Commit Graph

82143 Commits (next)

Author SHA1 Message Date
Junio C Hamano 602f6c329a Git 2.55
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAmpCiEcACgkQsLXohpav
 5svytRAA0KXEIi8QSQzOY+UUUBehPbJ6qgEoPNJhRjIx0FkYOG7kOg+esa9rkQOd
 LMB+m16GiHuOjl3nahfwauP7zleyGGnqZhsbfqXjtJy9bjRrZzHBXZSx3VTqpm0u
 TiClXu21DsvDn2NutBo5TOfoEt2t2W/LwbXV+GcHBqE8rB1mpNGS2eB6vid9cB1K
 XgG+u1gdi4DtKtHqyWP+Uml2mHPIEugqJDNkkf6sZFUnUFoeKmF0lsGabxpHo1PC
 Gr9uDSnzGarobIjQsWPcMALdD8/YxIPbZ/MqSgKkBz/060QmVhtCMWOn0hdaDx1R
 4VUsD9YO2sfpGiUnMSu+FksyzTHwwoCSuUmXCrFsGOX+6WN+7i9xtZRBGePTxDBF
 fsu/enpNg+EZF3WkBWmG6Ipz+IypXlPZj8JvbOqEdrldHYALU2krWu+Iln8piK11
 6qO2BGM+QhzDQwN0ET6E4CbUEcMNiUUAT0zDN8WRak4+pYQ+E/XIWGochDF8NZQY
 h6Tp1AFtdC/GNsyn7Kb+S/F54Tsw0+3p2F7ZDt87UrNRJFbAHu1gHfPgIZuzVU7H
 EQDWirBtHgjINVNT7p6pRInLut8gNkggqSmuh1w8eTzgKAKLNeGYDtk1nH2OlphB
 S4F2NO6OAvZDtLU9aKD5GF/tdqvOhwZKU74RB79Km6kvoIlzs80=
 =M661
 -----END PGP SIGNATURE-----

Sync with Git 2.55
2026-06-29 08:01:51 -07:00
Junio C Hamano 2bf33c6a40 Merge branch 'sg/t3420-do-not-grep-in-missing-file' into next
Test fix.

* sg/t3420-do-not-grep-in-missing-file:
  t3420-rebase-autostash: don't try to grep non-existing files
2026-06-29 08:00:33 -07:00
Junio C Hamano 10eef65b98 Merge branch 'ps/connected-generic-promisor-checks' into next
The connectivity check has been refactored to search for promisor
objects in a generic way using the object database interface,
rather than iterating packfiles directly. This allows connectivity
checks to work properly in repositories that do not use packfiles.

* ps/connected-generic-promisor-checks:
  connected: search promisor objects generically
  connected: split out promisor-based connectivity check
  odb/source-packed: support flags when iterating an object prefix
  odb/source-packed: extract logic to skip certain packs
2026-06-29 08:00:33 -07:00
Junio C Hamano 7b4929e311 Merge branch 'ps/refs-onbranch-fixes' into next
Reference backend configuration is now loaded lazily to avoid
recursive calls during repository initialization when "onbranch"
configuration conditions are evaluated. This also fixes a memory
leak and allows dropping the unused `chdir_notify_reparent()`
machinery.

* ps/refs-onbranch-fixes:
  refs: protect against chicken-and-egg recursion
  refs/reftable: lazy-load configuration to fix chicken-and-egg
  reftable: split up write options
  refs/files: lazy-load configuration to fix chicken-and-egg
  refs: move parsing of "core.logAllRefUpdates" back into ref stores
  repository: free main reference database
  chdir-notify: drop unused `chdir_notify_reparent()`
  refs: unregister reference stores from "chdir_notify"
  setup: don't apply "GIT_REFERENCE_BACKEND" without a repository
  setup: stop applying repository format twice
  setup: inline `check_and_apply_repository_format()`
2026-06-29 08:00:32 -07:00
Junio C Hamano 21ae0599dc Merge branch 'wy/doc-clarify-review-replies' into next
Documentation on community contribution guidelines has been updated to
encourage replying to review comments before rerolling, and to advise
a default limit of at most one reroll per day to give reviewers across
different time zones enough time to participate.

* wy/doc-clarify-review-replies:
  doc: advise batching patch rerolls
  doc: encourage review replies before rerolling
2026-06-29 08:00:32 -07:00
Junio C Hamano fbf9652169 Merge branch 'jk/repo-info-path-keys' into next
The "git repo info" command has been taught new keys to output both
absolute and relative paths for "gitdir" and "commondir", supported by
a new path-formatting helper extracted from "git rev-parse".

* jk/repo-info-path-keys:
  repo: add path.gitdir with absolute and relative suffix formatting
  repo: add path.commondir with absolute and relative suffix formatting
  path: extract format_path() and use in rev-parse
2026-06-29 08:00:32 -07:00
Junio C Hamano e9019fcafe Git 2.55
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-29 07:58:39 -07:00
Junio C Hamano 7fb089f411 Merge branch 'jk/t5551-expensive-test-timeouts-fix'
The Apache timeout in HTTP tests has been increased to prevent test
failures on heavily loaded CI runners. The tests creating an
enormous number of refs have been isolated to their own repositories
to avoid slowing down subsequent tests.

* jk/t5551-expensive-test-timeouts-fix:
  t5551: put many-tags case into its own repo
  t/lib-httpd: bump apache timeout
2026-06-29 07:57:17 -07:00
Jeff King f6ef747a7c t5551: put many-tags case into its own repo
Most of the t5551 http fetch tests use a handful of refs. But there are
a few test cases which check our handling of large numbers of refs.
These tests use the same server-side repo, so all subsequent tests end
up having to consider those extra refs, too.

The result is that the test script is a bit slower than it needs to be.
In a normal run, moving the "2,000 tags" test into its own repo drops my
runtime for the whole script from ~2.7s to ~1.9s.

This is a modest gain, but when we add the "--long" flag it gets much
bigger. There we trigger a test (marked with EXPENSIVE) that adds
100,000 tags, and the script runtime jumps to ~95s. But if we use the
same "many tags" repo for that, our runtime drops to just ~37s.

This is a pretty easy win to drop the cost of the script. It may even be
a larger gain on a heavily loaded system, since one of the main costs
here is unpacked refs, which are heavy on system time and I/O costs.

It's possible we are reducing test coverage, since all of those other
tests were inadvertently using large ref advertisements (and thus could
have uncovered some unexpected interaction). But that seems somewhat
unlikely; the tests targeted at the large number of refs are doing
roughly similar things to the other tests.

Note that the real performance culprit is the 100k-tag --long test, not
the 2k-tag one. So we could just let the 100k one use its own repo, and
keep the 2k tags in the main repo. But since these two tests are
somewhat interlinked, it's easier to just move them both (and it does
provide a small gain even for the 2000-tag test). I also notice that the
2000-tag test is gated on the CMDLINE_LIMIT prereq, and without that the
later EXPENSIVE test will fail (since we won't have a too-many-refs
clone). Nobody seems to have noticed or complained after many years, and
I left it alone for this patch.

Signed-off-by: Jeff King <peff@peff.net>
[jc: made the new "many-tags.git" bare to match the original "repo.git"]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-29 07:54:42 -07:00
Junio C Hamano 1274757cf8 Merge branch 'js/http-https-proxy-fix'
We lost ability to use https:// proxies during this cycle; this is
a hotfix for the regression.

* js/http-https-proxy-fix:
  http: accept https:// proxies again
2026-06-28 15:18:24 -07:00
Junio C Hamano 1fd1e6609c Sync with 'master' 2026-06-28 08:47:01 -07:00
Junio C Hamano a7fdf2ec97 Merge branch 'js/http-https-proxy-fix' into next
* js/http-https-proxy-fix:
  http: accept https:// proxies again
2026-06-28 08:46:49 -07:00
Jeff King dc51aedd53 t/lib-httpd: bump apache timeout
Since enabling more tests with 7a094d68a2 (ci: run expensive tests on
push builds to integration branches, 2026-05-08), we sometimes see test
failures or timeouts in GitHub CI. The culprit seems to be the "enormous
ref negotiation" test in t5551, which creates ~100k tag refs in our http
server-side repo.

Iterating through the loose refs of this repo to generate a ref
advertisement can take a long time, especially on a platform with slow
I/O. On my otherwise unloaded local machine, a cold cache ref
advertisement takes ~10s. On a busy CI machine running tests in
parallel, it can presumably top 60s, which runs afoul of Apache's
default CGI timeout.

The result in t5551 is a test failure, where Apache simply hangs up the
connection and the client reports an error. But worse, t5559 runs the
same test with HTTP/2, and a bug in Apache causes the connection to hang
indefinitely! We eventually see this as a CI timeout after 6 hours.

Let's bump Apache's timeout to something much larger: 600 seconds. This
doesn't eliminate the possibility of a timeout, but it makes it much
less likely. It should eliminate both the test failures and the CI
timeouts in practice, and it protects us from running into similar
problems with other tests in the future.

There are two counter-arguments to consider.

One, could/should we just make the test faster? Probably yes. The
biggest mistake here is having such an absurd number of unpacked refs on
a system which is bottle-necked on I/O. But I think it's worth bumping
the timeout so that we can fix this (and possibly other) correctness
issues, and then consider performance separately (which we'll do in
subsequent patches).

And two, is this just papering over a problem that users might see in
the real world? We could teach Git to handle this case more gracefully
with optimizations or keep-alives. But I think it's really an artificial
situation. You need a combination of this silly number of loose refs,
plus a very heavily loaded system. If you were trying to run a real
server and it took more than 60s to generate the ref advertisement, I
don't think the timeout is your biggest problem. Your crappy service is,
and you should adjust your resources to match your load. I.e., it is
probably reasonable for Git to assume that advertisements happen
fast-ish and don't need protocol-level keepalives.

Though the patch here is small, tons of work went into analyzing the
problem. Many thanks to the contributors credited below.

Helped-by: Michael Montalbo <mmontalbo@gmail.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-28 08:32:36 -07:00
Johannes Schindelin f6c8bae5cd http: accept https:// proxies again
Since 663d7abe07 (http: reject unsupported proxy URL schemes,
2026-05-05), set_curl_proxy_type() returns 0 only for the "http"
and SOCKS variants via dedicated early returns, and -1 for
everything else. The "https" branch configures the CURL handle for
HTTPS proxying but then falls through to the trailing `return -1`
intended for unknown schemes, so the caller in get_curl_handle()
treats a perfectly valid https:// proxy URL as unsupported and
refuses to use it.

Noticed while looking into a Coverity report against the same
function; the unchecked curl_easy_setopt() return values it flags
are orthogonal to this fix.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-28 08:30:21 -07:00
Junio C Hamano 9aa172cd1f l10n-2.55.0-v1
-----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmpBBXgbFIAAAAAABAAO
 bWFudTIsMi41KzEuMTIsMCwzAAoJEJNuFQ3dRTLVKN8QAJfOm5oM21vsH6ONo4QO
 u89j0ynacQI0rvQNLa9yGrR7vZumPQQKETwBulWTZLpQ0BrWev69LwpTZFVjQBp0
 JxXvUW5FiHKQx+tSPT2SeNkMR3eHWxEFcyCP3QMnAbV5GFRRTnOr9ajRVI/b3Fi3
 5xP2dgQW0F8oiuMAX/6osqwjjqO8qAAxtnX/+ecw2KPQ8ddgJsWPdAkWnAG7Ctnu
 ff5jxOJ4ECAvsV5eywr2Ea1MOT032nsRX6Yaf6JIfdpU2oZzhCaVXgJwVkjKn/8c
 mdEvaEZGSXPn969PEV3bsUEUEV7kgBt5wdWHRX5bGjwfXv/MKVnXZz/OQjlIa/pP
 Pzpbi8jRSVCNXBi1kOpqVIOP3yndrYPh103juue5LEwyxsctmmvOtvB2t8Q3pY6G
 /baSLDKp8GGi8x0h61D+lGAToK05YWafx95pZlxuwdd27ShJWaE6cknMkirJl9yD
 IkihgCWxrCZmRX32YstZsV3FrvsT1GUwLEXm31IHfFRLp+76oVympgQh1r2qttCo
 zMRPdo8ECZ9jwZ7OeCjshmAzgGzhuiwURZnYaPG/BC9wKqPDRmaUp8oKSjYreNgy
 IuBUt/bOJO/y8ut6KZvMhpbJnOlULrOnHWDWqm2IfY+7+PLSD6uoodtbWf7ISUeP
 k4eqg5pJX/q0t+uo8I0Z9Xqb
 =M5pa
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.55.0-v1' of https://github.com/git-l10n/git-po

l10n-2.55.0-v1

* tag 'l10n-2.55.0-v1' of https://github.com/git-l10n/git-po:
  l10n: zh-TW.po: Update Chinese (Traditional) translation
  l10n: uk: add 2.55 translation
  l10n: ga.po: update for Git 2.55
  l10n: fr: mass fix of typos
  l10n: fr: version 2.55
  l10n: po-id for 2.55
  l10n: AGENTS.md: add quotation mark preservation guidelines
  l10n: zh_CN: updated translation for 2.55
  l10n: TEAMS: change Simplified Chinese team leader
  l10n: sv.po: Update Swedish translation
  l10n: ca.po: update Catalan translation
  l10n: tr: Update Turkish translations
  l10n: bg.po: Updated Bulgarian translation (6322t)
  l10n: it: fix italian usage messages alignment
2026-06-28 08:28:08 -07:00
Jiang Xin 08621c32d5 Merge branch '2.55-uk-pr' of github.com:arkid15r/git-ukrainian-l10n
* '2.55-uk-pr' of github.com:arkid15r/git-ukrainian-l10n:
  l10n: uk: add 2.55 translation
2026-06-28 19:25:08 +08:00
Jiang Xin 2f5880f359 Merge branch 'l10n-ga-2.55' of github.com:aindriu80/git-po
* 'l10n-ga-2.55' of github.com:aindriu80/git-po:
  l10n: ga.po: update for Git 2.55
2026-06-28 16:49:15 +08:00
Jiang Xin 3311925efe Merge branch 'l10n/zh-TW/2026-06-26' of github.com:l10n-tw/git-po
* 'l10n/zh-TW/2026-06-26' of github.com:l10n-tw/git-po:
  l10n: zh-TW.po: Update Chinese (Traditional) translation
2026-06-28 16:20:41 +08:00
Jiang Xin d6cee0913a Merge branch 'ca-20260624-b' of github.com:Softcatala/git-po
* 'ca-20260624-b' of github.com:Softcatala/git-po:
  l10n: ca.po: update Catalan translation
2026-06-28 16:17:45 +08:00
Jiang Xin 13d2a9e98d Merge branch 'zh_CN-2.55' of github.com:lilydjwg/git-po
* 'zh_CN-2.55' of github.com:lilydjwg/git-po:
  l10n: zh_CN: updated translation for 2.55
  l10n: TEAMS: change Simplified Chinese team leader
2026-06-28 16:15:39 +08:00
Jiang Xin 94d7feeb5d Merge branch 'tr-l10n' of github.com:bitigchi/git-po
* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations
2026-06-28 16:14:13 +08:00
Jiang Xin f2f7369eda Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.55
2026-06-28 16:12:30 +08:00
Jiang Xin 0093fdf058 Merge branch 'master' of github.com:alshopov/git-po
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (6322t)
2026-06-28 16:11:24 +08:00
Jiang Xin 2cdc62bbf7 Merge branch 'fr_v2.55' of github.com:jnavila/git
* 'fr_v2.55' of github.com:jnavila/git:
  l10n: fr: mass fix of typos
  l10n: fr: version 2.55
2026-06-28 16:09:26 +08:00
Jiang Xin ecaa5e8a49 Merge branch 'master' of github.com:nafmo/git-l10n-sv
* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation
2026-06-28 16:07:00 +08:00
Lumynous d908e50fa2
l10n: zh-TW.po: Update Chinese (Traditional) translation
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2026-06-28 14:26:40 +08:00
SZEDER Gábor eaad121fef t3420-rebase-autostash: don't try to grep non-existing files
Several tests in 't3420-rebase-autostash.sh' start various rebase
processes that are expected to fail because of merge conflicts.  The
tests [1] checking that 'git rebase --quit' and autostash work
together as expected after such a failure then run '! grep ...' to
ensure that the dirty contents of the file is gone.  However, due to
the test repo's history and the choice of upstream branch that file
shouldn't exist in the conflicted state at all, and thus it shouldn't
exist after the subsequent 'git rebase --quit' either.  Consequently,
this 'grep' doesn't fail as expected, i.e. because it can't find the
dirty content, but instead it fails, because it can't open the file.

Thighten this check by using 'test_path_is_missing' instead, thereby
avoiding unexpected errors from 'grep' as well.

Previously 2745817028 (t3420-rebase-autostash: don't try to grep
non-existing files, 2018-08-22) fixed a couple of similar issues; this
one was added later in 9b2df3e8d0 (rebase: save autostash entry into
stash reflog on --quit, 2020-04-28).

[1] This patch modifies only a single test, but that test is run
    several times with different strategies ('--apply', '--merge', and
    '--interactive'), hence the plural "tests".

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-27 18:47:02 -07:00
Arkadii Yakovets ad2b38fc81
l10n: uk: add 2.55 translation
Co-authored-by: Kate Golovanova <kate@kgthreads.com>
Signed-off-by: Arkadii Yakovets <ark@cho.red>
Signed-off-by: Kate Golovanova <kate@kgthreads.com>
2026-06-27 11:42:28 -07:00
Aindriú Mac Giolla Eoin b3d72e5f16
l10n: ga.po: update for Git 2.55
Signed-off-by: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>
2026-06-27 15:04:14 +01:00
Jean-Noël Avila d051d24f54 l10n: fr: mass fix of typos
Helped-by: Kévin Leprêtre <k.lepretre@houseofhr.onmicrosoft.com>
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2026-06-27 11:08:27 +02:00
Jean-Noël Avila db162a9bcd l10n: fr: version 2.55
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2026-06-27 11:06:04 +02:00
Bagas Sanjaya c9357f66b2 l10n: po-id for 2.55
Update following components:

  * add-patch.c
  * apply.c
  * bisect.c
  * builtin/add.c
  * builtin/backfill.c
  * builtin/bisect.c
  * builtin/cat-file.c
  * builtin/checkout.c
  * builtin/config.c
  * builtin/fast-import.c
  * builtin/fetch.c
  * builtin/fsmonitor--daemon.c
  * builtin/hook.c
  * builtin/index-pack.c
  * builtin/interpret-trailers.c
  * builtin/last-modified.c
  * builtin/log.c
  * builtin/multi-pack-index.c
  * builtin/name-rev.c
  * builtin/pack-objects.c
  * builtin/push.c
  * builtin/repack.c
  * builtin/replay.c
  * builtin/repo.c
  * builtin/show-index.c
  * builtin/stash.c
  * builtin/submodule--helper.c
  * builtin/worktree.c
  * command-list.h
  * diff.c
  * fetch-pack.c
  * hook.c
  * list-objects-filter-options.c
  * lockfile.c
  * midx-write.c
  * midx.c
  * object-file.c
  * object.c
  * packfile.c
  * path-walk.c
  * pretty.c
  * promisor-remote.c
  * pseudo-merge.c
  * read-cache.c
  * refs.c
  * remote-curl.c
  * repack-midx.c
  * replay.c
  * repository.c
  * revision.c
  * sequencer.c
  * setup.c
  * submodule.c
  * t/helper/test-path-walk.c
  * t/helper/test-read-midx.c
  * trailer.c
  * git-send-email.perl

Translate following new components:

  * builtin/history.c
  * builtin/url-parse.c
  * compat/fsmonitor/fsm-listen-linux.c
  * sideband.c
  * t/helper/test-synthesize.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2026-06-27 11:00:14 +07:00
Patrick Steinhardt d6522d01df refs: protect against chicken-and-egg recursion
In the preceding commits we have fixed recursion when creating the
reference backends due to a chicken-and-egg situation with "onbranch"
conditions. Unfortunately, this issue has existed for a while, and we
didn't really have a good mechanism to detect this recursion.

Improve the status quo by detecting the recursion when creating the main
reference store.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 79fa75d499 refs/reftable: lazy-load configuration to fix chicken-and-egg
Same as with the "files" backend, the "reftable" backend also has a
chicken-and-egg problem with "onbranch" conditions. Fix this issue the
same as we did with the "files" backend by lazy-loading configuration.

Now that both the "files" and the "reftable" backend handle this
properly, add a generic test to t1400 that verifies that the user can
configure "core.logAllRefUpdates" via an "onbranch" condition. This is
mostly a nonsensical thing to do in the first place, but it serves as a
good sanity check.

Note that we had to move `should_write_log()` around so that it can
access the new `reftable_be_write_options()` function.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 44f46f2be5 reftable: split up write options
When initializing the reftable stack the caller may optionally pass some
write options. These write options mix up two different concerns though:

  - Of course, they allow the caller to configure how new reftables are
    being written.

  - But they also allow the caller to configure the stack itself, like
    its hash ID and the `on_reload` callback.

This is somewhat awkward, as it doesn't easily give the caller the
flexibility to for example write multiple reftables with different
options. Furthermore, this requires us to eagerly parse relevant
configuration when initializing the reftable backend.

Refactor the code by splitting out those options that configure the
stack itself. Creating a new stack will thus only require this limited
set of options, whereas the caller is expected to pass write options to
all functions that end up writing tables.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt f016ec17fb refs/files: lazy-load configuration to fix chicken-and-egg
When initializing the "files" reference backend we read the repository's
config to parse "core.preferSymlinkRefs" and "core.logAllRefUpdates".
This results in a chicken-and-egg problem though, because parsing the
configuration may require us to have access to the reference store
already when an "onbranch" condition exists.

Luckily, all the configuration that we honor only relates to writing
references. Consequently, we don't strictly need that configuration to
be readily available at initialization time, and we can easiliy defer
parsing it to a later point in time.

Implement this fix and add tests that verify that we can indeed properly
parse these config knobs via an "onbranch" condition.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt a9e4ce0aec refs: move parsing of "core.logAllRefUpdates" back into ref stores
In cc42c88945 (refs: extract out reflog config to generic layer,
2026-05-04) we have refactored how we parse "core.logAllRefUpdates" so
that it happens in the generic layer. Unfortunately, this has worsened a
preexisting issue where we may recurse when creating the reference store
because of a chicken-and-egg problem between parsing the configuration
and evaluating "onbranch" conditions.

Prepare for a fix by essentially reverting that change so that we handle
this setting in the respective backends again. The backends are already
parsing other configuration anyway, so by moving the logic back in there
we can ensure that all backend configuration is parsed the same way.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 432b2e4f9e repository: free main reference database
While we release worktree and submodule reference databases when
clearing a repository, we don't ever release the main reference
database. This memory leak went unnoticed because its pointer is
kept alive by the "chdir_notify" subsystem.

Fix the memory leak.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 5bf546755c chdir-notify: drop unused `chdir_notify_reparent()`
With the preceding commit we've removed all callers of
`chdir_notify_reparent()`, so the function is unused now. Drop it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 1f43ff2c7e refs: unregister reference stores from "chdir_notify"
When creating reference stores we register them with the "chdir_notify"
subsystem. This is required because some of the paths we track may be
relative paths, so we have to reparent them in case the current working
directory changes.

But while we register the reference stores, we never unregister them.
This can have multiple outcomes:

  - For a repository's main reference database we essentially keep the
    pointer alive. We never free that database, either, and our leak
    checker doesn't notice because it's still registered.

  - For submodule and worktree reference databases we do eventually free
    them in `repo_clear()`, so we may keep pointers to free'd memory
    registered. We never notice though as we don't tend to chdir around
    in the middle of the process.

We never noticed either of these symptoms, but they are obviously bad.

Partially fix those issues by unregistering the reference stores when
releasing them. The leak of the main reference database will be fixed in
a subsequent commit.

Note that this requires us to use `chdir_notify_register()` instead of
`chdir_notify_reparent()`, as there is no infrastructure to unregister the
latter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 7d9ffe68f2 setup: don't apply "GIT_REFERENCE_BACKEND" without a repository
When discovering a repository we eventually also apply the
"GIT_REFERENCE_BACKEND" environment variable to the repository. There's
two problems with that:

  - We do this unconditionally, which is rather pointless: we really
    only have to configure the repository when we have found one.

  - We have already applied the repository format at that point in time,
    so we need to manually reapply it.

Move the logic around so that we only apply the environment variable
when a repository was discovered. This also allows us to drop the
explcit call to `repo_set_ref_storage_format()` because we now adjust
the format before we apply it via `apply_repository_format()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 93c4361c41 setup: stop applying repository format twice
When discovering the repository in "setup.c" we apply the final
repository format multiple times:

  - Once via `repository_format_configure()`, where we apply the hash
    algorithm and ref storage format to both `struct repository_format`
    and `struct repository`.

  - And once via `apply_repository_format()`, where we apply these two
    settings from `struct repository_format` to `struct repository`.

With the current flow both of these are in fact necessary. But this is
only because we call `repository_format_configure()` after we have
called `apply_repository_format()`. Consequently, if we only changed the
repository format in `repository_format_configure()` it would never
propagate to the repository.

Refactor the code so that we first configure the repository format
before applying it to the repository so that we can stop setting the
hash and reference storage format multiple times.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Patrick Steinhardt 35b6b8256c setup: inline `check_and_apply_repository_format()`
We have two callsites of `check_and_apply_repository_format()`. In a
subsequent commit we'll want to adapt one of those callsites to change
the order in which we read and apply the repository format, at which
point the helper function will not really be a good fit for us anymore.

Inline the function to both of the callsites.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-26 08:27:19 -07:00
Junio C Hamano f19edf4d01 Merge branch 'ps/setup-centralize-odb-creation' into ps/refs-onbranch-fixes
* ps/setup-centralize-odb-creation:
  setup: construct object database in `apply_repository_format()`
  repository: stop reading loose object map twice on repo init
  setup: stop initializing object database without repository
  setup: stop creating the object database in `setup_git_env()`
  repository: stop initializing the object database in `repo_set_gitdir()`
  setup: deduplicate logic to apply repository format
  setup: drop `setup_git_env()`
  t0001: plug test gaps for git-init(1) with GIT_OBJECT_DIRECTORY
2026-06-26 08:26:01 -07:00
Jiang Xin 830806694e Merge branch 'master' of github.com:mbeniamino/git-po
* 'master' of github.com:mbeniamino/git-po:
  l10n: it: fix italian usage messages alignment
2026-06-26 20:51:39 +08:00
Jiang Xin 5eb25b9605 l10n: AGENTS.md: add quotation mark preservation guidelines
Add a "Preserving Quotation Marks" section to prevent AI-assisted
translation and review from incorrectly converting language-specific
UTF-8 curly quotes (e.g., „ U+201E, " U+201C for Bulgarian) into
ASCII straight quotes " (U+0022), which would cause PO string
truncation and syntax errors.

Also update the "Special characters" item in the Quality checklist
to reference the new section.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-06-26 20:01:49 +08:00
lilydjwg 52f771b3d4 l10n: zh_CN: updated translation for 2.55
Reviewed-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Fangyi Zhou <me@fangyi.io>
Signed-off-by: lilydjwg <lilydjwg@gmail.com>
2026-06-26 17:41:11 +08:00
lilydjwg 19ab0a8afd l10n: TEAMS: change Simplified Chinese team leader
Signed-off-by: lilydjwg <lilydjwg@gmail.com>
2026-06-26 17:41:04 +08:00
Junio C Hamano 766c0a55de Sync with 'master' 2026-06-25 19:53:59 -07:00
Junio C Hamano 6c3d7b7355 Merge branch 'ps/t4216-tap-fix'
TAP output breakage fix.

* ps/t4216-tap-fix:
  t4216: fix no-op test that breaks TAP output
2026-06-25 19:49:01 -07:00