<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.c, branch v2.6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.6.4</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.6.4'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2015-12-04T19:33:08Z</updated>
<entry>
<title>Merge branch 'dk/gc-idx-wo-pack' into maint</title>
<updated>2015-12-04T19:33:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-12-04T19:33:07Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b50ceab48f46a74571ee2a89048563dd5d3322b9'/>
<id>urn:sha1:b50ceab48f46a74571ee2a89048563dd5d3322b9</id>
<content type='text'>
Having a leftover .idx file without corresponding .pack file in
the repository hurts performance; "git gc" learned to prune them.

We may want to do the same for .bitmap (and notice but not prune
.keep) without corresponding .pack, but that can be a separate
topic.

* dk/gc-idx-wo-pack:
  gc: remove garbage .idx files from pack dir
  t5304: test cleaning pack garbage
  prepare_packed_git(): refactor garbage reporting in pack directory
</content>
</entry>
<entry>
<title>Merge branch 'nd/clone-linked-checkout' into maint</title>
<updated>2015-11-05T20:18:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-11-05T20:18:07Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4349f597f08b6dc50fc6198b8e1b96e19df37c65'/>
<id>urn:sha1:4349f597f08b6dc50fc6198b8e1b96e19df37c65</id>
<content type='text'>
It was not possible to use a repository-lookalike created by "git
worktree add" as a local source of "git clone".

* nd/clone-linked-checkout:
  clone: better error when --reference is a linked checkout
  clone: allow --local from a linked checkout
  enter_repo: allow .git files in strict mode
  enter_repo: avoid duplicating logic, use is_git_directory() instead
  t0002: add test for enter_repo(), non-strict mode
  path.c: delete an extra space
</content>
</entry>
<entry>
<title>Merge branch 'mk/submodule-gitdir-path' into maint</title>
<updated>2015-11-03T23:32:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-11-03T23:32:34Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1bf986bc9c1e823da27465bfd9faf2b725bbcc09'/>
<id>urn:sha1:1bf986bc9c1e823da27465bfd9faf2b725bbcc09</id>
<content type='text'>
The submodule code has been taught to work better with separate
work trees created via "git worktree add".

* mk/submodule-gitdir-path:
  path: implement common_dir handling in git_pathdup_submodule()
  submodule refactor: use strbuf_git_path_submodule() in add_submodule_odb()
</content>
</entry>
<entry>
<title>test-path-utils.c: remove incorrect assumption</title>
<updated>2015-10-09T01:03:50Z</updated>
<author>
<name>Ray Donnelly</name>
<email>mingw.android@gmail.com</email>
</author>
<published>2015-10-01T19:04:17Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b2a7123b997f950e9785a5e7df64c3104270fef3'/>
<id>urn:sha1:b2a7123b997f950e9785a5e7df64c3104270fef3</id>
<content type='text'>
In normalize_ceiling_entry(), we test that normalized paths end with
slash, *unless* the path to be normalized was already the root
directory.

However, normalize_path_copy() does not even enforce this condition.

Even worse: on Windows, the root directory gets translated into a
Windows directory by the Bash before being passed to `git.exe` (or
`test-path-utils.exe`), which means that we cannot even know whether
the path that was passed to us was the root directory to begin with.

This issue has already caused endless hours of trying to "fix" the
MSYS2 runtime, only to break other things due to MSYS2 ensuring that
the converted path maintains the same state as the input path with
respect to any final '/'.

So let's just forget about this test. It is non-essential to Git's
operation, anyway.

Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Ray Donnelly &lt;mingw.android@gmail.com&gt;
</content>
</entry>
<entry>
<title>enter_repo: allow .git files in strict mode</title>
<updated>2015-09-28T17:46:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2015-09-28T13:06:14Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1f5fbe1fe2d04f6386cf8febc1ce308bcf815592'/>
<id>urn:sha1:1f5fbe1fe2d04f6386cf8febc1ce308bcf815592</id>
<content type='text'>
Strict mode is about not guessing where .git is. If the user points to a
.git file, we know exactly where the target .git dir will be. This makes
it possible to serve .git files as repository on the server side.

This may be needed even in local clone case because transport.c code
uses upload-pack for fetching remote refs. But right now the
clone/transport code goes with non-strict.

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>enter_repo: avoid duplicating logic, use is_git_directory() instead</title>
<updated>2015-09-28T17:46:22Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2015-09-28T13:06:13Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0f64cc407f32f979c8bcfa7d3d9b24d8e023df35'/>
<id>urn:sha1:0f64cc407f32f979c8bcfa7d3d9b24d8e023df35</id>
<content type='text'>
It matters for linked checkouts where 'refs' directory won't be
available in $GIT_DIR. is_git_directory() knows about $GIT_COMMON_DIR
and can handle this case.

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>path: implement common_dir handling in git_pathdup_submodule()</title>
<updated>2015-09-14T18:03:46Z</updated>
<author>
<name>Max Kirillov</name>
<email>max@max630.net</email>
</author>
<published>2015-09-13T22:17:42Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=11f9dd719104a960d3e2b478477d9055141d1dbc'/>
<id>urn:sha1:11f9dd719104a960d3e2b478477d9055141d1dbc</id>
<content type='text'>
When submodule is a linked worktree, "git diff --submodule" and other
calls which directly access the submodule's object database do not correctly
calculate its path. Fix it by changing the git_pathdup_submodule() behavior,
to use either common or per-worktree directory.

Do it similarly as for parent repository, but ignore the GIT_COMMON_DIR
environment variable, because it would mean common directory for the parent
repository and does not make sense for submodule.

Also add test for functionality which uses this call.

Signed-off-by: Max Kirillov &lt;max@max630.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path.c: delete an extra space</title>
<updated>2015-09-07T16:19:36Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2015-08-22T00:39:58Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1fb59259054d379974c7ce470f36e15386f25311'/>
<id>urn:sha1:1fb59259054d379974c7ce470f36e15386f25311</id>
<content type='text'>
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>prepare_packed_git(): refactor garbage reporting in pack directory</title>
<updated>2015-08-17T16:14:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-13T18:02:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0a489b0680b841d3e7714be53b263ff190c39193'/>
<id>urn:sha1:0a489b0680b841d3e7714be53b263ff190c39193</id>
<content type='text'>
The hook to report "garbage" files in $GIT_OBJECT_DIRECTORY/pack/
could be generic but is too specific to count-object's needs.

Move the part to produce human-readable messages to count-objects,
and refine the interface to callback with the "bits" with values
defined in the cache.h header file, so that other callers (e.g.
prune) can later use the same mechanism to enumerate different
kinds of garbage files and do something intelligent about them,
other than reporting in textual messages.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>memoize common git-path "constant" files</title>
<updated>2015-08-10T22:37:14Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-10T09:38:57Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f932729cc7707390f4d6739be1573e93ceb9df22'/>
<id>urn:sha1:f932729cc7707390f4d6739be1573e93ceb9df22</id>
<content type='text'>
One of the most common uses of git_path() is to pass a
constant, like git_path("MERGE_MSG"). This has two
drawbacks:

  1. The return value is a static buffer, and the lifetime
     is dependent on other calls to git_path, etc.

  2. There's no compile-time checking of the pathname. This
     is OK for a one-off (after all, we have to spell it
     correctly at least once), but many of these constant
     strings appear throughout the code.

This patch introduces a series of functions to "memoize"
these strings, which are essentially globals for the
lifetime of the program. We compute the value once, take
ownership of the buffer, and return the cached value for
subsequent calls.  cache.h provides a helper macro for
defining these functions as one-liners, and defines a few
common ones for global use.

Using a macro is a little bit gross, but it does nicely
document the purpose of the functions. If we need to touch
them all later (e.g., because we learned how to change the
git_dir variable at runtime, and need to invalidate all of
the stored values), it will be much easier to have the
complete list.

Note that the shared-global functions have separate, manual
declarations. We could do something clever with the macros
(e.g., expand it to a declaration in some places, and a
declaration _and_ a definition in path.c). But there aren't
that many, and it's probably better to stay away from
too-magical macros.

Likewise, if we abandon the C preprocessor in favor of
generating these with a script, we could get much fancier.
E.g., normalizing "FOO/BAR-BAZ" into "git_path_foo_bar_baz".
But the small amount of saved typing is probably not worth
the resulting confusion to readers who want to grep for the
function's definition.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
