summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2010-03-06 20:34:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-20 18:19:36 (GMT)
commit8e75abfd8dc6649d800b8877304eaa0fd404c10f (patch)
tree748dd2446aa0287210a3668c3cc358c3fe411a7f
parentab7e63e85f2307447f8fc6679e1f355385881236 (diff)
downloadgit-8e75abfd8dc6649d800b8877304eaa0fd404c10f.zip
git-8e75abfd8dc6649d800b8877304eaa0fd404c10f.tar.gz
git-8e75abfd8dc6649d800b8877304eaa0fd404c10f.tar.bz2
rebase -i: use new --ff cherry-pick option
This simplifies rebase -i a little bit. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-rebase--interactive.sh15
1 files changed, 3 insertions, 12 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 3e4fd14..92d19f5 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -222,8 +222,8 @@ do_with_author () {
}
pick_one () {
- no_ff=
- case "$1" in -n) sha1=$2; no_ff=t ;; *) sha1=$1 ;; esac
+ ff=--ff
+ case "$1" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac
output git rev-parse --verify $sha1 || die "Invalid commit name: $sha1"
test -d "$REWRITTEN" &&
pick_one_preserving_merges "$@" && return
@@ -232,16 +232,7 @@ pick_one () {
output git cherry-pick "$@"
return
fi
- parent_sha1=$(git rev-parse --verify $sha1^) ||
- die "Could not get the parent of $sha1"
- current_sha1=$(git rev-parse --verify HEAD)
- if test -z "$no_ff" && test "$current_sha1" = "$parent_sha1"
- then
- output git reset --hard $sha1
- output warn Fast-forward to $(git rev-parse --short $sha1)
- else
- output git cherry-pick "$@"
- fi
+ output git cherry-pick $ff "$@"
}
pick_one_preserving_merges () {