From: Jeff King <peff@peff.net>
To: Kevin Willford <kcwillford@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com,
Kevin Willford <kewillf@microsoft.com>
Subject: Re: [PATCH 2/2] rebase: turn on progress option by default for format-patch
Date: Wed, 31 May 2017 18:11:51 -0400 [thread overview]
Message-ID: <20170531221151.pxdikxgxy37g7zub@sigill.intra.peff.net> (raw)
In-Reply-To: <20170531150427.7820-3-kewillf@microsoft.com>
On Wed, May 31, 2017 at 08:04:27AM -0700, Kevin Willford wrote:
> This change passes the progress option of format-patch by
> default and passes the -q --quiet option through to the
> format-patch call so that it is respected as well.
That makes sense. Is it a bug that we aren't propagating "-q" already?
I think the answer is "no", because that option only claims to silence
the printing of the filenames that format-patch writes. But since we're
using --stdout, it wouldn't write those anyway.
Come to think of it, I'm not sure that "-q" silencing "--progress" in
your patch 1 actually makes sense. If you do:
git format-patch -o out/
you don't need progress, because we're already writing the filenames to
stdout. So it's only if you did:
git format-patch -o out/ -q
that you'd actually want progress. But "-q" would override any
--progress option! So I actually think we may be better off keeping the
two as distinct features (especially if we follow the "no progress
unless --progress is given" rule I mentioned in the earlier message).
> diff --git a/git-rebase--am.sh b/git-rebase--am.sh
> index 375239341f..ab2be30abf 100644
> --- a/git-rebase--am.sh
> +++ b/git-rebase--am.sh
> @@ -51,8 +51,9 @@ then
> else
> rm -f "$GIT_DIR/rebased-patches"
>
> - 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 $git_format_patch_opt -k --stdout --full-index \
> + --cherry-pick --right-only --src-prefix=a/ --dst-prefix=b/ \
> + --no-renames --no-cover-letter --progress \
> "$revisions" ${restrict_revision+^$restrict_revision} \
> >"$GIT_DIR/rebased-patches"
Here we pass --progress unconditionally, which tells format-patch to
output progress information. Shouldn't we be checking whether stderr is
a tty before making that decision? And that we're not in --quiet mode?
That explains why you want to pass "-q" in the other hunk; to
countermand the explicit --progress here. But if we separate the two as
I mentioned above, you'd want logic more like:
if test -t 2 && test "$GIT_QUIET" != "t"
git_format_patch_opt="$git_format_patch_opt --progress"
fi
-Peff
next prev parent reply other threads:[~2017-05-31 22:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 15:04 [PATCH 0/2] Add progress to format-patch and rebase Kevin Willford
2017-05-31 15:04 ` [PATCH 1/2] format-patch: have progress option while generating patches Kevin Willford
2017-05-31 18:40 ` Stefan Beller
2017-05-31 19:31 ` Kevin Willford
2017-05-31 22:01 ` Jeff King
2017-06-01 4:10 ` Junio C Hamano
2017-06-01 11:15 ` Johannes Schindelin
2017-06-01 15:54 ` Jeff King
2017-05-31 15:04 ` [PATCH 2/2] rebase: turn on progress option by default for format-patch Kevin Willford
2017-05-31 19:08 ` Stefan Beller
2017-05-31 19:46 ` Kevin Willford
2017-05-31 20:27 ` Stefan Beller
2017-06-01 11:11 ` Johannes Schindelin
2017-05-31 22:11 ` Jeff King [this message]
2017-06-03 23:45 ` Junio C Hamano
2017-08-10 18:32 ` [PATCH v2 0/2] Add progress for format-patch and rebase Kevin Willford
2017-08-10 22:48 ` Junio C Hamano
2017-08-10 23:17 ` Jeff King
2017-08-10 18:32 ` [PATCH v2 1/2] format-patch: have progress option while generating patches Kevin Willford
2017-08-10 23:20 ` Jeff King
2017-08-11 22:18 ` Junio C Hamano
2017-08-12 8:06 ` Philip Oakley
2017-08-13 4:39 ` Jeff King
2017-08-14 16:45 ` Junio C Hamano
2017-08-14 18:35 ` Junio C Hamano
2017-08-14 22:29 ` Jeff King
2017-08-14 22:42 ` Junio C Hamano
2017-08-14 23:08 ` Jeff King
2017-08-14 23:23 ` Junio C Hamano
2017-08-19 17:39 ` [PATCH] progress: simplify "delayed" progress API Junio C Hamano
2017-08-19 20:58 ` Junio C Hamano
2017-08-20 7:43 ` Jeff King
2017-08-10 18:32 ` [PATCH v2 2/2] rebase: turn on progress option by default for format-patch Kevin Willford
2017-08-11 22:22 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170531221151.pxdikxgxy37g7zub@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kcwillford@gmail.com \
--cc=kewillf@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).