From: Johannes Schindelin Date: Thu, 27 Sep 2007 10:24:38 GMT Subject: Re: [PATCH] Add --no-rename to git-apply Message-ID: In-Reply-To: <7vbqbozo7t.fsf@gitster.siamese.dyndns.org> Hi, On Wed, 26 Sep 2007, Junio C Hamano wrote: > Robin Rosenberg writes: > > > 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