Commit Graph
82708 Commits
Author SHA1 Message Date
Junio C Hamano 742810498e Merge branch 'tk/t7104-test-path-is-file'
A test script 't7104' has been modernized to use 'test_path_is_file'
instead of 'test -f'.

* tk/t7104-test-path-is-file:
  t7104: use test_path_is_file instead of test -f
2026-11-04 11:04:28 -08:00
Junio C Hamano 95a149082f Merge branch 'pw/allow-compound-literals'
The coding guidelines have been updated to officially allow the use
of C99 compound literals, as the test balloon has been flying
without issues since late 2024.

* pw/allow-compound-literals:
  CodingGuidelines: allow compound literals
2026-11-04 11:04:28 -08:00
Junio C Hamano a9d6fefd36 Merge branch 'kf/archive-zip-msg-i18n'
The error message given when pathname is too long has been updated
to use the pluralized translation function, Q_().

* kf/archive-zip-msg-i18n:
  archive-zip: refactor 'path too long' error message to use Q_()
2026-11-04 11:04:28 -08:00
Junio C Hamano 78ec482541 Merge branch 'tb/ci-pin-actions'
The CI workflow has been updated to pin GitHub Actions to their full
commit IDs rather than version tags, which secures the CI
environment against potential supply-chain attacks.

* tb/ci-pin-actions:
  ci: pin actions in the main workflow to full commit IDs
2026-11-04 11:04:28 -08:00
Junio C Hamano 912b02d8a5 Merge branch 'oa/diffcore-break-remove-use-the-repository-variable'
The unused 'USE_THE_REPOSITORY_VARIABLE' macro has been removed from
'diffcore-break.c'.

* oa/diffcore-break-remove-use-the-repository-variable:
  diffcore-break: remove USE_THE_REPOSITORY_VARIABLE
2026-11-04 11:04:28 -08:00
Junio C Hamano 85af3f431f Merge branch 'ks/unit-tests-ignore-long-tests'
The 'unit-test' runner has been taught to safely ignore the
'--long-tests' ('-l') option, preventing it from failing when the
same compatibility arguments are passed to both unit and
integration tests.  The list of ignored arguments has also been
sorted.

* ks/unit-tests-ignore-long-tests:
  unit-tests: ignore --long-tests
  unit-tests: reshuffle NOOP arguments to maintain order
2026-11-04 11:04:27 -08:00
Junio C Hamano c72855d7ab Merge branch 'je/doc-merge-conflicts'
A new user manual page on how to resolve merge conflicts has been
introduced, and other commands that could encounter conflicts have
been updated to link to it.

* je/doc-merge-conflicts:
  doc: git-pull: link to new merge conflicts guide
  doc: git-cherry-pick: link to new merge conflicts guide
  doc: git-revert: link to new merge conflicts guide
  doc: git-rebase: link to new merge conflicts guide
  doc: git-merge: link to new merge conflicts guide
  doc: add new gitmergeconflicts man page
2026-11-04 11:04:27 -08:00
Junio C Hamano 07fac492ad Merge branch 'tb/t1450-use-mv-f'
A test in 't1450-fsck.sh' failed on older macOS when overwriting a
read-only loose object, which has been corrected by using 'mv -f'.

* tb/t1450-use-mv-f:
  t1450: use 'mv -f' when overwriting a read-only file
2026-11-04 11:04:27 -08:00
Junio C Hamano 239bd52d17 Merge branch 'oa/diffcore-rename-no-the-repository'
The global state 'the_repository' in 'diffcore-rename.c' has been
removed by utilizing the repository pointer available within the
'diff_options' context structure.

* oa/diffcore-rename-no-the-repository:
  diffcore-rename: stop using the_repository
2026-11-04 11:04:27 -08:00
Junio C Hamano ac49b3abc8 Merge branch 'lb/reflog-expire-dry-run-fix'
The --dry-run option of git reflog expire has been corrected to
report "would prune" instead of "prune" when refs are named on the
command line, bringing it in line with the behavior of the --all
option.

* lb/reflog-expire-dry-run-fix:
  builtin/reflog: say "would prune" for named refs with --dry-run
2026-11-04 11:04:27 -08:00
Junio C Hamano 2ef78ae7ef Merge branch 'dk/stash-completion-updates'
The command-line completion for 'git stash' has been updated to
dynamically discover subcommands and to correct a Zsh-specific
formatting issue where stash references were improperly unquoted.
Additionally, the deprecated 'save' subcommand has been removed from
completions and synopsis documentation.

* dk/stash-completion-updates:
  completion: drop "stash save" completion altogether
  doc: drop usage mentions of "git stash save"
  completion: fix Zsh handling of stash names
  Completion: extract common stash listing code
  completion: simplify stash subcommand completion
2026-11-04 11:04:26 -08:00
Junio C Hamano 750f5de7df The 14th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-11-03 07:32:37 -08:00
Junio C Hamano e1bb515788 Merge branch 'ss/t0081-test-path-is-file'
The test script 't0081-find-pack.sh' has been updated to use the
'test_path_is_file' helper instead of the raw 'test -f' command.

* ss/t0081-test-path-is-file:
  t0081: modernize the code testing whether a file exists
2026-11-03 07:32:37 -08:00
Junio C Hamano 90be13890e Merge branch 'jc/advice-config-set-global'
The advice subsystem has been updated to suggest using the
'--global' option when recommending a command snippet to squelch
future advice messages, since global configuration is generally
more appropriate for user-level preferences than per-repository
settings.

* jc/advice-config-set-global:
  advice: give cut-and-pasteable advice to squelch
2026-11-03 07:32:37 -08:00
Junio C Hamano a70100e9db Merge branch 'jc/myfirstcontribution-discuss-then-reroll'
The documentation on contributing has been updated to emphasize the
importance of discussing review feedback before sending the next
iteration, and the section on sending an updated version has been
moved to appear after the discussion of the review process.

* jc/myfirstcontribution-discuss-then-reroll:
  MyFirstContribution: clarify that "reviewing" is a discussion
  MyFirstContribution: move "how to send v2" after discussing reviews
2026-11-03 07:32:37 -08:00
Junio C Hamano ebdc087dc9 The 13th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-11-01 09:25:24 -08:00
Junio C Hamano b1bf38c452 Merge branch 'ps/rerere-remove-global-state'
The 'rerere' subsystem has been libified to remove its dependency on
the global 'the_repository' state and global tracking variables,
allowing it to operate correctly in multi-repository contexts.

* ps/rerere-remove-global-state:
  rerere: get rid of global rerere cache state
  rerere: bundle global state into a struct
  rerere: stop using `the_repository`
  rerere: cache result of `is_rerere_enabled()`
  rerere: remove redundant calls to `repo_config()`
  rerere: stop using `the_repository` in internal helpers
  rerere: stop using `the_repository` in `rerere_path()`
2026-11-01 09:25:24 -08:00
Junio C Hamano aa139fdc67 Merge branch 'tb/hook-enabled-covers-traditional-hooks'
The hook.<event>.enabled configuration variable has been extended to
also disable traditional hookdir hooks in addition to configured
hooks.  In addition, the hook configuration parser has been updated
to treat missing values for boolean variables like enabled and
parallel as true.

* tb/hook-enabled-covers-traditional-hooks:
  hook: accept .enabled and .parallel given without a value
  hook: make hook.<event>.enabled cover the hookdir hook
2026-11-01 09:25:23 -08:00
Junio C Hamano 73b37f8d8f Merge branch 'ti/checkout-track-failure'
The 'git switch' and 'git checkout' commands have been updated to
complete the branch switch instead of aborting when the tracking
configuration fails to write, matching the behavior of 'git push -u'.

* ti/checkout-track-failure:
  checkout: finish switching when the tracking config cannot be written
  branch: return an error from setup_tracking()
2026-11-01 09:25:23 -08:00
Junio C Hamano d6370f765e Merge branch 'ti/branch-set-upstream-hint-fix'
The hint printed when tracking configuration fails to be written has
been corrected to produce a valid remote-tracking branch name.

* ti/branch-set-upstream-hint-fix:
  branch: strip refs/heads/ from the --set-upstream-to hint
2026-11-01 09:25:23 -08:00
Junio C Hamano a04194e134 Merge branch 'tj/checkout-orphan-more-plural'
The messages 'git checkout' prints to describe orphaned commits and
multiple references have been updated to use the Q_() macro, allowing
translators to use the correct plural forms for numbers greater than
one.

* tj/checkout-orphan-more-plural:
  checkout: use Q_() for messages with counts
2026-11-01 09:25:23 -08:00
Junio C Hamano 96eb94a122 Merge branch 'ag/fsck-connectivity-msg-i18n'
The verbose "Checking connectivity" message in 'git fsck' has been
updated to use the pluralizing translation macro.

* ag/fsck-connectivity-msg-i18n:
  fsck: use Q_() for the verbose connectivity message
2026-11-01 09:25:23 -08:00
Junio C Hamano 22b2310194 Merge branch 'kk/connectivity-check-incremental'
The connectivity check in 'git fetch' and 'git receive-pack' has
been optimized with an alternative incremental mode, available via
'transfer.connectivityCheck=incremental'.  Instead of walking the
full object closure of the boundary commits, it compares the trees
of incoming commits against their trusted parent trees, skipping
unchanged subtrees.

* kk/connectivity-check-incremental:
  connected: add "auto" connectivity check mode
  connected: add incremental connectivity check via rev-list
  connected: add transfer.connectivityCheck config
  connected: drop dependency on `the_repository`
  p5413: add perf tests for connectivity check
  Documentation: describe connectivity checking
2026-11-01 09:25:22 -08:00
Junio C Hamano cc3b09a046 Merge branch 'jt/odb-keep-lockfile-fix'
The creation of '.keep' lockfiles during object database
transactions has been deferred to commit time, explicitly managing
the lockfiles within the files backend rather than relying on
'git-index-pack', to prevent race conditions that could lead to
concurrent lockfiles being erroneously deleted.

* jt/odb-keep-lockfile-fix:
  object-file: write ".keep" lockfiles during transaction commit
  object-file: explicitly write ".keep" lockfile
  pack-write: lift and expose index-pack report parsing
  pack-write: make index-pack output comment hash agnostic
2026-11-01 09:25:22 -08:00
Junio C Hamano 50fe5cc63f The 12th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-30 13:53:20 -07:00
Junio C Hamano 84bea4324a Merge branch 'cu/t2104-avoid-pipes'
A test script ('t2104') has been updated to avoid piping the output of
a 'git' command into another command, which would hide its exit code.

* cu/t2104-avoid-pipes:
  t2104: avoid suppressing git's exit code
2026-10-30 13:53:20 -07:00
Junio C Hamano cb9cccc843 Merge branch 'ak/cargo-pin-target-dir'
The Makefile has been updated to explicitly pass '--target-dir
target' to 'cargo' when building the 'gitcore' library, fixing a
link error that occurs when the user has a custom target directory
configured via 'CARGO_TARGET_DIR' or their Cargo configuration.

* ak/cargo-pin-target-dir:
  Makefile: pin cargo --target-dir to ./target
2026-10-30 13:53:20 -07:00
Junio C Hamano c5eda93f27 Merge branch 'rk/t5301-use-test-path-helpers'
The test in 't5301' has been modernized to use the
'test_path_is_file' helper instead of the raw 'test -f' command.

* rk/t5301-use-test-path-helpers:
  t5301: use test_path_is_file instead of test -f
2026-10-30 13:53:19 -07:00
Junio C Hamano af456b19ba Merge branch 'ak/refs-files-root-refs-cache'
The loose refs cache in the files backend has been updated to avoid
caching root refs (like 'HEAD'), preventing them from being omitted
from subsequent iterators that explicitly request them when a
previous iterator populated the cache without them.

* ak/refs-files-root-refs-cache:
  refs/files: keep root refs out of loose ref cache
2026-10-30 13:53:19 -07:00
Junio C Hamano 7d55df7790 Merge branch 'jc/ci-update-macos-15'
The macOS CI jobs have been updated to use a mixture of 'macos-15' and
'macos-latest' images, as the 'macos-14' hosted runner image is being
deprecated by GitHub.

* jc/ci-update-macos-15:
  github-ci: update macos jobs from macos-14
2026-10-30 13:53:19 -07:00
Junio C Hamano b9e5cff180 The 11th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-29 07:18:00 -07:00
Junio C Hamano dd2e9fb957 Merge branch 'rs/archive-zip-omit-out-of-range-mtime'
The ZIP archive creation code has been updated to omit the 'UT'
extended timestamp extra field when the commit time exceeds the
32-bit positive signed integer limit, avoiding integer wraparound
for dates past the year 2038.

* rs/archive-zip-omit-out-of-range-mtime:
  archive-zip: omit UT extra field if mtime is out of range
2026-10-29 07:18:00 -07:00
Junio C Hamano 21e0d223ed Merge branch 'of/config-buf-fgetc-unsigned'
The internal config file parser has been updated to treat the
content read from a blob as a sequence of unsigned bytes, preventing
bytes with the high bit set from being mistakenly interpreted as
'EOF'.

* of/config-buf-fgetc-unsigned:
  config: read the bytes of a blob as unsigned characters
2026-10-29 07:18:00 -07:00
Junio C Hamano 3a5cd30544 Merge branch 'of/bundle-uninitialized-memory-fix'
The 'git bundle create' command has been updated to initialize the
revs_copy structure at declaration. This prevents a potential crash
caused by reading uninitialized stack memory during cleanup when an
unrecognized argument is provided.

* of/bundle-uninitialized-memory-fix:
  bundle: do not free uninitialized memory on bad arguments
2026-10-29 07:18:00 -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
Tilak Kumar 2c78e78878 t7104: use test_path_is_file instead of test -f
Use the helper so that a missing file is reported
with a clear message instead of a silent failure.

Signed-off-by: Tilak Kumar <raaztilak07@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 14:14:26 -07:00
Phillip Wood c06637ba1f CodingGuidelines: allow compound literals
Our coding guidelines say that we'll allow compound literals from
mid 2026 if no problems are reported in relation to the test balloon
added in 01e49941d6 (reftable/system: provide thin wrapper for tempfile
subsystem, 2024-11-18). As no such reports have been received, update
the guidelines to allow this construct.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 14:07:34 -07:00
Keryle Fondji 652e0c0dba archive-zip: refactor 'path too long' error message to use Q_()
Replace _() with Q_() in the 'path too long' error message. Although
pathlen is always greater than 0xffff when this error is hit, Q_() is
required to support correct translation for languages that require
different plural forms depending on the count.

Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 13:24:46 -07:00
Taylor Blau 10df2126aa ci: pin actions in the main workflow to full commit IDs
Our main CI workflow refers to actions by version tags. These tags can
move, changing the action code we run without any change to our
repository. If an attacker gains access to an action's repository,
they can move an existing tag to a malicious revision and have our
workflow pick it up automatically.

Pin these actions to full commit IDs so that moving a tag cannot
substitute a different action revision. Updating the actions will
require an explicit change to our workflow, including when picking up
bug fixes and security fixes within a major version.

Retain the version names in comments to keep the references readable
and make future updates easier to review.

Signed-off-by: Taylor Blau <ttaylorr@openai.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 11:21:24 -07:00
Okhuomon Ajayi 4e59483d59 diffcore-break: remove USE_THE_REPOSITORY_VARIABLE
Since 84325f0730 (merge,diff: remove the_repository check before
prefetching blobs, 2026-02-21), diffcore-break.c no longer references
the_repository, so it does not need USE_THE_REPOSITORY_VARIABLE.

Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 10:59:11 -07:00
Julia Evans 2013cf5c14 doc: git-pull: link to new merge conflicts guide
Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 09:48:16 -07:00
Julia Evans 3a5d4c4cb1 doc: git-cherry-pick: link to new merge conflicts guide
Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 09:48:16 -07:00
Julia Evans 16977d08a5 doc: git-revert: link to new merge conflicts guide
Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 09:48:16 -07:00
Julia Evans e860d3646d doc: git-rebase: link to new merge conflicts guide
Remove some of the detail about how to handle a merge conflict, since
it's explained in detail in the new guide, and there probably isn't
enough detail anyway.

Leave the steps since rebase is special and has a `--skip` option which
the other commands which cause merge conflicts don't have.

Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 09:48:16 -07:00
Julia Evans eafa40b2be doc: git-merge: link to new merge conflicts guide
All of the info about merge conflicts has been moved to the new guide

Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 09:48:16 -07:00
Julia EvansandMarie Claire LeBlanc Flanagan 807229bc5c doc: add new gitmergeconflicts man page
Introduce a new page, `gitmergeconflicts`, that explains the process of
handling a merge conflict in a way that addresses the following issues,
which came from feedback from Git users on the current explanation of
merge conflicts in the `git merge` man page:

- The process for resolving a merge conflict is only explained in the
  `git merge` man page, even though there are several other commands
  which can result in conflicts.
- Sometimes we use "ours" and "theirs" to refer to the two sides of
  the merge conflicts and sometimes we use HEAD and MERGE_HEAD. It should
  be consistent. Also the terms "ours" and "theirs" are not explained.
  Similarly, it says "The part before the `=======` is typically your
  side...", but doesn't explain what "typically" means.
- It introduces the merge format using an analogy to RCS, which very few
  Git users have ever used.
- In "The only clean-ups you need are to reset the index file to the
  `HEAD` commit to reverse 2. and to clean up working tree changes made
  by 2. and 3.", it's not clear to users what "2" and "3" are supposed
  to mean.
- It uses a cultural reference ("Conflict resolution is hard; let's go
  shopping.") which is confusing or unfamiliar to some people. I think it
  would be clearer for users to use a code example instead.
- It doesn't explain the difference between diff3 and zdiff3.
- It sometimes uses the term "area" and sometimes uses the term "hunk".

Also document the unified `--abort`, `--continue` workflow in one
place, since it's a really nice example of a place Git has a consistent
interface between similar commands.

Only discuss merge, rebase, cherry-pick, and revert for now even though
there are other ways that merge conflicts can happen to avoid getting
into the difference between applying a patch and doing a 3-way merge.

Co-Authored-By: Marie Claire LeBlanc Flanagan <hello@marieflanagan.com>
Helped-by: D. Ben Knoble <ben.knoble@gmail.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Marie Claire LeBlanc Flanagan <hello@marieflanagan.com>
Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-26 09:48:16 -07:00