<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v2.14.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.14.0</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.14.0'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2017-07-05T20:32:57Z</updated>
<entry>
<title>Merge branch 'jt/unify-object-info'</title>
<updated>2017-07-05T20:32:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-07-05T20:32:57Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=00b7cf2379901394c971db5ab59ce70e12e434b7'/>
<id>urn:sha1:00b7cf2379901394c971db5ab59ce70e12e434b7</id>
<content type='text'>
Code clean-ups.

* jt/unify-object-info:
  sha1_file: refactor has_sha1_file_with_flags
  sha1_file: do not access pack if unneeded
  sha1_file: teach sha1_object_info_extended more flags
  sha1_file: refactor read_object
  sha1_file: move delta base cache code up
  sha1_file: rename LOOKUP_REPLACE_OBJECT
  sha1_file: rename LOOKUP_UNKNOWN_OBJECT
  sha1_file: teach packed_object_info about typename
</content>
</entry>
<entry>
<title>Merge branch 'rs/sha1-name-readdir-optim'</title>
<updated>2017-07-05T20:32:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-07-05T20:32:56Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=5ab148dda0076a136b4afb385d96bd9cdc4d2590'/>
<id>urn:sha1:5ab148dda0076a136b4afb385d96bd9cdc4d2590</id>
<content type='text'>
Optimize "what are the object names already taken in an alternate
object database?" query that is used to derive the length of prefix
an object name is uniquely abbreviated to.

* rs/sha1-name-readdir-optim:
  sha1_file: guard against invalid loose subdirectory numbers
  sha1_file: let for_each_file_in_obj_subdir() handle subdir names
  p4205: add perf test script for pretty log formats
  sha1_name: cache readdir(3) results in find_short_object_filename()
</content>
</entry>
<entry>
<title>sha1_file: refactor has_sha1_file_with_flags</title>
<updated>2017-06-26T17:28:58Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-06-22T00:40:24Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b'/>
<id>urn:sha1:e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b</id>
<content type='text'>
has_sha1_file_with_flags() implements many mechanisms in common with
sha1_object_info_extended(). Make has_sha1_file_with_flags() a
convenience function for sha1_object_info_extended() instead.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sha1_file: teach sha1_object_info_extended more flags</title>
<updated>2017-06-26T17:28:42Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-06-22T00:40:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=dfdd4afcf97b0199f44231e726e373934da77717'/>
<id>urn:sha1:dfdd4afcf97b0199f44231e726e373934da77717</id>
<content type='text'>
Improve sha1_object_info_extended() by supporting additional
flags. This allows has_sha1_file_with_flags() to be modified to use
sha1_object_info_extended() in a subsequent patch.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sha1_file: guard against invalid loose subdirectory numbers</title>
<updated>2017-06-24T18:09:52Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-06-24T14:09:39Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=70c49050d4a16a7e2990e4d3c91d9d12f62e631e'/>
<id>urn:sha1:70c49050d4a16a7e2990e4d3c91d9d12f62e631e</id>
<content type='text'>
Loose object subdirectories have hexadecimal names based on the first
byte of the hash of contained objects, thus their numerical
representation can range from 0 (0x00) to 255 (0xff).  Change the type
of the corresponding variable in for_each_file_in_obj_subdir() and
associated callback functions to unsigned int and add a range check.

Suggested-by: Jeff King &lt;peff@peff.net&gt;
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>path: create path.h</title>
<updated>2017-06-24T01:24:34Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-22T18:43:35Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e7d72d07535012b73c6bed67a5a09b1f58082203'/>
<id>urn:sha1:e7d72d07535012b73c6bed67a5a09b1f58082203</id>
<content type='text'>
Move all path related declarations from cache.h to a new path.h header
file.  This makes cache.h smaller and makes it easier to add new path
related functions.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>environment: place key repository state in the_repository</title>
<updated>2017-06-24T01:24:34Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-22T18:43:33Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=c14c234f22e0656a61f5718baf155118e6e609c9'/>
<id>urn:sha1:c14c234f22e0656a61f5718baf155118e6e609c9</id>
<content type='text'>
Migrate 'git_dir', 'git_common_dir', 'git_object_dir', 'git_index_file',
'git_graft_file', and 'namespace' to be stored in 'the_repository'.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: don't perform lazy initialization of repository state</title>
<updated>2017-06-24T01:24:34Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-20T19:19:32Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=73f192c991016bf88a9416cdf0e949f8b946f7e2'/>
<id>urn:sha1:73f192c991016bf88a9416cdf0e949f8b946f7e2</id>
<content type='text'>
Under some circumstances (bogus GIT_DIR value or the discovered gitdir
is '.git') 'setup_git_directory()' won't initialize key repository
state.  This leads to inconsistent state after running the setup code.
To account for this inconsistent state, lazy initialization is done once
a caller asks for the repository's gitdir or some other piece of
repository state.  This is confusing and can be error prone.

Instead let's tighten the expected outcome of 'setup_git_directory()'
and ensure that it initializes repository state in all cases that would
have been handled by lazy initialization.

This also lets us drop the requirement to have 'have_git_dir()' check if
the environment variable GIT_DIR was set as that will be handled by the
end of the setup code.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'bw/ls-files-sans-the-index' and 'bw/config-h' into bw/repo-object</title>
<updated>2017-06-24T01:24:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-21T22:20:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=25bf951381a4880c43a3d1c65e6dce651e61148f'/>
<id>urn:sha1:25bf951381a4880c43a3d1c65e6dce651e61148f</id>
<content type='text'>
* bw/ls-files-sans-the-index:
  ls-files: factor out tag calculation
  ls-files: factor out debug info into a function
  ls-files: convert show_files to take an index
  ls-files: convert show_ce_entry to take an index
  ls-files: convert prune_cache to take an index
  ls-files: convert ce_excluded to take an index
  ls-files: convert show_ru_info to take an index
  ls-files: convert show_other_files to take an index
  ls-files: convert show_killed_files to take an index
  ls-files: convert write_eolinfo to take an index
  ls-files: convert overlay_tree_on_cache to take an index
  tree: convert read_tree to take an index parameter
  convert: convert renormalize_buffer to take an index
  convert: convert convert_to_git to take an index
  convert: convert convert_to_git_filter_fd to take an index
  convert: convert crlf_to_git to take an index
  convert: convert get_cached_convert_stats_ascii to take an index

* bw/config-h:
  config: don't implicitly use gitdir or commondir
  config: respect commondir
  setup: teach discover_git_directory to respect the commondir
  config: don't include config.h by default
  config: remove git_config_iter
  config: create config.h
  alias: use the early config machinery to expand aliases
  t7006: demonstrate a problem with aliases in subdirectories
  t1308: relax the test verifying that empty alias values are disallowed
  help: use early config when autocorrecting aliases
  config: report correct line number upon error
  discover_git_directory(): avoid setting invalid git_dir
</content>
</entry>
<entry>
<title>sha1_name: cache readdir(3) results in find_short_object_filename()</title>
<updated>2017-06-22T19:07:51Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-06-22T18:19:48Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=cc817ca3ef2267c21af9589a7f92190a3659906c'/>
<id>urn:sha1:cc817ca3ef2267c21af9589a7f92190a3659906c</id>
<content type='text'>
Read each loose object subdirectory at most once when looking for unique
abbreviated hashes.  This speeds up commands like "git log --pretty=%h"
considerably, which previously caused one readdir(3) call for each
candidate, even for subdirectories that were visited before.

The new cache is kept until the program ends and never invalidated.  The
same is already true for pack indexes.  The inherent racy nature of
finding unique short hashes makes it still fit for this purpose -- a
conflicting new object may be added at any time.  Tasks with higher
consistency requirements should not use it, though.

The cached object names are stored in an oid_array, which is quite
compact.  The bitmap for remembering which subdir was already read is
stored as a char array, with one char per directory -- that's not quite
as compact, but really simple and incurs only an overhead equivalent to
11 hashes after all.

Suggested-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
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>
</feed>
