From: Junio C Hamano <gitster@pobox.com>
To: jidanni@jidanni.org
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Documentation/diff-options.txt: unify options
Date: Sat, 27 Dec 2008 22:52:49 -0800 [thread overview]
Message-ID: <7vvdt4aj0e.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <87lju1jmp9.fsf@jidanni.org> (jidanni@jidanni.org's message of "Sun, 28 Dec 2008 06:08:18 +0800")
jidanni@jidanni.org writes:
> JCH> Sorry, but this patch is very unusual in that it lacks any context lines,
> JCH> which makes it impossible to review.
>
> Trust me, I tried it with the default context lines and it was just
> the same hard reading.
Nonsense.
Here is a snippet from your patch.
diff --git a/diff-options.txt b/diff-options.txt
index 5721548..b05503a 100644
--- a/diff-options.txt
+++ b/diff-options.txt
@@ -21,0 +22 @@ ifndef::git-format-patch[]
+-u::
@@ -26,3 +26,0 @@ endif::git-format-patch[]
--u::
- Synonym for "-p".
-
The only thing anybody can guess without looking at the original (that is
what "sending a patch without context" means) is that you moved "-u::" to
somewhere else, and stripped of its description. There is absolutely no
clue to judge if the new home to "-u::" is an appropriate place.
In a normal patch with context, the same hunk would have looked like this:
diff --git i/Documentation/diff-options.txt w/Documentation/diff-options.txt
index c62b45c..c4ca0a9 100644
--- i/Documentation/diff-options.txt
+++ w/Documentation/diff-options.txt
@@ -19,16 +19,12 @@ endif::git-format-patch[]
ifndef::git-format-patch[]
-p::
+-u::
Generate patch (see section on generating patches).
{git-diff? This is the default.}
endif::git-format-patch[]
--u::
- Synonym for "-p".
-
-U<n>::
- Shorthand for "--unified=<n>".
-
--unified=<n>::
Presented this way, it is much more clear what is going on, as there is no
need to go back to the original and see if the new location for "-u::"
makes sense (and I think it does, but that is something I can say after
applying the patch and reviewing the result, because the patch itself is
not reviewable).
If you find yours just as easy to read as the one with context, your patch
reading ability far exceeds mine, and I'd refuse to read your patches in
the future to preserve my sanity.
There is another issue that should be obvious to people who deal with
patches every day. The context-free patch you sent can be applied *ONLY*
after locating the *EXACT* preimage of the file you used to produce your
patch. Before your patch is reviewed, other people may have already
modified the same file, perhaps introducing a few new lines at the top of
the file, and then what? Your first hunk tells us that you would want to
insert a line with "-u::" at line #21, but the context does not match
anymore when your patch is reviewed.
next prev parent reply other threads:[~2008-12-28 6:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-27 20:12 [PATCH] Documentation/diff-options.txt: unify options jidanni
2008-12-27 22:01 ` Junio C Hamano
2008-12-27 22:08 ` jidanni
2008-12-28 6:52 ` Junio C Hamano [this message]
2008-12-29 7:03 ` jidanni
2008-12-29 8:47 ` Junio C Hamano
2008-12-29 9:10 ` Junio C Hamano
2008-12-30 0:02 ` git apply didn't catch error? [was Re: [PATCH] Documentation/diff-options.txt: unify options] jidanni
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=7vvdt4aj0e.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jidanni@jidanni.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 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).