Re: [PATCH] Add --no-rename to git-apply
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 27, 2007, 10:24 UTC
- Message-ID
- <Pine.LNX.4.64.0709271107530.28395@racer.site>
- In-Reply-To
- <7vbqbozo7t.fsf@gitster.siamese.dyndns.org>
Hi,
On Wed, 26 Sep 2007, Junio C Hamano wrote:
Show 11 quoted lines
> Robin Rosenberg <robin.rosenberg@dewire.com> 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