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

[PATCH 1/2] Use extended SHA1 syntax in merge-recursive conflicts.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 23, 2006, 08:44 UTC
Message-ID
<20061223084400.GA10203@spearce.org>

When we get a line-level conflict in merge-recursive and print out the two sides in the conflict hunk header and footer we should use the standard extended SHA1 syntax to specify the specific blob, as this allows the user to copy and paste the line right into 'git show' to view the complete version.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 merge-recursive.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index ae7ae4c..abebb95 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -649,8 +649,8 @@ static struct merge_file_info merge_file(struct diff_filespec *o,
 			char *name1, *name2;
 			int merge_status;
 
-			name1 = xstrdup(mkpath("%s/%s", branch1, a->path));
-			name2 = xstrdup(mkpath("%s/%s", branch2, b->path));
+			name1 = xstrdup(mkpath("%s:%s", branch1, a->path));
+			name2 = xstrdup(mkpath("%s:%s", branch2, b->path));
 
 			fill_mm(o->sha1, &orig);
 			fill_mm(a->sha1, &src1);
-- 
1.4.4.3.g87d8
Message 1 of 1 in “Use extended SHA1 syntax in merge-recursive conflicts.”
  1. 1/2 Use extended SHA1 syntax in merge-recursive conflicts.Shawn O. Pearce, Dec 23, 2006

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.