Thread (1 message) 1 message, 1 author, 2016-06-15

Re: git merge <tag>: Spawning an editor can't be disabled

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:01

Hi,

Guido Günther wrote[1]:
as of 1.7.9 merging in a tag unconditionally spawns an editor. I tried
turning this of with --no-edit but to no avail. This is a behaviour
change that breaks tools like git-buildpackage. I wonder if this should
be turned off by default?
Thanks.  I can confirm this: ever since commit fab47d05 (merge: force
edit and no-ff mode when merging a tag object, 2011-11-07), running
"git checkout github/maint-1.5.6 && git merge --no-edit v1.7.2"
launches an editor window despite the caller's request.  And I agree
that it is counter-intuitive.

Here's a quick band-aid.  Unlike the case of [2], this does not
suppress the pulling-signed-tag magic when it kicks in, so the
resulting commit will record the signature and message of the tag you
merged, even though you have not carefully looked it over.  Not sure
if that's a good or bad thing yet.

Patch relies on "merge: use editor by default in interactive sessions"
from master.  If this looks like a sane approach, I can resend with a
proposed log message and a test for t/t7600-merge.sh.  (Or if someone
else wants to do it first, even better.)

Hmm?
Jonathan

[1] http://bugs.debian.org/659255
[2] http://thread.gmane.org/gmane.comp.version-control.git/189825/focus=189989
diff --git i/builtin/merge.c w/builtin/merge.c
index 62c7b681..c401106e 100644
--- i/builtin/merge.c
+++ w/builtin/merge.c
@@ -1323,7 +1323,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		if (merge_remote_util(commit) &&
 		    merge_remote_util(commit)->obj &&
 		    merge_remote_util(commit)->obj->type == OBJ_TAG) {
-			option_edit = 1;
+			if (option_edit < 0)
+				option_edit = 1;
 			allow_fast_forward = 0;
 		}
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help