All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <git@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Subject: Should "git apply --check" imply verbose?
Date: Tue, 20 Aug 2013 11:11:54 -0400	[thread overview]
Message-ID: <5213873A.6010003@windriver.com> (raw)

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

             reply	other threads:[~2013-08-20 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20 15:11 Paul Gortmaker [this message]
2013-08-20 17:57 ` Should "git apply --check" imply verbose? 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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5213873A.6010003@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=git@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.