Commit Graph

80952 Commits

Author SHA1 Message Date
Junio C Hamano
91e22a74dc Sync with Git 2.54-rc0 2026-04-01 21:36:52 -07:00
Junio C Hamano
df61eac37b Merge branch 'ps/receive-pack-updateinstead-in-worktree' into next
The check in "receive-pack" to prevent a checked out branch from
getting updated via updateInstead mechanism has been corrected.

* ps/receive-pack-updateinstead-in-worktree:
  receive-pack: use worktree HEAD for updateInstead
  t5516: clean up cloned and new-wt in denyCurrentBranch and worktrees test
  t5516: test updateInstead with worktree and unborn bare HEAD
2026-04-01 21:36:33 -07:00
Junio C Hamano
bec92be5e9 Merge branch 'jt/fast-import-signed-modes' into next
Handling of signed commits and tags in fast-import has been made more
configurable.

* jt/fast-import-signed-modes:
  fast-import: add 'abort-if-invalid' mode to '--signed-tags=<mode>'
  fast-import: add 'sign-if-invalid' mode to '--signed-tags=<mode>'
  fast-import: add 'strip-if-invalid' mode to '--signed-tags=<mode>'
  fast-import: add 'abort-if-invalid' mode to '--signed-commits=<mode>'
  fast-export: check for unsupported signing modes earlier
2026-04-01 21:36:32 -07:00
Junio C Hamano
724e6526dc Merge branch 'mm/line-log-use-standard-diff-output' into next
The way the "git log -L<range>:<file>" feature is bolted onto the
log/diff machinery is being reworked a bit to make the feature
compatible with more diff options, like -S/G.

* mm/line-log-use-standard-diff-output:
  doc: note that -L supports patch formatting and pickaxe options
  t4211: add tests for -L with standard diff options
  line-log: route -L output through the standard diff pipeline
  line-log: fix crash when combined with pickaxe options
2026-04-01 21:36:32 -07:00
Junio C Hamano
256554692d Git 2.54-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-04-01 21:31:08 -07:00
Todd Zullinger
6cc95979c6 RelNotes: minor typo fixes in 2.54.0 draft
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-04-01 21:15:26 -07:00
Junio C Hamano
189a785ab5 Sync with 'master' 2026-04-01 10:34:50 -07:00
Junio C Hamano
b9edaddcff Merge branch 'sp/add-patch-with-fewer-the-repository' into next
Reduce dependency on `the_repository` in add-patch.c file.

* sp/add-patch-with-fewer-the-repository:
  add-patch: use repository instance from add_i_state instead of the_repository
2026-04-01 10:34:33 -07:00
Junio C Hamano
6ab7607f2d Merge branch 'ps/fsck-wo-the-repository' into next
Internals of "git fsck" have been refactored to not depend on the
global `the_repository` variable.

* ps/fsck-wo-the-repository:
  builtin/fsck: stop using `the_repository` in error reporting
  builtin/fsck: stop using `the_repository` when marking objects
  builtin/fsck: stop using `the_repository` when checking packed objects
  builtin/fsck: stop using `the_repository` with loose objects
  builtin/fsck: stop using `the_repository` when checking reflogs
  builtin/fsck: stop using `the_repository` when checking refs
  builtin/fsck: stop using `the_repository` when snapshotting refs
  builtin/fsck: fix trivial dependence on `the_repository`
  fsck: drop USE_THE_REPOSITORY
  fsck: store repository in fsck options
  fsck: initialize fsck options via a function
  fetch-pack: move fsck options into function scope
2026-04-01 10:34:32 -07:00
Junio C Hamano
ddcff8b9c6 Merge branch 'yc/path-walk-fix-error-reporting' into next
The value of a wrong pointer variable was referenced in an error
message that reported that it shouldn't be NULL.

* yc/path-walk-fix-error-reporting:
  path-walk: fix NULL pointer dereference in error message
2026-04-01 10:34:32 -07:00
Junio C Hamano
10a4d95236 Merge branch 'jc/whitespace-incomplete-line' into next
Fix whitespace correction for new-style empty context lines.

* jc/whitespace-incomplete-line:
  apply: fix new-style empty context line triggering incomplete-line check
2026-04-01 10:34:32 -07:00
Junio C Hamano
c502054354 Merge branch 'ps/commit-graph-overflow-fix' into next
Fix a regression in writing the commit-graph where commits with dates
exceeding 34 bits (beyond year 2514) could cause an underflow and
crash Git during the generation data overflow chunk writing.

* ps/commit-graph-overflow-fix:
  commit-graph: fix writing generations with dates exceeding 34 bits
2026-04-01 10:34:31 -07:00
Junio C Hamano
7047e45a6d Merge branch 'jd/read-cache-trace-wo-the-repository' into next
A handful of inappropriate uses of the_repository have been
rewritten to use the right repository structure instance in the
read-cache.c codepath.

* jd/read-cache-trace-wo-the-repository:
  read-cache: use istate->repo for trace2 logging
2026-04-01 10:34:31 -07:00
Junio C Hamano
cf2139f8e1 The 24th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-04-01 10:28:20 -07:00
Junio C Hamano
949f59e963 Merge branch 'kj/refspec-parsing-outside-repository'
"git ls-remote '+refs/tags/*:refs/tags/*' https://..." run outside a
repository would dereference a NULL while trying to see if the given
refspec is a single-object refspec, which has been corrected.

* kj/refspec-parsing-outside-repository:
  refspec: fix typo in comment
  remote-curl: fall back to default hash outside repo
2026-04-01 10:28:19 -07:00
Junio C Hamano
93841d029e Merge branch 'jk/t0061-bat-test-update'
A test to run a .bat file with whitespaces in the name with arguments
with whitespaces in them was flaky in that sometimes it got killed
before it produced expected side effects, which has been rewritten to
make it more robust.

* jk/t0061-bat-test-update:
  t0061: simplify .bat test
2026-04-01 10:28:19 -07:00
Junio C Hamano
9d498801a7 Merge branch 'mk/repo-help-strings'
"git repo info -h" and "git repo structure -h" limit their help output
to the part that is specific to the subcommand.

* mk/repo-help-strings:
  repo: show subcommand-specific help text
  repo: factor repo usage strings into shared macros
2026-04-01 10:28:19 -07:00
Junio C Hamano
0f85c4c100 Merge branch 'jc/macos-homebrew-wo-reg-enhanced'
In case homebrew breaks REG_ENHANCED again, leave a in-code comment
to suggest use of our replacement regex as a workaround.

* jc/macos-homebrew-wo-reg-enhanced:
  regexp: leave a pointer to resurrect workaround for Homebrew
2026-04-01 10:28:19 -07:00
Junio C Hamano
51a74900aa Merge branch 'rs/use-strvec-pushv'
Code paths that loop over another array to push each element into a
strvec have been rewritten to use strvec_pushv() instead.

* rs/use-strvec-pushv:
  use strvec_pushv() to add another strvec
2026-04-01 10:28:19 -07:00
Junio C Hamano
11f494d5b2 Merge branch 'bk/t5315-test-path-is-helpers'
Test clean-up.

* bk/t5315-test-path-is-helpers:
  t5315: use test_path_is_file for loose-object check
2026-04-01 10:28:18 -07:00
Junio C Hamano
8744cef324 Merge branch 'jk/diff-highlight-more'
Various updates to contrib/diff-highlight, including documentation
updates, test improvements, and color configuration handling.

* jk/diff-highlight-more:
  diff-highlight: fetch all config with one process
  diff-highlight: allow module callers to pass in color config
  diff-highlight: test color config
  diff-highlight: use test_decode_color in tests
  t: add matching negative attributes to test_decode_color
  diff-highlight: check diff-highlight exit status in tests
  diff-highlight: drop perl version dependency back to 5.8
  diff-highlight: mention build instructions
2026-04-01 10:28:18 -07:00
Junio C Hamano
0a39ec283c Merge branch 'vp/http-rate-limit-retries'
The HTTP transport learned to react to "429 Too Many Requests".

* vp/http-rate-limit-retries:
  http: add support for HTTP 429 rate limit retries
  strbuf_attach: fix call sites to pass correct alloc
  strbuf: pass correct alloc to strbuf_attach() in strbuf_reencode()
2026-04-01 10:28:18 -07:00
Junio C Hamano
c813b9b814 Merge branch 'jk/c23-const-preserving-fixes' into next
Adjust the codebase for C23 that changes functions like strchr()
that discarded constness when they return a pointer into a const
string to preserve constness.

* jk/c23-const-preserving-fixes:
  config: store allocated string in non-const pointer
  rev-parse: avoid writing to const string for parent marks
  revision: avoid writing to const string for parent marks
  rev-parse: simplify dotdot parsing
  revision: make handle_dotdot() interface less confusing
2026-03-31 13:00:56 -07:00
Junio C Hamano
fb77f8ba9e Merge branch 'aa/reap-transport-child-processes' into next
A few code paths that spawned child processes for network
connection weren't wait(2)ing for their children and letting "init"
reap them instead; they have been tightened.

* aa/reap-transport-child-processes:
  transport-helper, connect: use clean_on_exit to reap children on abnormal exit
2026-03-31 13:00:56 -07:00
Junio C Hamano
66ece1b5d6 Merge branch 'qb/doc-git-stash-push-optionality' into next
Doc update.

* qb/doc-git-stash-push-optionality:
  docs: fix "git stash [push]" documentation
2026-03-31 13:00:55 -07:00
Junio C Hamano
ab3e6e484e Merge branch 'sp/doc-gitignore-oowt' into next
Doc update.

* sp/doc-gitignore-oowt:
  doc: gitignore: clarify pattern base for info/exclude and core.excludesFile
2026-03-31 13:00:55 -07:00
Junio C Hamano
8867bcf2b4 Merge branch 'th/t6101-unhide-git-failures' into next
Test cleanup.

* th/t6101-unhide-git-failures:
  t6101: avoid suppressing git's exit code
2026-03-31 13:00:55 -07:00
Junio C Hamano
279c41a3e0 Merge branch 'za/t2000-modernise' into next
Test cleanup.

* za/t2000-modernise:
  t2000: modernise overall structure
2026-03-31 13:00:55 -07:00
Junio C Hamano
8f775bd513 Merge branch 'mf/format-patch-commit-list-format-doc' into next
Doc updates.

* mf/format-patch-commit-list-format-doc:
  format-patch: removing unconditional wrapping
  docs: fix --commit-list-format related entries
2026-03-31 13:00:54 -07:00
Junio C Hamano
47456fcc12 Merge branch 'tc/replay-down-to-root' into next
git replay now supports replaying down to the root commit.

* tc/replay-down-to-root:
  replay: support replaying down from root commit
2026-03-31 13:00:54 -07:00
Junio C Hamano
e8927aa861 Merge branch 'tb/stdin-packs-excluded-but-open' into next
pack-objects's --stdin-packs=follow mode learns to handle
excluded-but-open packs.

* tb/stdin-packs-excluded-but-open:
  repack: mark non-MIDX packs above the split as excluded-open
  pack-objects: support excluded-open packs with --stdin-packs
  t7704: demonstrate failure with once-cruft objects above the geometric split
  pack-objects: refactor `read_packs_list_from_stdin()` to use `strmap`
  pack-objects: plug leak in `read_stdin_packs()`
2026-03-31 13:00:54 -07:00
Junio C Hamano
c14d7bdd1e Merge branch 'ps/odb-generic-object-name-handling' into next
Object name handling (disambiguation and abbreviation) has been
refactored to be backend-generic, moving logic into the respective
object database backends.

* ps/odb-generic-object-name-handling:
  odb: introduce generic `odb_find_abbrev_len()`
  object-file: move logic to compute packed abbreviation length
  object-name: move logic to compute loose abbreviation length
  object-name: simplify computing common prefixes
  object-name: abbreviate loose object names without `disambiguate_state`
  object-name: merge `update_candidates()` and `match_prefix()`
  object-name: backend-generic `get_short_oid()`
  object-name: backend-generic `repo_collect_ambiguous()`
  object-name: extract function to parse object ID prefixes
  object-name: move logic to iterate through packed prefixed objects
  object-name: move logic to iterate through loose prefixed objects
  odb: introduce `struct odb_for_each_object_options`
  oidtree: extend iteration to allow for arbitrary return codes
  oidtree: modernize the code a bit
  object-file: fix sparse 'plain integer as NULL pointer' error
2026-03-31 13:00:54 -07:00
Junio C Hamano
0c370356e2 Sync with 'master' 2026-03-30 14:04:35 -07:00
Junio C Hamano
ad41378b07 Merge branch 'th/t8003-unhide-git-failures' into next
Test clean-up.

* th/t8003-unhide-git-failures:
  t8003: modernise style
  t8003: avoid suppressing git's exit code
2026-03-30 14:04:22 -07:00
Junio C Hamano
ef4896a676 Merge branch 'sa/replay-revert' into next
"git replay" (experimental) learns, in addition to "pick" and
"replay", a new operating mode "revert".

* sa/replay-revert:
  replay: add --revert mode to reverse commit changes
  sequencer: extract revert message formatting into shared function
2026-03-30 14:04:22 -07:00
Junio C Hamano
f967ececef Merge branch 'pw/worktree-reduce-the-repository' into next
Reduce the reference to the_repository in the worktree subsystem.

* pw/worktree-reduce-the-repository:
  worktree: reject NULL worktree in get_worktree_git_dir()
  worktree add: stop reading ".git/HEAD"
  worktree: remove "the_repository" from is_current_worktree()
2026-03-30 14:04:21 -07:00
Junio C Hamano
c128948b16 Merge branch 'ar/config-hook-cleanups' into next
Code clean-up around the recent "hooks defined in config" topic.

* ar/config-hook-cleanups:
  hook: reject unknown hook names in git-hook(1)
  hook: show disabled hooks in "git hook list"
  hook: show config scope in git hook list
  hook: introduce hook_config_cache_entry for per-hook data
  t1800: add test to verify hook execution ordering
  hook: make consistent use of friendly-name in docs
  hook: replace hook_list_clear() -> string_list_clear_func()
  hook: detect & emit two more bugs
  hook: rename cb_data_free/alloc -> hook_data_free/alloc
  hook: fix minor style issues
  builtin/receive-pack: properly init receive_hook strbuf
  hook: move unsorted_string_list_remove() to string-list.[ch]
2026-03-30 14:04:21 -07:00
Junio C Hamano
270e10ad6d The 23rd batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 13:57:03 -07:00
Junio C Hamano
6cb924707f Merge branch 'ai/t2107-test-path-is-helpers'
Test cleanup.

* ai/t2107-test-path-is-helpers:
  t2107: modernize path existence check
2026-03-30 13:57:03 -07:00
Junio C Hamano
a1d7a8fef1 Merge branch 'jw/object-name-bitset-to-enum'
The unsigned integer that is used as an bitset to specify the kind
of branches interpret_branch_name() function has been changed to
use a dedicated enum type.

* jw/object-name-bitset-to-enum:
  object-name: turn INTERPRET_BRANCH_* constants into enum values
2026-03-30 13:57:02 -07:00
Junio C Hamano
ffb31a39ad Merge branch 'jw/t2203-status-pipe-fix'
Test clean-up.

* jw/t2203-status-pipe-fix:
  t2203: avoid suppressing git status exit code
2026-03-30 13:57:01 -07:00
Junio C Hamano
5032e70fc2 Merge branch 'jw/apply-corrupt-location'
"git apply" now reports the name of the input file along with the
line number when it encounters a corrupt patch, and correctly
resets the line counter when processing multiple patch files.

* jw/apply-corrupt-location:
  apply: report input location in binary and garbage patch errors
  apply: report input location in header parsing errors
  apply: report the location of corrupt patches
2026-03-30 13:57:00 -07:00
Junio C Hamano
295eb2cc47 Merge branch 'rs/split-index-the-repo-fix'
split-index.c has been updated to not use the global the_repository
and the_hash_algo variables.

* rs/split-index-the-repo-fix:
  split-index: stop using the_repository and the_hash_algo
2026-03-30 13:56:59 -07:00
Junio C Hamano
cb7428fd7b Merge branch 'rs/ahead-behind-cleanup-optimization'
The cleanup of remaining bitmaps in "ahead_behind()" has been
simplified.

* rs/ahead-behind-cleanup-optimization:
  commit-reach: simplify cleanup of remaining bitmaps in ahead_behind ()
2026-03-30 13:56:59 -07:00
Jayesh Daga
a7aca15677 read-cache: use istate->repo for trace2 logging
trace2 calls in read-cache.c use the global 'the_repository',
even though the relevant index_state provides an explicit
repository pointer via 'istate->repo'.

Using the global repository can result in incorrect trace2
output when multiple repository instances are in use, as
events may be attributed to the wrong repository.

Use 'istate->repo' instead to ensure correct repository
attribution.

Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 13:02:29 -07:00
Pablo Sabater
8151f4fe7e receive-pack: use worktree HEAD for updateInstead
When a bare repo has linked worktrees, and its HEAD points to an unborn branch,
pushing to a wt branch with updateInstead fails and rejects the push, even if
the wt is clean. This happens because HEAD is checked only for the bare repo
context, instead of the wt.

Remove head_has_history and check for worktree->head_oid which does
have the correct HEAD of the wt.

Update the test added by Runxi's patch to expect success.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 12:52:41 -07:00
Pablo Sabater
b310755eca t5516: clean up cloned and new-wt in denyCurrentBranch and worktrees test
The 'denyCurrentBranch and worktrees' test creates a 'cloned' and a 'new-wt'
but it doesn't clean them after the test. This makes other tests that use
the same name after this one to fail.

Add test_when_finished to clean them at the end.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 12:52:40 -07:00
Runxi Yu
80871f356e t5516: test updateInstead with worktree and unborn bare HEAD
This is a regression test which should presently fail, to demonstrate
the behavior I encountered that looks like a bug.

When a bare repository has a worktree checked out on a separate branch,
receive.denyCurrentBranch=updateInstead should allow a push to that
branch and update the linked worktree, as long as the linked worktree is
clean.

But, if the bare repository's own HEAD is repointed to an unborn branch,
the push is rejected with "Working directory has staged changes", even
though the linked worktree itself is clean.

This test is essentially a minimal working example of what I encountered
while actually using Git; it might not be the optimal way to demonstrate
the underlying bug. I suspect builtin/receive-pack.c is using the bare
repository's HEAD even when comparing it to the worktree's index.

Signed-off-by: Runxi Yu <me@runxiyu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 12:52:40 -07:00
Quentin Bernet
3402850ee1 docs: fix "git stash [push]" documentation
Both the synopsis and explanation are incorrect and contradict each
other.
The synopsis claims "push" can only be omitted when you do not give any
options and arguments.
The explanation correctly claims that non-option arguments are not
allowed, except pathspec elements preceded by double hyphens.
But it also adds "-p" to the list of exceptions, even though it is an
option argument.

Signed-off-by: Quentin Bernet <quentin.bernet@bluewin.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 08:19:40 -07:00
Shreyansh Paliwal
0f0ce07625 doc: gitignore: clarify pattern base for info/exclude and core.excludesFile
The pattern format section describes how patterns are interpreted
relative to the location of a .gitignore file, but does not mention
the behavior for exclude sources outside the working tree.

Clarify that patterns from $GIT_DIR/info/exclude and core.excludesFile
are treated as if they are specified at the root of the working tree,
so a leading '/' anchors matches at the repository root.

Reported-by: Dan Drake <dan@dandrake.org>
Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-28 11:41:59 -07:00