<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v2.10.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.10.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.10.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-10-28T16:01:17Z</updated>
<entry>
<title>Merge branch 'jk/fetch-quick-tag-following' into maint</title>
<updated>2016-10-28T16:01:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39000e849970a554a257577dcb2fb844a523a1d1'/>
<id>urn:sha1:39000e849970a554a257577dcb2fb844a523a1d1</id>
<content type='text'>
When fetching from a remote that has many tags that are irrelevant
to branches we are following, we used to waste way too many cycles
when checking if the object pointed at by a tag (that we are not
going to fetch!) exists in our repository too carefully.

* jk/fetch-quick-tag-following:
  fetch: use "quick" has_sha1_file for tag following
</content>
</entry>
<entry>
<title>fetch: use "quick" has_sha1_file for tag following</title>
<updated>2016-10-14T18:31:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-13T16:53:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5827a03545663f6d6b491a35edb313900608568b'/>
<id>urn:sha1:5827a03545663f6d6b491a35edb313900608568b</id>
<content type='text'>
When we auto-follow tags in a fetch, we look at all of the
tags advertised by the remote and fetch ones where we don't
already have the tag, but we do have the object it peels to.
This involves a lot of calls to has_sha1_file(), some of
which we can reasonably expect to fail. Since 45e8a74
(has_sha1_file: re-check pack directory before giving up,
2013-08-30), this may cause many calls to
reprepare_packed_git(), which is potentially expensive.

This has gone unnoticed for several years because it
requires a fairly unique setup to matter:

  1. You need to have a lot of packs on the client side to
     make reprepare_packed_git() expensive (the most
     expensive part is finding duplicates in an unsorted
     list, which is currently quadratic).

  2. You need a large number of tag refs on the server side
     that are candidates for auto-following (i.e., that the
     client doesn't have). Each one triggers a re-read of
     the pack directory.

  3. Under normal circumstances, the client would
     auto-follow those tags and after one large fetch, (2)
     would no longer be true. But if those tags point to
     history which is disconnected from what the client
     otherwise fetches, then it will never auto-follow, and
     those candidates will impact it on every fetch.

So when all three are true, each fetch pays an extra
O(nr_tags * nr_packs^2) cost, mostly in string comparisons
on the pack names. This was exacerbated by 47bf4b0
(prepare_packed_git_one: refactor duplicate-pack check,
2014-06-30) which uses a slightly more expensive string
check, under the assumption that the duplicate check doesn't
happen very often (and it shouldn't; the real problem here
is how often we are calling reprepare_packed_git()).

This patch teaches fetch to use HAS_SHA1_QUICK to sacrifice
accuracy for speed, in cases where we might be racy with a
simultaneous repack. This is similar to the fix in 0eeb077
(index-pack: avoid excessive re-reading of pack directory,
2015-06-09). As with that case, it's OK for has_sha1_file()
occasionally say "no I don't have it" when we do, because
the worst case is not a corruption, but simply that we may
fail to auto-follow a tag that points to it.

Here are results from the included perf script, which sets
up a situation similar to the one described above:

Test            HEAD^               HEAD
----------------------------------------------------------
5550.4: fetch   11.21(10.42+0.78)   0.08(0.04+0.02) -99.3%

Reported-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tg/add-chmod+x-fix' into maint</title>
<updated>2016-09-29T23:49:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-29T23:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36f64036f647912c8037e625e9fe3cee6713b105'/>
<id>urn:sha1:36f64036f647912c8037e625e9fe3cee6713b105</id>
<content type='text'>
"git add --chmod=+x &lt;pathspec&gt;" added recently only toggled the
executable bit for paths that are either new or modified. This has
been corrected to flip the executable bit for all paths that match
the given pathspec.

* tg/add-chmod+x-fix:
  t3700-add: do not check working tree file mode without POSIXPERM
  t3700-add: create subdirectory gently
  add: modify already added files when --chmod is given
  read-cache: introduce chmod_index_entry
  update-index: add test for chmod flags
</content>
</entry>
<entry>
<title>Merge branch 'rs/hex2chr' into maint</title>
<updated>2016-09-19T20:51:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-19T20:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c3befaeab9ebd0def9f03d434a52cf40614c65f9'/>
<id>urn:sha1:c3befaeab9ebd0def9f03d434a52cf40614c65f9</id>
<content type='text'>
Code cleanup.

* rs/hex2chr:
  introduce hex2chr() for converting two hexadecimal digits to a character
</content>
</entry>
<entry>
<title>add: modify already added files when --chmod is given</title>
<updated>2016-09-15T19:13:54Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2016-09-14T21:07:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=610d55af0f082f6b866dc858e144c03d8ed4424c'/>
<id>urn:sha1:610d55af0f082f6b866dc858e144c03d8ed4424c</id>
<content type='text'>
When the chmod option was added to git add, it was hooked up to the diff
machinery, meaning that it only works when the version in the index
differs from the version on disk.

As the option was supposed to mirror the chmod option in update-index,
which always changes the mode in the index, regardless of the status of
the file, make sure the option behaves the same way in git add.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read-cache: introduce chmod_index_entry</title>
<updated>2016-09-15T19:13:54Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2016-09-14T21:07:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9d7096662122f6b82ad6e4c08397b75906da78d'/>
<id>urn:sha1:d9d7096662122f6b82ad6e4c08397b75906da78d</id>
<content type='text'>
As there are chmod options for both add and update-index, introduce a
new chmod_index_entry function to do the work.  Use it in update-index,
while it will be used in add in the next patch.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/reflog-date' into maint</title>
<updated>2016-09-09T04:35:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-09T04:35:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f59c6e6ccb1386f0fdde2753f62536dfd3343118'/>
<id>urn:sha1:f59c6e6ccb1386f0fdde2753f62536dfd3343118</id>
<content type='text'>
The reflog output format is documented better, and a new format
--date=unix to report the seconds-since-epoch (without timezone)
has been added.

* jk/reflog-date:
  date: clarify --date=raw description
  date: add "unix" format
  date: document and test "raw-local" mode
  doc/pretty-formats: explain shortening of %gd
  doc/pretty-formats: describe index/time formats for %gd
  doc/rev-list-options: explain "-g" output formats
  doc/rev-list-options: clarify "commit@{Nth}" for "-g" option
</content>
</entry>
<entry>
<title>Merge branch 'jc/renormalize-merge-kill-safer-crlf' into maint</title>
<updated>2016-09-09T04:35:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-09T04:35:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7f5885ad2abfbf9b760e2f32f70537d1c380734d'/>
<id>urn:sha1:7f5885ad2abfbf9b760e2f32f70537d1c380734d</id>
<content type='text'>
"git merge" with renormalization did not work well with
merge-recursive, due to "safer crlf" conversion kicking in when it
shouldn't.

* jc/renormalize-merge-kill-safer-crlf:
  merge: avoid "safer crlf" during recording of merge results
  convert: unify the "auto" handling of CRLF
</content>
</entry>
<entry>
<title>introduce hex2chr() for converting two hexadecimal digits to a character</title>
<updated>2016-09-07T17:42:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-09-03T15:59:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d23309733a5b2a9e1adc304ee50c5a5ed7a087c2'/>
<id>urn:sha1:d23309733a5b2a9e1adc304ee50c5a5ed7a087c2</id>
<content type='text'>
Add and use a helper function that decodes the char value of two
hexadecimal digits.  It returns a negative number on error, avoids
running over the end of the given string and doesn't shift negative
values.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/trace-fixup'</title>
<updated>2016-08-12T16:47:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-08-12T16:47:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d4960ac7d360744fe5bac39cb90697d81128565'/>
<id>urn:sha1:6d4960ac7d360744fe5bac39cb90697d81128565</id>
<content type='text'>
Various small fixups to the "GIT_TRACE" facility.

* jk/trace-fixup:
  trace: do not fall back to stderr
  write_or_die: drop write_or_whine_pipe()
  trace: disable key after write error
  trace: correct variable name in write() error message
  trace: cosmetic fixes for error messages
  trace: use warning() for printing trace errors
  trace: stop using write_or_whine_pipe()
  trace: handle NULL argument in trace_disable()
</content>
</entry>
</feed>
