Commit Graph

82090 Commits (3daa89ed0f3d9420b5c508f42e04c4e5229b53fc)

Author SHA1 Message Date
Junio C Hamano 3daa89ed0f checkout: extract branch setup and tracking helpers
The checkout_main() function validates branch-creation options,
DWIMs tracking branch options, and sets up branch information
directly in its body.

Extract these branch setup operations into static helper functions:

  - validate_branch_options() validates compatibility of '-b', '-B',
    and '--orphan' options.

  - dwim_branch_track_option() infers the branch name when '--track'
    is given without an explicit branch name.

  - setup_branch_name_and_info() drives branch validation and parses
    the branch name argument.

Call the new setup helper from checkout_main().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-30 13:49:46 -07:00
Junio C Hamano 0ae025f69c checkout: extract option validation and pathspec helpers
The checkout_main() function handles initialization, option parsing,
option validation, and pathspec resolution.

Extract option validation and pathspec handling logic into static
helper functions:

  - init_checkout_opts() initializes default checkout options and
    repo settings.

  - validate_path_options() validates patch context and
    index/worktree flags.

  - prepare_common_options() prepares progress, merge, and force
    options.

  - parse_pathspec_from_file_options() parses and validates
    pathspecs read from a file.

Call these helpers from checkout_main().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-30 13:49:46 -07:00
Junio C Hamano d2e9d3597a checkout: validate stage and merge option compatibility in checkout_paths()
In checkout_main(), checking that no more than one of --ours/--theirs,
--force, and --merge is specified is performed when pathspecs are
present, before dispatching to checkout_paths().  Checking out a
branch does not use index stages, so this validation belongs in
checkout_paths().

Move the incompatibility check from checkout_main() into
checkout_paths().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-30 13:49:46 -07:00
Junio C Hamano 3b87cfb731 checkout: validate new branch name in checkout_branch()
In checkout_main(), new branch name validation is performed before
dispatching to checkout_branch() or checkout_paths().  Checking out
paths does not create new branches, so this validation only belongs
in checkout_branch().

Move the validate_branchname() and validate_new_branchname() calls
from checkout_main() into checkout_branch().  checkout_paths()
checks and fails if '.new_branch' is set before doing anything,
which indicates that this change is safe and makes good sense.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-30 13:49:46 -07:00
Junio C Hamano e3eda4a6f7 checkout: pass cb_option explicitly to branch name parsers
The file-scope static variable 'cb_option' is used to record whether
a new branch is being created via '-b' (in 'git checkout') or '-c'
(in 'git switch'), primarily for error reporting and advice messages
in parse_remote_branch().

Global mutable state makes the code harder to reason about and refactor.

Pass 'cb_option' explicitly as a parameter to parse_remote_branch()
and parse_branchname_arg(), removing the file-scope static variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-30 13:49:46 -07:00
Junio C Hamano c73e85354c The 20th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-28 11:04:57 -07:00
Junio C Hamano f9a1c7b83b Merge branch 'sk/object-name-use-after-free'
A heap-use-after-free bug in the object name parsing code when
reporting failures with a relative path to a sparse directory has
been corrected.

* sk/object-name-use-after-free:
  object-name: avoid use-after-free in get_oid_with_context_1()
2026-08-28 11:04:57 -07:00
Junio C Hamano 9c94d206f0 Merge branch 'kh/format-rev-doc-synopsis'
The documentation for 'git format-rev' has been updated to use the
[synopsis] block definition on code blocks to properly highlight
placeholders, and a quoting inconsistency in the running text has
been fixed.

* kh/format-rev-doc-synopsis:
  doc: format-rev: use [synopsis] on code block
  doc: format-rev: quote subject placeholder before and after
2026-08-28 11:04:57 -07:00
Junio C Hamano f78ce2f7b6 The 19th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-25 10:53:34 -07:00
Junio C Hamano fee541a0d8 Merge branch 'jc/complete-checkout'
'git -C <dir> checkout fi<TAB>' did not complete, which has been
corrected.

* jc/complete-checkout:
  completion: 'git checkout' completes untracked paths as a last resort
  completion: complete tracked paths for "git checkout"
  completion: no-op refactoring of checkout completion
2026-08-25 10:53:34 -07:00
Junio C Hamano 4e5713a686 Merge branch 'jc/complete-diff-tracked-paths'
'git -C <dir> diff fi<TAB>' did not complete 'file', which has been
corrected.

* jc/complete-diff-tracked-paths:
  completion: 'git diff' completes untracked paths as a last resort
  completion: complete tracked paths for 'git diff'
  completion: no-op refactoring of diff completion
2026-08-25 10:53:33 -07:00
Junio C Hamano 3caf98a8bf Merge branch 'ch/chdir-notify-drop-name'
The unused name parameter in 'struct chdir_notify_entry' has been
removed from chdir_notify_register(), chdir_notify_unregister(), and
related callback signatures across several subsystems, simplifying the
API now that trace output no longer uses it.

* ch/chdir-notify-drop-name:
  chdir-notify.h: Removed unused param 'name'
2026-08-25 10:53:33 -07:00
Junio C Hamano b7677512b3 Merge branch 'js/packfile-fast-append'
The performance of adding numerous new packfiles has been improved
by introducing a fast path for known-new packfiles to skip an
unnecessary traversal in packfile_list_append(), avoiding a
quadratic complexity regression on load.

* js/packfile-fast-append:
  packfile: fix perf regression with many packs
2026-08-25 10:53:33 -07:00
Junio C Hamano 6d7be5f7fd Merge branch 'ss/submittingpatches-typofix'
Typofix.

* ss/submittingpatches-typofix:
  doc: fix typo in submitting patches
2026-08-25 10:53:32 -07:00
Junio C Hamano 6730f07098 Merge branch 'ss/repack-drop-filtered'
'git repack' has been taught '--drop-filtered' to delete local
promisor blobs exceeding a limit (currently 'blob:limit=') in partial
clones, reclaiming space.  Guards prevent running during other
operations or if referenced by the index.

* ss/repack-drop-filtered:
  builtin/repack: add guards for --drop-filtered
  builtin/repack: actually drop filtered promisor blobs
  builtin/repack: enumerate promisor blobs for --drop-filtered
  repack-promisor: allow excluding objects from the rebuilt promisor pack
  list-objects-filter: add list_objects_filter__filter_oidset()
  builtin/repack: add --drop-filtered and --dry-run options
2026-08-25 10:53:32 -07:00
Junio C Hamano 2c3adbb2c4 The 18th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-24 13:17:51 -07:00
Junio C Hamano 66573dbe3a Merge branch 'en/diff-l-opt-help'
The help text for the '-l' option of 'git diff' has been updated.

* en/diff-l-opt-help:
  diff: avoid misleading statement about -l option
2026-08-24 13:17:51 -07:00
Junio C Hamano 18ce227f12 Merge branch 'ps/t7900-deflake-maintenance'
Various tests in 't7900-maintenance.sh' have been updated to use a
throwaway repository, and auto-detaching of maintenance tasks is now
disabled for these tests to fix flaky races with concurrent background
maintenance jobs.

* ps/t7900-deflake-maintenance:
  t7900: fix flaky "maintenance.strategy" test
  t7900: adapt some tests to use a throwaway repository
2026-08-24 13:17:51 -07:00
Junio C Hamano bc4c56690e Merge branch 'en/serve-promisor-remote-fix'
A client requesting the promisor-remote capability without a value
caused a null pointer dereference, which has been corrected by
rejecting a request without an argument.

* en/serve-promisor-remote-fix:
  serve: reject valueless promisor-remote capability
2026-08-24 13:17:51 -07:00
Junio C Hamano 781fd4ea83 Merge branch 'js/pack-objects-delta-size-t'
The 'pack-objects' and delta-encoding code paths have been updated to
use 'size_t' instead of 'unsigned long' for object sizes and offset
limits, avoiding potential truncation issues on 64-bit Windows.

* js/pack-objects-delta-size-t:
  packfile: widen `unpack_object_header_buffer()` to `size_t`
  git-zlib: widen `git_deflate_bound()` to `size_t`
  t/helper/test-pack-deltas: widen `do_compress()`'s maxsize local to `size_t`
  http-push: widen `start_put()`'s size local from `ssize_t` to `size_t`
  diff: widen `deflate_it()`'s bound local from int to `size_t`
  archive-zip: widen `zlib_deflate_raw()`'s maxsize local to `size_t`
  packfile, git-zlib: widen `use_pack()` and zstream avail fields to `size_t`
  delta: widen `create_delta()` and `diff_delta()` to `size_t`
  pack-objects: widen `mem_usage` and `try_delta()`'s out-param to `size_t`
  pack-objects: widen `free_unpacked()` return to `size_t`
  pack-objects: widen delta-cache accounting to `size_t`
  delta: widen `create_delta_index()` parameter to `size_t`
  diff-delta: widen `struct delta_index`' size fields to `size_t`
2026-08-24 13:17:51 -07:00
Junio C Hamano 32f49ed9f2 Merge branch 'cc/git-shallow-file-wo-value'
The '--shallow-file' option of 'git' command requires a value, but the
code did not check the presence of a value and instead segfaulted
without one, which has been corrected.

* cc/git-shallow-file-wo-value:
  git: avoid segfault on "git --shallow-file" without a value
2026-08-24 13:17:50 -07:00
Junio C Hamano 15b23b50a6 Merge branch 'en/sequencer-lose-pretty-given'
The setting of a now-unused member '.pretty_given' in the sequencer
machinery has been removed.

* en/sequencer-lose-pretty-given:
  sequencer: remove unnecessary variable setting
2026-08-24 13:17:50 -07:00
Junio C Hamano fcc8c931b5 Merge branch 'js/coverity-unchecked-returns-fix'
A handful of code paths have been corrected to check return values
from functions like curl_easy_duphandle(), deflateInit(), lseek(),
dup(), and strbuf_getline_lf(), resolving several Coverity warnings
about unchecked returns.

* js/coverity-unchecked-returns-fix:
  bisect: handle dup() failure when redirecting stdout
  bisect: check get_terms return at all call sites
  bisect: check strbuf_getline_lf return when reading terms
  transport-helper: warn when export-marks file cannot be finalized
  transport-helper: check dup() return in get_exporter
  compat/pread: check initial lseek for errors
  last-modified: handle repo_parse_commit() failures
  reftable tests: check reftable_table_init_ref_iterator() return
  reftable/block: check deflateInit() return value
  reftable: handle block-writer initialization errors
  config: propagate launch_editor() failure in show_editor()
  http: die on curl_easy_duphandle failure in get_active_slot
2026-08-24 13:17:50 -07:00
Junio C Hamano 593c42fe07 The 17th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-23 18:01:47 -07:00
Junio C Hamano 679a72c6b8 Merge branch 'kk/merge-base-exhaustion'
The merge-base computation has been optimized by stopping the walk
early when one side's exclusive commits in the queue are exhausted,
yielding significant speedups for queries with one-sided histories.

* kk/merge-base-exhaustion:
  commit-reach: remove commit-date ordering fallback
  commit-reach: move min_generation check into paint_queue_get()
  commit-reach: terminate merge-base walk when one paint side is exhausted
  commit-reach: introduce struct paint_state with per-side counters
  t6600: add clock-skew topologies and step counts for edge cases
  commit-reach: add trace2 instrumentation to paint_down_to_common()
  t6099: add side-exhaustion regression test
  t6600: add test cases for side-exhaustion edge cases
  test-lib-functions: improve diagnostic output for trace2 data assertions
  Documentation/technical: add paint-down-to-common doc
2026-08-23 18:01:46 -07:00
Junio C Hamano e8e7bf97fe Merge branch 'js/sequencer-release-odb-before-commit'
The sequencer has been updated to release the object database before
spawning 'git commit'.  This prevents open file handles from
blocking auto-maintenance tasks, such as repacking, on systems like
Windows where open files cannot be easily unlinked.

* js/sequencer-release-odb-before-commit:
  sequencer: release the ODB before spawning git commit
2026-08-23 18:01:45 -07:00
Junio C Hamano 6aab7b26a6 Merge branch 'hn/send-email-missing-subject-error'
The error message given by 'git send-email' when a message file is
missing a 'Subject:' header has been clarified, and the error string
is now terminated with a newline so that Perl avoids appending its
internal source location data.

* hn/send-email-missing-subject-error:
  send-email: clarify missing subject error
2026-08-23 18:01:44 -07:00
Junio C Hamano a2ef06b1ef Merge branch 'ps/odb-streams'
The 'struct odb_read_stream' and 'struct odb_write_stream'
structures have been consolidated into a single unified 'struct
odb_stream' structure, simplifying object database streaming APIs
and enabling streaming of arbitrary object types.

* ps/odb-streams:
  odb/streaming: unify function names to create new streams
  odb/streaming: rename `struct input_zstream_data`
  odb/streaming: rename `struct read_object_fd_data`
  odb/streaming: consolidate read and write streams
  odb/streaming: rename `struct odb_read_stream`
  odb/streaming: support streaming arbitrary object types
  odb/streaming: drop `is_finished` field
  odb/streaming: track write stream size in the structure
2026-08-23 18:01:43 -07:00
Junio C Hamano 10d3ea2469 Merge branch 'cc/fast-import-usage'
The usage string of 'git fast-import' has been updated to use the
parse_options() API for displaying help, and its SYNOPSIS in the
documentation has been standardized to match.

* cc/fast-import-usage:
  fast-import: remove useless from_stream argument
  fast-import: use parse_options() for command line options
  fast-import: use callbacks to parse some options
  fast-import: use struct option for usage string
  fast-import: move command state globals into 'struct fast_import_state'
  fast-import: introduce 'struct fast_import_state'
  fast-import: factor out option_*() functions
  fast-import: use int for some bool flags
  fast-import: localize 'i' into the 'for' loops using it
  api-parse-options.adoc: document hidden and OPT_*_F option macros
  api-parse-options.adoc: document per-option flags
  parse-options: introduce OPT_HIDDEN_GROUP
2026-08-23 18:01:42 -07:00
Junio C Hamano 4b27b7c707 Merge branch 'ps/cat-file-remote-object-info-type'
The 'remote-object-info' command for 'git cat-file --batch-command'
has been extended to support the '%(objecttype)' placeholder.

* ps/cat-file-remote-object-info-type:
  cat-file: unify default format
  serve: advertise type capability
  fetch-object-info: parse type from server response
  protocol-caps: add type support to object-info
  transport: drop remote object-info fields from transport struct
  fetch-object-info: die() on the remaining error path
  fetch-object-info: use dedicated struct for the results
  fetch-object-info: pass arguments directly instead of a struct
  fetch-object-info: detect malformed server responses
  t5701: use test_file_size() to get the size of a file
2026-08-23 18:01:42 -07:00
Junio C Hamano 1a3e64c6c4 The 16th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-20 07:30:52 -07:00
Junio C Hamano 3f664917c2 Merge branch 'kh/doc-trailers'
Documentation for 'git interpret-trailers' has been updated to explain
the format of trailer keys (alphanumeric characters and hyphens),
replace outdated terminology, define key terms upfront, and document
how comment lines in the input are treated.

* kh/doc-trailers:
  doc: interpret-trailers: document comment line treatment
  doc: interpret-trailers: rewrite new-trailers paragraphs
  doc: interpret-trailers: commit to “trailer block” term
  doc: interpret-trailers: join new-trailers again
  doc: interpret-trailers: add key format example
  doc: interpret-trailers: explain key format
  doc: interpret-trailers: explain the format after the intro
  doc: interpret-trailers: not just for commit messages
  doc: interpret-trailers: use “metadata” in Name as well
  doc: interpret-trailers: replace “lines” with “metadata”
  doc: interpret-trailers: stop fixating on RFC 822
2026-08-20 07:30:52 -07:00
Junio C Hamano 2f6614658f Merge branch 'ps/odb-make-creation-pluggable'
The creation of the on-disk data structures for the object database
has been made pluggable, allowing future backends to customize their
setup.  As part of this, the initialization of the object database
has been deferred, and the loading of the loose-object map has been
detangled from repository initialization.

* ps/odb-make-creation-pluggable:
  odb: make creation of on-disk structures pluggable
  odb/source: introduce function to map source type to name
  setup: defer object database creation
  setup: handle ODB-related environment variables in `odb_new()`
  setup: detangle loading of loose object maps
  loose: load loose object map for the correct source
2026-08-20 07:30:52 -07:00
Junio C Hamano 006933a32c Merge branch 'hn/branch-delete-merged'
The 'git branch' command has been taught the '--delete-merged' option
to remove local branches that are already merged into their tracked
remote-tracking branches.

* hn/branch-delete-merged:
  branch: add --dry-run for --delete-merged
  branch: add branch.<name>.deleteMerged opt-out
  branch: add --delete-merged <pattern>
  branch: prepare delete_branches for a bulk caller
  branch: let delete_branches skip unmerged branches on bulk refusal
  branch: convert delete_branches() to a flags argument
  branch: add --forked filter for --list mode
2026-08-20 07:30:51 -07:00
Junio C Hamano dea0ea3582 The 15th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-18 09:31:36 -07:00
Junio C Hamano e23356ae1a Merge branch 'hn/bisect-reset-when-found'
The 'git bisect' command has been taught a
'--reset-when-found[=<where>]' option that tells the command to
automatically run 'git bisect reset' to jump back to the original
state or to the found culprit.

* hn/bisect-reset-when-found:
  bisect: add --reset-when-found to leave when done
  bisect: let bisect_reset() optionally check out quietly
2026-08-18 09:31:36 -07:00
Junio C Hamano 3beb8bb742 Merge branch 'ps/writev'
A compatibility wrapper for writev(3p) has been reintroduced,
including fixes for CMake build and 'MAX_IO_SIZE' limits on NonStop.
Calls to write(3p) in send_sideband() and cat_blob() have been
refactored to use writev(3p) wrappers to reduce syscall overhead.

* ps/writev:
  fast-import: use writev(3p) to send cat-blob responses
  sideband: use writev(3p) to send pktlines
  wrapper: properly handle MAX_IO_SIZE in writev(3p)
  wrapper: introduce writev(3p) wrappers
  compat/posix: introduce writev(3p) wrapper
2026-08-18 09:31:36 -07:00
Junio C Hamano 1428b15baf Merge branch 'kh/doc-refs-migrate-limitations'
The known limitations of the ref format migration in 'git refs' have
been moved to be displayed as a warning admonition directly under the
description of the 'migrate' subcommand, improving visibility.  A
reference to 'git-maintenance' has also been corrected to use the
'linkgit' macro.

* kh/doc-refs-migrate-limitations:
  doc: refs: linkgit to git-maintenance(1)
  doc: refs: put ref migration warning under the command
2026-08-18 09:31:36 -07:00
Kristoffer Haugsbakk 634257a89b doc: format-rev: use [synopsis] on code block
This code block uses the placeholder `<subject>`. Let’s highlight this
placeholder properly by using the `synopsis` open block definition which
was introduced in a34d1d53 (doc: convert git-show to synopsis style,
2026-02-06). This renders the block like a code block but with emphasis
styling on placeholders, just like inline-verbatim (`) in running text.

Yes, note that open blocks since commit a34d1d53 can, on synopsis-style
docs like this one, be immediately preceded by `[synopsis]`, just like
the command synopsis is:

    [synopsis]
    (EXPERIMENTAL!) git format-rev - [...]

Cf. verse-style:

    [verse]
    'git name-rev' [...]

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-17 13:33:06 -07:00
Kristoffer Haugsbakk ddd7de1341 doc: format-rev: quote subject placeholder before and after
We first talk about just `%s`, but then show the result with
quotes. That is inconsistent. Let’s use quotes both in the format
as well as in the result.

The implied input here, which is not spelled out for brevity, is:

    Did we not fix this in <commit object name>?

Which is then supposed to be formatted to `"<subject>"`.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-17 13:33:06 -07:00
Shlok Kulshreshtha 0bb83c5f47 object-name: avoid use-after-free in get_oid_with_context_1()
When a ":<path>" argument names a relative path, resolve_relative_path()
returns a newly allocated string and "cp" is pointed at it:

	new_path = resolve_relative_path(repo, cp);
	if (!new_path) {
		namelen = namelen - (cp - name);
	} else {
		cp = new_path;
		namelen = strlen(cp);
	}

From there on "cp" and "new_path" name the same allocation. Later the
memory location that "new_path" points to is freed.

	free(new_path);
	if (reject_tree_in_index(repo, only_to_die, ce, stage, prefix, cp))

But here the reject_tree_in_index() passes "cp" to
diagnose_invalid_index_path(), which calls strlen() on it, looks it up
in the index, and formats it into its messages, allocating as it goes.
All of this reads memory that has already been freed.

Collapse the two exits into one to ensure a single free() that happens
after the last use.

Three things have to coincide to reach this:

1. The path has to be relative, or nothing is allocated and "cp"
still points into the argument.

2. The entry found has to be a sparse
directory, which needs a sparse index.

3. The argument has to get past the check in die_verify_filename() that
skips a leading ':' followed by a non-alphanumeric, so ":0:./dir/"
arrives here where ":./dir/" does not.

Add a test to t1092 that covers the combination. It fails under
SANITIZE=address without the change to object-name.c.

This was reported in [1], and the shape used here was suggested in
review [2], but that series was not rerolled and the fix never landed.

[1] https://lore.kernel.org/git/cf6bcdb43e5b4abab464c30a914d64dc8e7a9925.1655336146.git.gitgitgadget@gmail.com/
[2] https://lore.kernel.org/git/xmqqy1xxw7rc.fsf@gitster.g/

Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Original-patch-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Helped-by: Junio C Hamano <gitster@pobox.com>
Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Shlok Kulshreshtha <diy2903@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-17 08:39:12 -07:00
Junio C Hamano 18e66859d8 The 14th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-15 09:20:27 -07:00
Junio C Hamano 230296d560 Merge branch 'jc/add-resolved'
'git add' has been taught a new '--resolved' option to stage
conflict-resolved paths, while leaving unrelated local changes
unstaged.  It scans the unmerged paths for leftover conflict
markers and aborts if any are found.

* jc/add-resolved:
  add: introduce '--resolved' option
  read-cache: add remove_file_from_index_with_flags()
  merge-ll: consolidate conflict marker scanning logic
  read-cache: reindent
2026-08-15 09:20:27 -07:00
Junio C Hamano 90d7103396 Merge branch 'kl/t7528-ssh-agent-for-csh-users'
The 'ssh-agent' tests in 't7528' have been fixed to work when the
user's login shell is csh-like, by explicitly passing '-s' to
'ssh-agent' to force Bourne shell syntax.

* kl/t7528-ssh-agent-for-csh-users:
  t7528: fix failure under csh
2026-08-15 09:20:27 -07:00
Junio C Hamano 8b34c1f352 Merge branch 'tn/packfile-uri-concurrency'
Concurrent downloads of packfiles via packfile URIs and dumb HTTP are
safer by avoiding concurrent appends to the staging file.  Opening in
read-write mode with separate file offsets prevents corruption and
preserves resumability.  'fetch-pack' now tolerates pre-existing
'.keep' files.

* tn/packfile-uri-concurrency:
  fetch-pack: accept "pack" output for packfile URIs
  http: permit unlinking partial packs on Windows
  http: avoid concurrent appends to partial packs
  http: accept HTTP 416 for complete partial packs
  http: avoid closing index-pack input twice
  http-fetch: correct --index-pack-arg documentation
2026-08-15 09:20:27 -07:00
Junio C Hamano f2f3a37b68 Merge branch 'jm/t0213-skip-emulated-ancestry-tests'
The 'TRACE2_ANCESTRY' prerequisite in the 't0213' test script has been
refined to avoid failures under user-mode emulation by verifying that
the ancestry collector reports the expected process names rather than
the emulator binary name.

* jm/t0213-skip-emulated-ancestry-tests:
  t0213: skip ancestry tests under user-mode emulation
2026-08-15 09:20:26 -07:00
Colin Hinton f17d211c97 chdir-notify.h: Removed unused param 'name'
The `name` parameter in `chdir_notify_entry` was only ever used by
chdir_notify_reparent() to produce trace output. That function was
removed in 5bf546755c (chdir-notify: drop unused
`chdir_notify_reparent()`, 2026-06-25), which left `name` with no
remaining consumers.

Prior to that removal, most callers had already stopped passing a
meaningful name, switching to NULL in 1f43ff2c7e (refs: unregister
reference stores from "chdir_notify", 2026-06-25) and 0de2467e6c
(odb/source-packed: start converting to a proper `struct odb_source`,
2026-06-17).

Since no caller has populated `name` with real data for some time,
and its last consumer is gone, drop it from chdir_notify_register(),
chdir_notify_unregister(), and the callback signature to simplify
the API.

Signed-off-by: Colin Hinton <colinlewishinton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-14 15:08:35 -07:00
Swapnil Saste | INDIA 026636128f doc: fix typo in submitting patches
Remove the article "an" before "incremental updates".

Signed-off-by: Swapnil Saste | INDIA <theswapnilsaste@gmail.Com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-14 12:21:29 -07:00
Elijah Newren 764243bdf4 diff: avoid misleading statement about -l option
In commit 6623a528e0 (doc: clarify documentation for rename/copy
limits, 2021-07-15), the wording around rename limit options and config
variables were updated to point out that only the quadratic portion of
rename detection (or "exhaustive portion of rename/copy detection" as
used in that commit) was limited by these options, because exact rename
detection and basename-guided rename detection (which both run in time
linear in the number of files) still run before this limit is checked.

However, the short help message wasn't updated at the time; update it
too.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-13 20:21:42 -07:00
Siddharth Shrimali c6fed8b7a6 builtin/repack: add guards for --drop-filtered
--drop-filtered removes local promisor blobs. That is only safe when the
repository is not mid-operation and when the blobs are not actively in
use, so add two guards, both skipped for bare repositories which have
neither a worktree nor an index.

First, refuse to run while a merge, rebase, am, cherry-pick, revert, or
bisect is in progress. During these operations the working tree and
index are in an intermediate state, and rewriting packs and deleting
objects underneath a half-finished operation is unsafe.

Second, refuse to drop a blob that the current index references. Such a
blob is needed by the working tree, so dropping it would only cause the
next command that touches the worktree to lazy-fetch it straight back,
reclaiming nothing. The offending path is reported so the user can see
why the drop was refused.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-13 13:34:50 -07:00