Browse Source

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>
maint
Michael Haggerty 15 years ago committed by Junio C Hamano
parent
commit
0aac0de4fe
  1. 17
      git-rebase--interactive.sh

17
git-rebase--interactive.sh

@ -74,6 +74,12 @@ SQUASH_MSG="$DOTEST"/message-squash
REWRITTEN="$DOTEST"/rewritten REWRITTEN="$DOTEST"/rewritten


DROPPED="$DOTEST"/dropped DROPPED="$DOTEST"/dropped

# A script to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and
# GIT_AUTHOR_DATE that will be used for the commit that is currently
# being rebased.
AUTHOR_SCRIPT="$DOTEST"/author-script

PRESERVE_MERGES= PRESERVE_MERGES=
STRATEGY= STRATEGY=
ONTO= ONTO=
@ -165,8 +171,8 @@ make_patch () {
esac > "$DOTEST"/patch esac > "$DOTEST"/patch
test -f "$MSG" || test -f "$MSG" ||
git cat-file commit "$1" | sed "1,/^$/d" > "$MSG" git cat-file commit "$1" | sed "1,/^$/d" > "$MSG"
test -f "$DOTEST"/author-script || test -f "$AUTHOR_SCRIPT" ||
get_author_ident_from_commit "$1" > "$DOTEST"/author-script get_author_ident_from_commit "$1" > "$AUTHOR_SCRIPT"
} }


die_with_patch () { die_with_patch () {
@ -375,8 +381,7 @@ peek_next_command () {
} }


do_next () { do_next () {
rm -f "$MSG" "$DOTEST"/author-script \ rm -f "$MSG" "$AUTHOR_SCRIPT" "$DOTEST"/amend || exit
"$DOTEST"/amend || exit
read command sha1 rest < "$TODO" read command sha1 rest < "$TODO"
case "$command" in case "$command" in
'#'*|''|noop) '#'*|''|noop)
@ -452,7 +457,7 @@ do_next () {
rm -f "$GIT_DIR"/MERGE_MSG || exit rm -f "$GIT_DIR"/MERGE_MSG || exit
;; ;;
esac esac
echo "$author_script" > "$DOTEST"/author-script echo "$author_script" > "$AUTHOR_SCRIPT"
if test $failed = f if test $failed = f
then then
# This is like --amend, but with a different message # This is like --amend, but with a different message
@ -579,7 +584,7 @@ do
then then
: Nothing to commit -- skip this : Nothing to commit -- skip this
else else
. "$DOTEST"/author-script || . "$AUTHOR_SCRIPT" ||
die "Cannot find the author identity" die "Cannot find the author identity"
amend= amend=
if test -f "$DOTEST"/amend if test -f "$DOTEST"/amend

Loading…
Cancel
Save