Re: Why doesn't git-apply remove empty file

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Francis Moreau <francis.moro@...>
Cc: René Scharfe <rene.scharfe@...>, Junio C Hamano <gitster@...>, <git@...>
Date: Thursday, August 14, 2008 - 3:57 pm

On Thu, 14 Aug 2008, Francis Moreau wrote:

The thing is, "patch" is a total piece of utterly unbelievable SH*T.

git-apply acts differently, yes, but it acts differently for a damn good 
reason. No, you cannot replace git-apply with that horrible crap that is 
GNU patch.

Some of the reasons are purely trivial implementation issues:

 - git-apply knows about the index, and knows about updating it properly, 
   including tracking new files automatically.

That's an important thing, but yeah, it's an implementation issue.

The other things that git-apply do right are much more fundamental:

 - git apply doesn't leave half-applied state turds around when a patch 
   fails.

   People who actually use "patch" for large projects will know the pain 
   here: if a diff fails in the middle, GNU patch will have applied the 
   previous parts (including to other files), and it's now your problem to 
   fix it up. There's no way to do an all-or-nothing patch, which is often 
   a huge requirement.

 - git apply doesn't guess (unless you really tell it to, and even then it 
   will guess a whole lot less than GNU patch). If a "git apply" succeeds, 
   it was probably good. If a GNU patch invocation succeeds, it might have 
   been total and utter crap, but hey, it tried to apply that piece of 
   shit very aggressively even when it made no sense and the context 
   didn't actually match even _remotely_.

   Yeah, context diffs can still mis-apply even with git apply, but they 
   do so a hell of a lot less than with GNU patch, and if you want it to 
   just generate a random end result, you at least have to _ask_ for it.

So no. There's no way in hell that git am should use GNU patch.

But as mentioned, if somebody wants to parse the dates, we could do that. 

			Linus
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Why doesn't git-apply remove empty file, Francis Moreau, (Tue Aug 12, 12:17 pm)
Re: Why doesn't git-apply remove empty file, Junio C Hamano, (Tue Aug 12, 8:25 pm)
Re: Why doesn't git-apply remove empty file, Francis Moreau, (Wed Aug 13, 3:48 am)
Re: Why doesn't git-apply remove empty file, René Scharfe, (Wed Aug 13, 5:52 pm)
Re: Why doesn't git-apply remove empty file, Linus Torvalds, (Wed Aug 13, 7:09 pm)
Re: Why doesn't git-apply remove empty file, Francis Moreau, (Thu Aug 14, 3:42 pm)
Re: Why doesn't git-apply remove empty file, Linus Torvalds, (Thu Aug 14, 3:57 pm)
Re: Why doesn't git-apply remove empty file, Francis Moreau, (Thu Aug 14, 4:17 pm)
Re: Why doesn't git-apply remove empty file, Linus Torvalds, (Thu Aug 14, 4:02 pm)
Re: Why doesn't git-apply remove empty file, Stephan Beyer, (Thu Aug 14, 4:21 pm)
Re: Why doesn't git-apply remove empty file, Linus Torvalds, (Fri Aug 15, 11:53 am)
Re: Why doesn't git-apply remove empty file, Jeff King, (Thu Aug 14, 4:54 pm)
Re: Why doesn't git-apply remove empty file, Stephan Beyer, (Thu Aug 14, 5:10 pm)
Re: Why doesn't git-apply remove empty file, Jeff King, (Fri Aug 15, 12:08 am)