rebase -i: Introduce a constant AUTHOR_SCRIPT
Add a constant AUTHOR_SCRIPT, holding the filename of the $DOTEST/author_script file, and document how this temporary file is used. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jan 14, 2010 at 06:54 UTC
0aac0de4feb569ed17d501f04f17ecb8801dbad9
1 file changed
+11
-6
git-rebase--interactive.sh
+11
-6
@@ -74,6 +74,12 @@ SQUASH_MSG="$DOTEST"/message-squash
74
REWRITTEN="$DOTEST"/rewritten
75
76
DROPPED="$DOTEST"/dropped
77
+
78
+# A script to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and
79
+# GIT_AUTHOR_DATE that will be used for the commit that is currently
80
+# being rebased.
81
+AUTHOR_SCRIPT="$DOTEST"/author-script
82
+
83
PRESERVE_MERGES=
84
STRATEGY=
85
ONTO=
@@ -165,8 +171,8 @@ make_patch () {
171
esac > "$DOTEST"/patch
172
test -f "$MSG" ||
173
git cat-file commit "$1" | sed "1,/^$/d" > "$MSG"
168
- test -f "$DOTEST"/author-script ||
169
- get_author_ident_from_commit "$1" > "$DOTEST"/author-script
174
+ test -f "$AUTHOR_SCRIPT" ||
175
+ get_author_ident_from_commit "$1" > "$AUTHOR_SCRIPT"
176
}
177
178
die_with_patch () {
@@ -375,8 +381,7 @@ peek_next_command () {
381
}
382
383
do_next () {
378
- rm -f "$MSG" "$DOTEST"/author-script \
379
- "$DOTEST"/amend || exit
384
+ rm -f "$MSG" "$AUTHOR_SCRIPT" "$DOTEST"/amend || exit
385
read command sha1 rest < "$TODO"
386
case "$command" in
387
'#'*|''|noop)
@@ -452,7 +457,7 @@ do_next () {
457
rm -f "$GIT_DIR"/MERGE_MSG || exit
458
;;
459
esac
455
- echo "$author_script" > "$DOTEST"/author-script
460
+ echo "$author_script" > "$AUTHOR_SCRIPT"
461
if test $failed = f
462
then
463
# This is like --amend, but with a different message
@@ -579,7 +584,7 @@ do
584
then
585
: Nothing to commit -- skip this
586
else
582
- . "$DOTEST"/author-script ||
587
+ . "$AUTHOR_SCRIPT" ||
588
die "Cannot find the author identity"
589
amend=
590
if test -f "$DOTEST"/amend