]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: consolidate unnecessary fields in merge_options
authorElijah Newren <newren@gmail.com>
Sat, 17 Aug 2019 18:41:38 +0000 (11:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2019 17:08:04 +0000 (10:08 -0700)
commit8599ab4574ce3a8b2fc894c7cfdac8fd61450b7b
tree7e1a56c1f2fab3f729c9c76d37bb3f12cc0ef16e
parent7c0a6c8e477bd9009001590f49274e892e92fce8
merge-recursive: consolidate unnecessary fields in merge_options

We provided users with the ability to state whether they wanted rename
detection, and to put a limit on how much CPU would be spent.  Both of
these fields had multiple configuration parameters for setting them,
with one being a fallback and the other being an override.  However,
instead of implementing the logic for how to combine the multiple
source locations into the appropriate setting at config loading time,
we loaded and tracked both values and then made the code combine them
every time it wanted to check the overall value.  This had a few
minor drawbacks:
  * it seems more complicated than necessary
  * it runs the risk of people using the independent settings in the
    future and breaking the intent of how the options are used
    together
  * it makes merge_options more complicated than necessary for other
    potential users of the API

Fix these problems by moving the logic for combining the pairs of
options into a single value; make it apply at time-of-config-loading
instead of each-time-of-use.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c
merge-recursive.h