Re: [PATCH] Add --no-rename to git-apply

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

 



Hi,

On Wed, 26 Sep 2007, Junio C Hamano wrote:

> Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> 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

-
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