git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv3 4/4] am, rebase: teach quiet option

From
Stephen Boyd <bebarino@gmail.com>
Date
Jun 16, 2009, 07:50 UTC
Message-ID
<4A374EAD.9030309@gmail.com>
In-Reply-To
<7vbpoog1py.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 12 quoted lines
> Hmm, this long conditional body looks ugly, and I suspect it is harder to
> maintain than necessary.  Can we do something about it?
>
> 	# When we are allowed to fall back to 3-way later, don't give
>         # false errors during the initial attempt.
> 	squelch=
> 	if test "$threeway" = t && test -n "$GIT_QUIET"
> 	then
> 		squelch='>/dev/null 2>&1 '
> 	fi
>         eval "git apply $squelch$git_apply_opt"' --index "$dotest/patch"'
>
Thanks. I thought there would be a nicer way but I didn't know it.
Show 5 quoted lines
> Ah, I was blind.
>
> While sending non-error messages to stderr is justifiable, I do not think
> this one is, because all the other progress-y message in this program we
> reviewed so far go to stdout.  I think we should drop >&2 here.
Will do, gotta fixup some tests for that though...
Show 21 quoted lines
> There is one more thing to think about in git-am, which I do not think you
> addressed.  Consider this scenario.
>
>     (1) Tell am to run quietly, feeding a four-patch series.
>
> 	$ git am -q -3 mbox
>
>     (2) The first patch applies cleanly; the second one does not apply,
>         even with -3, and leaves conflict (you did the right thing not to
>         squelch the message when this happens).
>
>     (3) You fix it up, and save the result from your editor, and tell it
>         to continue.
>
> 	$ git am --resolved
>
> Now, should the second invocation be also quiet, or talkative as default?
>
> Note that the third and fourth patch are applied with -3 option in effect,
> even though you did not say -3 when you restarted "am" with --resolved
> (cf. ll.280-340 in git-am.sh).

Thanks for bringing this up. I gave this some thought before I sent the series out but I was secretly hoping nobody would care :-) I think it's more correct and maybe even more consistent to keep the quiet option enabled.

Seeing as this series is going for round 4 I'll make sure to include this as well.

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 18 in “[PATCHv3 0/4] Teach shell scripts to be quiet”
  1. Stephen BoydJun 16, 2009
  2. 1/4 t4150: test applying with a newline in subjectStephen Boyd, Jun 16, 2009
  3. 2/4 git-sh-setup: introduce say() for quiet optionsStephen Boyd, Jun 16, 2009
  4. 3/4 submodule, repack: migrate to git-sh-setup's say()Stephen Boyd, Jun 16, 2009
  5. 4/4 am, rebase: teach quiet optionStephen Boyd, Jun 16, 2009
  6. Junio C HamanoJun 16, 2009
  7. Stephen BoydJun 16, 2009
  8. Junio C HamanoJun 16, 2009
  9. Junio C HamanoJun 16, 2009
  10. Stephen BoydJun 16, 2009
  11. Johannes SixtJun 16, 2009
  12. 0/5 Teach shell scripts to be quietStephen Boyd, Jun 16, 2009
  13. 1/5 t4150: test applying with a newline in subjectStephen Boyd, Jun 16, 2009
  14. 2/5 am: suppress apply errors when using 3-wayStephen Boyd, Jun 16, 2009
  15. 3/5 git-sh-setup: introduce say() for quiet optionsStephen Boyd, Jun 16, 2009
  16. 4/5 submodule, repack: migrate to git-sh-setup's say()Stephen Boyd, Jun 16, 2009
  17. 5/5 am, rebase: teach quiet optionStephen Boyd, Jun 16, 2009
  18. 6/5 stash: teach quiet optionStephen Boyd, Jun 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.