git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Martin RenoldNext: Nanako Shiraishi
Message 2 of 8 in “Remove filename from conflict markers”
  1. Remove filename from conflict markersMartin Renold, Jun 28, 2009
  2. Junio C HamanoJun 30, 2009
  3. Nanako ShiraishiJul 1, 2009
  4. Martin RenoldJul 1, 2009
  5. Junio C HamanoJul 1, 2009
  6. Martin RenoldJul 1, 2009
  7. Remove filename from conflict markersMartin Renold, Jul 1, 2009
  8. Junio C HamanoJul 1, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.