<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.c, branch v2.50.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.50.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.50.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-04-29T17:08:13Z</updated>
<entry>
<title>treewide: convert users of `repo_has_object_file()` to `has_object()`</title>
<updated>2025-04-29T17:08:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-29T07:52:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=062b914c841329a003f74e1340ea5178391274a6'/>
<id>urn:sha1:062b914c841329a003f74e1340ea5178391274a6</id>
<content type='text'>
As the comment of `repo_has_object_file()` and its `_with_flags()`
variant tells us, these functions are considered to be deprecated in
favor of `has_object()`. There are a couple of slight benefits in favor
of the replacement:

  - The new function has a short-and-sweet name.

  - More explicit defaults: `has_object()` doesn't fetch missing objects
    via promisor remotes, and neither does it reload packfiles if an
    object wasn't found by default. This ensures that it becomes
    immediately obvious when a simple object existence check may result
    in expensive actions.

Most importantly though, it is confusing that we have two sets of
functions that ultimately do the same thing, but with different
defaults.

Start sunsetting `repo_has_object_file()` and its `_with_flags()`
sibling by replacing all callsites with `has_object()`:

  - `repo_has_object_file(...)` is equivalent to
    `has_object(..., HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)`.

  - `repo_has_object_file_with_flags(..., OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT)`
    is equivalent to `has_object(..., 0)`.

  - `repo_has_object_file_with_flags(..., OBJECT_INFO_SKIP_FETCH_OBJECT)`
    is equivalent to `has_object(..., HAS_OBJECT_RECHECK_PACKED)`.

  - `repo_has_object_file_with_flags(..., OBJECT_INFO_QUICK)`
    is equivalent to `has_object(..., HAS_OBJECT_FETCH_PROMISOR)`.

The replacements should be functionally equivalent.

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 'ps/object-file-cleanup' into ps/object-store-cleanup</title>
<updated>2025-04-24T18:37:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-04-24T18:37:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d61ff9c237b05f9cff0831d4bde546ed4a9c3c42'/>
<id>urn:sha1:d61ff9c237b05f9cff0831d4bde546ed4a9c3c42</id>
<content type='text'>
* ps/object-file-cleanup:
  object-store: merge "object-store-ll.h" and "object-store.h"
  object-store: remove global array of cached objects
  object: split out functions relating to object store subsystem
  object-file: drop `index_blob_stream()`
  object-file: split up concerns of `HASH_*` flags
  object-file: split out functions relating to object store subsystem
  object-file: move `xmmap()` into "wrapper.c"
  object-file: move `git_open_cloexec()` to "compat/open.c"
  object-file: move `safe_create_leading_directories()` into "path.c"
  object-file: move `mkdir_in_gitdir()` into "path.c"
</content>
</entry>
<entry>
<title>Merge branch 'jt/clone-guess-remote-head-fix'</title>
<updated>2025-04-15T20:50:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-04-15T20:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a8c207797f2fe624c4959487e3508dde96f68976'/>
<id>urn:sha1:a8c207797f2fe624c4959487e3508dde96f68976</id>
<content type='text'>
"git clone" still gave the message about the default branch name;
this message has been turned into an advice message that can be
turned off.

* jt/clone-guess-remote-head-fix:
  advice: allow disabling default branch name advice
  builtin/clone: suppress unexpected default branch advice
  remote: allow `guess_remote_head()` to suppress advice
</content>
</entry>
<entry>
<title>object-store: merge "object-store-ll.h" and "object-store.h"</title>
<updated>2025-04-15T15:24:37Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-15T09:38:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=68cd492a3e662c75dec364986c81e94716d4ac56'/>
<id>urn:sha1:68cd492a3e662c75dec364986c81e94716d4ac56</id>
<content type='text'>
The "object-store-ll.h" header has been introduced to keep transitive
header dependendcies and compile times at bay. Now that we have created
a new "object-store.c" file though we can easily move the last remaining
additional bit of "object-store.h", the `odb_path_map`, out of the
header.

Do so. As the "object-store.h" header is now equivalent to its low-level
alternative we drop the latter and inline it into the former.

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>remote: allow `guess_remote_head()` to suppress advice</title>
<updated>2025-03-25T23:09:27Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2025-03-25T00:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d5d284df910b5f03681b480ae061bb1435b3b4b2'/>
<id>urn:sha1:d5d284df910b5f03681b480ae061bb1435b3b4b2</id>
<content type='text'>
The `repo_default_branch_name()` invoked through `guess_remote_head()`
is configured to always display the default branch advice message.

Adapt `guess_remote_head()` to accept flags and convert the `all`
parameter to a flag. Add the `REMOTE_GUESS_HEAD_QUIET` flag to to enable
suppression of advice messages. Call sites are updated accordingly.

Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Acked-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refspec: replace `refspec_init()` with fetch/push variants</title>
<updated>2025-03-21T08:45:16Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2025-03-18T22:50:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0baad1f3aee508d84bf74b9670f283f8c91e55dd'/>
<id>urn:sha1:0baad1f3aee508d84bf74b9670f283f8c91e55dd</id>
<content type='text'>
To avoid having a Boolean argument in the refspec_init() function,
replace it with two variants:

  - `refspec_init_fetch()`
  - `refspec_init_push()`

to codify the meaning of that Boolean into the function's name itself.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Acked-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refspec: treat 'fetch' as a Boolean value</title>
<updated>2025-03-21T08:45:15Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2025-03-18T22:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3809633d0adb77b02ba8cfe87578134e6a30f54d'/>
<id>urn:sha1:3809633d0adb77b02ba8cfe87578134e6a30f54d</id>
<content type='text'>
Since 6d4c057859 (refspec: introduce struct refspec, 2018-05-16), we
have macros called REFSPEC_FETCH and REFSPEC_PUSH. This confusingly
suggests that we might introduce other modes in the future, which, while
possible, is highly unlikely.

But these values are treated as a Boolean, and stored in a struct field
called 'fetch'. So the following:

    if (refspec-&gt;fetch == REFSPEC_FETCH) { ... }

, and

    if (refspec-&gt;fetch) { ... }

are equivalent. Let's avoid renaming the Boolean values "true" and
"false" here and remove the two REFSPEC_ macros mentioned above.

Since this value is truly a Boolean and will only ever take on a value
of 0 or 1, we can declare it as a single bit unsigned field. In
practice this won't shrink the size of 'struct refspec', but it more
clearly indicates the intent.

Note that this introduces some awkwardness like:

    refspec_item_init_or_die(&amp;spec, refspec, 1);

, where it's unclear what the final "1" does. This will be addressed in
the following commits.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Acked-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/path-sans-the-repository'</title>
<updated>2025-03-05T18:37:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-03-05T18:37:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=feffb34257ee8eef18cc6a3a5a4f01d40720bda1'/>
<id>urn:sha1:feffb34257ee8eef18cc6a3a5a4f01d40720bda1</id>
<content type='text'>
The path.[ch] API takes an explicit repository parameter passed
throughout the callchain, instead of relying on the_repository
singleton instance.

* ps/path-sans-the-repository:
  path: adjust last remaining users of `the_repository`
  environment: move access to "core.sharedRepository" into repo settings
  environment: move access to "core.hooksPath" into repo settings
  repo-settings: introduce function to clear struct
  path: drop `git_path()` in favor of `repo_git_path()`
  rerere: let `rerere_path()` write paths into a caller-provided buffer
  path: drop `git_common_path()` in favor of `repo_common_path()`
  worktree: return allocated string from `get_worktree_git_dir()`
  path: drop `git_path_buf()` in favor of `repo_git_path_replace()`
  path: drop `git_pathdup()` in favor of `repo_git_path()`
  path: drop unused `strbuf_git_path()` function
  path: refactor `repo_submodule_path()` family of functions
  submodule: refactor `submodule_to_gitdir()` to accept a repo
  path: refactor `repo_worktree_path()` family of functions
  path: refactor `repo_git_path()` family of functions
  path: refactor `repo_common_path()` family of functions
</content>
</entry>
<entry>
<title>path: drop `git_path()` in favor of `repo_git_path()`</title>
<updated>2025-02-28T21:54:11Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-07T11:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=88dd321cfedc6ee190dfafe4670a83ea33cdf4a3'/>
<id>urn:sha1:88dd321cfedc6ee190dfafe4670a83ea33cdf4a3</id>
<content type='text'>
Remove `git_path()` in favor of the `repo_git_path()` family of
functions, which makes the implicit dependency on `the_repository` go
away.

Note that `git_path()` returned a string allocated via `get_pathname()`,
which uses a rotating set of statically allocated buffers. Consequently,
callers didn't have to free the returned string. The same isn't true for
`repo_common_path()`, so we also have to add logic to free the returned
strings.

This refactoring also allows us to remove `repo_common_pathv()` as well
as `get_pathname()` from the public interface.

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>refspec: clarify function naming and documentation</title>
<updated>2025-02-18T17:44:27Z</updated>
<author>
<name>Meet Soni</name>
<email>meetsoni3017@gmail.com</email>
</author>
<published>2025-02-15T08:45:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=044b6f04f23d6c7e3c3750c9829db96b71470874'/>
<id>urn:sha1:044b6f04f23d6c7e3c3750c9829db96b71470874</id>
<content type='text'>
Rename `match_name_with_pattern()` to `match_refname_with_pattern()` to
better reflect its purpose and improve documentation comment clarity.
The previous function name and parameter names were inconsistent, making
it harder to understand their roles in refspec matching.

- Rename parameters:
  - `key` -&gt; `pattern` (globbing pattern to match)
  - `name` -&gt; `refname` (refname to check)
  - `value` -&gt; `replacement` (replacement mapping pattern)

Signed-off-by: Meet Soni &lt;meetsoni3017@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
