Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rebase -i: Introduce a constant AMEND
author
Michael Haggerty
<mhagger@alum.mit.edu>
Thu, 14 Jan 2010 05:54:47 +0000
(06:54 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 14 Jan 2010 08:27:56 +0000
(
00:27
-0800)
Add a constant AMEND holding the filename of the $DOTEST/amend 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>
git-rebase--interactive.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0aac0de
)
diff --git
a/git-rebase--interactive.sh
b/git-rebase--interactive.sh
index 17641d444ef536f96a342299846a78e4399c2648..31f9b3b038c5f535d4deaf2a507d336d128caa4d 100755
(executable)
--- a/
git-rebase--interactive.sh
+++ b/
git-rebase--interactive.sh
@@
-80,6
+80,14
@@
DROPPED="$DOTEST"/dropped
# being rebased.
AUTHOR_SCRIPT="$DOTEST"/author-script
# being rebased.
AUTHOR_SCRIPT="$DOTEST"/author-script
+# When an "edit" rebase command is being processed, the SHA1 of the
+# commit to be edited is recorded in this file. When "git rebase
+# --continue" is executed, if there are any staged changes then they
+# will be amended to the HEAD commit, but only provided the HEAD
+# commit is still the commit to be edited. When any other rebase
+# command is processed, this file is deleted.
+AMEND="$DOTEST"/amend
+
PRESERVE_MERGES=
STRATEGY=
ONTO=
PRESERVE_MERGES=
STRATEGY=
ONTO=
@@
-381,7
+389,7
@@
peek_next_command () {
}
do_next () {
}
do_next () {
- rm -f "$MSG" "$AUTHOR_SCRIPT" "$
DOTEST"/amend
|| exit
+ rm -f "$MSG" "$AUTHOR_SCRIPT" "$
AMEND"
|| exit
read command sha1 rest < "$TODO"
case "$command" in
'#'*|''|noop)
read command sha1 rest < "$TODO"
case "$command" in
'#'*|''|noop)
@@
-409,7
+417,7
@@
do_next () {
pick_one $sha1 ||
die_with_patch $sha1 "Could not apply $sha1... $rest"
make_patch $sha1
pick_one $sha1 ||
die_with_patch $sha1 "Could not apply $sha1... $rest"
make_patch $sha1
- git rev-parse --verify HEAD > "$
DOTEST"/amend
+ git rev-parse --verify HEAD > "$
AMEND"
warn "Stopped at $sha1... $rest"
warn "You can amend the commit now, with"
warn
warn "Stopped at $sha1... $rest"
warn "You can amend the commit now, with"
warn
@@
-587,10
+595,10
@@
do
. "$AUTHOR_SCRIPT" ||
die "Cannot find the author identity"
amend=
. "$AUTHOR_SCRIPT" ||
die "Cannot find the author identity"
amend=
- if test -f "$
DOTEST"/amend
+ if test -f "$
AMEND"
then
amend=$(git rev-parse --verify HEAD)
then
amend=$(git rev-parse --verify HEAD)
- test "$amend" = $(cat "$
DOTEST"/amend
) ||
+ test "$amend" = $(cat "$
AMEND"
) ||
die "\
You have uncommitted changes in your working tree. Please, commit them
first and then run 'git rebase --continue' again."
die "\
You have uncommitted changes in your working tree. Please, commit them
first and then run 'git rebase --continue' again."