summaryrefslogtreecommitdiffstats
path: root/t
AgeCommit message (Collapse)AuthorLines
3 daysMerge branch 'sp/send-email-validate-charset'Junio C Hamano-1/+1
"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
3 daysMerge branch 'ss/t9123-setup-inside-test-expect-success'Junio C Hamano-6/+9
Test clean-up. * ss/t9123-setup-inside-test-expect-success: t9123: use test_when_finished for cleanup
3 daysMerge branch 'sk/oidmap-clear-with-custom-free-func'Junio C Hamano-0/+41
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
3 daysMerge branch 'ss/t3700-modernize'Junio C Hamano-18/+31
Test clean-up. * ss/t3700-modernize: t3700: use test_grep helper for better diagnostics t3700: avoid suppressing git's exit code
3 daysMerge branch 'bc/sha1-256-interop-02'Junio C Hamano-32/+70
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
5 daysMerge branch 'jh/alias-i18n-fixes'Junio C Hamano-0/+14
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
5 daysMerge branch 'pt/fsmonitor-watchman-sample-fix'Junio C Hamano-13/+3
Fix typo-induced breakages in fsmonitor-watchman sample hook. * pt/fsmonitor-watchman-sample-fix: fsmonitor-watchman: fix variable reference and remove redundant code
5 daysMerge branch 'mm/diff-no-index-find-object'Junio C Hamano-0/+10
"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
5 daysMerge branch 'fp/t3310-test-path-is-helpers'Junio C Hamano-6/+6
Test clean-up. * fp/t3310-test-path-is-helpers: t3310: replace test -f/-d with test_path_is_file/test_path_is_dir
5 daysMerge branch 'ss/test-that-that-typofix'Junio C Hamano-1/+1
Typofix in t/. * ss/test-that-that-typofix: t: fix "that that" typo in lib-unicode-nfc-nfd.sh
5 daysMerge branch 'ar/config-hooks'Junio C Hamano-6/+238
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
5 daysMerge branch 'kh/format-patch-noprefix-is-boolean'Junio C Hamano-0/+16
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
6 daysMerge branch 'lp/diff-stat-utf8-display-width-fix'Junio C Hamano-0/+32
"git log --graph --stat" did not count the display width of colored graph part of its own output correctly, which has been corrected. * lp/diff-stat-utf8-display-width-fix: t4052: test for diffstat width when prefix contains ANSI escape codes diff: handle ANSI escape codes in prefix when calculating diffstat width
6 daysMerge branch 'cs/add-skip-submodule-ignore-all'Junio C Hamano-4/+139
"git add <submodule>" has been taught to honor submodule.<name>.ignore that is set to "all" (and requires "git add -f" to override it). * cs/add-skip-submodule-ignore-all: Documentation: update add --force option + ignore=all config tests: fix existing tests when add an ignore=all submodule tests: t2206-add-submodule-ignored: ignore=all and add --force tests read-cache: submodule add need --force given ignore=all configuration read-cache: update add_files_to_cache take param ignored_too
6 daysMerge branch 'ps/refs-for-each'Junio C Hamano-5/+10
Code refactoring around refs-for-each-* API functions. * ps/refs-for-each: refs: replace `refs_for_each_fullref_in()` refs: replace `refs_for_each_namespaced_ref()` refs: replace `refs_for_each_glob_ref()` refs: replace `refs_for_each_glob_ref_in()` refs: replace `refs_for_each_rawref_in()` refs: replace `refs_for_each_rawref()` refs: replace `refs_for_each_ref_in()` refs: improve verification for-each-ref options refs: generalize `refs_for_each_fullref_in_prefixes()` refs: generalize `refs_for_each_namespaced_ref()` refs: speed up `refs_for_each_glob_ref_in()` refs: introduce `refs_for_each_ref_ext` refs: rename `each_ref_fn` refs: rename `do_for_each_ref_flags` refs: move `do_for_each_ref_flags` further up refs: move `refs_head_ref_namespaced()` refs: remove unused `refs_for_each_include_root_ref()`
6 daysMerge branch 'ar/run-command-hook-take-2'Junio C Hamano-2/+218
Use the hook API to replace ad-hoc invocation of hook scripts via the run_command() API. * ar/run-command-hook-take-2: builtin/receive-pack: avoid spinning no-op sideband async threads 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
10 dayst9123: use test_when_finished for cleanupSiddharth Shrimali-6/+9
Move the setup logic into a 'test_expect_success' block. This ensures that the code is properly tracked by the test harness. Additionally, we use the 'test_when_finished' helper at the start of the block to ensure that the 'import' directory is removed even if the test fails. This is cleaner than the previous manual 'rm -rf import' approach. Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 daysoidmap: make entry cleanup explicit in oidmap_clearSeyi Kufoiji-0/+41
Replace oidmap's use of hashmap_clear_() and layout-dependent freeing with an explicit iteration and optional free callback. This removes reliance on struct layout assumptions while keeping the existing API intact. Add tests for oidmap_clear_with_free behavior. test_oidmap__clear_with_free_callback verifies that entries are freed when a callback is provided, while test_oidmap__clear_without_free_callback verifies that entries are not freed when no callback is given. These tests ensure the new clear implementation behaves correctly and preserves ownership semantics. Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 daysMerge branch 'ps/fsck-stream-from-the-right-object-instance'Junio C Hamano-13/+54
"fsck" iterates over packfiles and its access to pack data caused the list to be permuted, which caused it to loop forever; the code to access pack data by "fsck" has been updated to avoid this. * ps/fsck-stream-from-the-right-object-instance: pack-check: fix verification of large objects packfile: expose function to read object stream for an offset object-file: adapt `stream_object_signature()` to take a stream t/helper: improve "genrandom" test helper
10 daysMerge branch 'pt/t7527-flake-workaround'Junio C Hamano-38/+41
Test fixup. * pt/t7527-flake-workaround: t7527: fix flaky fsmonitor event tests with retry logic
11 daysMerge branch 'ds/config-list-with-type'Junio C Hamano-1/+83
"git config list" is taught to show the values interpreted for specific type with "--type=<X>" option. * ds/config-list-with-type: config: use an enum for type config: restructure format_config() config: format colors quietly color: add color_parse_quietly() config: format expiry dates quietly config: format paths gently config: format bools or strings in helper config: format bools or ints gently config: format bools gently config: format int64s gently config: make 'git config list --type=<X>' work config: add 'gently' parameter to format_config() config: move show_all_config()
11 daysMerge branch 'lo/repo-leftover-bits'Junio C Hamano-5/+5
Clean-up the code around "git repo info" command. * lo/repo-leftover-bits: Documentation/git-repo: capitalize format descriptions Documentation/git-repo: replace 'NUL' with '_NUL_' t1901: adjust nul format output instead of expected value t1900: rename t1900-repo to t1900-repo-info repo: rename struct field to repo_info_field repo: replace get_value_fn_for_key by get_repo_info_field repo: rename repo_info_fields to repo_info_field CodingGuidelines: instruct to name arrays in singular
11 daysMerge branch 'ps/maintenance-geometric-default'Junio C Hamano-7/+59
"git maintenance" starts using the "geometric" strategy by default. * ps/maintenance-geometric-default: builtin/maintenance: use "geometric" strategy by default t7900: prepare for switch of the default strategy t6500: explicitly use "gc" strategy t5510: explicitly use "gc" strategy t5400: explicitly use "gc" strategy t34xx: don't expire reflogs where it matters t: disable maintenance where we verify object database structure t: fix races caused by background maintenance
11 daysMerge branch 'jr/apply-directory-normalize'Junio C Hamano-0/+41
"git apply --directory=./un/../normalized/path" now normalizes the given path before using it. * jr/apply-directory-normalize: apply: normalize path in --directory argument
11 daysMerge branch 'pw/no-more-NULL-means-current-worktree'Junio C Hamano-0/+9
API clean-up for the worktree subsystem. * pw/no-more-NULL-means-current-worktree: path: remove repository argument from worktree_git_path() wt-status: avoid passing NULL worktree
11 daysMerge branch 'sp/shallow-deepen-relative-fix'Junio C Hamano-0/+23
"git fetch --deepen" that tries to go beyond merged branch used to get confused where the updated shallow points are, which has been corrected. * sp/shallow-deepen-relative-fix: shallow: handling fetch relative-deepen shallow: free local object_array allocations
11 daysMerge branch 'kn/ref-location'Junio C Hamano-0/+281
Allow the directory in which reference backends store their data to be specified. * kn/ref-location: refs: add GIT_REFERENCE_BACKEND to specify reference backend refs: allow reference location in refstorage config refs: receive and use the reference storage payload refs: move out stub modification to generic layer refs: extract out `refs_create_refdir_stubs()` setup: don't modify repo in `create_reference_database()`
12 dayst3700: use test_grep helper for better diagnosticsSiddharth Shrimali-18/+18
Replace 'grep' and '! grep' invocations with 'test_grep' and 'test_grep !'. This provides better debugging output if tests fail in the future, as 'test_grep' will automatically print the contents of the file when a check fails. While at it, update any remaining instances of 'grep' to 'test_grep' that were missed in the previous versions to ensure that the entire file is consistent with modern project style. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 dayst3700: avoid suppressing git's exit codeSiddharth Shrimali-15/+28
Replace pipelines involving git commands with temporary files (actual) to ensure that any crashes or unexpected exit codes from the git commands are properly caught by the test suite. A simple pipeline like 'git foo | grep bar' ignores the exit code of 'git', which can hide regressions. In cases where we were counting lines with 'wc -l' to ensure a pattern was absent, simplify the logic to use '! grep' to avoid subshells entirely. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 daysMerge branch 'hy/diff-lazy-fetch-with-break-fix'Junio C Hamano-0/+31
A prefetch call can be triggered to access a stale diff_queue entry after diffcore-break breaks a filepair into two and freed the original entry that is no longer used, leading to a segfault, which has been corrected. * hy/diff-lazy-fetch-with-break-fix: diffcore-break: avoid segfault with freed entries
12 daysMerge branch 'aa/add-p-no-auto-advance'Junio C Hamano-0/+101
"git add -p" learned a new mode that allows the user to revisit a file that was already dealt with. * aa/add-p-no-auto-advance: add-patch: allow interfile navigation when selecting hunks add-patch: allow all-or-none application of patches add-patch: modify patch_update_file() signature interactive -p: add new `--auto-advance` flag
12 daysMerge branch 'lg/t2004-test-path-is-helpers'Junio C Hamano-21/+21
Test code clean-up. * lg/t2004-test-path-is-helpers: t2004: use test_path_is_file instead of test -f
13 daysMerge branch 'ag/http-netrc-tests'Junio C Hamano-2/+41
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
13 dayst: fix "that that" typo in lib-unicode-nfc-nfd.shSiddharth Shrimali-1/+1
In the comments of lib-unicode-nfc-nfd.sh, "that that" was used unintentionally. Remove the redundant "that" to improve clarity. Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 dayst3310: replace test -f/-d with test_path_is_file/test_path_is_dirFrancesco Paparatto-6/+6
Replace old-style path assertions with modern helpers that provide clearer diagnostic messages on failure. When test -f fails, the output gives no indication of what went wrong. These instances were found using: git grep "test -[efd]" t/ as suggested in the microproject ideas. Signed-off-by: Francesco Paparatto <francescopaparatto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 daysdiff: fix crash with --find-object outside repositoryMichael Montalbo-0/+10
When "git diff --find-object=<oid>" is run outside a git repository, the option parsing callback eagerly resolves the OID via repo_get_oid(), which reaches get_main_ref_store() and hits a BUG() assertion because no repository has been set up. Check startup_info->have_repository before attempting to resolve the OID, and return a user-friendly error instead. Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 daysfsmonitor-watchman: fix variable reference and remove redundant codePaul Tarjan-13/+3
The is_work_tree_watched() function in fsmonitor-watchman.sample has two bugs: 1. Wrong variable in error check: After calling watchman_clock(), the result is stored in $o, but the code checks $output->{error} instead of $o->{error}. This means errors from the clock command are silently ignored. 2. Double output violates protocol: When the retry path triggers (the directory wasn't initially watched), output_result() is called with the "/" flag, then launch_watchman() is called recursively which calls output_result() again. This outputs two clock tokens to stdout, but git's fsmonitor v2 protocol expects exactly one response. Fix #1 by checking $o->{error} after watchman_clock(). Fix #2 by removing the recursive launch_watchman() call. The "/" "everything is dirty" flag already tells git to do a full scan, and git will call the hook again on the next invocation with a valid clock token. With the recursive call removed, the $retry guard is no longer needed since it only existed to prevent infinite recursion. Remove it. Apply the same fixes to the test helper scripts in t/t7519/. Signed-off-by: Paul Tarjan <github@paulisageek.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 dayssend-email: validate charset name in 8bit encoding promptShreyansh Paliwal-1/+1
When a non-ASCII character is detected in the body or subject of the email the user is prompted with, Which 8bit encoding should I declare [UTF-8]? foo After this the input string is validated by the regex, based on the fact that the charset string will be minimum 4 characters [1]. If the string is more than 4 letters the email is sent, if not then a second prompt to confirm is asked to the user, Are you sure you want to use <foo> [y/N]? y This relies on a length based regex heuristic check to validate the user input, and can allow clearly invalid charset names to pass if the input is greater than 4 characters. Add a semantic validation of the charset name using the Encode::find_encoding() which is a bundled module of perl. If the encoding is not recognized, warn the user and ask for confirmation before proceeding. After this validation the lenght based validation becomes redundant and also breaks flow, so change the regex of valid input to any non blank string. Make the encoding warning logic specific to the 8bit prompt, also add a unique confirmation prompt which reduces the load on ask(), and improves maintainability. Additionally, the wording of the first prompt can confuse the user if not read properly or under any default assumptions for a yes/no prompt. Change the wording to make it explicitly clear to the user that the prompt needs a string input, UTF-8 being the default. The intended flow is, Declare which 8bit encoding to use [default: UTF-8]? foobar 'foobar' does not appear to be a valid charset name. Use it anyway [y/N]? [1]- https://github.com/git/git/commit/852a15d748034eec87adbee73a72689c8936fb8b Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-27Merge branch 'ap/use-test-seq-f-more'Junio C Hamano-34/+29
Test clean-up. * ap/use-test-seq-f-more: t: use test_seq -f and pipes in a few more places
2026-02-27Merge branch 'mf/format-patch-honor-from-for-cover-letter'Junio C Hamano-0/+8
"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-27Merge branch 'jh/alias-i18n'Junio C Hamano-0/+71
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-27Merge branch 'ps/tests-wo-iconv-fixes'Junio C Hamano-47/+88
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-27Merge branch 'ps/ci-gitlab-msvc-updates'Junio C Hamano-6/+13
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-27Merge branch 'jc/whitespace-incomplete-line'Junio C Hamano-0/+112
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-27Merge branch 'jc/checkout-switch-restore'Junio C Hamano-0/+18
"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-27Merge branch 'ps/history-ergonomics-updates'Junio C Hamano-6/+14
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-27Merge branch 'ps/for-each-ref-in-fixes'Junio C Hamano-0/+84
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-27Merge branch 'lo/repo-info-keys'Junio C Hamano-15/+33
"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-27t4052: test for diffstat width when prefix contains ANSI escape codesLorenzoPegorari-0/+32
Add test checking the calculation of the diffstat display width when the `line_prefix`, which is text that goes before the diffstat, contains ANSI escape codes. This situation happens, for example, when `git log --stat --graph` is executed: * `--stat` will create a diffstat for each commit * `--graph` will stuff `line_prefix` with the graph portion of the log, which contains ANSI escape codes to color the text Signed-off-by: LorenzoPegorari <lorenzo.pegorari2002@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26alias: treat empty subsection [alias ""] as plain [alias]Jonatan Holmgren-0/+14
When git-config stores a key of the form alias..name, it records it under an empty subsection ([alias ""]). The new subsection-aware alias lookup would see a non-NULL but zero-length subsection and fall into the subsection code path, where it required a "command" key and thus silently ignored the entry. Normalize an empty subsection to NULL before any further processing so that entries stored this way continue to work as plain case-insensitive aliases, matching the pre-subsection behaviour. Users who relied on alias..name to create an alias literally named ".name" may want to migrate to subsection syntax, which looks less confusing: [alias ".name"] command = <value> Add tests covering both the empty-subsection compatibility case and the leading-dot alias via the new syntax. Signed-off-by: Jonatan Holmgren <jonatan@jontes.page> Signed-off-by: Junio C Hamano <gitster@pobox.com>