Commit Graph
82618 Commits
Author SHA1 Message Date
Patrick Steinhardt bb1fb42520 builtin/commit-graph: drop declaration for read_replace_refs
We have an `extern int read_replace_refs`, but that variable is not used
anymore since d24eda4e03 (repository: create disable_replace_refs(),
2023-06-06). In fact, that variable has been converted into a file-local
variable, and users are expected to call `disable_replace_refs()` now.

Remove the declaration.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-28 15:31:17 -07:00
Patrick Steinhardt e66d67d49f builtin/commit-graph: rename subcommand functions
Subcommands that we wire up via `OPT_SUBCOMMAND()` are typically called
`cmd_<command>_<subcommand>()`, but we don't follow that pattern in
"builtin/commit-graph.c". Rename the functions.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-28 15:31:17 -07:00
Junio C Hamano 8d1b215c01 The 10th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-28 07:40:27 -07:00
Junio C Hamano 30e6f5e4e6 Merge branch 'sw/cache-tree-ignore-locked-index'
The internal write_index_as_tree() function has been updated to
take the index lock gently. This allows it to skip the optional
cache-tree write-back when the lock is held by another process,
preventing commands like 'git rebase' from dying due to background
tasks holding the lock.

* sw/cache-tree-ignore-locked-index:
  cache-tree: do not die when the index is locked
2026-10-28 07:40:27 -07:00
Junio C Hamano 8fe963845e Merge branch 'ss/repack-drop-filtered-dry-run'
The '--dry-run' option of 'git repack --drop-filtered' used to
actually rebuild packs and delete redundant ones, which has been
corrected to only list the candidates without making changes.

* ss/repack-drop-filtered-dry-run:
  repack: do not rebuild packs on --dry-run
2026-10-28 07:40:26 -07:00
Junio C Hamano 8814f276c0 Merge branch 'tb/rerere-wait-for-merge-rr-lock'
Instead of failing to record conflicts to be resolved immediately,
wait while "rerere gc" is ongoing.

* tb/rerere-wait-for-merge-rr-lock:
  rerere: add "gc --skip-locked" for auto maintenance
  rerere: wait for MERGE_RR.lock before giving up
2026-10-28 07:40:26 -07:00
Junio C Hamano 84733a6de4 Merge branch 'jk/test-lazy-prereq-heredoc'
The lazy prerequisite set-up script can be fed as a here-doc, just
like test_expect_{success,failure} scripts these days.

* jk/test-lazy-prereq-heredoc:
  test-lib: allow lazy prerequisite snippets as here-docs
2026-10-28 07:40:26 -07:00
Junio C Hamano 37b3475fb5 The 9th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 07:28:01 -07:00
Junio C Hamano b66626e09a Merge branch 'ps/odb-files-alternates-cleanups'
The object database "files" backend has been optimized to check
packfiles across all alternate object directories before falling
back to checking loose objects, significantly reducing the number of
'stat(3p)' system calls.  Additional refactoring drops the generic
'local' flag from the object database source interface in favor of
backend-specific fields, and simplifies the retry loop for missing
objects.

* ps/odb-files-alternates-cleanups:
  odb/source: drop `local` flag
  odb: don't try re-fetching corrupt objects
  odb: remove read loop for found objects
  odb/source-files: make the second read an implementation detail
  odb/source-files: fix performance when streaming objects with alternates
  odb/source-files: fix performance when reading objects with alternates
2026-10-26 07:28:01 -07:00
Junio C Hamano 2526487566 Merge branch 'ic/includeif-hostname'
The conditional configuration inclusion mechanism via 'includeIf'
has been extended to support matching the machine's hostname, and
the system's hostname as seen by Git can now be queried using 'git
var GIT_HOSTNAME'.

* ic/includeif-hostname:
  config: learn the "hostname:" includeIf condition
  t6500: get hostname from "git var"
  var: add GIT_HOSTNAME
2026-10-26 07:28:01 -07:00
Junio C Hamano 5cdaf2b1a7 Merge branch 'je/doc-promote-git-help'
The earliest part of 'man git' has been rewritten to explain various
ways to use 'git help' to get help.

* je/doc-promote-git-help:
  doc: use `man git` to teach users how to navigate the docs
2026-10-26 07:28:01 -07:00
Junio C Hamano 832192728c Merge branch 'ps/ci-housekeeping-and-modernizations'
Various CI jobs have been updated to use modern OS images, drop dead
code, and remove redundant jobs. Support for Python 2 in CI has been
removed, and the linux-TEST-vars job has been renamed to
linux-feature-testbed.

* ps/ci-housekeeping-and-modernizations:
  ci: improve reftable test coverage
  ci: drop now-dead Python 2 coverage
  ci: switch away from EOL'd Ubuntu version in linux-feature-testbed
  ci: rename linux-TEST-vars job
  ci: switch away from unsupported i386/ubuntu image
  ci: drop unused "linux-clang" logic
  ci: fix "fedora-breaking-changes-meson" job
  t5004: fix test creating an archive with large objects under SHA256
2026-10-26 07:28:00 -07:00
Junio C Hamano bd52c76874 Merge branch 'ak/sequencer-head-refdup'
The branch decoration logic in the sequencer has been updated to use
an allocated buffer for the HEAD reference name, preventing it from
being clobbered when evaluating branches checked out in other
worktrees.

* ak/sequencer-head-refdup:
  sequencer: don't clobber HEAD ref name in worktree lookup
2026-10-26 07:28:00 -07:00
Junio C Hamano 775dc1673e Merge branch 'mb/fast-import-reference-pending'
The 'from' command in 'git fast-import' has been updated to
correctly resolve references to newly created commits and tags by
checking the internal object table, preventing a crash when the
objects are not yet available in the object database.

* mb/fast-import-reference-pending:
  fast-import: allow 'from' to reference new commits and tags by oid
2026-10-26 07:28:00 -07:00
Junio C Hamano adbe9b43f4 Merge branch 'ps/pack-check-bigfile-threshold'
A boundary check in 'git fsck' against the big file threshold has
been corrected to prevent bogus corruption reports on packed objects
whose sizes exactly match the threshold.

* ps/pack-check-bigfile-threshold:
  pack-check: fix bogus corruption report with core.bigFileThreshold
2026-10-26 07:27:59 -07:00
Junio C Hamano a5eccd30b2 Merge branch 'ps/setup-enforce-repo-passed-to-create-repository-has-no-state'
The repository initialization sequence has been refactored to treat
the repository object passed to create_repository() purely as an
out-parameter.

* ps/setup-enforce-repo-passed-to-create-repository-has-no-state:
  setup: enforce that passed-in repo does not carry relevant state
  repository: adapt `repo_clear()` to fully reset the repository
  builtin/clone: don't apply "core.sharedRepository" to leading dirs
  builtin/init: move handling of "core.sharedRepository" into "setup.c"
  builtin/init: refactor messy creation of leading directories
  path: introduce `safe_create_leading_directories_no_share_const()`
  path: drop useless `safe_create_leading_directories_1()`
2026-10-26 07:27:59 -07:00
Junio C Hamano eab342c82b Merge branch 'rm/blame-default-ignore-revs'
'git blame' and 'git annotate' have been updated to automatically
use the '.git-blame-ignore-revs' file from the working tree (or
'HEAD:.git-blame-ignore-revs' in bare repositories) as the default
ignore list if it exists, and the parser has been hardened.

* rm/blame-default-ignore-revs:
  blame: ignore revs in .git-blame-ignore-revs by default
  blame: harden ignore-revs parser and tag peeling
2026-10-26 07:27:59 -07:00
Junio C Hamano 7e34d8174d The 8th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-22 07:23:16 -07:00
Junio C Hamano 7ac84b7267 Merge branch 'oa/delta-islands-i18n-use-q'
The progress message emitted by the 'delta-islands' subsystem has
been updated to use the Q_() macro, allowing translators to properly
handle plural forms based on the number of islands marked.

* oa/delta-islands-i18n-use-q:
  delta-islands: use Q_() for island count
2026-10-22 07:23:16 -07:00
Junio C Hamano 8f352ee2dc Merge branch 'ss/history-sign-rewrites'
The git history command and its subcommands have been updated to
honor the commit.gpgSign configuration variable and accept the
--gpg-sign and --no-gpg-sign command-line options, ensuring both
rewritten commits and their replayed descendants are
cryptographically signed by the committer.

* ss/history-sign-rewrites:
  history: sign rewritten commits
  replay: allow callers to sign commits
2026-10-22 07:23:16 -07:00
Junio C Hamano 4940351929 Merge branch 'hn/ci-leak-sanitizer-annotations'
CI on GitHub Actions gets a better annotation experience.  Leak test
scripts are stopped at their first failure with --immediate to
prevent flooding the log, and failures are correctly annotated with
their file and line number.

* hn/ci-leak-sanitizer-annotations:
  ci: point test failures and fixed known breakages at their file and line
  ci: annotate leaks and stop a leak-sanitizer script at its first failure
2026-10-22 07:23:16 -07:00
Junio C Hamano b26dc1274c Merge branch 'pw/checkout-m-conflict-labels'
When recreating a merge conflict using 'git checkout -m', the
original conflict labels (such as branch names) were lost and
replaced with generic ones.  The merge machinery has been updated to
record the original labels in '.git/MERGE_LABELS', allowing 'git
checkout -m' to restore them.

* pw/checkout-m-conflict-labels:
  merge: remember conflict labels
  checkout -m <path>: cache merge settings
  remove_branch_state: convert boolean argument to flags
2026-10-22 07:23:16 -07:00
Junio C Hamano ad72032c8d Merge branch 'bb/unicode-width-table-18'
Unicode character width table has been updated to match
Unicode 18 announced on 2026-09-16.

* bb/unicode-width-table-18:
  unicode: update the width tables to Unicode 18
2026-10-22 07:23:15 -07:00
Junio C Hamano d9c4679fa8 Merge branch 'cc/lazy-fetch-trusted-bit'
A new 'uploadpack.lazyFetchTrusted' configuration variable has been
introduced to allow 'upload-pack' to lazily fetch missing objects from
configured promisor remotes when serving trusted repositories.

* cc/lazy-fetch-trusted-bit:
  builtin/upload-pack: don't disable lazy fetching on trusted repo
  promisor-remote: prevent infinite recursion when lazy fetching
  upload-pack: read uploadpack.lazyFetchTrusted
  setup: extract path_allowlist_apply()
  promisor-remote: factor out lazy_fetch_objects()
2026-10-22 07:23:15 -07:00
Junio C Hamano 47fdf2208c The 7th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-19 12:22:54 -07:00
Junio C Hamano b4b80b4885 Merge branch 'hn/t7004-flaky-gpg-test-fix'
The test for verifying a signed tag with a missing key has been
updated to point GNUPGHOME to an unused directory rather than
deleting the active gpghome directory, working around a flaky rm
failure caused by the background gpg-agent observed on Alpine.

* hn/t7004-flaky-gpg-test-fix:
  t7004: check a missing key without deleting gpghome
2026-10-19 12:22:54 -07:00
Junio C Hamano 3bba248c2c Merge branch 'je/status-merge-specific-help'
"git status" now suggests to use 'git merge --continue', not 'git commit',
when done with conflicts during a 'git merge'.

* je/status-merge-specific-help:
  status: suggest `git merge --continue`, not `git commit`
2026-10-19 12:22:54 -07:00
Junio C Hamano 583e98cd09 Merge branch 'ps/odb-files-alternates'
The odb_source API has been refactored to make alternates an
implementation detail of the files backend instead of managing them
at the core object database layer.

* ps/odb-files-alternates:
  odb/source: drop `read_alternates` callback
  odb/source-files: move alternates into the backend
  odb/source-files: extract reading alternates
  odb/source: make `will_destroy` an implementation detail
  tmp-objdir: replace primary source at creation time
  tmp-objdir: manage quarantine as an object directory
  tmp-objdir: absorb logic to set and restore primary sources
  odb/source-files: add the ability to have multiple object dirs
  odb: refactor `odb_find_source()` to yield dirs
  odb: refactor `odb_for_each_alternate()` to yield dirs
  odb/source-files: introduce `struct odb_files_dir`
  commit-graph: stop depending on `struct odb_source`
  commit-graph: require resolved packfile paths for `stdin_packs`
2026-10-19 12:22:54 -07:00
Junio C Hamano f2b7511422 Merge branch 'kk/fetch-write-commit-graph-incremental'
The fetch.writeCommitGraph behavior has been optimized to
incrementally update the commit graph using only the newly fetched
commits as seeds.  This avoids a full reachability scan of all
references and drastically reduces the post-fetch commit-graph
update time for repositories with many references.

* kk/fetch-write-commit-graph-incremental:
  fetch: write commit-graph using updated refs only
  test-tool read-graph: add commit-info subcommand
2026-10-19 12:22:53 -07:00
Junio C Hamano fc70f528aa Merge branch 'kn/packed-refs-verbatim-write'
The routine that rewrites the packed-refs file has been optimized to
directly pass unmodified reference records verbatim to the output
via fwrite(3p), instead of redundantly re-formatting them with
fprintf(3p).

* kn/packed-refs-verbatim-write:
  packed-refs: use `fwrite()` when passing refs verbatim
2026-10-19 12:22:53 -07:00
Junio C Hamano 80502091b8 Merge branch 'ch/fetch-followremotehead-lazy-validation'
Validation of the 'fetch.followRemoteHEAD' configuration variable
has been deferred to when it is actually used, preventing irrelevant
warnings during 'git fetch' invocations that do not consult it.

* ch/fetch-followremotehead-lazy-validation:
  fetch.c: defer fetch.followRemoteHEAD validation
2026-10-19 12:22:53 -07:00
Junio C Hamano 6948b04458 Merge branch 'ps/packfile-stale-delta-base-cache-fix'
Closing a packfile did not evict the entries belonging to it from
the delta base cache, which could lead to data corruption when a
newly allocated packfile happened to reuse the same memory address.
The cache eviction logic has been updated to remove these stale
entries upon closing a pack

* ps/packfile-stale-delta-base-cache-fix:
  packfile: fix corruption due to stale delta base cache entries
  packfile: move around `close_pack()`
2026-10-19 12:22:52 -07:00
Julia Evans e2e5e9f740 doc: use man git to teach users how to navigate the docs
Rewrite `man git` to give a more realistic view of what the
documentation actually provides.

Explain how Git's help system works in `man git`
(`git push -h` gives a short help, `git push --help` is the full docs),
since it's a slightly unusual approach.

Remove the direct references to all the guides, for the following
reasons:

* gittutorial and giteveryday are unlikely to help new users learn
  Git. Currently they feel very aspirational (it would be nice to have
  a tutorial and a guide to everyday Git commands!), but we should give
  users a realistic view of what the documentation actually provides.

  The goal is to mention the tutorial again when when we have a tutorial
  we're happy with.
* gitcli is not very useful for users. A lot of it is about scripting
  and internal details about the option parser.
* the user manual is outdated. The chapter on "Sharing development with
  others" explains how to use `git format-patch` which is not how most
  Git users collaborate with git.
* mentioning the data model feels out of place once everything else is
  removed

Mention `git help` instead of `giteveryday` for now, which does a better
job of giving an overview of everyday commands.

Mention `git help --guides` and `git help --user-interfaces`,
since there are some important guides in there (like `submodules`) that
are hard to discover.

Do not mention `git help --developer-interfaces` since it's not relevant
to users.

Remove https://git.github.io/htmldocs/git.html since it points to the
`master` version of the documentation. https://git-scm.com/ has the
version from the latest release which is more likely to be useful.

Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-16 13:52:04 -07:00
Siddharth Shrimali facedc705c repack: do not rebuild packs on --dry-run
"git repack --drop-filtered --dry-run" is documented to list the
objects that would be dropped "without rebuilding any pack or
deleting anything", but it does both.

This is a bug in cmd_repack(): after printing the candidates, the
--dry-run block falls through into the regular repack code.
repack_promisor_objects() writes a new promisor pack, and with -d,
existing_packs_remove_redundant() deletes the old packs.

The existing guard only skips the implied "delete_redundant = 1", so
it does not stop an explicit -d, and it does not stop the new pack
from being written either.

This has been broken since --dry-run was introduced in 1e746b00aa
(builtin/repack: add --drop-filtered and --dry-run options). The
--dry-run block never returned early, so a dry run has always gone
on to do a regular repack. It was not broken by a later change.

Fix it by returning right after the candidates are listed, and add a
test that checks the pack directory is unchanged with and without -d.

A dry run can no longer get past that point, so the two "!dry_run"
checks that tried to keep it from deleting or dropping anything are
now redundant.

Reported-by: Coy Geek <coygeek@gmail.com>
Helped-by: D. Ben Knoble <ben.knoble@gmail.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-16 13:41:51 -07:00
Szymon Wilczek 440b7035bb cache-tree: do not die when the index is locked
When a background process such as `git status` holds `index.lock` while
`git rebase` picks a commit, the rebase can die in the middle of the
pick and leave the sequencer in a state from which `git rebase
--continue` refuses to run:

    error: you have staged changes in your working tree

This happens because `try_to_commit()` calls `write_index_as_tree()`
right after the pick has updated the index and written
`CHERRY_PICK_HEAD`, and `write_index_as_tree()` dies when it cannot
take the index lock. We then die before writing `rebase-merge/message`.
Since 356ee4659b (sequencer: try to commit without forking 'git commit',
2017-11-24), this call happens in-process. Before that commit the
`die()` happened in a `git commit` child process, and the sequencer
stopped cleanly with its state saved.

`write_index_as_tree()` does two different things:

  - It turns the index into a tree object. This part must succeed.

  - When that succeeds, it also rewrites the index to populate the
    cache-tree extension. This part is allowed to fail without
    impacting the result; as the comment next to
    `write_locked_index()` already notes, failing to write the index
    here is fine.

Yet the function locks the index with `LOCK_DIE_ON_ERROR`, even though
we only need the lock for the optional second part.

Drop `LOCK_DIE_ON_ERROR` so that we take the lock gently, just like
other callers that only refresh the index, and skip writing the index
when the lock is held by someone else. This also lets `git write-tree`
and `git am` proceed while another process holds the lock.

Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-16 09:39:02 -07:00
Junio C Hamano c51408889c The 6th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-16 07:47:19 -07:00
Junio C Hamano a3059f04e3 Merge branch 'dk/fix-shattered-io-link'
Replace a link to a site that disappeared with a link to web archive
of the last known good copy.

* dk/fix-shattered-io-link:
  doc: fix shattered.io link
2026-10-16 07:47:19 -07:00
Junio C Hamano 02c88ed90a Merge branch 'ma/t0450-use-test-path-is-file'
A test script (t0450) has been updated to use the test_path_is_file
and test_path_is_missing helper functions, which provides better
diagnostic output on failure.

* ma/t0450-use-test-path-is-file:
  t0450: use test_path_is_file and test_path_is_missing
2026-10-16 07:47:19 -07:00
Junio C Hamano 3fb69375f1 Merge branch 'je/doc-section-7-synopsis'
The requirement for a 'SYNOPSIS' section in section 7 manual pages
has been relaxed by updating the linter script, and dummy
'SYNOPSIS' sections from existing section 7 documentation have been
removed to improve the rendered output

* je/doc-section-7-synopsis:
  doc: don't require a SYNOPSIS in section 7
2026-10-16 07:47:18 -07:00
Junio C Hamano cc6a26fab5 Merge branch 'jk/t5551-test-shell-quote-fix'
The shell quoting of a lazy prereq script was quoted incorrectly and
allowed variables dereferenced at the wrong moment, breaking the
curl version detection.

* jk/t5551-test-shell-quote-fix:
  t5551: fix quoting in curl version bug prereq
2026-10-16 07:47:18 -07:00
Junio C Hamano d8d02ce25f Merge branch 'tz/doc-override-less-env'
The documentation for core.pager has been updated to provide
examples of overriding the LESS environment variable for custom
pagers by prefixing the pager command in the configuration.

* tz/doc-override-less-env:
  doc: add more examples of overriding LESS in core.pager
2026-10-16 07:47:18 -07:00
Junio C Hamano 2341e1d74c Merge branch 'gm/filter-branch-state-map-fix'
The commit map populated from the state branch in 'git
filter-branch' has been corrected to parse the map using the
original-to-rewritten order.

* gm/filter-branch-state-map-fix:
  filter-branch: fix commit map init from state branch
2026-10-16 07:47:18 -07:00
Junio C Hamano f57c9a7388 The 5th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-15 07:44:31 -07:00
Junio C Hamano c2593bc14c Merge branch 'pw/stash-all-parseopt-fix'
Fix definition for the "--all" option to use symbolic constant
in the options[] array passed to parse_options API.

* pw/stash-all-parseopt-fix:
  stash: use named constant when parsing "--all"
2026-10-15 07:44:31 -07:00
Junio C Hamano a116545aad Merge branch 'kh/format-patch-range-diff-notes'
The 'format-patch' command has been updated with options to
configure notes specifically for range-diff output, allowing them to
differ from the notes displayed on the patches themselves.

* kh/format-patch-range-diff-notes:
  format-patch: learn --[no-]range-diff-notes
  format-patch: simplify get_notes_arg parameters
2026-10-15 07:44:31 -07:00
Junio C Hamano 0bde462668 Merge branch 'kh/doc-trailers-cmd-examples'
The documentation for 'git interpret-trailers' has been updated to
fix the grammatical errors in the descriptions of command examples.

* kh/doc-trailers-cmd-examples:
  doc: interpret-trailers: fix cmd examples
2026-10-15 07:44:31 -07:00
Junio C Hamano e37840933f Merge branch 'mg/doc-remote-set-head'
The documentation for 'git remote set-head' has been updated to
clarify that it only modifies the local repository's remote-tracking
symbolic reference, and does not alter the target remote
repository's own 'HEAD'.

* mg/doc-remote-set-head:
  doc: remote: say that it only affects the local repository
2026-10-15 07:44:31 -07:00
Junio C Hamano 605bb24465 Merge branch 'kz/doc-user-manual-typo'
A grammatically incorrect capitalization in user-manual.adoc has
been corrected.

* kz/doc-user-manual-typo:
  doc: fix typo in user manual
2026-10-15 07:44:30 -07:00
Junio C Hamano 4e399f027c Merge branch 'ps/parse-options-subcommand-groups'
The parse-options API has been updated to support grouping
subcommands, and the 'git refs' command has been updated to use this
new feature to categorize its subcommands in its help output.

* ps/parse-options-subcommand-groups:
  builtin/refs: introduce subcommand groups
  parse-options: allow grouping subcommands
  parse-options: extract functions to print single option
  parse-options: fix completion format when first option is skipped
2026-10-15 07:44:30 -07:00
Junio C Hamano 07cc531ed3 Merge branch 'hn/object-name-push-short'
The @{upstream} notation had short-hand @{u} from the beginning,
and @{push} learned corresponding @{p} to match.

* hn/object-name-push-short:
  object-name: accept @{p} as short for @{push}
2026-10-15 07:44:30 -07:00