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

Re: [PATCH] apply --unidiff-zero: loosen sanity checks for --unidiff=0 patches

From
Junio C Hamano <junkio@cox.net>
Date
Sep 17, 2006, 08:49 UTC
Message-ID
<7vac4y7u8n.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<eej12j$36t$2@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
Show 10 quoted lines
> Junio C Hamano wrote:
>
>> This adds a new flag, --unified-zero, to allow bypassing these
>> checks.  If you are in control of the patch generation process,
>> you should not use --unified=0 patch and fix it up with this
>> flag; rather you should try work with a patch with context.  But
>> if all you have to work with is a patch without context, this
>> flag may come handy as the last resort.
>
> Doesn't -C0 option to git-apply bypass those checks?

Only the head/tail anchor check, but not the creation/deletion check.

Also -CNUM's meaning is "you are allowed to reduce context down to only this many lines if you need to (but you do not have to if you can find the right match with context recorded in the patch)" not "what I am feeding you is a context-free patch so loosen sanity checks", so it does not make much sense to overload the flag with such a new meaning (if that is what you are implying, that is).

Previous: Jakub NarebskiNext: Jakub Narebski
Message 5 of 8 in “git-apply fails to apply some patches”
  1. Gerrit PapeSep 15, 2006
  2. Junio C HamanoSep 17, 2006
  3. apply --unidiff-zero: loosen sanity checks for --unidiff=0 patchesJunio C Hamano, Sep 17, 2006
  4. Jakub NarebskiSep 17, 2006
  5. Junio C HamanoSep 17, 2006
  6. Jakub NarebskiSep 17, 2006
  7. Junio C HamanoSep 17, 2006
  8. git-apply(1): document --unidiff-zeroJonas Fonseca, Sep 17, 2006

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.