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

Re: [RFC] Enable 'check for copy and renames' (-C) also when path filtering

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Aug 16, 2006, 20:49 UTC
Message-ID
<e5bfff550608161349t29a678ccl4b211cb570a1217d@mail.gmail.com>
In-Reply-To
<7v8xlo4lht.fsf@assigned-by-dhcp.cox.net>
On 8/16/06, Junio C Hamano <junkio@cox.net> wrote:
Show 28 quoted lines
> "Marco Costalba" <mcostalba@gmail.com> writes:
>
> > It seems that -C option of git-diff-tree it works only if the whole
> > changeset is retrieved.
>
> Correct (sort of).  Pathspec works on the input side not on the
> output side.  It's been specified and worked that way from the
> beginning (check the list archive to see me arguing that it
> would be easier to use on the output side, and Linus vetoing
> because following a single file is not that interesting and the
> cost outweighs the benefit of that uninteresting case).
>
> Always feeding the whole tree is wasteful, but if we are
> interested in following a single file, we could do something
> like:
>
>  - follow that file and that file only from the recent to past;
>
>  - notice when that file disappears -- that is the point the
>    file was created.  it may have created from scratch, it may
>    have been renamed or copied.
>
>  - on that commit that creates the file, look at the whole tree
>    to see if we can find an origin.
>
>  - if we find that the file was created by renaming or copying
>    another, keep following that other file from that point on.
>

Yes, I was thinking about something like this, Thanks for point me out this, now I am quite sure it's the correct way to go ;-)

   Marco

P.S: The first thing will be to teach qgit about renames and copies, i.e. diff-tree with -C option. I'm cooking a patch on this.

BTW, regarding copies, there are only 6 (6973dca, 8752d11, 927a503, 2276aa6, ddafa7e9 and 7ef7692) in git tree, against 181 renames.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “[RFC] Enable 'check for copy and renames' (-C) also when path filtering”
  1. Marco CostalbaAug 16, 2006
  2. Junio C HamanoAug 16, 2006
  3. Marco CostalbaAug 16, 2006
  4. Junio C HamanoAug 16, 2006

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.