Re: git apply vs. renamed files index mismatch
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:20
Also in:
linuxppc-dev
Anton Vorontsov [off-list ref] writes:
On Tue, Sep 09, 2008 at 07:45:19AM -0700, Junio C Hamano wrote: ...quoted
... It's an interesting idea from git person's point of view (i.e. "would be fun to implement"), but I doubt it would be useful in practice, because: (1) You often do not have the identically matching preimage; (2) More importantly, it is not unusual for people to *edit* the patch in their MUA (think of typofixes), after getting it out of git.Not for rename patches...
a. Why not? Even if your patch is (totally uninteresting) pure rename, it is natural to review the patch before you send out, and it also is natural to get tempted to fix typoes, just for a straight normal patch. b. If you can expect good behaviour out of people, by declaring "Not for rename patches" as your guarantee, what's the point of this discussion?
As for implementing, isn't this as simple as this pseudo code:
if (index_deleted_file == index_new_file)
if (deleted_file != new_file)
printk("warning\n");
In the git-apply?Implementation is easy (I said "would be fun to code", didn't I? --- by the way, how did you match "index_deleted_file" with "index_new_file"?). My point was that it would not be reliable enough to be useful in practice.