Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix git-rebase -i to allow squashing of fast-forwardable commits
author
Alex Riesen
<raa.lkml@gmail.com>
Thu, 12 Jul 2007 22:30:35 +0000
(
00:30
+0200)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 14 Jul 2007 05:33:16 +0000
(22:33 -0700)
Without this change the commits will be left standalone, with
duplicated commit message.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
9a4cbdc
)
diff --git
a/git-rebase--interactive.sh
b/git-rebase--interactive.sh
index d9563ec46fb9ab08a8295031bc6450a4827014de..f3950767ea6256cd9c2dceabbe7c91fa62e3f3aa 100755
(executable)
--- a/
git-rebase--interactive.sh
+++ b/
git-rebase--interactive.sh
@@
-84,6
+84,7
@@
pick_one () {
current_sha1=$(git rev-parse --verify HEAD)
if [ $current_sha1 = $parent_sha1 ]; then
git reset --hard $sha1
current_sha1=$(git rev-parse --verify HEAD)
if [ $current_sha1 = $parent_sha1 ]; then
git reset --hard $sha1
+ test "a$1" = a-n && git reset --soft $current_sha1
sha1=$(git rev-parse --short $sha1)
warn Fast forward to $sha1
else
sha1=$(git rev-parse --short $sha1)
warn Fast forward to $sha1
else
@@
-193,14
+194,14
@@
do_next () {
die "Cannot 'squash' without a previous commit"
mark_action_done
die "Cannot 'squash' without a previous commit"
mark_action_done
- failed=f
- pick_one -n $sha1 || failed=t
MSG="$DOTEST"/message
echo "# This is a combination of two commits." > "$MSG"
echo "# The first commit's message is:" >> "$MSG"
echo >> "$MSG"
git cat-file commit HEAD | sed -e '1,/^$/d' >> "$MSG"
echo >> "$MSG"
MSG="$DOTEST"/message
echo "# This is a combination of two commits." > "$MSG"
echo "# The first commit's message is:" >> "$MSG"
echo >> "$MSG"
git cat-file commit HEAD | sed -e '1,/^$/d' >> "$MSG"
echo >> "$MSG"
+ failed=f
+ pick_one -n $sha1 || failed=t
echo "# And this is the 2nd commit message:" >> "$MSG"
echo >> "$MSG"
git cat-file commit $sha1 | sed -e '1,/^$/d' >> "$MSG"
echo "# And this is the 2nd commit message:" >> "$MSG"
echo >> "$MSG"
git cat-file commit $sha1 | sed -e '1,/^$/d' >> "$MSG"