git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Sep 27, 2007, 19:12 UTC
Message-ID
<200709272112.29608.robin.rosenberg@dewire.com>
In-Reply-To
<7vbqbozo7t.fsf@gitster.siamese.dyndns.org>
torsdag 27 september 2007 skrev Junio C Hamano:
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?

The point of producing the rename info is to find out which renames are in it. It's only that I don't want to perform them straight away.

Show 10 quoted lines
>  * The change looks too special purpose to me.  If you are
>    giving the ability to deposit the result to somewhere other
>    than where the patch intendes to, why limit it only to the
>    preimage name?  Aren't there cases where A is renamed to B
>    sometime in the history, and you have a patch that talks
>    about the content change A->A but the tree you have has the
>    contents already in B, and you would want to apply that
>    patch?  It feels that this and your "ignore rename" could be
>    handled much more cleanly and flexibly by preprocessing the
>    patchfile.

Well it is special *purpose*, but not tied to a particuar tool. I'm not sure whether it is necessary with other tools though. I'll consider the preprocessing and will retry the rename-back that Johannes suggested.

Show 8 quoted lines
> 
>  * By disabling the parsing of rename header lines, you are
>    disabling the sanity checking of the input done in
>    gitdiff_verify_name() called from gitdiff_oldname() and
>    gitdiff_newname().  I think it is wrong for --no-rename
>    option to affect the parsing of the input.  If we were to do
>    this, perhaps write_out_results() or one of its callee would
>    be a better place to do so.

Hopefully git produces sane things so the checking shouldn't be that important, but I also do a check before beginning with checkouts and so on, much like git-cvsexportcommit. The check is performed without the switch.

-- robin
Previous: Robin Rosenberg
Message 6 of 6 in “Add --no-rename to git-apply”
  1. Add --no-rename to git-applyRobin Rosenberg, Sep 26, 2007
  2. Robin RosenbergSep 26, 2007
  3. Junio C HamanoSep 27, 2007
  4. Johannes SchindelinSep 27, 2007
  5. Robin RosenbergSep 27, 2007
  6. Robin RosenbergSep 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.