summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ab7e63e)
raw | patch | inline | side by side (parent: ab7e63e)
author | Christian Couder <chriscool@tuxfamily.org> | |
Sat, 6 Mar 2010 20:34:46 +0000 (21:34 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 20 Mar 2010 18:19:36 +0000 (11:19 -0700) |
This simplifies rebase -i a little bit.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh | patch | blob | history |
index 3e4fd1456f1ebb4aabb61de6d7f13f820ae2abdc..92d19f59035e0216cb88fdc50264d816653e9f06 100755 (executable)
}
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
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 () {