Re: possible bug in git apply?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> That said, if we really wanted to get it right, we should do this as a 
> three-phase thing: (1) remove old files (2) create new files (3) for all 
> removals and renames, try to remove source directories that might have 
> become empty.
>
> That would fix it properly and for all cases.

Actually that will break the case of removing foo/bar, which is
the only file in directory foo, and creating a new file foo.  So
if we really want to do all the corner cases, we would need to
do something like:

 * scan the list of files that will remain (i.e., renamed-to,
   modifed-in-place and created-anew) to note which directories
   should remain in the result;

 * remove old files, and remove its empty parent directories
   that are not in the above list;

 * create new files.

But in the meantime for 1.5.3, I think your patch is better than
what we currently have.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux