<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-04-03T16:25:41Z</updated>
<entry>
<title>Merge branch 'jk/alias-in-bare' into maint</title>
<updated>2013-04-03T16:25:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-03T16:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eeecf393972b9ca4a37adb8785f16e9617eecc57'/>
<id>urn:sha1:eeecf393972b9ca4a37adb8785f16e9617eecc57</id>
<content type='text'>
An aliased command spawned from a bare repository that does not say
it is bare with "core.bare = yes" is treated as non-bare by mistake.

* jk/alias-in-bare:
  setup: suppress implicit "." work-tree for bare repos
  environment: add GIT_PREFIX to local_repo_env
  cache.h: drop LOCAL_REPO_ENV_SIZE
</content>
</entry>
<entry>
<title>Sync with 1.8.1 maintenance track</title>
<updated>2013-04-03T16:18:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-03T16:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92e0d916326de103e463f9ffcfcd99ec1f3a9dc0'/>
<id>urn:sha1:92e0d916326de103e463f9ffcfcd99ec1f3a9dc0</id>
<content type='text'>
* maint-1.8.1:
  Start preparing for 1.8.1.6
  git-tag(1): we tag HEAD by default
  Fix revision walk for commits with the same dates
  t2003: work around path mangling issue on Windows
  pack-refs: add fully-peeled trait
  pack-refs: write peeled entry for non-tags
  use parse_object_or_die instead of die("bad object")
  avoid segfaults on parse_object failure
  entry: fix filter lookup
  t2003: modernize style
  name-hash.c: fix endless loop with core.ignorecase=true
</content>
</entry>
<entry>
<title>Merge branch 'kb/name-hash' into maint-1.8.1</title>
<updated>2013-04-03T15:44:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-03T15:44:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c81e2c61b387b7fc3ef8c303f0f8ac76411b465d'/>
<id>urn:sha1:c81e2c61b387b7fc3ef8c303f0f8ac76411b465d</id>
<content type='text'>
* kb/name-hash:
  name-hash.c: fix endless loop with core.ignorecase=true
</content>
</entry>
<entry>
<title>setup: suppress implicit "." work-tree for bare repos</title>
<updated>2013-03-08T22:02:40Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-03-08T09:32:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2cd83d10bb6bcf768129e1c4e5a4dee4b6bcd27f'/>
<id>urn:sha1:2cd83d10bb6bcf768129e1c4e5a4dee4b6bcd27f</id>
<content type='text'>
If an explicit GIT_DIR is given without a working tree, we
implicitly assume that the current working directory should
be used as the working tree. E.g.,:

  GIT_DIR=/some/repo.git git status

would compare against the cwd.

Unfortunately, we fool this rule for sub-invocations of git
by setting GIT_DIR internally ourselves. For example:

  git init foo
  cd foo/.git
  git status ;# fails, as we expect
  git config alias.st status
  git status ;# does not fail, but should

What happens is that we run setup_git_directory when doing
alias lookup (since we need to see the config), set GIT_DIR
as a result, and then leave GIT_WORK_TREE blank (because we
do not have one). Then when we actually run the status
command, we do setup_git_directory again, which sees our
explicit GIT_DIR and uses the cwd as an implicit worktree.

It's tempting to argue that we should be suppressing that
second invocation of setup_git_directory, as it could use
the values we already found in memory. However, the problem
still exists for sub-processes (e.g., if "git status" were
an external command).

You can see another example with the "--bare" option, which
sets GIT_DIR explicitly. For example:

  git init foo
  cd foo/.git
  git status ;# fails
  git --bare status ;# does NOT fail

We need some way of telling sub-processes "even though
GIT_DIR is set, do not use cwd as an implicit working tree".
We could do it by putting a special token into
GIT_WORK_TREE, but the obvious choice (an empty string) has
some portability problems.

Instead, we add a new boolean variable, GIT_IMPLICIT_WORK_TREE,
which suppresses the use of cwd as a working tree when
GIT_DIR is set. We trigger the new variable when we know we
are in a bare setting.

The variable is left intentionally undocumented, as this is
an internal detail (for now, anyway). If somebody comes up
with a good alternate use for it, and once we are confident
we have shaken any bugs out of it, we can consider promoting
it further.

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>environment: add GIT_PREFIX to local_repo_env</title>
<updated>2013-03-08T22:02:31Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-03-08T09:30:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6f7f9a32532a636bd458c7a3dc2cc16fbe237d3'/>
<id>urn:sha1:a6f7f9a32532a636bd458c7a3dc2cc16fbe237d3</id>
<content type='text'>
The GIT_PREFIX variable is set based on our location within
the working tree. It should therefore be cleared whenever
GIT_WORK_TREE is cleared.

In practice, this doesn't cause any bugs, because none of
the sub-programs we invoke with local_repo_env cleared
actually care about GIT_PREFIX. But this is the right thing
to do, and future proofs us against that assumption changing.

While we're at it, let's define a GIT_PREFIX_ENVIRONMENT
macro; this avoids repetition of the string literal, which
can help catch any spelling mistakes 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>cache.h: drop LOCAL_REPO_ENV_SIZE</title>
<updated>2013-03-08T15:55:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-03-08T09:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2163e5dbb4cad43d65a4ffc8daeacff5eedd7af9'/>
<id>urn:sha1:2163e5dbb4cad43d65a4ffc8daeacff5eedd7af9</id>
<content type='text'>
We keep a static array of variables that should be cleared
when invoking a sub-process on another repo. We statically
size the array with the LOCAL_REPO_ENV_SIZE macro so that
any readers do not have to count it themselves.

As it turns out, no readers actually use the macro, and it
creates a maintenance headache, as modifications to the
array need to happen in two places (one to add the new
element, and another to bump the size).

Since it's NULL-terminated, we can just drop the size macro
entirely. While we're at it, we'll clean up some comments
around it, and add a new mention of it at the top of the
list of environment variable macros. Even though
local_repo_env is right below that list, it's easy to miss,
and additions to that list should consider local_repo_env.

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>name-hash.c: fix endless loop with core.ignorecase=true</title>
<updated>2013-02-28T07:29:04Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2013-02-27T23:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2092678cd5265e40dfb2b8e3adc8f2075faeece4'/>
<id>urn:sha1:2092678cd5265e40dfb2b8e3adc8f2075faeece4</id>
<content type='text'>
With core.ignorecase=true, name-hash.c builds a case insensitive index of
all tracked directories. Currently, the existing cache entry structures are
added multiple times to the same hashtable (with different name lengths and
hash codes). However, there's only one dir_next pointer, which gets
completely messed up in case of hash collisions. In the worst case, this
causes an endless loop if ce == ce-&gt;dir_next (see t7062).

Use a separate hashtable and separate structures for the directory index
so that each directory entry has its own next pointer. Use reference
counting to track which directory entry contains files.

There are only slight changes to the name-hash.c API:
- new free_name_hash() used by read_cache.c::discard_index()
- remove_name_hash() takes an additional index_state parameter
- index_name_exists() for a directory (trailing '/') may return a cache
  entry that has been removed (CE_UNHASHED). This is not a problem as the
  return value is only used to check if the directory exists (dir.c) or to
  normalize casing of directory names (read-cache.c).

Getting rid of cache_entry.dir_next reduces memory consumption, especially
with core.ignorecase=false (which doesn't use that member at all).

With core.ignorecase=true, building the directory index is slightly faster
as we add / check the parent directory first (instead of going through all
directory levels for each file in the index). E.g. with WebKit (~200k
files, ~7k dirs), time spent in lazy_init_name_hash is reduced from 176ms
to 130ms.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/push-reject-reasons'</title>
<updated>2013-02-04T18:25:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-04T18:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=370855e967e21d9c5b70df7b5cd3756c7bed5c7c'/>
<id>urn:sha1:370855e967e21d9c5b70df7b5cd3756c7bed5c7c</id>
<content type='text'>
Improve error and advice messages given locally when "git push"
refuses when it cannot compute fast-forwardness by separating these
cases from the normal "not a fast-forward; merge first and push
again" case.

* jc/push-reject-reasons:
  push: finishing touches to explain REJECT_ALREADY_EXISTS better
  push: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE
  push: further simplify the logic to assign rejection reason
  push: further clean up fields of "struct ref"
</content>
</entry>
<entry>
<title>Merge branch 'jk/config-parsing-cleanup'</title>
<updated>2013-02-04T18:24:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-04T18:24:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=099ba556d05571001293c8eda10a4fc659f83f48'/>
<id>urn:sha1:099ba556d05571001293c8eda10a4fc659f83f48</id>
<content type='text'>
Configuration parsing for tar.* configuration variables were
broken. Introduce a new config-keyname parser API to make the
callers much less error prone.

* jk/config-parsing-cleanup:
  reflog: use parse_config_key in config callback
  help: use parse_config_key for man config
  submodule: simplify memory handling in config parsing
  submodule: use parse_config_key when parsing config
  userdiff: drop parse_driver function
  convert some config callbacks to parse_config_key
  archive-tar: use parse_config_key when parsing config
  config: add helper function for parsing key names
</content>
</entry>
<entry>
<title>Merge branch 'jc/custom-comment-char'</title>
<updated>2013-02-04T18:23:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-04T18:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=149a4211a4b8d8bbcdd72685d538d6ac7365e29e'/>
<id>urn:sha1:149a4211a4b8d8bbcdd72685d538d6ac7365e29e</id>
<content type='text'>
Allow a configuration variable core.commentchar to customize the
character used to comment out the hint lines in the edited text from
the default '#'.

* jc/custom-comment-char:
  Allow custom "comment char"
</content>
</entry>
</feed>
