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

[PATCH] git-gui: pass the branch name to git merge

From
Johannes Sixt <j6t@kdbg.org>
Date
Nov 22, 2016, 17:52 UTC
Message-ID
<6a6dd0b9-436d-327f-c33d-e5cce078b3a0@kdbg.org>

The recent rewrite of the 'git merge' invocation in b5f325cb (git-gui: stop using deprecated merge syntax) replaced the subsidiary call of 'git fmt-merge-msg' to take advantage of the capability of 'git merge' that can construct a merge log message when the rev being merged is FETCH_HEAD.

A disadvantage of this method is, though, that the conflict markers are augmented with a raw SHA1 instead of a symbolic branch name. Revert to the former invocation style so that we get both a useful commit message and a symbolic name in the conflict markers.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 A minor regression of our effort to get rid of
 deprecated merge syntax. Even though I had done a number of
 merges since then, I noticed this only today because I
 actively looked for the branch name.
 lib/merge.tcl | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/lib/merge.tcl b/lib/merge.tcl
index 9f253db..39e3fb4 100644
--- a/lib/merge.tcl
+++ b/lib/merge.tcl
@@ -112,16 +112,9 @@ method _start {} {
 	close $fh
 	set _last_merged_branch $branch
 
-	if {[git-version >= "2.5.0"]} {
-		set cmd [list git merge --strategy=recursive FETCH_HEAD]
-	} else {
-		set cmd [list git]
-		lappend cmd merge
-		lappend cmd --strategy=recursive
-		lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
-		lappend cmd HEAD
-		lappend cmd $name
-	}
+	set cmd [list git merge --strategy=recursive --no-log -m]
+	lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
+	lappend cmd $name
 
 	ui_status [mc "Merging %s and %s..." $current_branch $stitle]
 	set cons [console::new [mc "Merge"] "merge $stitle"]
-- 
2.11.0.rc1.52.g65ffb51
Next: Junio C Hamano
Message 1 of 6 in “git-gui: pass the branch name to git merge”
  1. git-gui: pass the branch name to git mergeJohannes Sixt, Nov 22, 2016
  2. Junio C HamanoNov 22, 2016
  3. Johannes SixtNov 22, 2016
  4. Johannes SixtNov 23, 2016
  5. Junio C HamanoNov 23, 2016
  6. Johannes SixtNov 23, 2016

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.