<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-03-16T17:48:14Z</updated>
<entry>
<title>Merge branch 'ty/setup-error-tightening'</title>
<updated>2026-03-16T17:48:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-16T17:48:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c563b12ce7aa6bf8130385c80c001b2340026ff5'/>
<id>urn:sha1:c563b12ce7aa6bf8130385c80c001b2340026ff5</id>
<content type='text'>
While discovering a ".git" directory, the code treats any stat()
failure as a sign that a filesystem entity .git does not exist
there, and ignores ".git" that is not a "gitdir" file or a
directory.  The code has been tightened to notice and report
filesystem corruption better.

* ty/setup-error-tightening:
  setup: improve error diagnosis for invalid .git files
</content>
</entry>
<entry>
<title>Merge branch 'kn/ref-location'</title>
<updated>2026-03-04T18:52:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-04T18:52:58Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1d0a2acb78f157d39937a088548e561b27722e8d'/>
<id>urn:sha1:1d0a2acb78f157d39937a088548e561b27722e8d</id>
<content type='text'>
Allow the directory in which reference backends store their data to
be specified.

* kn/ref-location:
  refs: add GIT_REFERENCE_BACKEND to specify reference backend
  refs: allow reference location in refstorage config
  refs: receive and use the reference storage payload
  refs: move out stub modification to generic layer
  refs: extract out `refs_create_refdir_stubs()`
  setup: don't modify repo in `create_reference_database()`
</content>
</entry>
<entry>
<title>setup: improve error diagnosis for invalid .git files</title>
<updated>2026-03-04T17:23:48Z</updated>
<author>
<name>Tian Yuchen</name>
<email>a3205153416@gmail.com</email>
</author>
<published>2026-03-04T14:15:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1dd27bfbfdc0f3b2071ecb8b505476f4caa56a13'/>
<id>urn:sha1:1dd27bfbfdc0f3b2071ecb8b505476f4caa56a13</id>
<content type='text'>
'read_gitfile_gently()' treats any non-regular file as
'READ_GITFILE_ERR_NOT_A_FILE' and fails to discern between 'ENOENT'
and other stat failures. This flawed error reporting is noted by two
'NEEDSWORK' comments.

Address these comments by introducing two new error codes:
'READ_GITFILE_ERR_MISSING'(which groups the "file missing" scenarios
together) and 'READ_GITFILE_ERR_IS_A_DIR':

1. Update 'read_gitfile_error_die()' to treat 'IS_A_DIR', 'MISSING',
'NOT_A_FILE' and 'STAT_FAILED' as non-fatal no-ops. This accommodates
intentional non-repo scenarios (e.g., GIT_DIR=/dev/null).

2. Explicitly catch 'NOT_A_FILE' and 'STAT_FAILED' during
discovery and call 'die()' if 'die_on_error' is set.

3. Unconditionally pass '&amp;error_code' to 'read_gitfile_gently()'.

4. Only invoke 'is_git_directory()' when we explicitly receive
   'READ_GITFILE_ERR_IS_A_DIR', avoiding redundant checks.

Additionally, audit external callers of 'read_gitfile_gently()' in
'submodule.c' and 'worktree.c' to accommodate the refined error codes.

Signed-off-by: Tian Yuchen &lt;a3205153416@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: add GIT_REFERENCE_BACKEND to specify reference backend</title>
<updated>2026-02-25T17:40:00Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-02-25T09:40:46Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=53592d68e86814fcc4a8df6cc38340597e56fe5a'/>
<id>urn:sha1:53592d68e86814fcc4a8df6cc38340597e56fe5a</id>
<content type='text'>
Git allows setting a different object directory via
'GIT_OBJECT_DIRECTORY', but provides no equivalent for references. In
the previous commit we extended the 'extensions.refStorage' config to
also support an URI input for reference backend with location.

Let's also add a new environment variable 'GIT_REFERENCE_BACKEND' that
takes in the same input as the config variable. Having an environment
variable allows us to modify the reference backend and location on the
fly for individual Git commands.

The environment variable also allows usage of alternate reference
directories during 'git-clone(1)' and 'git-init(1)'. Add the config to
the repository when created with the environment variable set.

When initializing the repository with an alternate reference folder,
create the required stubs in the repositories $GIT_DIR. The inverse,
i.e. removal of the ref store doesn't clean up the stubs in the $GIT_DIR
since that would render it unusable. Removal of ref store is only used
when migrating between ref formats and cleanup of the $GIT_DIR doesn't
make sense in such a situation.

Helped-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: allow reference location in refstorage config</title>
<updated>2026-02-25T17:38:41Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-02-25T09:40:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=01dc84594ee365ee7086fccc7f590ab527730531'/>
<id>urn:sha1:01dc84594ee365ee7086fccc7f590ab527730531</id>
<content type='text'>
The 'extensions.refStorage' config is used to specify the reference
backend for a given repository. Both the 'files' and 'reftable' backends
utilize the $GIT_DIR as the reference folder by default in
`get_main_ref_store()`.

Since the reference backends are pluggable, this means that they could
work with out-of-tree reference directories too. Extend the 'refStorage'
config to also support taking an URI input, where users can specify the
reference backend and the location.

Add the required changes to obtain and propagate this value to the
individual backends. Add the necessary documentation and tests.

Traditionally, for linked worktrees, references were stored in the
'$GIT_DIR/worktrees/&lt;wt_id&gt;' path. But when using an alternate reference
storage path, it doesn't make sense to store the main worktree
references in the new path, and the linked worktree references in the
$GIT_DIR. So, let's store linked worktree references in
'$ALTERNATE_REFERENCE_DIR/worktrees/&lt;wt_id&gt;'. To do this, create the
necessary files and folders while also adding stubs in the $GIT_DIR path
to ensure that it is still considered a Git directory.

Ideally, we would want to pass in a `struct worktree *` to individual
backends, instead of passing the `gitdir`. This allows them to handle
worktree specific logic. Currently, that is not possible since the
worktree code is:

  - Tied to using the global `the_repository` variable.

  - Is not setup before the reference database during initialization of
    the repository.

Add a TODO in 'refs.c' to ensure we can eventually make that change.

Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: don't modify repo in `create_reference_database()`</title>
<updated>2026-02-25T17:27:11Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-02-25T09:40:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2c69ff481938a10660c2078cf83235db26773254'/>
<id>urn:sha1:2c69ff481938a10660c2078cf83235db26773254</id>
<content type='text'>
The `create_reference_database()` function is used to create the
reference database during initialization of a repository. The function
calls `repo_set_ref_storage_format()` to set the repositories reference
format. This is an unexpected side-effect of the function. More so
because the function is only called in two locations:

  1. During git-init(1) where the value is propagated from the `struct
     repository_format repo_fmt` value.

  2. During git-clone(1) where the value is propagated from the
     `the_repository` value.

The former is valid, however the flow already calls
`repo_set_ref_storage_format()`, so this effort is simply duplicated.
The latter sets the existing value in `the_repository` back to itself.
While this is okay for now, introduction of more fields in
`repo_set_ref_storage_format()` would cause issues, especially
dynamically allocated strings, where we would free/allocate the same
string back into `the_repostiory`.

To avoid all this confusion, clean up the function to no longer take in
and set the repo's reference storage format.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/clean-includes'</title>
<updated>2026-02-17T21:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-17T21:30:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=354b8d89ac155fb3ae74575b23ee3b38451dfde6'/>
<id>urn:sha1:354b8d89ac155fb3ae74575b23ee3b38451dfde6</id>
<content type='text'>
Clean up redundant includes of header files.

* rs/clean-includes:
  remove duplicate includes
</content>
</entry>
<entry>
<title>remove duplicate includes</title>
<updated>2026-02-08T23:03:06Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2026-02-08T12:32:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=10c68d2577b2c4eb4ca9b259a38a67444068e2d9'/>
<id>urn:sha1:10c68d2577b2c4eb4ca9b259a38a67444068e2d9</id>
<content type='text'>
The following command reports that some header files are included twice:

   $ git grep '#include' '*.c' | sort | uniq -cd

Remove the second #include line in each case, as it has no effect.

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>
<entry>
<title>Merge branch 'ar/submodule-gitdir-tweak'</title>
<updated>2026-02-05T23:41:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-05T23:41:58Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c3a5261dc0e726b5d8ee6309afcad9d431a4b50c'/>
<id>urn:sha1:c3a5261dc0e726b5d8ee6309afcad9d431a4b50c</id>
<content type='text'>
Avoid local submodule repository directory paths overlapping with
each other by encoding submodule names before using them as path
components.

* ar/submodule-gitdir-tweak:
  submodule: detect conflicts with existing gitdir configs
  submodule: hash the submodule name for the gitdir path
  submodule: fix case-folding gitdir filesystem collisions
  submodule--helper: fix filesystem collisions by encoding gitdir paths
  builtin/credential-store: move is_rfc3986_unreserved to url.[ch]
  submodule--helper: add gitdir migration command
  submodule: allow runtime enabling extensions.submodulePathConfig
  submodule: introduce extensions.submodulePathConfig
  builtin/submodule--helper: add gitdir command
  submodule: always validate gitdirs inside submodule_name_to_gitdir
  submodule--helper: use submodule_name_to_gitdir in add_submodule
</content>
</entry>
<entry>
<title>submodule: allow runtime enabling extensions.submodulePathConfig</title>
<updated>2026-01-12T19:56:56Z</updated>
<author>
<name>Adrian Ratiu</name>
<email>adrian.ratiu@collabora.com</email>
</author>
<published>2026-01-12T18:46:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c349bad72969d59758e1294b4e9964dccd967fa0'/>
<id>urn:sha1:c349bad72969d59758e1294b4e9964dccd967fa0</id>
<content type='text'>
Add a new config `init.defaultSubmodulePathConfig` which allows
enabling `extensions.submodulePathConfig` for new submodules by
default (those created via git init or clone).

Important: setting init.defaultSubmodulePathConfig = true does
not globally enable `extensions.submodulePathConfig`. Existing
repositories will still have the extension disabled and will
require migration (for example via git submodule--helper command
added in the next commit).

Suggested-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Adrian Ratiu &lt;adrian.ratiu@collabora.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
