Re: [PATCH 1/9] diff-merges: introduce --diff-merges=def
- From
Philip Oakley <philipoakley@iee.email>
- Date
- Apr 8, 2021, 11:48 UTC
- Message-ID
- <f6b25ea6-88b1-c167-7fd4-440be8782fcb@iee.email>
- In-Reply-To
- <20210407225608.14611-2-sorganov@gmail.com>
Hi,
On 07/04/2021 23:56, Sergey Organov wrote:
> Introduce the notion of default diff format for merges, and the option > "def" to select it. The default is "separate" and can't yet be
"def" feels a bit too short and sounds similar to "define" - why not spell out in full?
> changed, so effectively "dev" is just a synonym for "separate" for
did you mean "def"? i.e. s/dev/def/ (..spell out in full ;-)
-- Philip
Show 42 quoted lines
> now.
>
> This is in preparation for introducing log.diffMerges configuration
> option that will let --diff-merges=def to be configured to any
> supported format.
>
> Signed-off-by: Sergey Organov <sorganov@gmail.com>
> ---
> diff-merges.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/diff-merges.c b/diff-merges.c
> index 146bb50316a6..0887a07cfc67 100644
> --- a/diff-merges.c
> +++ b/diff-merges.c
> @@ -2,6 +2,8 @@
>
> #include "revision.h"
>
> +typedef void (*diff_merges_setup_func_t)(struct rev_info *);
> +
> static void suppress(struct rev_info *revs)
> {
> revs->separate_merges = 0;
> @@ -19,6 +21,8 @@ static void set_separate(struct rev_info *revs)
> revs->separate_merges = 1;
> }
>
> +static diff_merges_setup_func_t set_to_default = set_separate;
> +
> static void set_first_parent(struct rev_info *revs)
> {
> set_separate(revs);
> @@ -66,6 +70,8 @@ static void set_diff_merges(struct rev_info *revs, const char *optarg)
> set_combined(revs);
> else if (!strcmp(optarg, "cc") || !strcmp(optarg, "dense-combined"))
> set_dense_combined(revs);
> + else if (!strcmp(optarg, "def"))
> + set_to_default(revs);
> else
> die(_("unknown value for --diff-merges: %s"), optarg);
>