git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Robin Rosenberg <robin.rosenberg@dewire.com>, git@vger.kernel.org
Subject: Re: [PATCH] Add --no-rename to git-apply
Date: Thu, 27 Sep 2007 11:24:38 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0709271107530.28395@racer.site> (raw)
In-Reply-To: <7vbqbozo7t.fsf@gitster.siamese.dyndns.org>

Hi,

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

> 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

  reply	other threads:[~2007-09-27 10:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26 21:26 [PATCH] Add --no-rename to git-apply Robin Rosenberg
2007-09-26 22:31 ` Robin Rosenberg
2007-09-27  5:12 ` Junio C Hamano
2007-09-27 10:24   ` Johannes Schindelin [this message]
2007-09-27 19:04     ` Robin Rosenberg
2007-09-27 19:12   ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0709271107530.28395@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=robin.rosenberg@dewire.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).