Re: [PATCH] Documentation/diff-options.txt: unify options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 29, 2008, 08:47 UTC
- Message-ID
- <7vabafe5ai.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <8763l331l6.fsf@jidanni.org>
Thanks.
jidanni@jidanni.org writes:
Show 7 quoted lines
> (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.