Skip to content

Commit 4974c2c

Browse files
Martin von Zweigbergkgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 431b7e7 commit 4974c2c

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

git-rebase--interactive.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,6 @@ warn () {
8686
printf '%s\n' "$*" >&2
8787
}
8888

89-
output () {
90-
case "$verbose" in
91-
'')
92-
output=$("$@" 2>&1 )
93-
status=$?
94-
test $status != 0 && printf "%s\n" "$output"
95-
return $status
96-
;;
97-
*)
98-
"$@"
99-
;;
100-
esac
101-
}
102-
10389
# Output the commit message for the specified commit.
10490
commit_message () {
10591
git cat-file commit "$1" | sed "1,/^$/d"

git-rebase.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ read_basic_state () {
7474
GIT_QUIET=$(cat "$state_dir"/quiet)
7575
}
7676

77+
output () {
78+
case "$verbose" in
79+
'')
80+
output=$("$@" 2>&1 )
81+
status=$?
82+
test $status != 0 && printf "%s\n" "$output"
83+
return $status
84+
;;
85+
*)
86+
"$@"
87+
;;
88+
esac
89+
}
90+
7791
move_to_original_branch () {
7892
case "$head_name" in
7993
refs/*)
@@ -263,7 +277,7 @@ continue)
263277
run_specific_rebase
264278
;;
265279
skip)
266-
git reset --hard HEAD || exit $?
280+
output git reset --hard HEAD || exit $?
267281
read_basic_state
268282
run_specific_rebase
269283
;;
@@ -276,7 +290,7 @@ abort)
276290
die "Could not move back to $head_name"
277291
;;
278292
esac
279-
git reset --hard $orig_head
293+
output git reset --hard $orig_head
280294
rm -r "$state_dir"
281295
exit
282296
;;

0 commit comments

Comments
 (0)