git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Mon, 29 Dec 2008 00:47:49 -0800	[thread overview]
Message-ID: <7vabafe5ai.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <8763l331l6.fsf@jidanni.org> (jidanni@jidanni.org's message of "Mon, 29 Dec 2008 15:03:17 +0800")

Thanks.

jidanni@jidanni.org writes:

> (You were right about my previous patch being bad.
> At least git-am gives an error message when fed
> http://article.gmane.org/gmane.comp.version-control.git/104017/raw
> git-apply however does nothing and returns 0! Must be a bug.)
> OK, here's a better patch:
>
> Signed-off-by: jidanni <jidanni@jidanni.org>

> ---

That commentary above your S-o-b is not a proper commit log message, but
I'll come up with something and apply.

$ wget http://article.gmane.org/gmane.comp.version-control.git/104017/raw
$ git apply raw
error: diff-options.txt: No such file or directory
$ echo $?
1

Even if you hand munge the "raw" file to have proper prefix, it will
refuse to apply a context-free diff.

$ git apply raw-edited
error: patch failed: Documentation/diff-options.txt:26
error: Documentation/diff-options.txt: patch does not apply
$ echo $?
1     

This is to avoid applying the patch only by line number without context;
see the last paragraph of <7vvdt4aj0e.fsf@gitster.siamese.dyndns.org> for
the explanation.

Upon a very rare case where you are absolutely sure that your copy is what the
patch is based on and that it is safe to applying a context-free patch
only by line number, you can give --unidiff-zero option to git-apply to
countermand this safety measure, but a patch posted on the public mailing
list for open source development rarely falls into that category.

  reply	other threads:[~2008-12-29  8:49 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
2008-12-29  7:03       ` jidanni
2008-12-29  8:47         ` Junio C Hamano [this message]
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=7vabafe5ai.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).