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

Re: cygwin, 44k files: how to commit only index?

From
Alex Riesen <raa.lkml@gmail.com>
Date
Dec 8, 2006, 07:48 UTC
Message-ID
<81b0412b0612072348q13faaab0s9ba7a235f7fd64dc@mail.gmail.com>
In-Reply-To
<7vhcw6n8iz.fsf@assigned-by-dhcp.cox.net>
On 12/8/06, Junio C Hamano <junkio@cox.net> wrote:
Show 12 quoted lines
> >> The current code for "diff-index --cached" reads the whole tree
> >> into the index as stage #1 entries (diff-lib.c::run_diff_index),
> >> and then compares stage #0 (from the original index contents)
> >> and stage #1 (the tree parameter from the command line).  Even
> >> if you stop at the first mismatch, you would already have paid
> >> the overhead to open and read all tree objects before even
> >> starting the comparison.
> >
> > But I don't have to pay for the overhead of comparing all
> > entries, if I can stop at first mismatch and exit with non-0.
>
> Bench it if you doubt me.

I don't question that the overhead of comparing is very much unnoticable. It just that it surely isn't zero, and it will grow with the size of repo (linearly, right?)... And I am sure that this repo will _only_ grow (typical corporate project).

Show 5 quoted lines
> I'd bet that the time spent in comparison between stages inside
> index (and remember, you are not generating textual diff, only
> comparing the SHA-1) is dwarfed by the overhead of populating
> the stage #1 of the index with what is read from all the tree
> objects.
I already understood that. I just haven't found yet what can I do
Previous: Junio C HamanoNext: Alex Riesen
Message 16 of 18 in “cygwin, 44k files: how to commit only index?”
  1. Alex RiesenDec 7, 2006
  2. Junio C HamanoDec 7, 2006
  3. Shawn PearceDec 7, 2006
  4. Shawn PearceDec 7, 2006
  5. Christian MICHONDec 7, 2006
  6. Torgil SvenssonDec 9, 2006
  7. Junio C HamanoDec 7, 2006
  8. Shawn PearceDec 7, 2006
  9. Junio C HamanoDec 7, 2006
  10. Alex RiesenDec 7, 2006
  11. Junio C HamanoDec 7, 2006
  12. Alex RiesenDec 8, 2006
  13. Junio C HamanoDec 8, 2006
  14. Alex RiesenDec 8, 2006
  15. Junio C HamanoDec 8, 2006
  16. Alex RiesenDec 8, 2006
  17. Alex RiesenDec 8, 2006
  18. Alex RiesenDec 8, 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.