Commit Graph

81473 Commits

Author SHA1 Message Date
Junio C Hamano
91e30e3543 Merge branch 'kn/refs-fsck-skip-lock-files' into next
The consistency checks for the files reference backend have been updated
to skip lock files earlier, avoiding unnecessary parsing of
intermediate files.

* kn/refs-fsck-skip-lock-files:
  refs/files: skip lock files during consistency checks
2026-05-21 13:39:22 +09:00
Junio C Hamano
6e5bcc1fc9 Sync with 'master' 2026-05-20 10:32:52 +09:00
Junio C Hamano
f1e7ac1cbd Merge branch 'ps/t3903-cover-stash-include-untracked' into next
Test coverage has been added to "git stash --include-untracked".

* ps/t3903-cover-stash-include-untracked:
  stash: add coverage for show --include-untracked
2026-05-20 10:32:35 +09:00
Junio C Hamano
afe427dc66 Merge branch 'kk/merge-octopus-optim' into next
The logic to determine that branches in an octopus merge are
independent has been optimized.

* kk/merge-octopus-optim:
  merge: use repo_in_merge_bases for octopus up-to-date check
2026-05-20 10:32:35 +09:00
Junio C Hamano
722acf81c8 Merge branch 'en/batch-prefetch' into next
In a lazy clone, "git cherry" and "git grep" often fetch necessary
blob objects one by one from promisor remotes.  It has been corrected
to collect necessary object names and fetch them in bulk to gain
reasonable performance.

* en/batch-prefetch:
  grep: prefetch necessary blobs
  builtin/log: prefetch necessary blobs for `git cherry`
  patch-ids.h: add missing trailing parenthesis in documentation comment
  promisor-remote: document caller filtering contract
2026-05-20 10:32:35 +09:00
Junio C Hamano
725a20bf93 Merge branch 'jk/apply-leakfix' into next
Leakfix.

* jk/apply-leakfix:
  apply: plug leak on "patch too large" error
2026-05-20 10:32:34 +09:00
Junio C Hamano
e1a320d4e5 Merge branch 'jk/commit-sign-overflow-fix' into next
Leakfix.

* jk/commit-sign-overflow-fix:
  commit: handle large commit messages in utf8 verification
2026-05-20 10:32:34 +09:00
Junio C Hamano
38c9fb15c2 Merge branch 'rs/trailer-fold-optim' into next
Code simplification.

* rs/trailer-fold-optim:
  trailer: change strbuf in-place in unfold_value()
2026-05-20 10:32:34 +09:00
Junio C Hamano
fe8d31e9f9 Merge branch 'pb/doc-diff-format-updates' into next
Doc updates.

* pb/doc-diff-format-updates:
  diff-format.adoc: mode and hash are 0* for unmerged paths from index only
  diff-format.adoc: 'git diff-files' prints two lines for unmerged files
  diff-format.adoc: remove mention of diff-tree specific output
2026-05-20 10:32:34 +09:00
Junio C Hamano
1c00d2d839 The 5th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-20 10:30:58 +09:00
Junio C Hamano
f5fc0f53de Merge branch 'sb/unpack-index-pack-buffer-resize'
Use a larger buffer size in the code paths to ingest pack stream.

* sb/unpack-index-pack-buffer-resize:
  index-pack, unpack-objects: increase input buffer from 4 KiB to 128 KiB
2026-05-20 10:30:58 +09:00
Junio C Hamano
ca7d7d6424 Merge branch 'ps/history-fixup'
"git history" learned "fixup" command.

* ps/history-fixup:
  builtin/history: introduce "fixup" subcommand
  builtin/history: generalize function to commit trees
  replay: allow callers to control what happens with empty commits
2026-05-20 10:30:57 +09:00
Junio C Hamano
345bc60828 Merge branch 'jh/alias-i18n-fixes'
Further update to the i18n alias support to avoid regressions.

* jh/alias-i18n-fixes:
  alias: restore support for simple dotted aliases
2026-05-20 10:30:57 +09:00
Junio C Hamano
cf7151110d Merge branch 'bc/sign-commit-with-custom-encoding'
Signing commit with custom encoding was passing the data to be
signed at a wrong stage in the pipeline, which has been corrected.

* bc/sign-commit-with-custom-encoding:
  commit: sign commit after mutating buffer
  commit: name UTF-8 function appropriately
2026-05-20 10:30:57 +09:00
Junio C Hamano
18581f836f Merge branch 'js/adjust-tests-to-explicitly-access-bare-repo'
Some tests assume that bare repository accesses are by default
allowed; rewrite some of them to avoid the assumption, rewrite
others to explicitly set safe.bareRepository to allow them.

* js/adjust-tests-to-explicitly-access-bare-repo:
  safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGES
  status tests: filter `.gitconfig` from status output
  ls-files tests: filter `.gitconfig` from `--others` output
  t5601: restore `.gitconfig` after includeIf test
  t1305: use `--git-dir=.` for bare repo in include cycle test
  t1300: remove global config settings injected by test-lib.sh
  t7900: do not let `$HOME/.gitconfig` interfere with XDG tests
  test-lib: allow bare repository access when breaking changes are enabled
2026-05-20 10:30:57 +09:00
Junio C Hamano
3b3a3ef066 Merge branch 'en/diffstat-utf8-truncation-fix'
The computation to shorten the filenames shown in diffstat measured
width of individual UTF-8 characters to add up, but forgot to take
into account error cases (e.g., an invalid UTF-8 sequence, or a
control character).

* en/diffstat-utf8-truncation-fix:
  diff: fix out-of-bounds reads and NULL deref in diffstat UTF-8 truncation
2026-05-20 10:30:56 +09:00
Junio C Hamano
91ddfe3d5c Merge branch 'js/mingw-no-nedmalloc'
Stop using unmaintained custom allocator in Windows build which was
the last user of the code.

* js/mingw-no-nedmalloc:
  mingw: remove the vendored compat/nedmalloc/ subtree
  mingw: drop the build-system plumbing for nedmalloc
  mingw: stop using nedmalloc
2026-05-20 10:30:56 +09:00
Junio C Hamano
a6876b2068 Merge branch 'js/objects-larger-than-4gb-on-windows'
Update code paths that assumed "unsigned long" was long enough for
"size_t".

* js/objects-larger-than-4gb-on-windows:
  ci: run expensive tests on push builds to integration branches
  t5608: mark >4GB tests as EXPENSIVE
  test-tool synthesize: add precomputed SHA-256 pack for 4 GiB + 1
  test-tool synthesize: precompute pack for 4 GiB + 1
  test-tool synthesize: use the unsafe hash for speed
  t5608: add regression test for >4GB object clone
  test-tool: add a helper to synthesize large packfiles
  delta, packfile: use size_t for delta header sizes
  odb, packfile: use size_t for streaming object sizes
  git-zlib: handle data streams larger than 4GB
  index-pack, unpack-objects: use size_t for object size
2026-05-20 10:30:56 +09:00
Junio C Hamano
4f17f83d09 Sync with 'master' 2026-05-19 10:00:37 +09:00
Junio C Hamano
f17450dd1b Merge branch 'kk/limit-list-optim' into next
The limit_list() function that is one of the core part of the
revision traversal infrastructure has been optimized by replacing
its use of linear list with priority queue.

* kk/limit-list-optim:
  revision: use priority queue in limit_list()
2026-05-19 10:00:18 +09:00
Junio C Hamano
ecee155d5c Merge branch 'tb/pseudo-merge-bugfixes' into next
Fixes many bugs in pseudo-merge code.

* tb/pseudo-merge-bugfixes:
  pack-bitmap: prevent pattern leak on pseudo-merge re-assignment
  Documentation: fix broken `sampleRate` in gitpacking(7)
  pack-bitmap: reject pseudo-merge "sampleRate" of 0
  pack-bitmap: parse commits in `find_pseudo_merge_group_for_ref()`
  pack-bitmap: fix pseudo-merge lookup for shared commits
  pack-bitmap: fix inverted binary search in `pseudo_merge_at()`
  pack-bitmap-write: sort pseudo-merge commit lookup table in pack order
  t5333: demonstrate various pseudo-merge bugs
  t/helper: add 'test-tool bitmap write' subcommand
2026-05-19 10:00:18 +09:00
Junio C Hamano
7bcaabddcf The 4th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-19 09:57:46 +09:00
Junio C Hamano
bad1648bf0 Merge branch 'sj/submodule-update-clone-config-fix'
The configuration variable submodule.fetchJobs was not read correctly,
which has been corrected.

* sj/submodule-update-clone-config-fix:
  submodule-config: fix reading submodule.fetchJobs
2026-05-19 09:57:46 +09:00
Junio C Hamano
ded7b8cf55 Merge branch 'rs/sideband-clear-line-before-print'
Tweak the way how sideband messages from remote are printed while
we talk with a remote repository to avoid tickling terminal
emulator glitches.

* rs/sideband-clear-line-before-print:
  sideband: clear full line when printing remote messages
2026-05-19 09:57:46 +09:00
Junio C Hamano
1cde0a68d8 Merge branch 'ag/rebase-update-refs-limit-to-branches'
"git rebase --update-refs", when used with an rebase.instructionFormat
with "%d" (describe) in it, tried to update local branch HEAD by
mistake, which has been corrected.

* ag/rebase-update-refs-limit-to-branches:
  rebase: ignore non-branch update-refs
2026-05-19 09:57:46 +09:00
Junio C Hamano
c297fdf18c Merge branch 'kh/doc-restore-double-underscores-fix'
Doc update.

* kh/doc-restore-double-underscores-fix:
  doc: restore: remove double underscore
2026-05-19 09:57:45 +09:00
Junio C Hamano
55c4feae1c Merge branch 'kh/doc-commit-graph'
Ramifications of turning off commit-graph has been documented a bit
more clearly.

* kh/doc-commit-graph:
  doc: add caveat about turning off commit-graph
2026-05-19 09:57:44 +09:00
Junio C Hamano
056472b82d Merge branch 'kh/name-rev-custom-format'
A new builtin "git format-rev" is introduced for pretty formatting
one revision expression per line or commit object names found in
running text.

* kh/name-rev-custom-format:
  format-rev: introduce builtin for on-demand pretty formatting
  name-rev: make dedicated --annotate-stdin --name-only test
  name-rev: factor code for sharing with a new command
  name-rev: run clang-format before factoring code
  name-rev: wrap both blocks in braces
2026-05-19 09:57:44 +09:00
Junio C Hamano
6bfdc87e99 Merge branch 'sg/t6112-unwanted-tilde-expansion-fix'
Test fix.

* sg/t6112-unwanted-tilde-expansion-fix:
  t6112: avoid tilde expansion
2026-05-19 09:57:44 +09:00
Junio C Hamano
0330568152 Merge branch 'en/xdiff-cleanup-3'
Preparation of the xdiff/ codebase to work with Rust.

* en/xdiff-cleanup-3:
  xdiff/xdl_cleanup_records: make execution of action easier to follow
  xdiff/xdl_cleanup_records: make setting action easier to follow
  xdiff/xdl_cleanup_records: make limits more clear
  xdiff/xdl_cleanup_records: use unambiguous types
  xdiff: use unambiguous types in xdl_bogo_sqrt()
  xdiff/xdl_cleanup_records: delete local recs pointer
2026-05-19 09:57:44 +09:00
Junio C Hamano
60afbae98d Merge branch 'mc/http-emptyauth-negotiate-fix'
The 'http.emptyAuth=auto' configuration now correctly attempts
Negotiate authentication before falling back to manual credentials.
This allows seamless Kerberos ticket-based authentication without
requiring users to explicitly set 'http.emptyAuth=true'.

* mc/http-emptyauth-negotiate-fix:
  doc: clarify http.emptyAuth values
  t5563: add tests for http.emptyAuth with Negotiate
  http: attempt Negotiate auth in http.emptyAuth=auto mode
  http: extract http_reauth_prepare() from retry paths
2026-05-19 09:57:43 +09:00
Karthik Nayak
e0fcba2d9c refs/files: skip lock files during consistency checks
Consistency checks in the files reference backend involve two steps:

1. Iterate over all entries within the 'refs/' directory and call
`files_fsck_ref()` on each.
2. Iterate over all root refs via `for_each_root_ref()` and call
`files_fsck_ref()` on each.

`files_fsck_ref()` then runs all fsck checks defined in
`fsck_refs_fn[]`. Step 2 goes through the refs API and only sees valid
refs, but step 1 iterates the directory directly and may also encounter
intermediate '*.lock' files.

Currently, `files_fsck_refs_name()`, one of the functions in
`fsck_refs_fn[]`, filters out lock files itself. The other function,
`files_fsck_refs_content()`, has no such check and would parse the lock
file. Any new function added to `fsck_refs_fn[]` would have the same
problem.

Move the filter up into `files_fsck_refs_dir()`, where the directory
iteration happens. Since step 2 cannot produce lock files, this is the
only site where the filter is needed, and individual checks no longer
have to re-implement it.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-18 08:43:32 +09:00
Junio C Hamano
3ed373ac14 Sync with 'master' 2026-05-17 23:01:33 +09:00
Junio C Hamano
c1a51214fb Merge branch 'jk/dumb-http-alternate-fix' into next
The HTTP walker misinterpreted the alternates file that gives an
absolute path when the server URL does not have the final slash
(i.e., "https://example.com" not "https://example.com/").

* jk/dumb-http-alternate-fix:
  http: handle absolute-path alternates from server root
2026-05-17 23:01:23 +09:00
Junio C Hamano
ee684c614f Merge branch 'jk/pretty-no-strbuf-presizing' into next
Remove ineffective strbuf presizing that would have computed an
allocation that would not have fit in the available memory anyway,
or too small due to integer wraparound to cause immediate automatic
growing.

* jk/pretty-no-strbuf-presizing:
  pretty: drop strbuf pre-sizing from add_rfc2047()
2026-05-17 23:01:23 +09:00
Junio C Hamano
8553437ae1 Merge branch 'ag/sequencer-remove-unused-struct-member' into next
Code clean-up.

* ag/sequencer-remove-unused-struct-member:
  sequencer: remove todo_add_branch_context.commit
2026-05-17 23:01:22 +09:00
Junio C Hamano
d81439a049 Merge branch 'mm/diff-U-takes-no-negative-values' into next
The command line parser for "git diff" learned a few options take
only non-negative integers.

* mm/diff-U-takes-no-negative-values:
  parse-options: clarify what "negated" means for PARSE_OPT_NONEG
  xdiff: guard against negative context lengths
  diff: reject negative values for -U/--unified
  diff: reject negative values for --inter-hunk-context
2026-05-17 23:01:22 +09:00
Junio C Hamano
ddc761aec6 Merge branch 'dk/doc-exclude-is-shared-per-repo' into next
Document the fact that .git/info/exclude is shared across worktrees
linked to the same repository.

* dk/doc-exclude-is-shared-per-repo:
  ignore: note info/exclude lives in GIT_COMMON_DIR, not GIT_DIR
2026-05-17 23:01:22 +09:00
Junio C Hamano
2e39c767e5 Merge branch 'kk/paint-down-to-common-optim' into next
"git merge-base" optimization.

* kk/paint-down-to-common-optim:
  commit-reach: early exit paint_down_to_common for single merge-base
  commit-reach: introduce merge_base_flags enum
2026-05-17 23:01:22 +09:00
Junio C Hamano
68aca6b912 The 3rd batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-17 22:58:31 +09:00
Junio C Hamano
6d7492cf85 Merge branch 'rs/grep-column-only-match-fix'
"git grep" update.

* rs/grep-column-only-match-fix:
  grep: fix --column --only-match for 2nd and later matches
2026-05-17 22:58:31 +09:00
Junio C Hamano
d17a7b8191 Merge branch 'hn/git-checkout-m-with-stash'
"git checkout -m another-branch" was invented to deal with local
changes to paths that are different between the current and the new
branch, but it gave only one chance to resolve conflicts.  The command
was taught to create a stash to save the local changes.

* hn/git-checkout-m-with-stash:
  checkout -m: autostash when switching branches
  checkout: rollback lock on early returns in merge_working_tree
  sequencer: teach autostash apply to take optional conflict marker labels
  sequencer: allow create_autostash to run silently
  stash: add --label-ours, --label-theirs, --label-base for apply
2026-05-17 22:58:31 +09:00
Junio C Hamano
068c10c741 Merge branch 'pw/rename-to-get-current-worktree'
Code clean-up.

* pw/rename-to-get-current-worktree:
  worktree: rename get_worktree_from_repository()
2026-05-17 22:58:30 +09:00
Junio C Hamano
c26c58de0c Merge branch 'mf/format-patch-cover-letter-format-docfix'
Docfix.

* mf/format-patch-cover-letter-format-docfix:
  Fix docs for format.commitListFormat
2026-05-17 22:58:30 +09:00
Junio C Hamano
3cfbb7b3f7 Merge branch 'en/ort-cached-rename-with-trivial-resolution'
"ort" merge backend improvements.

* en/ort-cached-rename-with-trivial-resolution:
  merge-ort: handle cached rename & trivial resolution interaction better
2026-05-17 22:58:30 +09:00
Junio C Hamano
f7ae594a85 Merge branch 'ss/t7004-unhide-git-failures'
Test clean-up.

* ss/t7004-unhide-git-failures:
  t7004: avoid subshells to capture git exit codes
  t7004: dynamically grab expected state in tests
  t7004: drop hardcoded tag count for state verification
2026-05-17 22:58:30 +09:00
Junio C Hamano
27caa6b4f7 Merge branch 'en/backfill-fixes-and-edges'
The 'git backfill' command now rejects revision-limiting options that
are incompatible with its operation, uses standard documentation for
revision ranges, and includes blobs from boundary commits by default
to improve performance of subsequent operations.

* en/backfill-fixes-and-edges:
  backfill: default to grabbing edge blobs too
  backfill: document acceptance of revision-range in more standard manner
  backfill: reject rev-list arguments that do not make sense
2026-05-17 22:58:29 +09:00
Pushkar Singh
499f9048e0 stash: add coverage for show --include-untracked
Add a test for 'git stash show --include-untracked' to
cover the case where untracked files saved in the stash
are included in the output.

While stash creation and restoration of untracked files
are already tested, there is currently no explicit test
covering the output behavior of 'stash show
--include-untracked'.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-17 14:59:46 +09:00
Philippe Blain
6d09e798bc diff-format.adoc: mode and hash are 0* for unmerged paths from index only
In the "Raw output format" section, we mention that the 'mode' and
'sha1' for "src" and "dst" are 0* if "(creation|deletion) or unmerged".
For unmerged entries, 'mode' and 'sha1' are in fact 0* only when we are
looking at the index, i.e. on the left side for 'git diff-files' and on
the right side for 'git diff-index --cached'. Be more precise by
mentioning this, and while at it uniformize the wording of the "work
tree out of sync with the index" case.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-16 22:21:37 +09:00
Philippe Blain
4cd5d8a3c8 diff-format.adoc: 'git diff-files' prints two lines for unmerged files
Since 10637b84d9 (diff-files: -1/-2/-3 to diff against unmerged stage.,
2005-11-29), for unmerged entries 'git diff-files' print both an
"unmerged" line ('U'), as well as an "in-place edit" line ('M')
comparing stage 2 (by default) with the working tree. The "Raw output
format" documentation however mentions that all commands print a single
line per changed file. Adjust diff-format.adoc to also mention this
special case, for completeness.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-16 22:21:37 +09:00