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>maint
parent
431b7e7818
commit
4974c2caa2
|
@ -86,20 +86,6 @@ warn () {
|
||||||
printf '%s\n' "$*" >&2
|
printf '%s\n' "$*" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
output () {
|
|
||||||
case "$verbose" in
|
|
||||||
'')
|
|
||||||
output=$("$@" 2>&1 )
|
|
||||||
status=$?
|
|
||||||
test $status != 0 && printf "%s\n" "$output"
|
|
||||||
return $status
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
"$@"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# Output the commit message for the specified commit.
|
# Output the commit message for the specified commit.
|
||||||
commit_message () {
|
commit_message () {
|
||||||
git cat-file commit "$1" | sed "1,/^$/d"
|
git cat-file commit "$1" | sed "1,/^$/d"
|
||||||
|
|
|
@ -74,6 +74,20 @@ read_basic_state () {
|
||||||
GIT_QUIET=$(cat "$state_dir"/quiet)
|
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 () {
|
move_to_original_branch () {
|
||||||
case "$head_name" in
|
case "$head_name" in
|
||||||
refs/*)
|
refs/*)
|
||||||
|
@ -263,7 +277,7 @@ continue)
|
||||||
run_specific_rebase
|
run_specific_rebase
|
||||||
;;
|
;;
|
||||||
skip)
|
skip)
|
||||||
git reset --hard HEAD || exit $?
|
output git reset --hard HEAD || exit $?
|
||||||
read_basic_state
|
read_basic_state
|
||||||
run_specific_rebase
|
run_specific_rebase
|
||||||
;;
|
;;
|
||||||
|
@ -276,7 +290,7 @@ abort)
|
||||||
die "Could not move back to $head_name"
|
die "Could not move back to $head_name"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
git reset --hard $orig_head
|
output git reset --hard $orig_head
|
||||||
rm -r "$state_dir"
|
rm -r "$state_dir"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue