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

Re: git status / git diff -C not detecting file copy

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 3, 2014, 16:01 UTC
Message-ID
<xmqqa934lo2p.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141202200910.GB23461@peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> I find that git.git is often a useful and easy thing to time to
> extrapolate to other projects. It's 1/10th-1/20th the size of the kernel
> (both in tree size and commit depth), which I do consider a "big
> project" (and I have a feeling is what Linus was talking about).
>
> Of course, performance numbers do not always scale linearly with repo
> size.
> ...
> What does impact it is the _size_ of each commit. If you quite
> frequently add a new file while touching tens of thousands of other
> files, then the performance will be a lot more noticeable. And both
> git.git and linux.git are probably better than some other projects about
> having small commits.

Yes, the number of paths touched per-commit in git.git may not be typical. If it is unusually lower, that would skew the result, as the cost of rename detection is proportional to it, and the cost of -C -C is that number times the number of total paths in the project.

Show 12 quoted lines
> Still, though. I stand by my earlier conclusions. Even with commits ten
> times as large as the kernel's, you are talking about 3ms added to a
> "status" run (and again, only when you hit such a gigantic commit _and_
> it has an 'A' file).
>
>> It is a fine idea to make this configurable ("status.renames = -C"
>> or something, perhaps?), though.
>
> I think it would be OK to move to "-C" as a default, but I agree it is
> nicer if it is configurable, as it gives a safety hatch for people in
> pathological repos to drop back to the old behavior (or even turn off
> renames altogether).
Yeah I am OK with that, too.
Previous: Jeff KingNext: Bryan Turner
Message 9 of 12 in “git status / git diff -C not detecting file copy”
  1. Pol OnlineNov 30, 2014
  2. Bryan TurnerNov 30, 2014
  3. Pol OnlineNov 30, 2014
  4. Bryan TurnerNov 30, 2014
  5. Jeff KingDec 2, 2014
  6. Pol OnlineDec 2, 2014
  7. Junio C HamanoDec 2, 2014
  8. Jeff KingDec 2, 2014
  9. Junio C HamanoDec 3, 2014
  10. Bryan TurnerDec 2, 2014
  11. Jeff KingDec 2, 2014
  12. Junio C HamanoDec 3, 2014

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.