git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: jidanni@jidanni.orgNext: Junio C Hamano
Message 6 of 8 in “Documentation/diff-options.txt: unify options”
  1. Documentation/diff-options.txt: unify optionsjidanni@jidanni.org, Dec 27, 2008
  2. Junio C HamanoDec 27, 2008
  3. jidanni@jidanni.orgDec 27, 2008
  4. Junio C HamanoDec 28, 2008
  5. jidanni@jidanni.orgDec 29, 2008
  6. Junio C HamanoDec 29, 2008
  7. Junio C HamanoDec 29, 2008
  8. git apply didn't catch error? [was Re: [PATCH] Documentation/diff-options.txt: unify options]jidanni@jidanni.org, Dec 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.