<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.h, branch v2.47.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.47.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.47.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-08-13T17:01:01Z</updated>
<entry>
<title>path: hide functions using `the_repository` by default</title>
<updated>2024-08-13T17:01:01Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-13T09:13:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7ac16649eca0ee206fdb203a76fa4330484b3b6a'/>
<id>urn:sha1:7ac16649eca0ee206fdb203a76fa4330484b3b6a</id>
<content type='text'>
The path subsystem provides a bunch of legacy functions that compute
paths relative to the "gitdir" and "commondir" directories of the global
`the_repository` variable. Use of those functions is discouraged, and it
is easy to miss the implicit dependency on `the_repository` that calls
to those functions may cause.

With `USE_THE_REPOSITORY_VARIABLE`, we have recently introduced a tool
that allows us to get rid of such functions over time. With this macro,
we can hide away functions that have such implicit dependency such that
other subsystems that want to be free of `the_repository` will not use
them by accident.

Move all path-related functions that use `the_repository` into a block
that gets only conditionally compiled depending on whether or not the
macro has been defined. This also removes all dependencies on that
variable in "path.c", allowing us to remove the definition of said
preprocessor macro.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path: stop relying on `the_repository` in `worktree_git_path()`</title>
<updated>2024-08-13T17:01:01Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-13T09:13:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a973f60dc7c178828e351ec4e68886ffecfbcadc'/>
<id>urn:sha1:a973f60dc7c178828e351ec4e68886ffecfbcadc</id>
<content type='text'>
When not provided a worktree, then `worktree_git_path()` will fall back
to returning a path relative to the main repository. In this case, we
implicitly rely on `the_repository` to derive the path. Remove this
dependency by passing a `struct repository` as parameter.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path: stop relying on `the_repository` when reporting garbage</title>
<updated>2024-08-13T17:01:01Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-13T09:13:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78f2210b3c8605144d62a90b58e888312f64efc8'/>
<id>urn:sha1:78f2210b3c8605144d62a90b58e888312f64efc8</id>
<content type='text'>
We access `the_repository` in `report_linked_checkout_garbage()` both
directly and indirectly via `get_git_dir()`. Remove this dependency by
instead passing a `struct repository` as parameter.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path: expose `do_git_common_path()` as `repo_common_pathv()`</title>
<updated>2024-08-13T17:01:00Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-13T09:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=61419a42f641c7b9f7bfc9585e3ec9c393ab0166'/>
<id>urn:sha1:61419a42f641c7b9f7bfc9585e3ec9c393ab0166</id>
<content type='text'>
With the same reasoning as the preceding commit, expose the function
`do_git_common_path()` as `repo_common_pathv()`. While at it, reorder
parameters such that they match the order we have in `repo_git_pathv()`.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path: expose `do_git_path()` as `repo_git_pathv()`</title>
<updated>2024-08-13T17:01:00Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-13T09:13:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6c6bfef31e1ffe3804e5a1ba5bfe9e7879eda92'/>
<id>urn:sha1:b6c6bfef31e1ffe3804e5a1ba5bfe9e7879eda92</id>
<content type='text'>
We're about to move functions of the "path" subsytem that do not use a
`struct repository` into "path.h" as static inlined functions. This will
require us to call `do_git_path()`, which is internal to "path.c".

Expose the function as `repo_git_pathv()` to prepare for the change.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/worktree-git-path'</title>
<updated>2024-06-24T23:39:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-24T23:39:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=107ed551030713e25933dc8e92ad8d67cff28ff6'/>
<id>urn:sha1:107ed551030713e25933dc8e92ad8d67cff28ff6</id>
<content type='text'>
Code cleanup.

* jc/worktree-git-path:
  worktree_git_path(): move the declaration to path.h
</content>
</entry>
<entry>
<title>worktree_git_path(): move the declaration to path.h</title>
<updated>2024-06-08T18:42:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-08T18:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf6a86236e829d08c92356e5c861193ccb516ef7'/>
<id>urn:sha1:bf6a86236e829d08c92356e5c861193ccb516ef7</id>
<content type='text'>
The definition of this function is in path.c but its declaration is
in worktree.h, which is something unexpected.  The function is
explained as "Similar to git_path()"; declaring it next to where
git_path() is declared would make more sense.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path: move `validate_headref()` to its only user</title>
<updated>2024-05-07T05:50:48Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-05-07T04:52:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c6bd2b81d1e18dfa1e143c354c554cca34b3685'/>
<id>urn:sha1:0c6bd2b81d1e18dfa1e143c354c554cca34b3685</id>
<content type='text'>
While `validate_headref()` is only called from `is_git_directory()` in
"setup.c", it is currently implemented in "path.c". Move it over such
that it becomes clear that it is only really used during setup in order
to discover repositories.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/apply-lift-path-length-limit'</title>
<updated>2024-04-15T21:11:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-15T21:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c7a9ec4728db6f88c0957789f3b77a3e2e8b0ec9'/>
<id>urn:sha1:c7a9ec4728db6f88c0957789f3b77a3e2e8b0ec9</id>
<content type='text'>
"git apply" has been updated to lift the hardcoded pathname length
limit, which in turn allowed a mksnpath() function that is no
longer used.

* rs/apply-lift-path-length-limit:
  path: remove mksnpath()
  apply: avoid fixed-size buffer in create_one_file()
</content>
</entry>
<entry>
<title>path: remove mksnpath()</title>
<updated>2024-04-05T16:49:38Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-04-05T10:56:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=708f7e05907ba7d4acd08bf87f51474471a16f43'/>
<id>urn:sha1:708f7e05907ba7d4acd08bf87f51474471a16f43</id>
<content type='text'>
Remove the function mksnpath(), which has become unused.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
