From: Junio C Hamano Date: Tue, 13 May 2008 22:34:05 GMT Subject: Re: [PATCH] builtin-apply: check for empty files when detecting creation patch Message-ID: <7vlk2dsujm.fsf@gitster.siamese.dyndns.org> In-Reply-To: Linus Torvalds writes: > Look at CVS-generated patches, or SVN for that matter. The diffs look like > this: > > Index: file > =================================================================== > --- file (revision 0) > +++ file (working copy) > @@ -0,0 +1 @@ > +test > > and there is no /dev/null there. > > The thing is, git-apply is careful, and it's very much careful with > respect to *knowing* that there are lots of different versions of "diff" > floating around, and lots of different SCM systems that generate odd diff > headers. We should absolutely NOT start expecting that diffs are only > generated with GNU diff. > > So non-/dev/null'ness means absolutely nothing. It means "don't know", and > we should leave is_new and is_delete as -1. Ok, then what's the judgement for the original issue? Is it a user error to have a tracked absolutely empty file in the index?