Skip to content

Commit

Permalink
squash! rebase: turn on progress option by default for format-patch
Browse files Browse the repository at this point in the history
rebase: turn on progress option by default for format-patch

This change passes the progress option of format-patch when run in
an interactive terminal, unless rebase runs in quiet mode.

The idea is to give the user an early warning if they try to rebase an
insane amount of commits by mistake.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
  • Loading branch information
Kevin Willford authored and dscho committed Jul 14, 2017
1 parent 15dde00 commit 259ebd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions git-rebase--am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ then
else
rm -f "$GIT_DIR/rebased-patches"

git format-patch $git_format_patch_opt -k --stdout --full-index \
--cherry-pick --right-only --src-prefix=a/ --dst-prefix=b/ \
--no-renames --no-cover-letter --progress \
git format-patch -k --stdout --full-index --cherry-pick --right-only \
--src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
$git_format_patch_opt \
"$revisions" ${restrict_revision+^$restrict_revision} \
>"$GIT_DIR/rebased-patches"
ret=$?
Expand Down
6 changes: 5 additions & 1 deletion git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ do
--quiet)
GIT_QUIET=t
git_am_opt="$git_am_opt -q"
git_format_patch_opt="$git_format_patch_opt -q"
verbose=
diffstat=
;;
Expand Down Expand Up @@ -446,6 +445,11 @@ else
state_dir="$apply_dir"
fi

if test -t 2 && test -z "$GIT_QUIET"
then
git_format_patch_opt="$git_format_patch_opt --progress"
fi

if test -z "$rebase_root"
then
case "$#" in
Expand Down

0 comments on commit 259ebd4

Please sign in to comment.