aboutsummaryrefslogtreecommitdiff
path: root/git-sh-setup.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-sh-setup.sh
parentb1f5f64fc831eb9f90bd07dc708279a921410bb2 (diff)
downloadgit-f94741324e26af42093a89e955ff9a923abff951.tar.gz
git-f94741324e26af42093a89e955ff9a923abff951.tar.xz
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-sh-setup.sh')
-rwxr-xr-xgit-sh-setup.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 42f9b1c12..87b939c0e 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -20,6 +20,14 @@ usage() {
die "Usage: $0 $USAGE"
}
+set_reflog_action() {
+ if [ -z "${GIT_REFLOG_ACTION:+set}" ]
+ then
+ GIT_REFLOG_ACTION="$*"
+ export GIT_REFLOG_ACTION
+ fi
+}
+
if [ -z "$LONG_USAGE" ]
then
LONG_USAGE="Usage: $0 $USAGE"