<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-05-24T01:59:27Z</updated>
<entry>
<title>get_sha1_with_context: dynamically allocate oc-&gt;path</title>
<updated>2017-05-24T01:59:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-05-19T12:54:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc944b65f1d13e258edc88a7608e2fe957ec334e'/>
<id>urn:sha1:dc944b65f1d13e258edc88a7608e2fe957ec334e</id>
<content type='text'>
When a sha1 lookup returns the tree path via "struct
object_context", it just copies it into a fixed-size buffer.
This means the result can be truncated, and it means our
"struct object_context" consumes a lot of stack space.

Instead, let's allocate a string on the heap. Because most
callers don't care about this information, we'll avoid doing
it by default (so they don't all have to start calling
free() on the result). There are basically two options for
the caller to signal to us that it's interested:

  1. By setting a pointer to storage in the object_context.

  2. By passing a flag in another parameter.

Doing (1) would match the way that sha1_object_info_extended()
works. But it would mean that every caller would have to
initialize the object_context, which they don't currently
have to do.

This patch does (2), and adds a new bit to the function's
flags field. All of the callers that look at the "path"
field are updated to pass the new flag.

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>sha1_name: consistently refer to object_context as "oc"</title>
<updated>2017-05-24T01:59:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-05-19T12:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0a487eafb63301004af424bf02b1951abdc4da7'/>
<id>urn:sha1:c0a487eafb63301004af424bf02b1951abdc4da7</id>
<content type='text'>
An early version of the patch to add object_context used the
name object_resolve_context. This was later shortened to
just object_context, but the "orc" variable name stuck in a
few places.  Let's use "oc", which is used elsewhere in the
code.

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 'jh/add-index-entry-optim'</title>
<updated>2017-04-26T06:39:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-26T06:39:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6cbc478d83b5773d1925869e50bf6067306f4817'/>
<id>urn:sha1:6cbc478d83b5773d1925869e50bf6067306f4817</id>
<content type='text'>
"git checkout" that handles a lot of paths has been optimized by
reducing the number of unnecessary checks of paths in the
has_dir_name() function.

* jh/add-index-entry-optim:
  read-cache: speed up has_dir_name (part 2)
  read-cache: speed up has_dir_name (part 1)
  read-cache: speed up add_index_entry during checkout
  p0006-read-tree-checkout: perf test to time read-tree
  read-cache: add strcmp_offset function
</content>
</entry>
<entry>
<title>Merge branch 'nd/conditional-config-in-early-config'</title>
<updated>2017-04-26T06:39:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-26T06:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9672ba4c86a5fb18ea20d1c4a2c0eb6a731f3cb'/>
<id>urn:sha1:c9672ba4c86a5fb18ea20d1c4a2c0eb6a731f3cb</id>
<content type='text'>
The recently introduced conditional inclusion of configuration did
not work well when early-config mechanism was involved.

* nd/conditional-config-in-early-config:
  config: correct file reading order in read_early_config()
  config: handle conditional include when $GIT_DIR is not set up
  config: prepare to pass more info in git_config_with_options()
</content>
</entry>
<entry>
<title>Merge branch 'jh/verify-index-checksum-only-in-fsck'</title>
<updated>2017-04-24T05:07:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cdfe138b360cd10f74ef9d2d031cb10447cb3338'/>
<id>urn:sha1:cdfe138b360cd10f74ef9d2d031cb10447cb3338</id>
<content type='text'>
The index file has a trailing SHA-1 checksum to detect file
corruption, and historically we checked it every time the index
file is used.  Omit the validation during normal use, and instead
verify only in "git fsck".

* jh/verify-index-checksum-only-in-fsck:
  read-cache: force_verify_index_checksum
</content>
</entry>
<entry>
<title>Merge branch 'nd/conditional-config-include'</title>
<updated>2017-04-24T05:07:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a2e2c046833be53e7599ee7fed5c45f16580ab37'/>
<id>urn:sha1:a2e2c046833be53e7599ee7fed5c45f16580ab37</id>
<content type='text'>
$GIT_DIR may in some cases be normalized with all symlinks resolved
while "gitdir" path expansion in the pattern does not receive the
same treatment, leading to incorrect mismatch.  This has been fixed.

* nd/conditional-config-include:
  config: resolve symlinks in conditional include's patterns
  path.c: and an option to call real_path() in expand_user_path()
</content>
</entry>
<entry>
<title>Merge branch 'dt/http-postbuffer-can-be-large'</title>
<updated>2017-04-24T05:07:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c01f67d9102942cc7f0a737de4c609a6ac1832e'/>
<id>urn:sha1:4c01f67d9102942cc7f0a737de4c609a6ac1832e</id>
<content type='text'>
Allow the http.postbuffer configuration variable to be set to a
size that can be expressed in size_t, which can be larger than
ulong on some platforms.

* dt/http-postbuffer-can-be-large:
  http.postbuffer: allow full range of ssize_t values
</content>
</entry>
<entry>
<title>Merge branch 'bc/object-id'</title>
<updated>2017-04-20T04:37:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-20T04:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1081e4004091947b6c6a806625addd1cbba61b7'/>
<id>urn:sha1:b1081e4004091947b6c6a806625addd1cbba61b7</id>
<content type='text'>
Conversion from unsigned char [40] to struct object_id continues.

* bc/object-id:
  Documentation: update and rename api-sha1-array.txt
  Rename sha1_array to oid_array
  Convert sha1_array_for_each_unique and for_each_abbrev to object_id
  Convert sha1_array_lookup to take struct object_id
  Convert remaining callers of sha1_array_lookup to object_id
  Make sha1_array_append take a struct object_id *
  sha1-array: convert internal storage for struct sha1_array to object_id
  builtin/pull: convert to struct object_id
  submodule: convert check_for_new_submodule_commits to object_id
  sha1_name: convert disambiguate_hint_fn to take object_id
  sha1_name: convert struct disambiguate_state to object_id
  test-sha1-array: convert most code to struct object_id
  parse-options-cb: convert sha1_array_append caller to struct object_id
  fsck: convert init_skiplist to struct object_id
  builtin/receive-pack: convert portions to struct object_id
  builtin/pull: convert portions to struct object_id
  builtin/diff: convert to struct object_id
  Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ
  Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ
  Define new hash-size constants for allocating memory
</content>
</entry>
<entry>
<title>config: handle conditional include when $GIT_DIR is not set up</title>
<updated>2017-04-18T02:18:43Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-04-17T10:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2185fde56328942d5be9603cc199ee7c6d004085'/>
<id>urn:sha1:2185fde56328942d5be9603cc199ee7c6d004085</id>
<content type='text'>
If setup_git_directory() and friends have not been called,
get_git_dir() (because of includeIf.gitdir:XXX) would lead to

    die("BUG: setup_git_env called without repository");

There are two cases when a config file could be read before $GIT_DIR
is located.

The first one is check_repository_format(), where we read just the one
file $GIT_DIR/config to check if we could understand this
repository. This case should be safe. We do not parse include
directives, which can only be triggered from git_config_with_options,
but setup code uses a lower-level function. The concerned variables
should never be hidden away behind includes anyway.

The second one is triggered in check_pager_config() when we're about
to run an external git command. We might be able to find $GIT_DIR in
this case, which is exactly what read_early_config() does (and also is
what check_pager_config() uses). Conditional includes and
get_git_dir() could be triggered by the first
git_config_with_options() call there, before discover_git_directory()
is used as a fallback $GIT_DIR detection.

Detect this special "early reading" case, pass down the $GIT_DIR,
either from previous setup or detected by discover_git_directory(),
and make conditional include use it.

Noticed-by: Bert Wesarg &lt;bert.wesarg@googlemail.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: prepare to pass more info in git_config_with_options()</title>
<updated>2017-04-18T02:18:40Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-04-17T10:10:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c48f4b379eb3a0d093f5a87cce1d2ed6c175104f'/>
<id>urn:sha1:c48f4b379eb3a0d093f5a87cce1d2ed6c175104f</id>
<content type='text'>
So far we can only pass one flag, respect_includes, to thie function. We
need to pass some more (non-flag even), so let's make it accept a struct
instead of an integer.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
