Re: [PATCH] Add --no-rename to git-apply
From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:37
Hi, On Wed, 26 Sep 2007, Junio C Hamano wrote:
Robin Rosenberg [off-list ref] writes:quoted
With this option git-apply can apply a patch with a rename onto the original file(s).This is troubling from both design and implementation point of view. * Why would this be useful? What's the point of producing the renaming patch if you know you would want to apply while ignoring the rename?
Robin said in a follow-up mail that he needs it for a payed-for SCM (let's describe it as TransparentBox here), which insists on explicit renames. But I suggest a simple script here which extracts from the diff the renames, which outputs a script which renames the file(s) back and then uses the TransparentBox' mv command: sed -n -e "/^rename from/N" \ -e "s/^rename from \(.*\)\nrename to \(.*\)/mv \2 \1 \&\& tb mv \1 \2/p" \ < diff.patch Ciao, Dscho