Thread (16 messages) flat view 16 messages, 3 authors, 2016-06-15
  • (off-list ancestor, not in this archive)
  • Re: git bugs · Junio C Hamano <hidden> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15
  • Re: git bugs · Ben Lynn <hidden> · 2016-06-15
  • Re: git bugs · Linus Torvalds <torvalds@linux-foundation.org> · 2016-06-15

Re: git bugs

From: Ben Lynn <hidden>
Date: 2016-06-15 22:44:43

I'm not sure why you think my patch that just did the zero-sized blob
thing was slow? It's a 20-byte memcmp(). It takes no time at all.
I don't think the memcmp is slow. I think the ce_modified_check_fs in:

smudge() {
   ...
  if (ce_match_stat_basic(ce, &st))
                return;
  if (ce_modified_check_fs(ce, &st))
                ce->ce_size = 0;
}

is potentially slow, and I'm saying you could replace it with

smudge() {
   ...
  if (ce_match_stat_basic(ce, &st))
                return;
  ce->ce_size = ~0;
}

to avoid the ce_modified_check_fs call. But it is an unclean solution,
which is why I champion having an extra flag per file.

Also, I think we could set ce->ce_size to ~0 when we first realize
timestamp = mtime, and we'd no longer have to do index-wide smudging
on writes.

Thanks for the explanation by the way. I get why you can't modify the
SHA1. It is indeed what we asked git to record, right or wrong. I got
confused because I misread the code and thought ce_modified_check_fs()
would write the new SHA1 to disk.

-Ben
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help