Commit Graph

78068 Commits (seen)

Author SHA1 Message Date
Junio C Hamano 64ea18eea6 Merge branch 'jc/strbuf-split' into seen
Arrays of strbuf is often a wrong data structure to use, and
strbuf_split*() family of functions that create them often have
better alternatives.

Update several code paths and replace strbuf_split*().

Comments?

* jc/strbuf-split:
  trace2: do not use strbuf_split*()
  trace2: trim_trailing_newline followed by trim is a no-op
  sub-process: do not use strbuf_split*()
  environment: do not use strbuf_split*()
  config: do not use strbuf_split()
  notes: do not use strbuf_split*()
  merge-tree: do not use strbuf_split*()
  clean: do not use strbuf_split*() [part 2]
  clean: do not use strbuf_split*() [part 1]
  clean: do not pass strbuf by value
  wt-status: avoid strbuf_split*()
2025-08-01 11:31:02 -07:00
Junio C Hamano 5d181849f3 Merge branch 'jc/string-list-split' into seen
string_list_split*() family of functions have been extended to
simplify common use cases.

Comments?

* jc/string-list-split:
  string-list: split-then-remove-empty can be done while splitting
  string-list: optionally omit empty string pieces in string_list_split*()
  diff: simplify parsing of diff.colormovedws
  string-list: optionally trim string pieces split by string_list_split*()
  string-list: unify string_list_split* functions
  string-list: align string_list_split() with its _in_place() counterpart
  string-list: report programming error with BUG
2025-08-01 11:31:02 -07:00
Junio C Hamano 8ed005490e Merge branch 'ps/object-store-midx-dedup-info' into seen
Further code clean-up for multi-pack-index code paths.

* ps/object-store-midx-dedup-info:
  midx: compute paths via their source
  midx: stop duplicating info redundant with its owning source
  midx: write multi-pack indices via their source
  midx: load multi-pack indices via their source
  midx: drop redundant `struct repository` parameter
  odb: return newly created in-memory sources
  odb: allow `odb_find_source()` to fail
  odb: store locality in object database sources
2025-08-01 11:31:01 -07:00
Junio C Hamano e23bc47ef5 Merge branch 'lo/repo-info' into seen
A new subcommand "git repo" gives users a way to grab various
repository characteristics.

* lo/repo-info:
  repo: add the --format flag
  repo: add field layout.shallow
  repo: add field layout.bare
  repo: add the field references.format
  repo: declare the repo command
2025-08-01 11:30:59 -07:00
Junio C Hamano 8bdfa5c97c Merge branch 'am/xdiff-hash-tweak' into seen
Inspired by Ezekiel's recent effort to showcase Rust interface, the
hash function implementation used to hash lines have been updated
to the one used for ELF symbol lookup by Glibc.

Comments?

* am/xdiff-hash-tweak:
  fixup! xdiff: optimize xdl_hash_record_verbatim
  xdiff: optimize xdl_hash_record_verbatim
  xdiff: refactor xdl_hash_record()
2025-08-01 11:30:59 -07:00
Junio C Hamano 85db3b19fe Merge branch 'ds/sparse-checkout-clean' into seen
"git sparse-checkout" subcommand learned a new "clean" action to
prune otherwise unused working-tree files that are outside the
areas of interest.

* ds/sparse-checkout-clean:
  sparse-checkout: make 'clean' clear more files
  t: expand tests around sparse merges and clean
  sparse-index: point users to new 'clean' action
  sparse-checkout: add --verbose option to 'clean'
  dir: add generic "walk all files" helper
  sparse-checkout: match some 'clean' behavior
  sparse-checkout: add basics of 'clean' command
  sparse-checkout: remove use of the_repository
2025-08-01 11:30:58 -07:00
Junio C Hamano ce6df7a0c1 Merge branch 'ac/deglobal-sparse-variables' into seen
Two global variables related to sparse checkout have been moved to
the repository settings structure.

Ready?

* ac/deglobal-sparse-variables:
  environment: remove the global variable 'sparse_expect_files_outside_of_patterns'
  environment: move access to "core.sparsecheckoutcone" into repo_settings
  environment: move access to "core.sparsecheckout" into repo_settings
2025-08-01 11:30:58 -07:00
Junio C Hamano ac0fd3a1c3 Merge branch 'kj/renamed-submodule' into seen
The case where a new submodule takes a path where used to be a
completely different subproject is now dealt a bit better than
before.

Looking good.

* kj/renamed-submodule:
  fixup! submodule: skip redundant active entries when pattern covers path
  fixup! submodule: prevent overwriting .gitmodules on path reuse
  submodule: skip redundant active entries when pattern covers path
  submodule: prevent overwriting .gitmodules on path reuse
2025-08-01 11:30:56 -07:00
Junio C Hamano 6ce29fe1bb Merge branch 'pw/3.0-commentchar-auto-deprecation' into seen
Proposes to deprecate "core.commentChar=auto" that attempts to
dynamically pick a suitable comment character, as it is too much
trouble to support for little benefit.

* pw/3.0-commentchar-auto-deprecation:
  commit: print advice when core.commentString=auto
  config: warn on core.commentString=auto
  breaking-changes: deprecate support for core.commentString=auto
2025-08-01 11:30:55 -07:00
Junio C Hamano 0972ba1991 Merge branch 'en/ort-rename-fixes' into seen
Various bugs about rename handling in "ort" merge strategy have
been fixed.

* en/ort-rename-fixes:
  merge-ort: fix directory rename on top of source of other rename/delete
  merge-ort: fix incorrect file handling
  t6423: fix missed staging of file in testcases 12i,12j,12k
  t6423: document two bugs with rename-to-self testcases
  merge-ort: drop unnecessary temporary in check_for_directory_rename()
  merge-ort: update comments to modern testfile location
2025-08-01 11:30:55 -07:00
Junio C Hamano 85c5610de3 Merge branch 'ps/remote-rename-fix' into jch
"git remote rename origin upstream" failed to move origin/HEAD to
upstream/HEAD when origin/HEAD is unborn and performed other
renames extremely inefficiently, which has been corrected.

* ps/remote-rename-fix:
  builtin/remote: only iterate through refs that are to be renamed
  builtin/remote: rework how remote refs get renamed
  builtin/remote: determine whether refs need renaming early on
  builtin/remote: fix sign comparison warnings
  refs: simplify logic when migrating reflog entries
  refs: pass refname when invoking reflog entry callback
2025-08-01 11:27:38 -07:00
Junio C Hamano 4cf0bd0609 Merge branch 'tb/prepare-midx-pack-cleanup' into jch
Improvement on Multi-pack-index API.

* tb/prepare-midx-pack-cleanup:
  midx: return a `packed_git` pointer from `prepare_midx_pack()`
  midx-write.c: extract inner loop from fill_packs_from_midx()
  midx-write.c: guard against incremental MIDXs in want_included_pack()
  midx: access pack names through `nth_midxed_pack_name()`
2025-08-01 11:27:37 -07:00
Junio C Hamano 12de825f69 Merge branch 'ag/send-email-imap-sent' into jch
"git send-email" learned to drive "git imap-send" to store already
sent e-mails in an IMAP folder.

A reroll (v4) exists.
cf. <PN3PR01MB9597EC4C5DF97943587AEEB4B85FA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>

* ag/send-email-imap-sent:
  send-email: add ability to send a copy of sent emails to an IMAP folder
2025-08-01 11:27:37 -07:00
Junio C Hamano a5eb0a2672 Merge branch 'cc/promisor-remote-capability' into jch
The "promisor-remote" capability mechanism has been updated to
allow the "partialCloneFilter" settings and the "token" value to be
communicated from the server side.

* cc/promisor-remote-capability:
  promisor-remote: use string constants for 'name' and 'url' too
  promisor-remote: allow a client to check fields
  promisor-remote: refactor how we parse advertised fields
  promisor-remote: allow a server to advertise more fields
  promisor-remote: refactor to get rid of 'struct strvec'
2025-08-01 11:27:36 -07:00
Junio C Hamano b90a83762e Merge branch 'rs/tighten-alias-help' into jch
"git -c alias.foo=bar foo -h baz" reported "'foo' is aliased to
'bar'" and then went on to do "git foo -h baz", which was
unexpected.  Tighten the rule so that alias expansion is reported
only when "-h" is the sole option.

* rs/tighten-alias-help:
  git: show alias info only with lone -h
2025-08-01 11:27:35 -07:00
Junio C Hamano cbd1e6884f Merge branch 'ps/reflog-migrate-fixes' into jch
"git refs migrate" to migrate the reflog entries from a refs
backend to another had a handful of bugs squashed.

* ps/reflog-migrate-fixes:
  refs: fix invalid old object IDs when migrating reflogs
  refs: stop unsetting REF_HAVE_OLD for log-only updates
  refs/files: detect race when generating reflog entry for HEAD
  refs: fix identity for migrated reflogs
  ident: fix type of string length parameter
  builtin/reflog: implement subcommand to write new entries
  refs: export `ref_transaction_update_reflog()`
  builtin/reflog: improve grouping of subcommands
  Documentation/git-reflog: convert to use synopsis type
2025-08-01 11:27:35 -07:00
Junio C Hamano 44198bc7ed Merge branch 'jc/test-hashmap-is-still-here' into jch
Comment fix.

* jc/test-hashmap-is-still-here:
  test-hashmap: document why it is no longer used but still there
2025-08-01 11:27:34 -07:00
Junio C Hamano c0c966d6a9 ### match next 2025-08-01 11:27:34 -07:00
Junio C Hamano 36e035ed71 Merge branch 'kh/doc-fast-import-historical' into jch
Doc update.

* kh/doc-fast-import-historical:
  doc: fast-import: contextualize the hardware cost
2025-08-01 11:27:34 -07:00
Junio C Hamano 5a37868a42 Merge branch 'ms/meson-with-ancient-git-wo-ls-files-dedup' into jch
Build fix.

* ms/meson-with-ancient-git-wo-ls-files-dedup:
  meson: tolerate errors from git ls-files --deduplicate
2025-08-01 11:27:33 -07:00
Junio C Hamano a7a30f9d90 Merge branch 'jc/doc-release-vs-clear' into jch
Doc update.

* jc/doc-release-vs-clear:
  CodingGuidelines: clarify that S_release() does not reinitialize
2025-08-01 11:27:33 -07:00
Junio C Hamano 83b74261f1 Merge branch 'ch/t7450-recursive-clone-test-fix' into jch
Test fix.

* ch/t7450-recursive-clone-test-fix:
  t7450: inspect the correct path a broken code would write to
2025-08-01 11:27:32 -07:00
Junio C Hamano 7514324406 Merge branch 'js/prompt-crlf-fix' into jch
Interactive prompt code did not correctly strip CRLF from the end
of line on Windows.

* js/prompt-crlf-fix:
  interactive: do strip trailing CRLF from input
2025-08-01 11:27:32 -07:00
Junio C Hamano 8bf38dd1ef Merge branch 'ps/meson-clar-decls-fix' into jch
Build fix.

* ps/meson-clar-decls-fix:
  meson: ensure correct "clar-decls.h" header is used
2025-08-01 11:27:32 -07:00
Junio C Hamano c5b5a91906 Merge branch 'ps/object-file-wo-the-repository' into jch
Reduce implicit assumption and dependence on the_repository in the
object-file subsystem.

* ps/object-file-wo-the-repository:
  object-file: get rid of `the_repository` in index-related functions
  object-file: get rid of `the_repository` in `force_object_loose()`
  object-file: get rid of `the_repository` in `read_loose_object()`
  object-file: get rid of `the_repository` in loose object iterators
  object-file: remove declaration for `for_each_file_in_obj_subdir()`
  object-file: inline `for_each_loose_file_in_objdir_buf()`
  object-file: get rid of `the_repository` when writing objects
  odb: introduce `odb_write_object()`
  loose: write loose objects map via their source
  object-file: get rid of `the_repository` in `finalize_object_file()`
  object-file: get rid of `the_repository` in `loose_object_info()`
  object-file: get rid of `the_repository` when freshening objects
  object-file: inline `check_and_freshen()` functions
  object-file: get rid of `the_repository` in `has_loose_object()`
  object-file: stop using `the_hash_algo`
  object-file: fix -Wsign-compare warnings
2025-08-01 11:27:31 -07:00
Junio C Hamano da0059473b Merge branch 'lm/add-p-context' into jch
"git add/etc -p" now honors diff.context configuration variable,
and learns to honor -U<n> option.

* lm/add-p-context:
  add-patch: add diff.context command line overrides
  add-patch: respect diff.context configuration
  t: use test_config in t4055
  t: use test_grep in t3701 and t4055
2025-08-01 11:27:30 -07:00
Junio C Hamano 80a5b2626f Merge branch 'ps/config-wo-the-repository' into jch
The config API had a set of convenience wrapper functions that
implicitly use the_repository instance; they have been removed and
inlined at the calling sites.

* ps/config-wo-the-repository: (21 commits)
  config: fix sign comparison warnings
  config: move Git config parsing into "environment.c"
  config: remove unused `the_repository` wrappers
  config: drop `git_config_set_multivar()` wrapper
  config: drop `git_config_get_multivar_gently()` wrapper
  config: drop `git_config_set_multivar_in_file_gently()` wrapper
  config: drop `git_config_set_in_file_gently()` wrapper
  config: drop `git_config_set()` wrapper
  config: drop `git_config_set_gently()` wrapper
  config: drop `git_config_set_in_file()` wrapper
  config: drop `git_config_get_bool()` wrapper
  config: drop `git_config_get_ulong()` wrapper
  config: drop `git_config_get_int()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string_multi()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get()` wrapper
  config: drop `git_config_clear()` wrapper
  ...
2025-08-01 11:27:30 -07:00
Junio C Hamano 8462163402 Merge branch 'kn/for-each-ref-skip-updates' into jch
Code clean-up.

* kn/for-each-ref-skip-updates:
  ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'
  t6302: add test combining '--start-after' with '--exclude'
  for-each-ref: reword the documentation for '--start-after'
  for-each-ref: fix documentation argument ordering
  ref-cache: use 'size_t' instead of int for length
2025-08-01 11:27:29 -07:00
Junio C Hamano 764754243c Merge branch 'jt/switch-restore-no-longer-experimental' into jch
Declare that "git switch" and "git restore" are no longer
experimental.

* jt/switch-restore-no-longer-experimental:
  builtin: unmark git-switch and git-restore as experimental
2025-08-01 11:27:28 -07:00
Junio C Hamano 3436e0a057 Merge branch 'jb/t7510-gpg-program-path' into jch
A new test to ensure that a recent change will keep working.

* jb/t7510-gpg-program-path:
  t7510: use $PWD instead of $(pwd) inside PATH
  t7510: add test cases for non-absolute gpg program
2025-08-01 11:27:28 -07:00
Junio C Hamano ec03e91288 Merge branch 'cc/t9350-cleanup' into jch
Test clean-up.

* cc/t9350-cleanup:
  t9350: redirect input to only fast-import
2025-08-01 11:27:28 -07:00
Junio C Hamano 1e257b45d7 Merge branch 'hy/blame-simplify-get-commit-info' into jch
Code simplification.

* hy/blame-simplify-get-commit-info:
  blame: remove parameter detailed in get_commit_info()
2025-08-01 11:27:27 -07:00
Junio C Hamano 19c24654f8 Merge branch 'hl/test-helper-fd-close' into jch
A few file descriptors left unclosed upon program completion in a
few test helper programs are now closed.

* hl/test-helper-fd-close:
  test-delta: close output descriptor after use
  test-delta: use strbufs to hold input files
  test-delta: handle errors with die()
  t/helper/test-truncate: close file descriptor after truncation
2025-08-01 11:27:27 -07:00
Junio C Hamano 51fa2c816d Merge branch 'ow/rebase-verify-insn-fmt-before-initializing-state' into jch
"git rebase -i" with bogus rebase.instructionFormat configuration
failed to produce the todo file after recording the state files,
leading to confused "git status"; this has been corrected.

* ow/rebase-verify-insn-fmt-before-initializing-state:
  rebase: write script before initializing state
2025-08-01 11:27:27 -07:00
Junio C Hamano 6f5fa52960 Merge branch 'ps/object-store-midx' into jch
Redefine where the multi-pack-index sits in the object subsystem,
which recently was restructured to allow multiple backends that
support a single object source that belongs to one repository.  A
midx does span mulitple "object sources".

* ps/object-store-midx:
  midx: remove now-unused linked list of multi-pack indices
  packfile: stop using linked MIDX list in `get_all_packs()`
  packfile: stop using linked MIDX list in `find_pack_entry()`
  packfile: refactor `get_multi_pack_index()` to work on sources
  midx: stop using linked list when closing MIDX
  packfile: refactor `prepare_packed_git_one()` to work on sources
  midx: start tracking per object database source
2025-08-01 11:27:26 -07:00
Junio C Hamano 523c9b4260 Merge branch 'kn/for-each-ref-skip' into jch
"git for-each-ref" learns "--skip-until" option to help
applications that want to page its output.

* kn/for-each-ref-skip:
  ref-cache: set prefix_state when seeking
  for-each-ref: introduce a '--start-after' option
  ref-filter: remove unnecessary else clause
  refs: selectively set prefix in the seek functions
  ref-cache: remove unused function 'find_ref_entry()'
  refs: expose `ref_iterator` via 'refs.h'
2025-08-01 11:27:25 -07:00
Junio C Hamano 866e6a391f The sixteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 11:27:14 -07:00
Junio C Hamano 80b80162fd Merge branch 'sk/reftable-clarify-tests'
The reftable unit tests are now ported to the "clar" unit testing
framework.

* sk/reftable-clarify-tests:
  t/unit-tests: finalize migration of reftable-related tests
  t/unit-tests: convert reftable stack test to use clar
  t/unit-tests: convert reftable record test to use clar
  t/unit-tests: convert reftable readwrite test to use clar
  t/unit-tests: convert reftable table test to use clar
  t/unit-tests: convert reftable pq test to use clar
  t/unit-tests: convert reftable merged test to use clar
  t/unit-tests: convert reftable block test to use clar
  t/unit-tests: convert reftable basics test to use clar test framework
  t/unit-tests: implement clar specific reftable test helper functions
2025-08-01 11:27:14 -07:00
Junio C Hamano 6fe666b2ce Merge branch 'ly/pull-autostash'
"git pull" learned to pay attention to pull.autostash configuration
variable, which overrides rebase/merge.autostash.

* ly/pull-autostash:
  pull: add pull.autoStash config option
2025-08-01 11:27:14 -07:00
Junio C Hamano cbcde15e73 Merge branch 'jc/document-test-balloons-in-flight'
To help our developers, document what C99 language features are
being considered for adoption, in addition to what past experiments
have already decided.

* jc/document-test-balloons-in-flight:
  CodingGuidelines: document test balloons in flight
2025-08-01 11:27:13 -07:00
Junio C Hamano 8ad370f668 Merge branch 'ag/imap-send-list-folders-doc'
Document recently added "git imap-send --list" with an example.

* ag/imap-send-list-folders-doc:
  docs: explain how to use `git imap-send --list` command to get a list of available folders
2025-08-01 11:27:13 -07:00
Junio C Hamano 557c494c49 Merge branch 'cb/meson-avoid-broken-macos-pcre2'
Build fix for macOS.

* cb/meson-avoid-broken-macos-pcre2:
  meson: work around broken system PCRE2 dependency in macOS
2025-08-01 11:27:12 -07:00
Junio C Hamano 4f5b1616f2 Merge branch 'jc/ci-print-test-failures-fix'
CI fix.

* jc/ci-print-test-failures-fix:
  ci: allow github-actions print test failures again
2025-08-01 11:27:12 -07:00
Junio C Hamano a2384a76e7 Merge branch 'jk/unleak-reflog-expire-entry'
Leakfix.

* jk/unleak-reflog-expire-entry:
  reflog: close leak of reflog expire entry
2025-08-01 11:27:11 -07:00
Junio C Hamano 152871b88b Merge branch 'jc/do-not-scan-argv-without-parsing'
Update a hard-to-read in-code NEEDSWORK comment.

* jc/do-not-scan-argv-without-parsing:
  rev-list: update a NEEDSWORK comment
2025-08-01 11:27:11 -07:00
Junio C Hamano 2346617382 Merge branch 'jk/revision-no-early-output'
Remove unsupported, unused, and unsupportable old option from "git
log".

* jk/revision-no-early-output:
  revision: drop early output option
2025-08-01 11:27:11 -07:00
Junio C Hamano 6741b9b7c6 Merge branch 'jc/rev-list-info-cleanup'
Move structure definition from unrelated header file to where it
belongs.

* jc/rev-list-info-cleanup:
  rev-list: make "struct rev_list_info" static to the only user
2025-08-01 11:27:10 -07:00
Martin Storsjö 3bdd897413 meson: tolerate errors from git ls-files --deduplicate
When using the Meson build system with versions of Git before 2.31,
that does not yet know the `git ls-files --deduplicate` option, one
can observe the following error:

    ../meson.build:697:19: ERROR: Command `/usr/bin/git -C /home/martin/code/git ls-files --deduplicate '*.h' ':!contrib' ':!compat/inet_ntop.c' ':!compat/inet_pton.c' ':!compat/nedmalloc' ':!compat/obstack.*' ':!compat/poll' ':!compat/regex' ':!sha1collisiondetection' ':!sha1dc' ':!t/unit-tests/clar' ':!t/t[0-9][0-9][0-9][0-9]*' ':!xdiff'` failed with status 129.

The failing command is used to find all header files in our code
base, which is required for static analysis.

Static analysis is an entirely optional feature that distributors
typically don't care about, and we already know to skip running the
command when we are not in a Git repository. But we do not handle
the above failure gracefully, even though we could.

Fix this by passing `check: false` to `run_command`, which makes it
tolerate failures. Then check `returncode()` manually to decide
whether to inspect the output.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 11:06:59 -07:00
Kristoffer Haugsbakk cca758d324 doc: fast-import: contextualize the hardware cost
6e411d2044 (Initial draft of fast-import documentation., 2007-02-05)
pointed out how much time a fast-import took on some hardware with a
specific cost.  Let’s further point out that this experiment was done
in 2007.  So modern hardware should have no issues with such a repo.

Also move the parenthetical to the end now that it contains four words.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 10:40:26 -07:00
Junio C Hamano 4ac3302a1a CodingGuidelines: clarify that S_release() does not reinitialize
In the section for naming various API functions, the fact that
S_release() only releases the resources without preparing the
structure for immediate reuse becomes only apparent when you
readentries for S_release() and S_clear().

Clarify the description of S_release() a bit to make the entry self
sufficient.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 10:08:17 -07:00