Commit Graph

80561 Commits

Author SHA1 Message Date
Junio C Hamano
19ca350c9b Merge branch 'jc/doc-wholesale-replace-before-next' into next
Doc update.

* jc/doc-wholesale-replace-before-next:
  SubmittingPatches: spell out "replace fully to pretend to be perfect"
2026-03-13 13:34:21 -07:00
Junio C Hamano
3c80964399 Merge branch 'cf/constness-fixes' into next
Small code clean-up around constness area.

* cf/constness-fixes:
  dir: avoid -Wdiscarded-qualifiers in remove_path()
  bloom: remove a misleading const qualifier
2026-03-13 13:34:21 -07:00
Junio C Hamano
75c22b6b26 Merge branch 'lc/rebase-trailer' into next
"git rebase" learns "--trailer" command to drive the
interpret-trailers machinery.

* lc/rebase-trailer:
  rebase: support --trailer
  commit, tag: parse --trailer with OPT_STRVEC
  trailer: append trailers without fork/exec
  trailer: libify a couple of functions
  interpret-trailers: refactor create_in_place_tempfile()
  interpret-trailers: factor trailer rewriting
2026-03-13 13:34:21 -07:00
Junio C Hamano
5a4098b0cd Merge branch 'jc/neuter-sideband-fixup' into next
Try to resurrect and reboot a stalled "avoid sending risky escape
sequences taken from sideband to the terminal" topic by Dscho.  The
plan is to keep it in 'next' long enough to see if anybody screams
with the "everything dropped except for ANSI color escape sequence"
default.

* jc/neuter-sideband-fixup:
  sideband: drop 'default' configuration
  sideband: offer to configure sanitizing on a per-URL basis
  sideband: add options to allow more control sequences to be passed through
  sideband: do allow ANSI color sequences by default
  sideband: introduce an "escape hatch" to allow control characters
  sideband: mask control characters
2026-03-13 13:34:20 -07:00
Junio C Hamano
b56d940889 Sync with 'master' 2026-03-12 10:59:13 -07:00
Junio C Hamano
61ffe62b75 Merge branch 'bk/run-command-wo-the-repository' into next
The run_command() API lost its implicit dependence on the singleton
the_repository instance.

* bk/run-command-wo-the-repository:
  run-command: wean auto_maintenance() functions off the_repository
  run-command: wean start_command() off the_repository
2026-03-12 10:59:01 -07:00
Junio C Hamano
39ef732ca9 Merge branch 'ps/editorconfig-unanchor' into next
Editorconfig filename patterns were specified incorrectly, making
many source files inside subdirectories uncovered, which has been
corrected.

* ps/editorconfig-unanchor:
  editorconfig: fix style not applying to subdirs anymore
2026-03-12 10:58:59 -07:00
Junio C Hamano
647ee3f2dc Merge branch 'ss/t3200-test-zero-oid' into next
A test now use symbolic constant $ZERO_OID instead of 40 "0" to
work better with SHA-256 as well as SHA-1.

* ss/t3200-test-zero-oid:
  t3200: replace hardcoded null OID with $ZERO_OID
2026-03-12 10:58:58 -07:00
Junio C Hamano
99c4dbd03e Merge branch 'dd/list-objects-filter-options-wo-strbuf-split' into next
Revamp the way combined option filter is parsed.

* dd/list-objects-filter-options-wo-strbuf-split:
  list-objects-filter-options: avoid strbuf_split_str()
  worktree: do not pass strbuf by value
2026-03-12 10:58:56 -07:00
Junio C Hamano
8500bdf172 Merge branch 'ps/t9200-test-path-is-helpers' into next
Test update.

* ps/t9200-test-path-is-helpers:
  t9200: replace test -f with modern path helper
  t9200: handle missing CVS with skip_all
2026-03-12 10:58:55 -07:00
Junio C Hamano
67006b9db8 The 15th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12 10:56:05 -07:00
Junio C Hamano
99da934835 Merge branch 'sp/send-email-validate-charset'
"git send-email" has learned to be a bit more careful when it
accepts charset to use from the end-user, to avoid 'y' (mistaken
'yes' when expecting a charset like 'UTF-8') and other nonsense.

* sp/send-email-validate-charset:
  send-email: validate charset name in 8bit encoding prompt
2026-03-12 10:56:05 -07:00
Junio C Hamano
8985491423 Merge branch 'dt/send-email-client-cert'
"git send-email" learns to support use of client-side certificates.

* dt/send-email-client-cert:
  send-email: add client certificate options
2026-03-12 10:56:05 -07:00
Junio C Hamano
fdfa7f64d6 Merge branch 'ps/ci-gitlab-prepare-for-macos-14-deprecation'
Move gitlab CI from macOS 14 images that are being deprecated.

* ps/ci-gitlab-prepare-for-macos-14-deprecation:
  gitlab-ci: update to macOS 15 images
  meson: detect broken iconv that requires ICONV_RESTART_RESET
  meson: simplify iconv-emits-BOM check
2026-03-12 10:56:04 -07:00
Junio C Hamano
b2102627d7 Merge branch 'ag/send-email-sasl-with-host-port'
"git send-email" learns to pass hostname/port to Authen::SASL
module.

* ag/send-email-sasl-with-host-port:
  send-email: pass smtp hostname and port to Authen::SASL
2026-03-12 10:56:04 -07:00
Junio C Hamano
0724f727ee Merge branch 'ss/t9123-setup-inside-test-expect-success'
Test clean-up.

* ss/t9123-setup-inside-test-expect-success:
  t9123: use test_when_finished for cleanup
2026-03-12 10:56:04 -07:00
Junio C Hamano
9a591a99d0 Merge branch 'sk/oidmap-clear-with-custom-free-func'
A bit of OIDmap API enhancement and cleanup.

* sk/oidmap-clear-with-custom-free-func:
  builtin/rev-list: migrate missing_objects cleanup to oidmap_clear_with_free()
  oidmap: make entry cleanup explicit in oidmap_clear
2026-03-12 10:56:04 -07:00
Junio C Hamano
642aa4f393 Merge branch 'jt/doc-submitting-patches-study-before-sending'
Doc update for our contributors.

* jt/doc-submitting-patches-study-before-sending:
  Documentation: extend guidance for submitting patches
2026-03-12 10:56:03 -07:00
Junio C Hamano
198eb1b93e Merge branch 'os/doc-custom-subcommand-on-path'
The way end-users can add their own "git <cmd>" subcommand by
storing "git-<cmd>" in a directory on their $PATH has not been
documented clearly, which has been corrected.

* os/doc-custom-subcommand-on-path:
  doc: add information regarding external commands
2026-03-12 10:56:03 -07:00
Junio C Hamano
f3e18324c2 Merge branch 'ss/t3700-modernize'
Test clean-up.

* ss/t3700-modernize:
  t3700: use test_grep helper for better diagnostics
  t3700: avoid suppressing git's exit code
2026-03-12 10:56:03 -07:00
Junio C Hamano
9b194289d4 Merge branch 'lp/doc-gitprotocol-pack-fixes'
Doc update.

* lp/doc-gitprotocol-pack-fixes:
  doc: gitprotocol-pack: normalize italic formatting
  doc: gitprotocol-pack: improve paragraphs structure
  doc: gitprotocol-pack: fix pronoun-antecedent agreement
2026-03-12 10:56:03 -07:00
Junio C Hamano
69affbe67f Merge branch 'kj/path-micro-code-cleanup'
Code clean-up.

* kj/path-micro-code-cleanup:
  path: remove redundant function calls
  path: use size_t for dir_prefix length
  path: remove unused header
2026-03-12 10:56:02 -07:00
Junio C Hamano
8194f1795b Merge branch 'bc/sha1-256-interop-02'
The code to maintain mapping between object names in multiple hash
functions is being added, written in Rust.

* bc/sha1-256-interop-02:
  object-file-convert: always make sure object ID algo is valid
  rust: add a small wrapper around the hashfile code
  rust: add a new binary object map format
  rust: add functionality to hash an object
  rust: add a build.rs script for tests
  rust: fix linking binaries with cargo
  hash: expose hash context functions to Rust
  write-or-die: add an fsync component for the object map
  csum-file: define hashwrite's count as a uint32_t
  rust: add additional helpers for ObjectID
  hash: add a function to look up hash algo structs
  rust: add a hash algorithm abstraction
  rust: add a ObjectID struct
  hash: use uint32_t for object_id algorithm
  conversion: don't crash when no destination algo
  repository: require Rust support for interoperability
2026-03-12 10:56:02 -07:00
Pablo Sabater
9072576123 t9200: replace test -f with modern path helper
Replace old style 'test -f' with helper
'test_path_is_file', which make debugging
a failing test easier by loudly reporting
what expectation was not met.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12 10:39:04 -07:00
Burak Kaan Karaçay
9df3be8e2e run-command: wean auto_maintenance() functions off the_repository
The prepare_auto_maintenance() relies on the_repository to read
configurations. Since run_auto_maintenance() calls
prepare_auto_maintenance(), it also implicitly depends the_repository.

Add 'struct repository *' as a parameter to both functions and update
all callers to pass the_repository.

With no global repository dependencies left in this file, remove the
USE_THE_REPOSITORY_VARIABLE macro.

Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Burak Kaan Karaçay <bkkaracay@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12 08:30:57 -07:00
Burak Kaan Karaçay
05c324b92f run-command: wean start_command() off the_repository
The start_command() relies on the_repository due to the
close_object_store flag in 'struct child_process'. When this flag is
set, start_command() closes the object store associated with
the_repository before spawning a child process.

To eliminate this dependency, replace the 'close_object_store' with the
new 'struct object_database *odb_to_close' field. This allows callers to
specify the object store that needs to be closed.

Suggested-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Burak Kaan Karaçay <bkkaracay@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-12 08:30:57 -07:00
Pablo Sabater
6523589a2c t9200: handle missing CVS with skip_all
CVS initialization runs outside a test_expect_success and when it
fails, the error report isn't good.

Wrap CVS initialization in a skip_all check so when CVS initialization
fails, the error report becomes clearer.

Move the Git repo initialization into its own test_expect_success instead
of being in the same CVS check.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11 12:53:16 -07:00
Siddharth Shrimali
30310f3cc4 t3200: replace hardcoded null OID with $ZERO_OID
To support the SHA-256 transition, replace the hardcoded 40-zero string
in 'git branch --merged' with '$ZERO_OID'. The current 40-character
string causes the test to fail prematurely in SHA-256 environments
because Git identifies a "malformed object name" (due to the 40 vs 64
character mismatch) before it even validates the object type.

By using '$ZERO_OID', we ensure the hash length is always correct for
the active algorithm. Additionally, use 'test_grep' to verify the
"must point to a commit" error message, ensuring the test validates
the object type logic rather than just string syntax.

Suggested-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-03-11 11:13:06 -07:00
Deveshi Dwivedi
f21967e541 list-objects-filter-options: avoid strbuf_split_str()
parse_combine_filter() splits a combine: filter spec at '+' using
strbuf_split_str(), which yields an array of strbufs with the
delimiter left at the end of each non-final piece.  The code then
mutates each non-final piece to strip the trailing '+' before parsing.

Allocating an array of strbufs is unnecessary.  The function processes
one sub-spec at a time and does not use strbuf editing on the pieces.
The two helpers it calls, has_reserved_character() and
parse_combine_subfilter(), only read the string content of the strbuf
they receive.

Walk the input string directly with strchrnul() to find each '+',
copying each sub-spec into a reusable temporary buffer.  The '+'
delimiter is naturally excluded.  Empty sub-specs (e.g. from a
trailing '+') are silently skipped for consistency.  Change the
helpers to take const char * instead of struct strbuf *.

The test that expected an error on a trailing '+' is removed, since
that behavior was incorrect.

Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11 11:08:53 -07:00
Deveshi Dwivedi
4107c0bb34 worktree: do not pass strbuf by value
write_worktree_linking_files() takes two struct strbuf parameters by
value, even though it only reads path strings from them.

Passing a strbuf by value is misleading and dangerous. The structure
carries a pointer to its underlying character array; caller and callee
end up sharing that storage.  If the callee ever causes the strbuf to
be reallocated, the caller's copy becomes a dangling pointer, which
results in a double-free when the caller does strbuf_release().

The function only needs the string values, not the strbuf machinery.
Switch it to take const char * and update all callers to pass .buf.

Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11 11:08:53 -07:00
Patrick Steinhardt
8a1b789c2f editorconfig: fix style not applying to subdirs anymore
In 046e1117d5 (templates: add .gitattributes entry for sample hooks,
2026-02-13) we have added another pattern to our EditorConfig that sets
the style for our hook templates. As our templates are located in
"templates/hooks/", we explicitly specify that subdirectory as part of
the globbing pattern.

This change causes files in other subdirectories, like for example
"builtin/add.c", to not be configured properly anymore. This seems to
stem from a subtlety in the EditorConfig specification [1]:

  If the glob contains a path separator (a / not inside square
  brackets), then the glob is relative to the directory level of the
  particular .editorconfig file itself. Otherwise the pattern may also
  match at any level below the .editorconfig level.

What's interesting is that the _whole_ expression is considered to be
the glob. So when the expression used is for example "{*.c,foo/*.h}",
then it will be considered a single glob, and because it contains a path
separator we will now anchor "*.c" matches to the same directory as the
".editorconfig" file.

Fix this issue by splitting out the configuration for hook templates
into a separate section. It leads to a tiny bit of duplication, but the
alternative would be something like the following (note the "{,**/}"):

  [{{,**/}*.{c,h,sh,bash,perl,pl,pm,txt,adoc},config.mak.*,{,**/}Makefile,templates/hooks/*.sample}]
  indent_style = tab
  tab_width = 8

This starts to become somewhat hard to read, so the duplication feels
like the better tradeoff.

[1]: https://spec.editorconfig.org/#glob-expressions

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-11 10:30:51 -07:00
Junio C Hamano
2727be2e99 Sync with 'master' 2026-03-10 14:24:49 -07:00
Junio C Hamano
c8be8d6f7e Merge branch 'ty/patch-ids-document-lazy-eval' into next
In-code comment update to record a design decision to allow lazy
computation of patch IDs.

* ty/patch-ids-document-lazy-eval:
  patch-ids: document intentional const-casting in patch_id_neq()
2026-03-10 14:24:39 -07:00
Junio C Hamano
7d58650290 Merge branch 'rs/history-ergonomics-updates-fix' into next
Fix use of uninitialized variable.

* rs/history-ergonomics-updates-fix:
  history: initialize rev_info in cmd_history_reword()
2026-03-10 14:24:39 -07:00
Junio C Hamano
e169ff00b3 Merge branch 'jk/unleak-mmap' into next
Plug a few leaks where mmap'ed memory regions are not unmapped.

* jk/unleak-mmap:
  meson: turn on NO_MMAP when building with LSan
  Makefile: turn on NO_MMAP when building with LSan
  object-file: fix mmap() leak in odb_source_loose_read_object_stream()
  pack-revindex: avoid double-loading .rev files
  check_connected(): fix leak of pack-index mmap
  check_connected(): delay opening new_pack
2026-03-10 14:24:39 -07:00
Junio C Hamano
38268a7acc Merge branch 'ty/setup-error-tightening' into next
While discovering a ".git" directory, the code treats any stat()
failure as a sign that a filesystem entity .git does not exist
there, and ignores ".git" that is not a "gitdir" file or a
directory.  The code has been tightened to notice and report
filesystem corruption better.

* ty/setup-error-tightening:
  setup: improve error diagnosis for invalid .git files
2026-03-10 14:24:38 -07:00
Junio C Hamano
7f19e4e1b6 The 14th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 14:23:24 -07:00
Junio C Hamano
42afcb954b Merge branch 'jh/alias-i18n-fixes'
Further update to the i18n alias support to avoid regressions.

* jh/alias-i18n-fixes:
  doc: fix list continuation in alias.adoc
  git, help: fix memory leaks in alias listing
  alias: treat empty subsection [alias ""] as plain [alias]
  doc: fix list continuation in alias subsection example
2026-03-10 14:23:24 -07:00
Junio C Hamano
08c3609935 Merge branch 'pt/fsmonitor-watchman-sample-fix'
Fix typo-induced breakages in fsmonitor-watchman sample hook.

* pt/fsmonitor-watchman-sample-fix:
  fsmonitor-watchman: fix variable reference and remove redundant code
2026-03-10 14:23:23 -07:00
Junio C Hamano
015cf12578 Merge branch 'mm/diff-no-index-find-object'
"git diff --no-index --find-object=<object-name>" outside a
repository of course wouldn't be able to find the object and died
while parsing the command line, which is made to die in a bit more
user-friendly way.

* mm/diff-no-index-find-object:
  diff: fix crash with --find-object outside repository
2026-03-10 14:23:22 -07:00
Junio C Hamano
0f34e8c174 Merge branch 'ps/ci-reduce-gitlab-envsize'
CI fix.

* ps/ci-reduce-gitlab-envsize:
  ci: unset GITLAB_FEATURES envvar to not bust xargs(1) limits
2026-03-10 14:23:21 -07:00
Junio C Hamano
755eb44fa4 Merge branch 'fp/t3310-test-path-is-helpers'
Test clean-up.

* fp/t3310-test-path-is-helpers:
  t3310: replace test -f/-d with test_path_is_file/test_path_is_dir
2026-03-10 14:23:20 -07:00
Junio C Hamano
cdc7ffacaf Merge branch 'ss/test-that-that-typofix'
Typofix in t/.

* ss/test-that-that-typofix:
  t: fix "that that" typo in lib-unicode-nfc-nfd.sh
2026-03-10 14:23:20 -07:00
Junio C Hamano
6953f24e40 Merge branch 'rs/parse-options-duplicated-long-options'
The parse-options API learned to notice an options[] array with
duplicated long options.

* rs/parse-options-duplicated-long-options:
  parseopt: check for duplicate long names and numerical options
  pack-objects: remove duplicate --stdin-packs definition
2026-03-10 14:23:19 -07:00
Junio C Hamano
f330d46dee Merge branch 'ar/config-hooks'
Allow hook commands to be defined (possibly centrally) in the
configuration files, and run multiple of them for the same hook
event.

* ar/config-hooks:
  hook: add -z option to "git hook list"
  hook: allow out-of-repo 'git hook' invocations
  hook: allow event = "" to overwrite previous values
  hook: allow disabling config hooks
  hook: include hooks from the config
  hook: add "git hook list" command
  hook: run a list of hooks to prepare for multihook support
  hook: add internal state alloc/free callbacks
2026-03-10 14:23:18 -07:00
Junio C Hamano
9a8aebae97 Merge branch 'kh/format-patch-noprefix-is-boolean'
The configuration variable format.noprefix did not behave as a
proper boolean variable, which has now been fixed and documented.

* kh/format-patch-noprefix-is-boolean:
  doc: diff-options.adoc: make *.noprefix split translatable
  doc: diff-options.adoc: show format.noprefix for format-patch
  format-patch: make format.noprefix a boolean
2026-03-10 14:23:17 -07:00
Collin Funk
02cbae61df dir: avoid -Wdiscarded-qualifiers in remove_path()
When building with glibc-2.43 there is the following warning:

    dir.c:3526:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     3526 |         slash = strrchr(name, '/');
          |               ^

In this case we use a non-const pointer to get the last slash of the
unwritable file name, and then use it again to write in the strdup'd
file name.

We can avoid this warning and make the code a bit more clear by using a
separate variable to access the original argument and its strdup'd
copy.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-09 21:52:07 -07:00
Junio C Hamano
476365ac85 SubmittingPatches: spell out "replace fully to pretend to be perfect"
It unfortunately is a recurring theme that new developers tend to
pile more "fixup" patches on top of the already reviewed patches,
making the topic longer and keeping the history of all wrong turns,
which interests nobody in the larger picture.  Even picking a narrow
search in the list archive for "pretend to be a perfect " substring,
we find these:

    https://lore.kernel.org/git/xmqqk29bsz2o.fsf@gitster.mtv.corp.google.com/
    https://lore.kernel.org/git/xmqqd0ds5ysq.fsf@gitster-ct.c.googlers.com/
    https://lore.kernel.org/git/xmqqr173faez.fsf@gitster.g/

The SubmittingPatches guide does talk about going incremental once a
topic hits the 'next' branch, but it does not say much about how a
new iteration of the topic should be prepared before that happens,
and it does not mention that the developers are encouraged to seize
the opportunity to pretend to be perfect with a full replacement set
of patches.

Add a new paragraph to stress this point in the section that
describes the life-cycle of a patch series.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-09 16:25:05 -07:00
Junio C Hamano
73c4285caa Sync with 'master' 2026-03-09 14:42:24 -07:00
Junio C Hamano
5cabe3db39 Merge branch 'os/doc-git-custom-commands' into next
Doc update.

* os/doc-git-custom-commands:
  doc: make it easier to find custom command information
2026-03-09 14:42:12 -07:00