diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-01-10 22:44:45 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-23 14:34:55 -0800 |
commit | f8246281af9adb0fdddbcc90d2e19cb5cd5217e5 (patch) | |
tree | c9adbb2e536c1ce99cffa44ce3c99aef9075e9fa /t/test-lib.sh | |
parent | commit: do not lose mergetag header when not amending (diff) | |
download | tgif-f8246281af9adb0fdddbcc90d2e19cb5cd5217e5.tar.xz |
merge: use editor by default in interactive sessions
Traditionally, a cleanly resolved merge was committed by "git merge" using
the auto-generated merge commit log message without invoking the editor.
After 5 years of use in the field, it turns out that people perform too
many unjustified merges of the upstream history into their topic branches.
These merges are not just useless, but they are often not explained well,
and making the end result unreadable when it gets time for merging their
history back to their upstream.
Earlier we added the "--edit" option to the command, so that people can
edit the log message to explain and justify their merge commits. Let's
take it one step further and spawn the editor by default when we are in an
interactive session (i.e. the standard input and the standard output are
pointing at the same tty device).
There may be existing scripts that leave the standard input and the
standard output of the "git merge" connected to whatever environment the
scripts were started, and such invocation might trigger the above
"interactive session" heuristics. GIT_MERGE_AUTOEDIT environment variable
can be set to "no" at the beginning of such scripts to use the historical
behaviour while the script runs.
Note that this backward compatibility is meant only for scripts, and we
deliberately do *not* support "merge.edit = yes/no/auto" configuration
option to allow people to keep the historical behaviour.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index bdd9513b84..ed32c2ab7b 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -63,7 +63,8 @@ GIT_AUTHOR_NAME='A U Thor' GIT_COMMITTER_EMAIL=committer@example.com GIT_COMMITTER_NAME='C O Mitter' GIT_MERGE_VERBOSITY=5 -export GIT_MERGE_VERBOSITY +GIT_MERGE_AUTOEDIT=no +export GIT_MERGE_VERBOSITY GIT_MERGE_AUTOEDIT export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME export EDITOR |