Re: [PATCH] Remove filename from conflict markers
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 30, 2009, 22:16 UTC
- Message-ID
- <7v63ed5pvi.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20090628154559.GA29049@old.homeip.net>
Martin Renold <martinxyz@gmx.ch> writes:
Show 7 quoted lines
> Put filenames into the conflict markers only when they are different. > Otherwise they are redundant information clutter. > > Signed-off-by: Martin Renold <martinxyz@gmx.ch> > --- > merge-recursive.c | 9 +++++++-- > t/t3404-rebase-interactive.sh | 4 ++--
The change seems to break more tests than just 3404.
I also wondered briefly if it will break people's existing scripts; I suspect it will not likely to be a huge problem.
Show 42 quoted lines
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index c703445..53cad96 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -622,8 +622,13 @@ static int merge_3way(struct merge_options *o,
> char *name1, *name2;
> int merge_status;
>
> - name1 = xstrdup(mkpath("%s:%s", branch1, a->path));
> - name2 = xstrdup(mkpath("%s:%s", branch2, b->path));
> + if (strcmp(a->path, b->path)) {
> + name1 = xstrdup(mkpath("%s:%s", branch1, a->path));
> + name2 = xstrdup(mkpath("%s:%s", branch2, b->path));
> + } else {
> + name1 = xstrdup(mkpath("%s", branch1));
> + name2 = xstrdup(mkpath("%s", branch2));
> + }
>
> fill_mm(one->sha1, &orig);
> fill_mm(a->sha1, &src1);
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index c32ff66..a973628 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -119,11 +119,11 @@ index e69de29..00750ed 100644
> EOF
>
> cat > expect2 << EOF
> -<<<<<<< HEAD:file1
> +<<<<<<< HEAD
> 2
> =======
> 3
> ->>>>>>> b7ca976... G:file1
> +>>>>>>> b7ca976... G
> EOF
>
> test_expect_success 'stop on conflicting pick' '
> --
> 1.6.3.1