summaryrefslogtreecommitdiff
path: root/git-am.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-am.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-am.sh')
-rwxr-xr-xgit-am.sh7
1 files changed, 2 insertions, 5 deletions
diff --git a/git-am.sh b/git-am.sh
index 0126a77b92..c3bbd78eab 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -6,6 +6,7 @@ USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way]
[--interactive] [--whitespace=<option>] <mbox>...
or, when resuming [--skip | --resolved]'
. git-sh-setup
+set_reflog_action am
git var GIT_COMMITTER_IDENT >/dev/null || exit
@@ -101,7 +102,6 @@ It does not apply to blobs recorded in its index."
}
prec=4
-rloga=am
dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary= ws= resolvemsg=
while case "$#" in 0) break;; esac
@@ -141,9 +141,6 @@ do
--resolvemsg=*)
resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;;
- --reflog-action=*)
- rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'`; shift ;;
-
--)
shift; break ;;
-*)
@@ -452,7 +449,7 @@ do
parent=$(git-rev-parse --verify HEAD) &&
commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
echo Committed: $commit &&
- git-update-ref -m "$rloga: $SUBJECT" HEAD $commit $parent ||
+ git-update-ref -m "$GIT_REFLOG_ACTION: $SUBJECT" HEAD $commit $parent ||
stop_here $this
if test -x "$GIT_DIR"/hooks/post-applypatch