<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.15.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.15.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-11-15T03:05:01Z</updated>
<entry>
<title>Merge branch 'js/early-config' into maint</title>
<updated>2017-11-15T03:05:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-15T03:05:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16f8cd1fba98fc39ac32c7063e38f9c8470f643a'/>
<id>urn:sha1:16f8cd1fba98fc39ac32c7063e38f9c8470f643a</id>
<content type='text'>
Correct start-up sequence so that a repository could be placed
immediately under the root directory again (which was broken at
around Git 2.13).

* js/early-config:
  setup: avoid double slashes when looking for HEAD
</content>
</entry>
<entry>
<title>setup: avoid double slashes when looking for HEAD</title>
<updated>2017-11-03T14:02:25Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-11-03T12:58:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fa4d8c783d780191d98fe1f68ad2dea2fe78d19c'/>
<id>urn:sha1:fa4d8c783d780191d98fe1f68ad2dea2fe78d19c</id>
<content type='text'>
Andrew Baumann reported that when called outside of any Git worktree,
`git rev-parse --is-inside-work-tree` eventually tries to access
`//HEAD`, i.e.  any `HEAD` file in the root directory, but with a double
slash.

This double slash is not only unintentional, but is allowed by the POSIX
standard to have a special meaning. And most notably on Windows, it
does, where it refers to a UNC path of the form `//server/share/`.

As a consequence, afore-mentioned `rev-parse` call not only looks for
the wrong thing, but it also causes serious delays, as Windows will try
to access a server called `HEAD`.  Let's simply avoid the unintended
double slash.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ks/verify-filename-non-option-error-message-tweak'</title>
<updated>2017-10-07T07:27:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-07T07:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2a5aa826eec2eec64b4065f599ee7fb613a871ba'/>
<id>urn:sha1:2a5aa826eec2eec64b4065f599ee7fb613a871ba</id>
<content type='text'>
Error message tweak.

* ks/verify-filename-non-option-error-message-tweak:
  setup: update error message to be more meaningful
</content>
</entry>
<entry>
<title>setup: update error message to be more meaningful</title>
<updated>2017-10-04T04:13:02Z</updated>
<author>
<name>Kaartic Sivaraam</name>
<email>kaarticsivaraam91196@gmail.com</email>
</author>
<published>2017-10-02T17:30:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33f3c683ecfb702c4cef85383f779ca93c4fc44c'/>
<id>urn:sha1:33f3c683ecfb702c4cef85383f779ca93c4fc44c</id>
<content type='text'>
The error message shown when a flag is found when expecting a
filename wasn't clear as it didn't communicate what was wrong
using the 'suitable' words in *all* cases.

        $ git ls-files
        README.md
        test-file

Correct case,

        $ git rev-parse README.md --flags
        README.md
        --flags
        fatal: bad flag '--flags' used after filename

Incorrect case,

        $ git grep "some random regex" -n
        fatal: bad flag '-n' used after filename

The above case is incorrect as "some random regex" isn't a filename
in this case.

Change the error message to be general and communicative. This results
in the following output,

        $ git rev-parse README.md --flags
        README.md
        --flags
        fatal: option '--flags' must come before non-option arguments

        $ git grep "some random regex" -n
        fatal: option '-n' must come before non-option arguments

Signed-off-by: Kaartic Sivaraam &lt;kaarticsivaraam91196@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read_gitfile_gently: clarify return value ownership.</title>
<updated>2017-09-27T00:14:02Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2017-09-26T11:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea1d87560c5d66396d1785a208783cbf7a1651c2'/>
<id>urn:sha1:ea1d87560c5d66396d1785a208783cbf7a1651c2</id>
<content type='text'>
Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>set_git_dir: handle feeding gitdir to itself</title>
<updated>2017-09-06T09:06:26Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-09-05T13:05:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fb2b636c672fea06fdc5f50d5c0ed44117ae45a'/>
<id>urn:sha1:1fb2b636c672fea06fdc5f50d5c0ed44117ae45a</id>
<content type='text'>
Ideally we'd free the existing gitdir field before assigning
the new one, to avoid a memory leak. But we can't do so
safely because some callers do the equivalent of:

  set_git_dir(get_git_dir());

We can detect that case as a noop, but there are even more
complicated cases like:

  set_git_dir(remove_leading_path(worktree, get_git_dir());

where we really do need to do some work, but the original
string must remain valid.

Rather than put the burden on callers to make a copy of the
string (only to free it later, since we'll make a copy of it
ourselves), let's solve the problem inside set_git_dir(). We
can make a copy of the pointer for the old gitdir, and then
avoid freeing it until after we've made our new copy.

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>grep: recurse in-process using 'struct repository'</title>
<updated>2017-08-02T21:26:46Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-08-02T19:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f9ee2fcdfa05586b6a4476c7aa5f4f0162e48455'/>
<id>urn:sha1:f9ee2fcdfa05586b6a4476c7aa5f4f0162e48455</id>
<content type='text'>
Convert grep to use 'struct repository' which enables recursing into
submodules to be handled in-process.

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://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: add comment indicating a hack</title>
<updated>2017-06-24T01:24:34Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-20T19:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7aee274fb4f3eb8d47ec9edce7042f809ce0e579'/>
<id>urn:sha1:7aee274fb4f3eb8d47ec9edce7042f809ce0e579</id>
<content type='text'>
'GIT_TOPLEVEL_PREFIX_ENVIRONMENT' was added in (b58a68c1c setup: allow
for prefix to be passed to git commands) to aid in fixing a bug where
'ls-files' and 'grep' were not able to properly recurse when called from
within a subdirectory.  Add a 'NEEDSWORK' comment indicating that this
envvar should be removed once 'ls-files' and 'grep' can recurse
in-process.

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://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>
</feed>
