git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Should "git apply --check" imply verbose?
@ 2013-08-20 15:11 Paul Gortmaker
  2013-08-20 17:57 ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Gortmaker @ 2013-08-20 15:11 UTC (permalink / raw)
  To: git; +Cc: Steven Rostedt

TL;DR -- "git apply --reject" implies verbose, but the similar
"git apply --check" does not, which seems inconsistent.

Background:  A common (non-git) workflow can be to use "patch --dry-run"
to inspect whether a patch is feasible, and then use patch again
a 2nd time (w/o --dry-run) to actually apply it (and then work
through the rejects).

You can also do the above in a git repo, but you lose out because
"patch" doesn't (yet) capture the patched function names[1] in the
rejected hunks, making it hard to double check your work.

My initial thought was to replace the above two steps with
"git apply --check ..." and then "git apply --reject ..." so
that I could just abandon using patch altogether.

That works great, with just one snag that had me go reading the
source.  It seems that "git apply --reject" is verbose, and kind
of looks like the identical output I'd get if I used patch.  But
"git apply --check" is quite reserved in its output and doesn't
look at all like "patch --dry-run".  I initially believed that
"--check" was stopping at the 1st failure, based on the output.

Only when I read the source did I realize it was checking all the
hunks silently, and adding a "-v" would make it similar to the
output from "patch --dry-run".

Not a critical issue by any means, but having the "-v" implied
by "--check" (or perhaps having both default to non-verbose?)
might save other users from getting confused in the same way.

Thanks,
Paul.
--

[1] https://savannah.gnu.org/bugs/index.php?39819

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-08-21  0:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 15:11 Should "git apply --check" imply verbose? Paul Gortmaker
2013-08-20 17:57 ` Junio C Hamano
2013-08-20 18:45   ` Paul Gortmaker
2013-08-20 18:51     ` Jonathan Nieder
2013-08-20 18:59       ` Paul Gortmaker
2013-08-20 19:07     ` Junio C Hamano
2013-08-20 19:15       ` Steven Rostedt
2013-08-20 19:45         ` Junio C Hamano
2013-08-20 19:54           ` Steven Rostedt
2013-08-20 20:19             ` Paul Gortmaker
2013-08-20 21:44               ` Junio C Hamano
2013-08-20 21:43             ` Junio C Hamano
2013-08-20 22:37               ` Steven Rostedt

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 NNTP newsgroup(s).