aboutsummaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2011-02-06 13:43:51 -0500
committerJunio C Hamano <gitster@pobox.com>2011-02-10 14:08:09 -0800
commit4974c2caa215a78dd0c6e3665e23e029d98cbbeb (patch)
tree410d00d696be537d17696cecf609a5bcf76a4ec1 /git-rebase.sh
parent431b7e7818fe3d118e4bf9e40ba6807ed2c511be (diff)
downloadgit-4974c2caa215a78dd0c6e3665e23e029d98cbbeb.tar.gz
git-4974c2caa215a78dd0c6e3665e23e029d98cbbeb.tar.xz
rebase: make -v a tiny bit more verbose
To make it possible to later remove the handling of --abort from git-rebase--interactive.sh, align the implementation in git-rebase.sh with the former by making it a bit more verbose. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index c60221b5a..42d635bc2 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -74,6 +74,20 @@ read_basic_state () {
GIT_QUIET=$(cat "$state_dir"/quiet)
}
+output () {
+ case "$verbose" in
+ '')
+ output=$("$@" 2>&1 )
+ status=$?
+ test $status != 0 && printf "%s\n" "$output"
+ return $status
+ ;;
+ *)
+ "$@"
+ ;;
+ esac
+}
+
move_to_original_branch () {
case "$head_name" in
refs/*)
@@ -263,7 +277,7 @@ continue)
run_specific_rebase
;;
skip)
- git reset --hard HEAD || exit $?
+ output git reset --hard HEAD || exit $?
read_basic_state
run_specific_rebase
;;
@@ -276,7 +290,7 @@ abort)
die "Could not move back to $head_name"
;;
esac
- git reset --hard $orig_head
+ output git reset --hard $orig_head
rm -r "$state_dir"
exit
;;