Commit Graph

79921 Commits

Author SHA1 Message Date
Junio C Hamano
db5e4fcf41 Merge branch 'yc/histogram-hunk-shift-fix' into jch
The final clean-up phase of the diff output could turn the result of
histogram diff algorithm suboptimal, which has been corrected.

* yc/histogram-hunk-shift-fix:
  xdiff: re-diff shifted change groups when using histogram algorithm
2026-02-23 14:26:51 -08:00
Junio C Hamano
d3240998a6 Merge branch 'tt/receive-pack-oo-namespace-symref-fix' into jch
"git receive-pack", when namespace is involved, segfaulted when a
symbolic ref cross the namespace boundary.

May not be a good idea after all.  A controlled death would be OK, though.
cf. <xmqqbjjgiz3a.fsf@gitster.g>

* tt/receive-pack-oo-namespace-symref-fix:
  receive-pack: fix crash on out-of-namespace symref
2026-02-23 14:26:51 -08:00
Junio C Hamano
673f301a07 Merge branch 'hn/status-compare-with-push' into jch
"git status" learned to show comparison between the current branch
and various other branches listed on status.compareBranches
configuration.

* hn/status-compare-with-push:
  status: add status.compareBranches config for multiple branch comparisons
  refactor format_branch_comparison in preparation
2026-02-23 14:26:51 -08:00
Junio C Hamano
9f843ed21c ### match next 2026-02-23 14:25:51 -08:00
Junio C Hamano
3d1cec352e Merge branch 'jt/object-file-use-container-of' into jch
Code clean-up.

* jt/object-file-use-container-of:
  object-file.c: avoid container_of() of a NULL container
2026-02-23 14:25:51 -08:00
Junio C Hamano
e8b2fc9974 Merge branch 'ps/receive-pack-shallow-optim' into jch
The code to accept shallow "git push" has been optimized.

* ps/receive-pack-shallow-optim:
  commit: use commit graph in `lookup_commit_reference_gently()`
  commit: make `repo_parse_commit_no_graph()` more robust
  commit: avoid parsing non-commits in `lookup_commit_reference_gently()`
2026-02-23 14:25:51 -08:00
Junio C Hamano
0b4d6b5592 Merge branch 'kh/doc-patch-id-4' into jch
Doc update.

* kh/doc-patch-id-4:
  doc: patch-id: see also git-cherry(1)
  doc: patch-id: add script example
  doc: patch-id: emphasize multi-patch processing
2026-02-23 14:25:51 -08:00
Junio C Hamano
eca873b4e7 Merge branch 'ps/meson-gitk-git-gui' into jch
Plumb gitk/git-gui build and install procedure in meson based
builds.

* ps/meson-gitk-git-gui:
  meson: wire up gitk and git-gui
2026-02-23 14:25:50 -08:00
Junio C Hamano
59c77855a9 Merge branch 'pw/meson-doc-mergetool' into jch
Update build precedure for mergetool documentation in meson-based builds.

* pw/meson-doc-mergetool:
  meson: fix building mergetool docs
2026-02-23 14:25:50 -08:00
Junio C Hamano
6de9bdb3f8 Merge branch 'kh/doc-am-xref' into jch
Doc update.

* kh/doc-am-xref:
  doc: am: fill out hook discussion
  doc: am: add missing config am.messageId
  doc: am: say that --message-id adds a trailer
  doc: am: normalize git(1) command links
2026-02-23 14:25:50 -08:00
Junio C Hamano
2c037dbd8d Merge branch 'ps/object-info-bits-cleanup' into jch
A couple of bugs in use of flag bits around odb API has been
corrected, and the flag bits reordered.

* ps/object-info-bits-cleanup:
  odb: convert `odb_has_object()` flags into an enum
  odb: convert object info flags into an enum
  odb: drop gaps in object info flag values
  builtin/fsck: fix flags passed to `odb_has_object()`
  builtin/backfill: fix flags passed to `odb_has_object()`
2026-02-23 14:25:50 -08:00
Junio C Hamano
98655bd40e Merge branch 'ar/run-command-hook-take-2' into jch
Use the hook API to replace ad-hoc invocation of hook scripts via
the run_command() API.

* ar/run-command-hook-take-2:
  receive-pack: convert receive hooks to hook API
  receive-pack: convert update hooks to new API
  run-command: poll child input in addition to output
  hook: add jobs option
  reference-transaction: use hook API instead of run-command
  transport: convert pre-push to hook API
  hook: allow separate std[out|err] streams
  hook: convert 'post-rewrite' hook in sequencer.c to hook API
  hook: provide stdin via callback
  run-command: add stdin callback for parallelization
  run-command: add helper for pp child states
  t1800: add hook output stream tests
2026-02-23 14:25:49 -08:00
Junio C Hamano
5b91ebdaac Merge branch 'ag/http-netrc-tests' into jch
Additional tests were introduced to see the interaction with netrc
auth with auth failure on the http transport.

* ag/http-netrc-tests:
  t5550: add netrc tests for http 401/403
2026-02-23 14:25:49 -08:00
Junio C Hamano
c67740c301 Merge branch 'ty/symlinks-use-unsigned-for-bitset' into jch
Code clean-up.

* ty/symlinks-use-unsigned-for-bitset:
  symlinks: use unsigned int for flags
2026-02-23 14:25:49 -08:00
Junio C Hamano
3d397da84a Merge branch 'ps/validate-prefix-in-subtree-split' into jch
"git subtree split --prefix=P <commit>" now checks the prefix P
against the tree of the (potentially quite different from the
current working tree) given commit.

* ps/validate-prefix-in-subtree-split:
  subtree: validate --prefix against commit in split
2026-02-23 14:25:49 -08:00
Junio C Hamano
e2c0552420 Merge branch 'uk/signature-is-good-after-key-expires' into jch
A signature on a commit that was GPG signed long time ago ought to
be still valid after the key that was used to sign it has expired,
but we showed them in alarming red.

* uk/signature-is-good-after-key-expires:
  gpg-interface: signatures by expired keys are fine
2026-02-23 14:25:48 -08:00
Junio C Hamano
7789d98c88 Merge branch 'ps/odb-for-each-object' into jch
Revamp object enumeration API around odb.

* ps/odb-for-each-object:
  odb: drop unused `for_each_{loose,packed}_object()` functions
  reachable: convert to use `odb_for_each_object()`
  builtin/pack-objects: use `packfile_store_for_each_object()`
  odb: introduce mtime fields for object info requests
  treewide: drop uses of `for_each_{loose,packed}_object()`
  treewide: enumerate promisor objects via `odb_for_each_object()`
  builtin/fsck: refactor to use `odb_for_each_object()`
  odb: introduce `odb_for_each_object()`
  packfile: introduce function to iterate through objects
  packfile: extract function to iterate through objects of a store
  object-file: introduce function to iterate through objects
  object-file: extract function to read object info from path
  odb: fix flags parameter to be unsigned
  odb: rename `FOR_EACH_OBJECT_*` flags
2026-02-23 14:25:48 -08:00
Junio C Hamano
9f357bf777 Merge branch 'ap/use-test-seq-f-more' into jch
Test clean-up.

* ap/use-test-seq-f-more:
  t: use test_seq -f and pipes in a few more places
2026-02-23 14:25:46 -08:00
Junio C Hamano
efafd1b793 Merge branch 'db/doc-fetch-jobs-auto' into jch
Doc update.

* db/doc-fetch-jobs-auto:
  doc: fetch: document `--jobs=0` behavior
2026-02-23 14:25:46 -08:00
Junio C Hamano
246bedcf85 Merge branch 'jt/object-file-use-container-of' (early part) into jch
* 'jt/object-file-use-container-of' (early part):
  object-file: use `container_of()` to convert from base types
2026-02-23 14:25:45 -08:00
Junio C Hamano
9665d517c3 Merge branch 'mf/format-patch-honor-from-for-cover-letter' into jch
"git format-patch --from=<me>" did not honor the command line
option when writing out the cover letter, which has been corrected.

* mf/format-patch-honor-from-for-cover-letter:
  format-patch: fix From header in cover letter
2026-02-23 14:25:45 -08:00
Junio C Hamano
93551e9dd1 Merge branch 'jh/alias-i18n' into jch
Extend the alias configuration syntax to allow aliases using
characters outside ASCII alphanumeric (plus '-').

* jh/alias-i18n:
  completion: fix zsh alias listing for subsection aliases
  alias: support non-alphanumeric names via subsection syntax
  alias: prepare for subsection aliases
  help: use list_aliases() for alias listing
2026-02-23 14:25:45 -08:00
Junio C Hamano
20e99615c4 Merge branch 'ps/tests-wo-iconv-fixes' into jch
Some tests assumed "iconv" is available without honoring ICONV
prerequisite, which has been corrected.

* ps/tests-wo-iconv-fixes:
  t6006: don't use iconv(1) without ICONV prereq
  t5550: add ICONV prereq to tests that use "$HTTPD_URL/error"
  t4205: improve handling of ICONV prerequisite
  t40xx: don't use iconv(1) without ICONV prereq
  t: don't set ICONV prereq when iconv(1) is missing
2026-02-23 14:25:45 -08:00
Junio C Hamano
f01d86795d Merge branch 'ps/ci-gitlab-msvc-updates' into jch
CI update.

* ps/ci-gitlab-msvc-updates:
  gitlab-ci: handle failed tests on MSVC+Meson job
  gitlab-ci: use "run-test-slice-meson.sh"
  ci: make test slicing consistent across Meson/Make
  github: fix Meson tests not executing at all
  meson: fix MERGE_TOOL_DIR with "--no-bin-wrappers"
  ci: don't skip smallest test slice in GitLab
  ci: handle failures of test-slice helper
2026-02-23 14:25:45 -08:00
Junio C Hamano
dc4e49cf7e Merge branch 'jc/whitespace-incomplete-line' into jch
It does not make much sense to apply the "incomplete-line"
whitespace rule to symbolic links, whose contents almost always
lack the final newline.  "git apply" and "git diff" are now taught
to exclude them for a change to symbolic links.

* jc/whitespace-incomplete-line:
  whitespace: symbolic links usually lack LF at the end
2026-02-23 14:25:44 -08:00
Junio C Hamano
ea7a9c8bac Merge branch 'jc/checkout-switch-restore' into jch
"git switch <name>", in an attempt to create a local branch <name>
after a remote tracking branch of the same name gave an advise
message to disambiguate using "git checkout", which has been
updated to use "git switch".

* jc/checkout-switch-restore:
  checkout: tell "parse_remote_branch" which command is calling it
  checkout: pass program-readable token to unified "main"
2026-02-23 14:25:44 -08:00
Junio C Hamano
ad90a2d1be Merge branch 'jk/ref-filter-lrstrip-optim' into jch
Code clean-up.

* jk/ref-filter-lrstrip-optim:
  ref-filter: clarify lstrip/rstrip component counting
  ref-filter: avoid strrchr() in rstrip_ref_components()
  ref-filter: simplify rstrip_ref_components() memory handling
  ref-filter: simplify lstrip_ref_components() memory handling
  ref-filter: factor out refname component counting
2026-02-23 14:25:44 -08:00
Junio C Hamano
ffe20c230b Merge branch 'ps/history-ergonomics-updates' into jch
UI improvements for "git history reword".

* ps/history-ergonomics-updates:
  Documentation/git-history: document default for "--update-refs="
  builtin/history: rename "--ref-action=" to "--update-refs="
  builtin/history: replace "--ref-action=print" with "--dry-run"
  builtin/history: check for merges before asking for user input
  builtin/history: perform revwalk checks before asking for user input
2026-02-23 14:25:44 -08:00
Junio C Hamano
b1b36c2ca7 Merge branch 'ps/for-each-ref-in-fixes' into jch
A handful of places used refs_for_each_ref_in() API incorrectly,
which has been corrected.

* ps/for-each-ref-in-fixes:
  bisect: simplify string_list memory handling
  bisect: fix misuse of `refs_for_each_ref_in()`
  pack-bitmap: fix bug with exact ref match in "pack.preferBitmapTips"
  pack-bitmap: deduplicate logic to iterate over preferred bitmap tips
2026-02-23 14:25:43 -08:00
Junio C Hamano
ba41a4ea13 Merge branch 'lo/repo-info-keys' into jch
"git repo info" learns "--keys" action to list known keys.

* lo/repo-info-keys:
  repo: add new flag --keys to git-repo-info
  repo: rename the output format "keyvalue" to "lines"
2026-02-23 14:25:43 -08:00
Junio C Hamano
5bc8a6d346 Merge branch 'ac/string-list-sort-u-and-tests' into jch
Code clean-up using a new helper function introduced lately.

* ac/string-list-sort-u-and-tests:
  sparse-checkout: use string_list_sort_u
2026-02-23 14:25:42 -08:00
Junio C Hamano
f44b78cd28 Merge branch 'mc/tr2-process-ancestry-cleanup' into jch
Add process ancestry data to trace2 on macOS to match what we
already do on Linux and Windows.  Also adjust the way Windows
implementation reports this information to match the other two.

* mc/tr2-process-ancestry-cleanup:
  t0213: add trace2 cmd_ancestry tests
  test-tool: extend trace2 helper with 400ancestry
  trace2: emit cmd_ancestry data for Windows
  trace2: refactor Windows process ancestry trace2 event
  build: include procinfo.c impl for macOS
  trace2: add macOS process ancestry tracing
2026-02-23 14:25:42 -08:00
Junio C Hamano
4855652e76 Merge branch 'ps/pack-concat-wo-backfill' into jch
"git pack-objects --stdin-packs" with "--exclude-promisor-objects"
fetched objects that are promised, which was not wanted.  This has
been fixed.

* ps/pack-concat-wo-backfill:
  builtin/pack-objects: don't fetch objects when merging packs
2026-02-23 14:25:42 -08:00
Junio C Hamano
8bf656c34c Merge branch 'dk/complete-stash-import-export' into jch
Command line completion (in contrib/) update.

* dk/complete-stash-import-export:
  completion: add stash import, export
2026-02-23 14:25:42 -08:00
Junio C Hamano
4855257316 Merge branch 'jc/doc-cg-needswork' into jch
A CodingGuidelines update.

* jc/doc-cg-needswork:
  CodingGuidelines: document NEEDSWORK comments
2026-02-23 14:25:41 -08:00
Junio C Hamano
4edc2ecb5f Merge branch 'ds/revision-maximal-only' into jch
"git rev-list" and friends learn "--maximal-only" to show only the
commits that are not reachable by other commits.

* ds/revision-maximal-only:
  revision: add --maximal-only option
2026-02-23 14:25:41 -08:00
Junio C Hamano
7e61843e13 Merge branch 'cc/lop-filter-auto' into jch
"auto filter" logic for large-object promisor remote.

* cc/lop-filter-auto:
  fetch-pack: wire up and enable auto filter logic
  promisor-remote: change promisor_remote_reply()'s signature
  promisor-remote: keep advertised filters in memory
  list-objects-filter-options: support 'auto' mode for --filter
  doc: fetch: document `--filter=<filter-spec>` option
  fetch: make filter_options local to cmd_fetch()
  clone: make filter_options local to cmd_clone()
  promisor-remote: allow a client to store fields
  promisor-remote: refactor initialising field lists
2026-02-23 14:25:41 -08:00
Junio C Hamano
38b50fbc65 Merge branch 'pw/commit-msg-sample-hook' into jch
Update sample commit-msg hook to complain when a log message has
material mailinfo considers the end of log message in the middle.

* pw/commit-msg-sample-hook:
  templates: detect commit messages containing diffs
  templates: add .gitattributes entry for sample hooks
2026-02-23 14:25:41 -08:00
Junio C Hamano
65023d8295 Merge branch 'kh/doc-am-format-sendmail' into jch
Doc update.

* kh/doc-am-format-sendmail:
  doc: add caveat about round-tripping format-patch
2026-02-23 14:25:41 -08:00
Junio C Hamano
8e06f961d7 object-file.c: avoid container_of() of a NULL container
Even though the "struct odb_transaction" member is at the beginning
of the containing "struct odb_transaction_files", i.e., at offset 0,
using container_of() to add offset 0 to a NULL pointer gets flagged
as a bad behaviour under SANITIZE=undefined.

Use container_of_or_null() to work around this issue.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-22 12:19:14 -08:00
Tian Yuchen
96286f14b0 symlinks: use unsigned int for flags
The 'flags' and 'track_flags' fields in symlinks.c are used
strictly as a collection of bits (using bitwise operators including
&, |, ~). Using a signed integer for bitmasks may lead to undefined
behavior with shift operations and logic errors if the MSB is touched.

Change these fields from 'int' to 'unsigned int' to match our usage
patterns.

Signed-off-by: Tian Yuchen <a3205153416@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20 15:03:42 -08:00
Junio C Hamano
7c02d39fc2 The 6th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20 11:36:18 -08:00
Junio C Hamano
c61120cf65 Merge branch 'ak/t9812-test-path-is-helpers'
Test update.

* ak/t9812-test-path-is-helpers:
  t9812: modernize test path helpers
2026-02-20 11:36:18 -08:00
Junio C Hamano
8ceb69f85d Merge branch 'pw/diff-anchored-optim'
"git diff --anchored=<text>" has been optimized.

* pw/diff-anchored-optim:
  diff --anchored: avoid checking unmatched lines
2026-02-20 11:36:18 -08:00
Junio C Hamano
2a0a64b9d4 Merge branch 'jc/doc-cg-c-comment'
A CodingGuidelines update.

* jc/doc-cg-c-comment:
  CodingGuidelines: document // comments
2026-02-20 11:36:18 -08:00
Junio C Hamano
5465d3683a Merge branch 'pw/xdiff-cleanups'
Small clean-up of xdiff library to remove unnecessary data
duplication.

* pw/xdiff-cleanups:
  xdiff: remove unused data from xdlclass_t
  xdiff: remove "line_hash" field from xrecord_t
2026-02-20 11:36:17 -08:00
Jeff King
8b0061b5c5 ref-filter: clarify lstrip/rstrip component counting
When a strip option to the %(refname) placeholder is asked to leave N
path components, we first count up the path components to know how many
to remove. That happens with a loop like this:

	/* Find total no of '/' separated path-components */
	for (i = 0; p[i]; p[i] == '/' ? i++ : *p++)
		;

which is a little hard to understand for two reasons.

First, the dereference in "*p++" is seemingly useless, since nobody
looks at the result. And static analyzers like Coverity will complain
about that. But removing the "*" will cause gcc to complain with
-Wint-conversion, since the two sides of the ternary do not match (one
is a pointer and the other an int).

Second, it is not clear what the meaning of "p" is at each iteration of
the loop, as its position with respect to our walk over the string
depends on how many slashes we've seen. The answer is that by itself, it
doesn't really mean anything: "p + i" represents the current state of
our walk, with "i" counting up slashes, and "p" by itself essentially
meaningless.

None of this behaves incorrectly, but ultimately the loop is just
counting the slashes in the refname. We can do that much more simply
with a for-loop iterating over the string and a separate slash counter.

We can also drop the comment, which is somewhat misleading. We are
counting slashes, not components (and a comment later in the function
makes it clear that we must add one to compensate). In the new code it
is obvious that we are counting slashes here.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20 08:40:06 -08:00
Patrick Steinhardt
eb49c6ef43 t6006: don't use iconv(1) without ICONV prereq
Two tests in t6006 depend on the iconv(1) prerequisite to reencode a
commit message. This executable may not even exist though in case the
prereq is not set, which will cause the tests to fail.

Fix this by using UTF-8 instead when the prereq is not set.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20 07:52:27 -08:00
Patrick Steinhardt
c70bea26c7 t5550: add ICONV prereq to tests that use "$HTTPD_URL/error"
We've got a bunch of tests in t5550 that connect to "$HTTPD_URL/error"
to ensure that error messages are properly forwarded. This URL executes
the "t/lib-httpd/error.sh" script, which in turn depends on the iconv(1)
executable to reencode the message.

This executable may not exist on platforms, which will make the tests
fail. Guard them with the ICONV prereq to fix such failures.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20 07:52:27 -08:00
Patrick Steinhardt
effb0aa84b t4205: improve handling of ICONV prerequisite
In t4205 we have a bunch of tests that depend on the iconv prereq. This
is for most of the part because we format commit messages that have been
encoded in an encoding different than UTF-8.

Those tests fall into two classes though:

  - One class of tests outputs the data as-is without reencoding.

  - One class of tests outputs the data with "i18n.logOutputEncoding" to
    reencode it.

Curiously enough, both of these classes are marked with the ICONV
prereq, even though one might expect that the first class wouldn't need
the prereq. This is because we unconditionally use ISO-8859-1 encoding
for the initial commit message, and thus we depend on converting to
UTF-8 indeed.

This creates another problem though: when the iconv(1) executable does
not exist the test setup fails, even in the case where the ICONV prereq
has not been set.

Fix these issues by making the test encoding conditional on ICONV: if
it's available we use ISO-8859-1, otherwise we use UTF-8. This fixes the
test setup on platforms without iconv(1), and it allows us to drop the
ICONV prereq from a bunch of tests.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20 07:52:27 -08:00