]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 months agopack-objects: enable --path-walk via config
Derrick Stolee [Fri, 16 May 2025 18:11:58 +0000 (18:11 +0000)] 
pack-objects: enable --path-walk via config

Users may want to enable the --path-walk option for 'git pack-objects' by
default, especially underneath commands like 'git push' or 'git repack'.

This should be limited to client repositories, since the --path-walk option
disables bitmap walks, so would be bad to include in Git servers when
serving fetches and clones. There is potential that it may be helpful to
consider when repacking the repository, to take advantage of improved deltas
across historical versions of the same files.

Much like how "pack.useSparse" was introduced and included in
"feature.experimental" before being enabled by default, use the repository
settings infrastructure to make the new "pack.usePathWalk" config enabled by
"feature.experimental" and "feature.manyFiles".

In order to test that this config works, add a new trace2 region around
the path walk code that can be checked by a 'git push' command.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agorepack: add --path-walk option
Derrick Stolee [Fri, 16 May 2025 18:11:57 +0000 (18:11 +0000)] 
repack: add --path-walk option

Since 'git pack-objects' supports a --path-walk option, allow passing it
through in 'git repack'. This presents interesting testing opportunities for
comparing the different repacking strategies against each other.

Add the --path-walk option to the performance tests in p5313.

For the microsoft/fluentui repo [1] checked out at a specific commit [2],
the --path-walk tests in p5313 look like this:

Test                                                     this tree
-------------------------------------------------------------------------
5313.18: thin pack with --path-walk                      0.08(0.06+0.02)
5313.19: thin pack size with --path-walk                           18.4K
5313.20: big pack with --path-walk                       2.10(7.80+0.26)
5313.21: big pack size with --path-walk                            19.8M
5313.22: shallow fetch pack with --path-walk             1.62(3.38+0.17)
5313.23: shallow pack size with --path-walk                        33.6M
5313.24: repack with --path-walk                         81.29(96.08+0.71)
5313.25: repack size with --path-walk                             142.5M

[1] https://github.com/microsoft/fluentui
[2] e70848ebac1cd720875bccaa3026f4a9ed700e08

Along with the earlier tests in p5313, I'll instead reformat the
comparison as follows:

Repack Method    Pack Size       Time
---------------------------------------
Hash v1             439.4M      87.24s
Hash v2             161.7M      21.51s
Path Walk           142.5M      81.29s

There are a few things to notice here:

 1. The benefits of --name-hash-version=2 over --name-hash-version=1 are
    significant, but --path-walk still compresses better than that
    option.

 2. The --path-walk command is still using --name-hash-version=1 for the
    second pass of delta computation, using the increased name hash
    collisions as a potential method for opportunistic compression on
    top of the path-focused compression.

 3. The --path-walk algorithm is currently sequential and does not use
    multiple threads for delta compression. Threading will be
    implemented in a future change so the computation time will improve
    to better compete in this metric.

There are small benefits in size for my copy of the Git repository:

Repack Method    Pack Size       Time
---------------------------------------
Hash v1             248.8M      30.44s
Hash v2             249.0M      30.15s
Path Walk           213.2M     142.50s

As well as in the nodejs/node repository [3]:

Repack Method    Pack Size       Time
---------------------------------------
Hash v1             739.9M      71.18s
Hash v2             764.6M      67.82s
Path Walk           698.1M     208.10s

[3] https://github.com/nodejs/node

This benefit also repeats in my copy of the Linux kernel repository:

Repack Method    Pack Size       Time
---------------------------------------
Hash v1               2.5G     554.41s
Hash v2               2.5G     549.62s
Path Walk             2.2G    1562.36s

It is important to see that even when the repository shape does not have
many name-hash collisions, there is a slight space boost to be found
using this method.

As this repacking strategy was released in Git for Windows 2.47.0, some
users have reported cases where the --path-walk compression is slightly
worse than the --name-hash-version=2 option. In those cases, it may be
beneficial to combine the two options. However, there has not been a
released version of Git that has both options and I don't have access to
these repos for testing.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot5538: add tests to confirm deltas in shallow pushes
Derrick Stolee [Fri, 16 May 2025 18:11:56 +0000 (18:11 +0000)] 
t5538: add tests to confirm deltas in shallow pushes

It can be notoriously difficult to detect if delta bases are being
computed properly during 'git push'. Construct an example where it will
make a kilobyte worth of difference when a delta base is not found. We
can then use the progress indicators to distinguish between bytes and
KiB depending on whether the delta base is found and used.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agopack-objects: introduce GIT_TEST_PACK_PATH_WALK
Derrick Stolee [Fri, 16 May 2025 18:11:55 +0000 (18:11 +0000)] 
pack-objects: introduce GIT_TEST_PACK_PATH_WALK

There are many tests that validate whether 'git pack-objects' works as
expected. Instead of duplicating these tests, add a new test environment
variable, GIT_TEST_PACK_PATH_WALK, that implies --path-walk by default
when specified.

This was useful in testing the implementation of the --path-walk
implementation, helping to find tests that are overly specific to the
default object walk. These include:

 - t0411-clone-from-partial.sh : One test fetches from a repo that does
   not have the boundary objects. This causes the path-based walk to
   fail. Disable the variable for this test.

 - t5306-pack-nobase.sh : Similar to t0411, one test fetches from a repo
   without a boundary object.

 - t5310-pack-bitmaps.sh : One test compares the case when packing with
   bitmaps to the case when packing without them. Since we disable the
   test variable when writing bitmaps, this causes a difference in the
   object list (the --path-walk option adds an extra object). Specify
   --no-path-walk in both processes for the comparison. Another test
   checks for a specific delta base, but when computing dynamically
   without using bitmaps, the base object it too small to be considered
   in the delta calculations so no base is used.

 - t5316-pack-delta-depth.sh : This script cares about certain delta
   choices and their chain lengths. The --path-walk option changes how
   these chains are selected, and thus changes the results of this test.

 - t5322-pack-objects-sparse.sh : This demonstrates the effectiveness of
   the --sparse option and how it combines with --path-walk.

 - t5332-multi-pack-reuse.sh : This test verifies that the preferred
   pack is used for delta reuse when possible. The --path-walk option is
   not currently aware of the preferred pack at all, so finds a
   different delta base.

 - t7406-submodule-update.sh : When using the variable, the --depth
   option collides with the --path-walk feature, resulting in a warning
   message. Disable the variable so this warning does not appear.

I want to call out one specific test change that is only temporary:

 - t5530-upload-pack-error.sh : One test cares specifically about an
   "unable to read" error message. Since the current implementation
   performs delta calculations within the path-walk API callback, a
   different "unable to get size" error message appears. When this
   is changed in a future refactoring, this test change can be reverted.

Similar to GIT_TEST_NAME_HASH_VERSION, we do not add this option to the
linux-TEST-vars CI build as that's already an overloaded build.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agop5313: add performance tests for --path-walk
Derrick Stolee [Fri, 16 May 2025 18:11:54 +0000 (18:11 +0000)] 
p5313: add performance tests for --path-walk

The previous change added a --path-walk option to 'git pack-objects'.
Create a performance test that demonstrates the time and space benefits
of the feature.

In order to get an appropriate comparison, we need to avoid reusing
deltas and recompute them from scratch.

Compare the creation of a thin pack representing a small push and the
creation of a relatively large non-thin pack.

Running on my copy of the Git repository results in this data (removing
the repack tests for --name-hash-version):

Test                                                     this tree
------------------------------------------------------------------------
5313.2: thin pack with --name-hash-version=1             0.02(0.01+0.01)
5313.3: thin pack size with --name-hash-version=1                   1.6K
5313.4: big pack with --name-hash-version=1              2.55(4.20+0.26)
5313.5: big pack size with --name-hash-version=1                   16.4M
5313.6: shallow fetch pack with --name-hash-version=1    1.24(2.03+0.08)
5313.7: shallow pack size with --name-hash-version=1               12.2M
5313.10: thin pack with --name-hash-version=2            0.03(0.01+0.01)
5313.11: thin pack size with --name-hash-version=2                  1.6K
5313.12: big pack with --name-hash-version=2             1.91(3.23+0.20)
5313.13: big pack size with --name-hash-version=2                  16.4M
5313.14: shallow fetch pack with --name-hash-version=2   1.06(1.57+0.10)
5313.15: shallow pack size with --name-hash-version=2              12.5M
5313.18: thin pack with --path-walk                      0.03(0.01+0.01)
5313.19: thin pack size with --path-walk                            1.6K
5313.20: big pack with --path-walk                       2.05(3.24+0.27)
5313.21: big pack size with --path-walk                            16.3M
5313.22: shallow fetch pack with --path-walk             1.08(1.66+0.07)
5313.23: shallow pack size with --path-walk                        12.4M

This can be reformatted as follows:

Pack Type            Hash v1   Hash v2     Path Walk
---------------------------------------------------
thin pack    (time)    0.02s      0.03s      0.03s
             (size)    1.6K       1.6K       1.6K
big pack     (time)    2.55s      1.91s      2.05s
             (size)   16.4M      16.4M      16.3M
shallow pack (time)    1.24s      1.06s      1.08s
             (size)   12.2M      12.5M      12.4M

Note that the timing is slower because there is no threading in the
--path-walk case (yet). Also, the shallow pack cases are really not
using the --path-walk logic right now because it is disabled until some
additions are made to the path walk API.

The cases where the --path-walk option really shines is when the default
name-hash is overwhelmed with unhelpful collisions. An open source
example can be found in the microsoft/fluentui repo [1] at a certain
commit [2].

[1] https://github.com/microsoft/fluentui
[2] e70848ebac1cd720875bccaa3026f4a9ed700e08

Running the tests on this repo results in the following comparison table:

Pack Type            Hash v1    Hash v2    Path Walk
---------------------------------------------------
thin pack    (time)    0.36s      0.12s      0.08s
             (size)    1.2M      22.0K      18.4K
big pack     (time)    2.00s      2.90s      2.21s
             (size)   20.4M      25.9M      19.5M
shallow pack (time)    1.41s      1.80s      1.65s
             (size)   34.4M      33.7M      33.6M

Notice in particular that in the small thin pack, the time performance
has improved from 0.36s for --name-hash-version=1 to 0.08s and this is
likely due to the improved size of the resulting pack: 18.4K instead of
1.2M.  The relatively new --name-hash-version=2 is competitive with
--path-walk (0.12s and 22.0K) but not quite as successful.

Finally, running this on a copy of the Linux kernel repository results
in these data points:

Pack Type            Hash v1    Hash v2    Path Walk
---------------------------------------------------
thin pack    (time)    0.03s      0.13s      0.03s
             (size)    4.6K       4.6K       4.6K
big pack     (time)   15.29s     12.32s     13.92s
             (size)  201.1M     159.1M     158.5M
shallow pack (time)   10.88s     22.93s     22.74s
             (size)  269.2M     273.8M     267.7M

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agopack-objects: update usage to match docs
Derrick Stolee [Fri, 16 May 2025 18:11:53 +0000 (18:11 +0000)] 
pack-objects: update usage to match docs

The t0450 test script verifies that builtin usage matches the synopsis
in the documentation. Adjust the builtin to match and then remove 'git
pack-objects' from the exception list.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agopack-objects: add --path-walk option
Derrick Stolee [Fri, 16 May 2025 18:11:52 +0000 (18:11 +0000)] 
pack-objects: add --path-walk option

In order to more easily compute delta bases among objects that appear at
the exact same path, add a --path-walk option to 'git pack-objects'.

This option will use the path-walk API instead of the object walk given
by the revision machinery. Since objects will be provided in batches
representing a common path, those objects can be tested for delta bases
immediately instead of waiting for a sort of the full object list by
name-hash. This has multiple benefits, including avoiding collisions by
name-hash.

The objects marked as UNINTERESTING are included in these batches, so we
are guaranteeing some locality to find good delta bases.

After the individual passes are done on a per-path basis, the default
name-hash is used to find other opportunistic delta bases that did not
match exactly by the full path name.

The current implementation performs delta calculations while walking
objects, which is not ideal for a few reasons. First, this will cause
the "Enumerating objects" phase to be much longer than usual. Second, it
does not take advantage of threading during the path-scoped delta
calculations. Even with this lack of threading, the path-walk option is
sometimes faster than the usual approach. Future changes will refactor
this code to allow for threading, but that complexity is deferred until
later to keep this patch as simple as possible.

This new walk is incompatible with some features and is ignored by
others:

 * Object filters are not currently integrated with the path-walk API,
   such as sparse-checkout or tree depth. A blobless packfile could be
   integrated easily, but that is deferred for later.

 * Server-focused features such as delta islands, shallow packs, and
   using a bitmap index are incompatible with the path-walk API.

 * The path walk API is only compatible with the --revs option, not
   taking object lists or pack lists over stdin. These alternative ways
   to specify the objects currently ignores the --path-walk option
   without even a warning.

Future changes will create performance tests that demonstrate the power
of this approach.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agopack-objects: extract should_attempt_deltas()
Derrick Stolee [Fri, 16 May 2025 18:11:51 +0000 (18:11 +0000)] 
pack-objects: extract should_attempt_deltas()

This will be helpful in a future change, which will reuse this logic.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoGit 2.49-rc2 v2.49.0-rc2
Junio C Hamano [Mon, 10 Mar 2025 15:47:08 +0000 (08:47 -0700)] 
Git 2.49-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoMerge branch 'tb/fetch-follow-tags-fix'
Junio C Hamano [Mon, 10 Mar 2025 15:45:58 +0000 (08:45 -0700)] 
Merge branch 'tb/fetch-follow-tags-fix'

* tb/fetch-follow-tags-fix:
  fetch: fix following tags when fetching specific OID

4 months agofetch: fix following tags when fetching specific OID
Taylor Blau [Fri, 7 Mar 2025 23:27:03 +0000 (18:27 -0500)] 
fetch: fix following tags when fetching specific OID

In 3f763ddf28 (fetch: set remote/HEAD if it does not exist, 2024-11-22),
unconditionally adds "HEAD" to the list of ref prefixes we send to the
server.

This breaks a core assumption that the list of prefixes we send to the
server is complete. We must either send all prefixes we care about, or
none at all (in the latter case the server then advertises everything).

The tag following code is careful to only add "refs/tags/" to the list
of prefixes if there are already entries in the prefix list. But because
the new code from 3f763ddf28 runs after the tag code, and because it
unconditionally adds to the prefix list, we may end up with a prefix
list that _should_ have "refs/tags/" in it, but doesn't.

When that is the case, the server does not advertise any tags, and our
auto-following breaks because we never learned about any tags in the
first place.

Fix this by only adding "HEAD" to the ref prefixes when we know that we
are already limiting the advertisement. In either case we'll learn about
HEAD (either through the limited advertisement, or implicitly through a
full advertisement).

Reported-by: Igor Todorovski <itodorov@ca.ibm.com>
Co-authored-by: Jeff King <peff@peff.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMerge branch 'js/win-2.49-build-fixes'
Junio C Hamano [Thu, 6 Mar 2025 22:06:31 +0000 (14:06 -0800)] 
Merge branch 'js/win-2.49-build-fixes'

Hotfix to help building Git-for-Windows.

* js/win-2.49-build-fixes:
  cmake: generalize the handling of the `CLAR_TEST_OBJS` list
  meson: fix sorting
  ident: stop assuming that `gw_gecos` is writable

5 months agoMerge branch 'pw/repo-layout-doc-update'
Junio C Hamano [Thu, 6 Mar 2025 22:06:31 +0000 (14:06 -0800)] 
Merge branch 'pw/repo-layout-doc-update'

Some future breaking changes would remove certain parts of the
default repository, which were still described even when the
documents were built for the future with WITH_BREAKING_CHANGES.

* pw/repo-layout-doc-update:
  docs: fix repository-layout when building with breaking changes

5 months agoMerge branch 'tz/doc-txt-to-adoc-fixes'
Junio C Hamano [Thu, 6 Mar 2025 22:06:31 +0000 (14:06 -0800)] 
Merge branch 'tz/doc-txt-to-adoc-fixes'

Fallouts from recent renaming of documentation files from .txt
suffix to the new .adoc suffix have been corrected.

* tz/doc-txt-to-adoc-fixes: (38 commits)
  xdiff: *.txt -> *.adoc fixes
  unpack-trees.c: *.txt -> *.adoc fixes
  transport.h: *.txt -> *.adoc fixes
  trace2/tr2_sysenv.c: *.txt -> *.adoc fixes
  trace2.h: *.txt -> *.adoc fixes
  t6434: *.txt -> *.adoc fixes
  t6012: *.txt -> *.adoc fixes
  t/helper/test-rot13-filter.c: *.txt -> *.adoc fixes
  simple-ipc.h: *.txt -> *.adoc fixes
  setup.c: *.txt -> *.adoc fixes
  refs.h: *.txt -> *.adoc fixes
  pseudo-merge.h: *.txt -> *.adoc fixes
  parse-options.h: *.txt -> *.adoc fixes
  object-name.c: *.txt -> *.adoc fixes
  list-objects-filter-options.h: *.txt -> *.adoc fixes
  fsck.h: *.txt -> *.adoc fixes
  diffcore.h: *.txt -> *.adoc fixes
  diff.h: *.txt -> *.adoc fixes
  contrib/long-running-filter: *.txt -> *.adoc fixes
  config.c: *.txt -> *.adoc fixes
  ...

5 months agocmake: generalize the handling of the `CLAR_TEST_OBJS` list
Johannes Schindelin [Thu, 6 Mar 2025 10:26:20 +0000 (10:26 +0000)] 
cmake: generalize the handling of the `CLAR_TEST_OBJS` list

A late-comer to the v2.49.0 party, `sk/unit-test-oid`, added yet another
array item to `CLAR_TEST_OBJS`, causing the `win+VS build` job to fail
with symptoms like this one:

  unit-tests-lib.lib(u-oid-array.obj) : error LNK2019: unresolved
  external symbol cl_parse_any_oid referenced in function fill_array

This is a similar scenario to the one that forced me to write
8afda42fce60 (cmake: generalize the handling of the `UNIT_TEST_OBJS`
list, 2024-09-18): The hard-coded echo of `CLAR_TEST_OBJS` in
`CMakeLists.txt` that recapitulates faithfully what was already
hard-coded in `Makefile` would either have to be updated whack-a-mole
style, or generalized.

Just like I chose the latter option for `UNIT_TEST_OBJS`, I now do the
same for `CLAR_TEST_OBJS`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: fix sorting
Johannes Schindelin [Thu, 6 Mar 2025 10:26:19 +0000 (10:26 +0000)] 
meson: fix sorting

In 904339edbd80 (Introduce support for the Meson build system,
2024-12-06) the `meson.build` file was introduced, adding also a
Windows-specific list of source files. This list was obviously meant to
be sorted alphabetically, but there is one mistake. Let's fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoident: stop assuming that `gw_gecos` is writable
Johannes Schindelin [Thu, 6 Mar 2025 10:26:18 +0000 (10:26 +0000)] 
ident: stop assuming that `gw_gecos` is writable

In 590e081dea7c (ident: add NO_GECOS_IN_PWENT for systems without
pw_gecos in struct passwd, 2011-05-19), code was introduced to iterate
over the `gw_gecos` field; The loop variable is of type `char *`, which
assumes that `gw_gecos` is writable.

However, it is not necessarily writable (and it is a bad idea to have it
writable in the first place), so let's switch the loop variable type to
`const char *`.

This is not a new problem, but what is new is the Meson build. While it
does not trigger in CI builds, imitating the commands of
`ci/run-build-and-tests.sh` in a regular Git for Windows SDK (`meson
setup build . --fatal-meson-warnings --warnlevel 2 --werror --wrap-mode
nofallback -Dfuzzers=true` followed by `meson compile -C build --`
results in this beautiful error:

  "cc" [...] -o libgit.a.p/ident.c.obj "-c" ../ident.c
  ../ident.c: In function 'copy_gecos':
  ../ident.c:68:18: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     68 |         for (src = get_gecos(w); *src && *src != ','; src++) {
        |                  ^
  cc1.exe: all warnings being treated as errors

Now, why does this not trigger in CI? The answer is as simple as it is
puzzling: The `win+Meson` job completely side-steps Git for Windows'
development environment, opting instead to use the GCC that is on the
`PATH` in GitHub-hosted `windows-latest` runners. That GCC is pinned to
v12.2.0 and targets the UCRT (unlikely to change any time soon, see
https://github.com/actions/runner-images/blob/win25/20250303.1/images/windows/toolsets/toolset-2022.json#L132-L141).
That is in stark contrast to Git for Windows, which uses GCC v14.2.0 and
targets MSVCRT. Git for Windows' `Makefile`-based build also obviously
uses different compiler flags, otherwise this compile error would have
had plenty of opportunity in almost 14 years to surface.

In other words, contrary to my expectations, the `win+Meson` job is
ill-equipped to replace the `win build` job because it exercises a
completely different tool version/compiler flags vector than what Git
for Windows needs.

Nevertheless, there is currently this huge push, including breaking
changes after -rc1 and all, for switching to Meson. Therefore, we need
to make it work, somehow, even in Git for Windows' SDK, hence this
patch, at this point in time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoA few more after -rc1
Junio C Hamano [Wed, 5 Mar 2025 18:37:53 +0000 (10:37 -0800)] 
A few more after -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMerge branch 'rs/reftable-reader-new-leakfix'
Junio C Hamano [Wed, 5 Mar 2025 18:37:45 +0000 (10:37 -0800)] 
Merge branch 'rs/reftable-reader-new-leakfix'

Leakfix.

* rs/reftable-reader-new-leakfix:
  reftable: release name on reftable_reader_new() error

5 months agoMerge branch 'pw/build-meson-technical-and-howto-docs'
Junio C Hamano [Wed, 5 Mar 2025 18:37:45 +0000 (10:37 -0800)] 
Merge branch 'pw/build-meson-technical-and-howto-docs'

Meson-based build procedure forgot to build some docs, which has
been corrected.

* pw/build-meson-technical-and-howto-docs:
  meson: fix building technical and howto docs

5 months agoMerge branch 'kn/ref-migrate-skip-reflog'
Junio C Hamano [Wed, 5 Mar 2025 18:37:45 +0000 (10:37 -0800)] 
Merge branch 'kn/ref-migrate-skip-reflog'

Usage string of "git refs" has been corrected.

* kn/ref-migrate-skip-reflog:
  refs: show --no-reflog in the help text

5 months agoMerge branch 'jc/breaking-changes-early-adopter-option'
Junio C Hamano [Wed, 5 Mar 2025 18:37:45 +0000 (10:37 -0800)] 
Merge branch 'jc/breaking-changes-early-adopter-option'

Doc update.

* jc/breaking-changes-early-adopter-option:
  BreakingChanges: clarify the procedure

5 months agoMerge branch 'dm/editorconfig-bash-is-like-sh'
Junio C Hamano [Wed, 5 Mar 2025 18:37:44 +0000 (10:37 -0800)] 
Merge branch 'dm/editorconfig-bash-is-like-sh'

The editorconfig file is updated to tell us that bash scripts are
similar to general Bourne shell scripts.

* dm/editorconfig-bash-is-like-sh:
  editorconfig: add .bash extension

5 months agoMerge branch 'cc/lop-remote'
Junio C Hamano [Wed, 5 Mar 2025 18:37:44 +0000 (10:37 -0800)] 
Merge branch 'cc/lop-remote'

Large-object promisor protocol extension.

* cc/lop-remote:
  doc: add technical design doc for large object promisors
  promisor-remote: check advertised name or URL
  Add 'promisor-remote' capability to protocol v2

5 months agoMerge branch 'sk/unit-test-oid'
Junio C Hamano [Wed, 5 Mar 2025 18:37:43 +0000 (10:37 -0800)] 
Merge branch 'sk/unit-test-oid'

Convert a few unit tests to the clar framework.

* sk/unit-test-oid:
  t/unit-tests: convert oidtree test to use clar test framework
  t/unit-tests: convert oidmap test to use clar test framework
  t/unit-tests: convert oid-array test to use clar test framework
  t/unit-tests: implement clar specific oid helper functions

5 months agoMerge branch 'ps/path-sans-the-repository'
Junio C Hamano [Wed, 5 Mar 2025 18:37:43 +0000 (10:37 -0800)] 
Merge branch 'ps/path-sans-the-repository'

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

5 months agodocs: fix repository-layout when building with breaking changes
Phillip Wood [Wed, 5 Mar 2025 10:42:37 +0000 (10:42 +0000)] 
docs: fix repository-layout when building with breaking changes

Since commit 8ccc75c2452 (remote: announce removal of "branches/" and
"remotes/", 2025-01-22) enabling WITH_BREAKING_CHANGES when building git
removes support for reading branches from ".git/branches" and remotes
from ".git/remotes". However those locations are still documented in
gitrepository-layout.adoc even though the build does not support them.

Rectify this by adding a new document attribute "with-breaking-changes"
and use it to make the inclusion of those sections of the documentation
conditional. Note that the name of the attribute does not match the test
prerequisite WITHOUT_BREAKING_CHANGES added in c5bc9a7f94a (Makefile:
wire up build option for deprecated features, 2025-01-22). This is to
avoid the awkward double negative ifndef::without_breaking_changes for
documentation that should be included when WITH_BREAKING_CHANGES is
enabled. The test prerequisite will be renamed to match the
documentation attribute in a future patch series.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoreftable: release name on reftable_reader_new() error
René Scharfe [Tue, 4 Mar 2025 16:11:54 +0000 (17:11 +0100)] 
reftable: release name on reftable_reader_new() error

If block_source_read_block() or parse_footer() fail, we leak the "name"
member of struct reftable_reader in reftable_reader_new().  Release it.

Reported by: H Z <shiyuyuranzh@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoGit 2.49-rc1 v2.49.0-rc1
Junio C Hamano [Tue, 4 Mar 2025 16:19:20 +0000 (08:19 -0800)] 
Git 2.49-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agorefs: show --no-reflog in the help text
Junio C Hamano [Mon, 3 Mar 2025 22:51:29 +0000 (14:51 -0800)] 
refs: show --no-reflog in the help text

We forgot that we must keep the documentation and help text in sync.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoxdiff: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:32 +0000 (15:44 -0500)] 
xdiff: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agounpack-trees.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:31 +0000 (15:44 -0500)] 
unpack-trees.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agotransport.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:30 +0000 (15:44 -0500)] 
transport.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agotrace2/tr2_sysenv.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:29 +0000 (15:44 -0500)] 
trace2/tr2_sysenv.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agotrace2.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:28 +0000 (15:44 -0500)] 
trace2.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agot6434: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:27 +0000 (15:44 -0500)] 
t6434: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agot6012: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:26 +0000 (15:44 -0500)] 
t6012: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agot/helper/test-rot13-filter.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:25 +0000 (15:44 -0500)] 
t/helper/test-rot13-filter.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agosimple-ipc.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:24 +0000 (15:44 -0500)] 
simple-ipc.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agosetup.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:23 +0000 (15:44 -0500)] 
setup.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agorefs.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:22 +0000 (15:44 -0500)] 
refs.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agopseudo-merge.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:21 +0000 (15:44 -0500)] 
pseudo-merge.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoparse-options.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:20 +0000 (15:44 -0500)] 
parse-options.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoobject-name.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:19 +0000 (15:44 -0500)] 
object-name.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agolist-objects-filter-options.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:18 +0000 (15:44 -0500)] 
list-objects-filter-options.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agofsck.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:17 +0000 (15:44 -0500)] 
fsck.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodiffcore.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:16 +0000 (15:44 -0500)] 
diffcore.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodiff.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:15 +0000 (15:44 -0500)] 
diff.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agocontrib/long-running-filter: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:14 +0000 (15:44 -0500)] 
contrib/long-running-filter: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoconfig.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:13 +0000 (15:44 -0500)] 
config.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agobuiltin.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:12 +0000 (15:44 -0500)] 
builtin.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoapply.c: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:11 +0000 (15:44 -0500)] 
apply.c: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoadvice.h: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:10 +0000 (15:44 -0500)] 
advice.h: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodoc: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:09 +0000 (15:44 -0500)] 
doc: *.txt -> *.adoc fixes

Update a few more instances of Documentation/*.txt files which have been
renamed to *.adoc.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agotechnical/partial-clone: update reference to rev-list-options.adoc
Todd Zullinger [Mon, 3 Mar 2025 20:44:08 +0000 (15:44 -0500)] 
technical/partial-clone: update reference to rev-list-options.adoc

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agohowto/new-command: update reference to builtin docs
Todd Zullinger [Mon, 3 Mar 2025 20:44:07 +0000 (15:44 -0500)] 
howto/new-command: update reference to builtin docs

Commit ec14d4ecb5 (builtin.h: take over documentation from
api-builtin.txt, 2017-08-02) deleted api-builtin.txt and moved the
contents into builtin.h.  Most of the references were fixed in
d85e9448dd (new-command.txt: update reference to builtin docs,
2023-02-04), but one remained.  Fix it.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMyFirstObjectWalk: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:06 +0000 (15:44 -0500)] 
MyFirstObjectWalk: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMyFirstContribution: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:05 +0000 (15:44 -0500)] 
MyFirstContribution: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoCodingGuidelines: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:04 +0000 (15:44 -0500)] 
CodingGuidelines: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoREADME: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:44:03 +0000 (15:44 -0500)] 
README: *.txt -> *.adoc fixes

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMakefile: update reference to technical/racy-git.adoc
Todd Zullinger [Mon, 3 Mar 2025 20:44:02 +0000 (15:44 -0500)] 
Makefile: update reference to technical/racy-git.adoc

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodoc: remove unneeded .gitattributes
Todd Zullinger [Mon, 3 Mar 2025 20:44:01 +0000 (15:44 -0500)] 
doc: remove unneeded .gitattributes

The top-level .gitattributes file contains entries for the Documentation
tree.  Documentation/.gitattributes has not been touched since it was
added in 14f9e128d3 (Define the project whitespace policy, 2008-02-10).

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months ago.gitattributes: more *.txt -> *.adoc updates
Todd Zullinger [Mon, 3 Mar 2025 20:44:00 +0000 (15:44 -0500)] 
.gitattributes: more *.txt -> *.adoc updates

All Documentation files now end in .adoc.  Update the entries for
git-merge.adoc, gitk.adoc, and user-manual.adoc to properly set the
conflict-marker-size attribute.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agot0450: *.txt -> *.adoc fixes
Todd Zullinger [Mon, 3 Mar 2025 20:43:59 +0000 (15:43 -0500)] 
t0450: *.txt -> *.adoc fixes

After 1f010d6bdf (doc: use .adoc extension for AsciiDoc files,
2025-01-20), we no longer matched any files in this test.  The result is
that we did not test for mismatches in the documentation and --help
output.

Adjust the test to look at the renamed *.adoc files.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoBreakingChanges: clarify the procedure
Junio C Hamano [Fri, 28 Feb 2025 17:28:21 +0000 (09:28 -0800)] 
BreakingChanges: clarify the procedure

The point behind a compile-time switch is to ensure that we have a
mechanism to hide myriad of backward incompatible changes that may
be prepared and accumulated over time, yet make them available for
testing any time during the development toward the big version
boundary.  Add a few words to stress that point.

Since the document was first written, we have added the CI job that
the document anticipated us to have.  Rephrase to state the current
status.

The discussion in [*1*] made us abandon the "feature.git3" based
runtime switching of behaviour and instead adopt the compile-time
switching mechanism, but a stray sentence about runtime switching
still remained in the final text by mistake.  Remove it.

[Reference]

 *1* https://lore.kernel.org/git/xmqqldzel6ug.fsf@gitster.g/

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodoc: add technical design doc for large object promisors
Christian Couder [Tue, 18 Feb 2025 11:32:04 +0000 (12:32 +0100)] 
doc: add technical design doc for large object promisors

Let's add a design doc about how we could improve handling liarge blobs
using "Large Object Promisors" (LOPs). It's a set of features with the
goal of using special dedicated promisor remotes to store large blobs,
and having them accessed directly by main remotes and clients.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoA few more before -rc1
Junio C Hamano [Mon, 3 Mar 2025 16:52:50 +0000 (08:52 -0800)] 
A few more before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMerge branch 'ps/build-meson-fixes'
Junio C Hamano [Mon, 3 Mar 2025 16:53:03 +0000 (08:53 -0800)] 
Merge branch 'ps/build-meson-fixes'

CI fix.

* ps/build-meson-fixes:
  gitlab-ci: fix "msvc-meson" test job succeeding despite test failures

5 months agoMerge branch 'ps/meson-contrib-bits'
Junio C Hamano [Mon, 3 Mar 2025 16:53:02 +0000 (08:53 -0800)] 
Merge branch 'ps/meson-contrib-bits'

Update meson-based build procedure to cover contrib/ and other
places as well.

* ps/meson-contrib-bits:
  ci: exercise credential helpers
  ci: fix propagating UTF-8 test locale in musl-based Meson job
  meson: wire up static analysis via Coccinelle
  meson: wire up git-contacts(1)
  meson: wire up credential helpers
  contrib/credential: fix compilation of "osxkeychain" helper
  contrib/credential: fix compiling "libsecret" helper
  contrib/credential: fix compilation of wincred helper with MSVC
  contrib/credential: fix "netrc" tests with out-of-tree builds
  GIT-BUILD-OPTIONS: propagate project's source directory

5 months agoMerge branch 'ms/merge-recursive-string-list-micro-optimization'
Junio C Hamano [Mon, 3 Mar 2025 16:53:02 +0000 (08:53 -0800)] 
Merge branch 'ms/merge-recursive-string-list-micro-optimization'

Rename processing in the recursive merge backend has seen a micro
optimization.

* ms/merge-recursive-string-list-micro-optimization:
  merge-recursive: optimize time complexity for process_renames

5 months agoMerge branch 'lo/doc-merge-submodule-update'
Junio C Hamano [Mon, 3 Mar 2025 16:53:02 +0000 (08:53 -0800)] 
Merge branch 'lo/doc-merge-submodule-update'

What happens to submodules during merge has been documented in a
bit more detail.

* lo/doc-merge-submodule-update:
  merge-strategies.adoc: detail submodule merge

5 months agoMerge branch 'ps/build-meson-fixes-0130'
Junio C Hamano [Mon, 3 Mar 2025 16:53:01 +0000 (08:53 -0800)] 
Merge branch 'ps/build-meson-fixes-0130'

Assorted fixes and improvements to the build procedure based on
meson.

* ps/build-meson-fixes-0130:
  gitlab-ci: restrict maximum number of link jobs on Windows
  meson: consistently use custom program paths to resolve programs
  meson: fix overwritten `git` variable
  meson: prevent finding sed(1) in a loop
  meson: improve handling of `sane_tool_path` option
  meson: improve PATH handling
  meson: drop separate version library
  meson: stop linking libcurl into all executables
  meson: introduce `libgit_curl` dependency
  meson: simplify use of the common-main library
  meson: inline the static 'git' library
  meson: fix OpenSSL fallback when not explicitly required
  meson: fix exec path with enabled runtime prefix

5 months agoMerge branch 'dk/test-aggregate-results-paste-fix'
Junio C Hamano [Mon, 3 Mar 2025 16:53:01 +0000 (08:53 -0800)] 
Merge branch 'dk/test-aggregate-results-paste-fix'

The use of "paste" command for aggregating the test results have
been corrected.

* dk/test-aggregate-results-paste-fix:
  t/aggregate-results: fix paste(1) invocation

5 months agoeditorconfig: add .bash extension
David Mandelberg [Sun, 2 Mar 2025 20:54:44 +0000 (15:54 -0500)] 
editorconfig: add .bash extension

Both files in the command below appear to be indented with tabs, and I'd
expect .bash files to have roughly the same style as .sh files.

$ find . -name \*.bash
./contrib/completion/git-completion.bash
./ci/check-directional-formatting.bash

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: fix building technical and howto docs
Phillip Wood [Sun, 2 Mar 2025 16:02:30 +0000 (16:02 +0000)] 
meson: fix building technical and howto docs

When our asciidoc files were renamed from "*.txt" to "*.adoc" in
1f010d6bdf7 (doc: use .adoc extension for AsciiDoc files, 2025-01-20)
the "meson.build" file in "Documentation" was updated but the
"meson.build" files in the "technical" and "howto" subdirectories were
not. This causes the meson build to fail when configured with
-Ddocs=html. Fix this by updating the relevant "meson.build" files.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodoc: fix build-docdep.perl
Junio C Hamano [Sat, 1 Mar 2025 18:25:10 +0000 (10:25 -0800)] 
doc: fix build-docdep.perl

We renamed from .txt to .adoc all the asciidoc source files and
necessary includes.  We also need to adjust the build-docdep tool to
work on files whose suffix is .adoc when computing the documentation
dependencies.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agocontrib/subtree: rename .txt to .adoc
Todd Zullinger [Sat, 1 Mar 2025 15:36:04 +0000 (10:36 -0500)] 
contrib/subtree: rename .txt to .adoc

The .txt extensions were changed to .adoc in 1f010d6bdf (doc: use .adoc
extension for AsciiDoc files, 2025-01-20).

Do the same for contrib/subtree.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agocontrib/contacts: rename .txt to .adoc
Todd Zullinger [Sat, 1 Mar 2025 15:36:03 +0000 (10:36 -0500)] 
contrib/contacts: rename .txt to .adoc

The .txt extensions were changed to .adoc in 1f010d6bdf (doc: use .adoc
extension for AsciiDoc files, 2025-01-20).

Do the same for contrib/contacts.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agodoc: update howto-index.sh for .adoc extensions
Todd Zullinger [Sat, 1 Mar 2025 15:36:02 +0000 (10:36 -0500)] 
doc: update howto-index.sh for .adoc extensions

The .txt extensions were changed to .adoc in 1f010d6bdf (doc: use .adoc
extension for AsciiDoc files, 2025-01-20).  This left broken links in
the generated howto-index.html.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMerge branch 'ps/meson-contrib-bits' into tz/doc-txt-to-adoc-fixes
Junio C Hamano [Sat, 1 Mar 2025 18:00:45 +0000 (10:00 -0800)] 
Merge branch 'ps/meson-contrib-bits' into tz/doc-txt-to-adoc-fixes

* ps/meson-contrib-bits:
  ci: exercise credential helpers
  ci: fix propagating UTF-8 test locale in musl-based Meson job
  meson: wire up static analysis via Coccinelle
  meson: wire up git-contacts(1)
  meson: wire up credential helpers
  contrib/credential: fix compilation of "osxkeychain" helper
  contrib/credential: fix compiling "libsecret" helper
  contrib/credential: fix compilation of wincred helper with MSVC
  contrib/credential: fix "netrc" tests with out-of-tree builds
  GIT-BUILD-OPTIONS: propagate project's source directory

5 months agopath: adjust last remaining users of `the_repository`
Patrick Steinhardt [Fri, 7 Feb 2025 11:03:41 +0000 (12:03 +0100)] 
path: adjust last remaining users of `the_repository`

With the preceding refactorings we now only have a couple of implicit
users of `the_repository` left in the "path" subsystem, all of which
depend on global state via `calc_shared_perm()`. Make the dependency on
`the_repository` explicit by passing the repo as a parameter instead and
adjust callers accordingly.

Note that this change bubbles up into a couple of subsystems that were
previously declared as free from `the_repository`. Instead of marking
all of them as `the_repository`-dependent again, we instead use the
repository that is available in the calling context. There are three
exceptions though with "copy.c", "pack-write.c" and "tempfile.c".
Adjusting these would require us to adapt callsites all over the place,
so this is left for a future iteration.

Mark "path.c" as free from `the_repository`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoenvironment: move access to "core.sharedRepository" into repo settings
Patrick Steinhardt [Fri, 7 Feb 2025 11:03:40 +0000 (12:03 +0100)] 
environment: move access to "core.sharedRepository" into repo settings

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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoenvironment: move access to "core.hooksPath" into repo settings
Patrick Steinhardt [Fri, 7 Feb 2025 11:03:39 +0000 (12:03 +0100)] 
environment: move access to "core.hooksPath" into repo settings

The "core.hooksPath" setting is stored in a global variable and
populated via the `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`. The value is computed as-needed and cached. The result
should be functionally the same as there aren't ever any code paths
where we'd execute hooks outside the context of a repository.

Note that this requires us to change the passed-in repository in the
`repo_git_path()` family of functions to be non-constant, as we call
`adjust_git_path()` there.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agorepo-settings: introduce function to clear struct
Patrick Steinhardt [Fri, 7 Feb 2025 11:03:38 +0000 (12:03 +0100)] 
repo-settings: introduce function to clear struct

We don't provide a way to clear a `struct repo_settings`, and instead
open-code this in `repo_clear()`. This is mixing up concerns and means
that developers have to touch multiple files whenever they add a new
field to the structure in case the associated resources need to be
released.

Provide a new `repo_settings_clear()` function to improve this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agopath: drop `git_path()` in favor of `repo_git_path()`
Patrick Steinhardt [Fri, 7 Feb 2025 11:03:37 +0000 (12:03 +0100)] 
path: drop `git_path()` in favor of `repo_git_path()`

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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agorerere: let `rerere_path()` write paths into a caller-provided buffer
Patrick Steinhardt [Fri, 7 Feb 2025 11:03:36 +0000 (12:03 +0100)] 
rerere: let `rerere_path()` write paths into a caller-provided buffer

Same as with `get_worktree_git_dir()` a couple of commits ago, the
`rerere_path()` function returns paths that need not be free'd by the
caller because `git_path()` internally uses `get_pathname()`.

Refactor the function to instead accept a caller-provided buffer that
the path will be written into, passing on ownership to the caller. This
refactoring prepares us for the removal of `git_path()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoA bit more post -rc0
Junio C Hamano [Thu, 27 Feb 2025 23:22:47 +0000 (15:22 -0800)] 
A bit more post -rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agoMerge branch 'jc/3.0-branches-remotes-update'
Junio C Hamano [Thu, 27 Feb 2025 23:23:01 +0000 (15:23 -0800)] 
Merge branch 'jc/3.0-branches-remotes-update'

Removal of ".git/branches" and ".git/remotes" support in the
BreakingChanges document has been further clarified.

* jc/3.0-branches-remotes-update:
  BreakingChanges: clarify branches/ and remotes/

5 months agoMerge branch 'bc/http-push-auth-netrc-fix'
Junio C Hamano [Thu, 27 Feb 2025 23:23:01 +0000 (15:23 -0800)] 
Merge branch 'bc/http-push-auth-netrc-fix'

The netrc support (via the cURL library) for the HTTP transport has
been re-enabled.

* bc/http-push-auth-netrc-fix:
  http: allow using netrc for WebDAV-based HTTP protocol

5 months agoMerge branch 'rs/clear-commit-marks-optim'
Junio C Hamano [Thu, 27 Feb 2025 23:23:00 +0000 (15:23 -0800)] 
Merge branch 'rs/clear-commit-marks-optim'

A micro-optimization.

* rs/clear-commit-marks-optim:
  commit: avoid parent list buildup in clear_commit_marks_many()

5 months agoMerge branch 'pw/rebase-i-ff-empty-commit'
Junio C Hamano [Thu, 27 Feb 2025 23:23:00 +0000 (15:23 -0800)] 
Merge branch 'pw/rebase-i-ff-empty-commit'

"git rebase -i" failed to allow rewording an empty commit that has
been fast-forwarded.

* pw/rebase-i-ff-empty-commit:
  rebase -i: reword empty commit after fast-forward

5 months agoMerge branch 'kn/ref-migrate-skip-reflog'
Junio C Hamano [Thu, 27 Feb 2025 23:23:00 +0000 (15:23 -0800)] 
Merge branch 'kn/ref-migrate-skip-reflog'

"git refs migrate" can optionally be told not to migrate the reflog.

* kn/ref-migrate-skip-reflog:
  builtin/refs: add '--no-reflog' flag to drop reflogs

5 months agoMerge branch 'ua/os-version-capability'
Junio C Hamano [Thu, 27 Feb 2025 23:22:59 +0000 (15:22 -0800)] 
Merge branch 'ua/os-version-capability'

The value of "uname -s" is by default sent over the wire as a part
of the "version" capability.

* ua/os-version-capability:
  agent: advertise OS name via agent capability
  t5701: add setup test to remove side-effect dependency
  version: extend get_uname_info() to hide system details
  version: refactor get_uname_info()
  version: refactor redact_non_printables()
  version: replace manual ASCII checks with isprint() for clarity

5 months agogitlab-ci: fix "msvc-meson" test job succeeding despite test failures
Patrick Steinhardt [Thu, 27 Feb 2025 13:39:22 +0000 (14:39 +0100)] 
gitlab-ci: fix "msvc-meson" test job succeeding despite test failures

We have recently noticed that the "msvc-meson" test job in GitLab CI
succeeds even if there are failures. This is somewhat puzzling because
we use exactly the same command as we do on GitHub Actions, and there
the jobs fail as exected.

As it turns out, this is another weirdness of the GitLab CI hosted
runner for Windows [1]: by default, even successful commands will not
make the job fail. Interestingly though, this depends on what exactly
the command is that you're running -- the MinGW-based job for example
works alright and does fail as expected.

The root cause here seems to be specific behaviour of PowerShell. The
invocation of `ForEach-Object` does not bubble up any errors in case the
invocation of `meson test` fails, and thus we don't notice the error.
This is specific to executing the command in a loop: other build steps
where we execute commands directly fail as expected.

This is because the specific version of PowerShell that we use in the
runner does not know about `PSNativeCommandUseErrorActionPreference`
yet, which controls whether native commands like "meson.exe" honor the
`ErrorActionPreference` variable. The preference has been introduced
with PowerShell 7.3 and is default-enabled since PowerShell 7.4, but
GitLab's hosted runners still seem to use PowerShell 5.1. Consequently,
when tests fail, we won't bubble up the error at all from the loop and
thus the job doesn't fail. This isn't an issue in other cases though
where we execute native commands directly, as the GitLab runner knows to
check the last error code after every command.

The same thing doesn't seem to be an issue on GitHub Actions, most
likely because it uses PowerShell 7.4. Curiously, the preference for
`PSNativeCommandUseErrorActionPreference` is disabled there, but the
jobs fail as expected regardless of that. It's puzzling, but I do not
have enough PowerShell expertise to give a definitive answer as to why
it works there.

In any case, Meson 1.8 will likely get support for slicing tests [1], so
we can eventually get rid of the whole PowerShell script. For now, work
around the issue by explicitly exiting out of the loop with a non-zero
error code if we see that Meson has failed.

[1]: https://github.com/mesonbuild/meson/pull/14092

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agogitlab-ci: restrict maximum number of link jobs on Windows
Patrick Steinhardt [Wed, 26 Feb 2025 08:22:23 +0000 (09:22 +0100)] 
gitlab-ci: restrict maximum number of link jobs on Windows

The hosted Windows runners on GitLab.com only have 7.5GB of RAM. Given
that "link.exe" provided by Microsoft Visual Studio is multi-threaded by
itself already and thus quite memory hungry this can quickly lead to
memory starvation, out-of-memory situations and thus failed CI jobs.

Fix the issue by limiting the number of concurrent linker jobs. The same
issue hasn't been observed on GitHub Actions yet, probably because it
got more than twice the amount of RAM with 16GB.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: consistently use custom program paths to resolve programs
Patrick Steinhardt [Wed, 26 Feb 2025 08:22:22 +0000 (09:22 +0100)] 
meson: consistently use custom program paths to resolve programs

The calls to `find_program()` in our documentation don't use our custom
program path. This variable gets populated on Windows with the location
of Git for Windows so that we can use it to provide our build tools.
Consequently, we may not be able to find all necessary binaries on
Windows.

Adapt the calls to use the program path to fix this. While at it, drop
`required: true` arguments, which are the default anyway.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: fix overwritten `git` variable
Patrick Steinhardt [Wed, 26 Feb 2025 08:22:21 +0000 (09:22 +0100)] 
meson: fix overwritten `git` variable

We're assigning the `git` variable in three places:

  - In "meson.build" to store the external Git executable.

  - In "meson.build" to store the compiled Git executable.

  - In "Documentation/meson.build" to store the external Git executable,
    a second time.

The last case is only needed because we overwrite the original variable
with the built version. Rename the variable used for the built Git
executable so that we don't have to resolve the external Git executable
multiple times.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: prevent finding sed(1) in a loop
Patrick Steinhardt [Wed, 26 Feb 2025 08:22:20 +0000 (09:22 +0100)] 
meson: prevent finding sed(1) in a loop

We're searching for the sed(1) executable in a loop, which will make us
try to find it multiple times. Starting with the preceding commit we
already declare a variable for that program in the top-level build file.
Use it so that we only need to search for the program once.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: improve handling of `sane_tool_path` option
Patrick Steinhardt [Wed, 26 Feb 2025 08:22:19 +0000 (09:22 +0100)] 
meson: improve handling of `sane_tool_path` option

The `sane_tool_path` option can be used to override the PATH variable
from which the build process, tests and ultimately Git will end up
picking programs from. It is currently lacking though because we only
use it to populate the PATH environment variable for executed scripts
and for the `BROKEN_PATH_FIX` mechanism, but we don't use it to find
programs used in the build process itself.

Fix this issue by treating it similar to the Windows-specific paths,
which will make us use it both to find programs and to populate the PATH
environment variable.

To help with this fix, change the type of the option to be an array of
paths, which makes the handling a bit easier for us. It's also the
correct thing to do as the input indeed is a list of paths.

Furthermore, the option now overrides the default behaviour on Windows,
which si to pick up tools from Git for Windows. This is done so that it
becomes easier to override that default behaviour in case it's not
desired.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 months agomeson: improve PATH handling
Patrick Steinhardt [Wed, 26 Feb 2025 08:22:18 +0000 (09:22 +0100)] 
meson: improve PATH handling

When locating programs required for the build we give some special
treatment to Windows systems so that we know to also look up tools
provided by a Git for Windows installation. This ensures that the build
doesn't have any prerequisites other than Microsoft Visual Studio, Meson
and Git for Windows.

Consequently, some of the programs returned by `find_program()` may not
be found via PATH, but via these extra directories. But while Meson can
use these tools directly without any special treatment, any scripts that
we execute may not be able to find those programs. To help them we thus
prepend the directories of a subset of the found programs to PATH.

This doesn't make much sense though: we don't need to prepend PATH for
any program that was found via PATH, but we really only need to do so
for programs located via the extraneous Windows-specific paths. So
instead of prepending all programs paths, we really only need to prepend
the Windows-specific paths.

Adapt the code accordingly by only prepeding Windows-specific paths to
PATH, which both simplifies the code and clarifies intent.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>