<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/environment.c, branch v2.51.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.51.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.51.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-07-23T15:15:22Z</updated>
<entry>
<title>config: move Git config parsing into "environment.c"</title>
<updated>2025-07-23T15:15:22Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-23T14:08:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08b775864edf96b97500fd70446c55528f5cf4a6'/>
<id>urn:sha1:08b775864edf96b97500fd70446c55528f5cf4a6</id>
<content type='text'>
In "config.c" we host both the business logic to read and write config
files as well as the logic to parse specific Git-related variables. On
the one hand this is mixing concerns, but even more importantly it means
that we cannot easily remove the dependency on `the_repository` in our
config parsing logic.

Move the logic into "environment.c". This file is a grab bag of all
kinds of global state already, so it is quite a good fit. Furthermore,
it also hosts most of the global variables that we're parsing the config
values into, making this an even better fit.

Note that there is one hidden change: in `parse_fsync_components()` we
use an `int` to iterate through `ARRAY_SIZE(fsync_component_names)`. But
as -Wsign-compare warnings are enabled in this file this causes a
compiler warning. The issue is fixed by using a `size_t` instead.

This change allows us to drop the `USE_THE_REPOSITORY_VARIABLE`
declaration.

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>repository: move 'repository_format_precious_objects' to repo scope</title>
<updated>2025-07-07T15:31:13Z</updated>
<author>
<name>Ayush Chandekar</name>
<email>ayu.chandekar@gmail.com</email>
</author>
<published>2025-07-04T14:12:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44e300a97480ef272a596e02b912b72528043193'/>
<id>urn:sha1:44e300a97480ef272a596e02b912b72528043193</id>
<content type='text'>
The 'extensions.preciousObjects' setting when set true, prevents
operations that might drop objects from the object storage. This setting
is populated in the global variable
'repository_format_precious_objects'.

Move this global variable to repo scope by adding it to 'struct
repository and also refactor all the occurences accordingly.

This change is part of an ongoing effort to eliminate global variables,
improve modularity and help libify the codebase.

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Ghanshyam Thakkar &lt;shyamthakkar001@gmail.com&gt;
Signed-off-by: Ayush Chandekar &lt;ayu.chandekar@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>environment: remove the global variable 'core_preload_index'</title>
<updated>2025-06-10T17:10:38Z</updated>
<author>
<name>Ayush Chandekar</name>
<email>ayu.chandekar@gmail.com</email>
</author>
<published>2025-06-10T13:02:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1d47b464e553331c555f122c5e341dfbfb618bd'/>
<id>urn:sha1:b1d47b464e553331c555f122c5e341dfbfb618bd</id>
<content type='text'>
The global variable 'core_preload_index' is used in a single function
named 'preload_index()' in "preload-index.c". Move its declaration inside
that function, removing unnecessary global state.

This change is part of an ongoing effort to eliminate global variables,
improve modularity and help libify the codebase.

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Ghanshyam Thakkar &lt;shyamthakkar001@gmail.com&gt;
Signed-off-by: Ayush Chandekar &lt;ayu.chandekar@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/windows-arm64'</title>
<updated>2025-05-05T21:56:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-05-05T21:56:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b50795db7969712ef937906d548fe9eb58cb9fb5'/>
<id>urn:sha1:b50795db7969712ef937906d548fe9eb58cb9fb5</id>
<content type='text'>
Update to arm64 Windows port.

* js/windows-arm64:
  max_tree_depth: lower it for clangarm64 on Windows
  mingw(arm64): do move the `/etc/git*` location
  msvc: do handle builds on Windows/ARM64
  mingw: do not use nedmalloc on Windows/ARM64
  config.mak.uname: add support for clangarm64
  bswap.h: add support for built-in bswap functions
</content>
</entry>
<entry>
<title>Merge branch 'as/typofix-in-env-h-header'</title>
<updated>2025-04-29T21:21:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-04-29T21:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd45c2e48f79020891bd2375de245ba215ce3826'/>
<id>urn:sha1:dd45c2e48f79020891bd2375de245ba215ce3826</id>
<content type='text'>
Typofix.

* as/typofix-in-env-h-header:
  environment: fix typo: 'setup_git_directory_gently'
</content>
</entry>
<entry>
<title>max_tree_depth: lower it for clangarm64 on Windows</title>
<updated>2025-04-23T16:16:24Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2025-04-23T08:01:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=436a42215e51fa2f8b74d128472d7d9bfe2595e1'/>
<id>urn:sha1:436a42215e51fa2f8b74d128472d7d9bfe2595e1</id>
<content type='text'>
Just as in b64d78ad02ca (max_tree_depth: lower it for MSVC to avoid
stack overflows, 2023-11-01), I encountered the same problem with the
clang builds on Windows/ARM64.

The symptom is an exit code 127 when t6700 tries to verify that `git
archive big` fails.

This exit code is reserved on Unix/Linux to mean "command not found".
Unfortunately in this case, it is the fall-back chosen by
Cygwin's `pinfo::status_exit()` method when encountering
the NSTATUS `STATUS_STACK_OVERFLOW`, see
https://github.com/cygwin/cygwin/blob/cygwin-3.6.1/winsup/cygwin/pinfo.cc#L171

I verified manually that the stack overflow always happens somewhere
around tree depth 1403, therefore 1280 should be a safe bound in these
instances.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>environment: fix typo: 'setup_git_directory_gently'</title>
<updated>2025-04-18T21:04:08Z</updated>
<author>
<name>Abhijeet Sonar</name>
<email>abhijeet.nkt@gmail.com</email>
</author>
<published>2025-04-18T18:58:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff4a7493542df81b0786e257fd84fd9ee82e2e38'/>
<id>urn:sha1:ff4a7493542df81b0786e257fd84fd9ee82e2e38</id>
<content type='text'>
Above the declaration of git_work_tree_cfg, we have:

  /* This is set by setup_git_dir_gently() and/or git_default_config() */
  char *git_work_tree_cfg;

It can be verified that there is no function called
'setup_git_dir_gently' by running grep on the codebase:

  $ grep -R setup_git_dir_gently .
  ./environment.c:/* This is set by setup_git_dir_gently() and/or git_default_config() */

The comment, introduced in e90fdc39b6 (Clean up work-tree handling), is
the only occurrence of the name 'setup_git_dir_gently'.

It probably meant 'setup_git_directory_gently' as that is a name of a
real function in setup.c. Correct it.

Signed-off-by: Abhijeet Sonar &lt;abhijeet.nkt@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>environment: move access to "core.bigFileThreshold" into repo settings</title>
<updated>2025-03-10T20:16:18Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-03-10T07:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7835ee75cdffbce925246cbacc83e8b4a932a681'/>
<id>urn:sha1:7835ee75cdffbce925246cbacc83e8b4a932a681</id>
<content type='text'>
The "core.bigFileThreshold" setting is stored in a global variable and
populated via `git_default_core_config()`. This may cause issues in
the case where one is handling multiple different repositories in a
single process with different values for that config key, as we may or
may not see the correct value in that case. Furthermore, global state
blocks our path towards libification.

Refactor the code so that we instead store the value in `struct
repo_settings`, where the value is computed as-needed and cached.

Note that this change requires us to adapt one test in t1050 that
verifies that we die when parsing an invalid "core.bigFileThreshold"
value. The exercised Git command doesn't use the value at all, and thus
it won't hit the new code path that parses the value. This is addressed
by using git-hash-object(1) instead, which does read the value.

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/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>environment: move access to "core.sharedRepository" into repo settings</title>
<updated>2025-02-28T21:54:11Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-07T11:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1ce861c34bffbc02998173016b0bca0f6d9f6c4'/>
<id>urn:sha1:f1ce861c34bffbc02998173016b0bca0f6d9f6c4</id>
<content type='text'>
Similar as with the preceding commit, we track "core.sharedRepository"
via a pair of global variables. Move them into `struct repo_settings` so
that we can instead track them per-repository.

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