summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-12-28 02:34:48 -0500
committerJunio C Hamano <junkio@cox.net>2006-12-28 01:05:15 -0800
commitf94741324e26af42093a89e955ff9a923abff951 (patch)
tree0beeca333111820b6af3705435ccb837f7793e20 /git-merge.sh
parentb1f5f64fc831eb9f90bd07dc708279a921410bb2 (diff)
downloadgit-f94741324e26af42093a89e955ff9a923abff951.tar.gz
Use GIT_REFLOG_ACTION environment variable instead.
Junio rightly pointed out that the --reflog-action parameter was starting to get out of control, as most porcelain code needed to hand it to other porcelain and plumbing alike to ensure the reflog contained the top-level user action and not the lower-level actions it invoked. At Junio's suggestion we are introducing the new set_reflog_action function to all shell scripts, allowing them to declare early on what their default reflog name should be, but this setting only takes effect if the caller has not already set the GIT_REFLOG_ACTION environment variable. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh13
1 files changed, 5 insertions, 8 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 7dd0a11236..e8db52725c 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -3,9 +3,10 @@
# Copyright (c) 2005 Junio C Hamano
#
-USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [--reflog-action=<action>] [-m=<merge-message>] <commit>+'
+USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
. git-sh-setup
+set_reflog_action "merge $*"
LF='
'
@@ -57,10 +58,10 @@ squash_message () {
finish () {
if test '' = "$2"
then
- rlogm="$rloga"
+ rlogm="$GIT_REFLOG_ACTION"
else
echo "$2"
- rlogm="$rloga: $2"
+ rlogm="$GIT_REFLOG_ACTION: $2"
fi
case "$squash" in
t)
@@ -109,7 +110,7 @@ merge_name () {
case "$#" in 0) usage ;; esac
-rloga= have_message=
+have_message=
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -139,9 +140,6 @@ do
die "available strategies are: $all_strategies" ;;
esac
;;
- --reflog-action=*)
- rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'`
- ;;
-m=*|--m=*|--me=*|--mes=*|--mess=*|--messa=*|--messag=*|--message=*)
merge_msg=`expr "z$1" : 'z-[^=]*=\(.*\)'`
have_message=t
@@ -213,7 +211,6 @@ head=$(git-rev-parse --verify "$head_arg"^0) || usage
# All the rest are remote heads
test "$#" = 0 && usage ;# we need at least one remote head.
-test "$rloga" = '' && rloga="merge: $@"
remoteheads=
for remote