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

Re: git-apply{,mbox,patch} should default to --unidiff-zero

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 6, 2007, 03:16 UTC
Message-ID
<Pine.LNX.4.64.0707060413190.4093@racer.site>
In-Reply-To
<20070706022629.GL3492@stusta.de>
Hi,
On Fri, 6 Jul 2007, Adrian Bunk wrote:
Show 9 quoted lines
> On Fri, Jul 06, 2007 at 02:51:07AM +0100, Johannes Schindelin wrote:
> > 
> > On Fri, 6 Jul 2007, Adrian Bunk wrote:
> > 
> > > You must do something like "diff -U0" or manually editing patches 
> > > for creating such patches, and that's very unusual.
> > 
> > The point is that the _committer_ is not necessarily involved in that 
> > business.

BTW this still holds true, and you have not addressed that. It really is a serious issue. "git apply" is a committer's tool. So it should help the committer.

Show 10 quoted lines
> > And "git apply" is strict for a reason. It catches possibly unwanted 
> > things much earlier than patch. I _want_ to be warned that somebody is 
> > introducing some code at a certain position, which might, or might not 
> > be correct. apply has no way to tell, since there is no context to at 
> > least minimally verify.
> >...
> 
> That's wrong.
> 
> My use cases are replacing or deleting lines.
That is _your_ use case.
> In these cases there is context in the deleted lines that is already 
> being verified even with --unidiff-zero.

With --unidiff-zero, also _adding_ lines will be handled as if there were no problem.

Yes, in your case it fixes a problem.
Yet, in other cases it introduces a problem.
Okay?

Ciao, Dscho

Previous: Adrian BunkNext: Linus Torvalds
Message 6 of 10 in “git-apply{,mbox,patch} should default to --unidiff-zero”
  1. Adrian BunkJul 5, 2007
  2. Johannes SchindelinJul 6, 2007
  3. Adrian BunkJul 6, 2007
  4. Johannes SchindelinJul 6, 2007
  5. Adrian BunkJul 6, 2007
  6. Johannes SchindelinJul 6, 2007
  7. Linus TorvaldsJul 6, 2007
  8. Junio C HamanoJul 6, 2007
  9. Adrian BunkJul 6, 2007
  10. Johannes SchindelinJul 6, 2007

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.