jch - #2373
Open
hub966 wants to merge 94 commits into
Open
Conversation
fetch_objects() spawns a child `git fetch` to lazily fill in missing objects. That child's index-pack, when it receives a thin pack containing a REF_DELTA against a still-missing base, calls promisor_remote_get_direct() -- which is fetch_objects() again. With negotiationAlgorithm=noop the client advertises no "have" lines, so a well-behaved server sends requested objects un-deltified or deltified only against objects in the same pack. A server that nevertheless sends REF_DELTA against a base the client does not have is misbehaving; however the client should not recurse unboundedly in response. Propagate GIT_NO_LAZY_FETCH=1 into the child fetch's environment so that if the child's index-pack encounters such a REF_DELTA, it hits the existing guard at the top of fetch_objects() and fails fast instead of recursing. Depth-1 lazy fetch (the whole point of fetch_objects()) is unaffected: only the child and its descendants see the variable. Add a test that injects a thin pack containing a REF_DELTA against a missing base via HTTP, triggering the recursion path through index-pack's promisor_remote_get_direct() call. With the fix, the child's fetch_objects() sees GIT_NO_LAZY_FETCH=1 and blocks the depth-2 fetch with a "lazy fetching disabled" warning. Signed-off-by: Paul Tarjan <github@paulisageek.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Move the subcommand branch out of parse_options_step() into a new handle_subcommand() helper. Also, make parse_subcommand() return a simple success/failure status. This removes the switch over impossible parse_opt_result values and makes the non-option path easier to follow and maintain. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Move config parsing and prompt/delay handling into autocorrect.c and expose them in autocorrect.h. This makes autocorrect reusable regardless of which target links against it. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
TTY checking is the autocorrect config parser's responsibility. It must ensure the parsed value is correct and reliable. Thus, move the check to autocorrect_resolve_config(). Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Drop magic numbers and describe autocorrect config with a mode enum and an integer delay. This reduces errors when mutating config values and makes the values easier to access. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
AUTOCORRECT_SHOW is ambiguous. Its purpose is to show commands similar to the unknown one and take no other action. Rename it to fit the semantics. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Add autocorrect_resolve(). This resolves and populates the correct values for autocorrect config. Make autocorrect config callback internal. The API is meant to provide a high-level way to retrieve the config. Allowing access to the config callback from outside violates that intent. Additionally, in some cases, without access to the config callback, two config iterations cannot be merged into one, which can hurt performance. This is fine, as the code path that calls autocorrect_resolve() is cold. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Try to autocorrect the mistyped mandatory subcommand before showing an error and exiting. Subcommands parsed with PARSE_OPT_SUBCOMMAND_OPTIONAL are skipped. Use standard Damerau-Levenshtein distance (weights 1, 1, 1, 1) to establish a predictable, mathematically sound baseline. Scale the allowed edit distance based on input length to prevent false positives on short commands, following common practice for fuzziness thresholds (e.g., Elasticsearch's AUTO fuzziness): - Length 0-2: 0 edits allowed - Length 3-5: 1 edit allowed - Length 6+: 2 edits allowed Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Add PARSE_OPT_SUBCOMMAND_AUTOCORR to enable autocorrection for subcommands parsed with PARSE_OPT_SUBCOMMAND_OPTIONAL. Use it for git-remote and git-notes, so mistyped subcommands can be automatically corrected, and builtin entry points no longer need to handle the unknown subcommand error path themselves. This is safe for these two builtins, because they either resolve to a single subcommand or take no subcommand at all. This means that if the subcommand parser encounters an unknown argument, it must be a mistyped subcommand. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
These tests cover default behavior (help.autocorrect is unset), no correction, immediate correction, delayed correction, and rejection when the typo is too dissimilar. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Explain behaviors for autocorrect_resolve(), autocorrect_confirm(), and struct autocorrect. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
`get_remote_group`, `add_remote_or_group`, and the `remote_group_data` struct are currently defined as static helpers inside builtin/fetch.c. They implement generic remote group resolution that is not specific to fetch — they parse `remotes.<name>` config entries and resolve a name to either a list of group members or a single configured remote. Move them to remote.c and declare them in remote.h so that other builtins can use the same logic without duplication. Useful for the next patch. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
`git fetch` accepts a remote group name (configured via `remotes.<name>`
in config) and fetches from each member remote. `git push` has no
equivalent — it only accepts a single remote name.
Teach `git push` to resolve its repository argument through
`add_remote_or_group()`, which was made public in the previous patch,
so that a user can push to all remotes in a group with:
git push <group>
When the argument resolves to a single remote, the behaviour is
identical to before. When it resolves to a group, each member remote
is pushed in sequence.
The group push path rebuilds the refspec list (`rs`) from scratch for
each member remote so that per-remote push mappings configured via
`remote.<name>.push` are resolved correctly against each specific
remote. Without this, refspec entries would accumulate across iterations
and each subsequent remote would receive a growing list of duplicated
entries.
Mirror detection (`remote->mirror`) is also evaluated per remote using
a copy of the flags, so that a mirror remote in the group cannot set
TRANSPORT_PUSH_FORCE on subsequent non-mirror remotes in the same group.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack_trees() currently initializes its repository from the global 'the_repository', even though a repository instance is already available via the source index. Use 'o->src_index->repo' instead of the global variable, reducing reliance on global repository state. This is a step towards eliminating global repository usage in unpack_trees(). Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack_trees() currently initializes its repository from the global 'the_repository', even though a repository instance is already available via the source index. Use 'o->src_index->repo' instead of the global variable, reducing reliance on global repository state. This is a step towards eliminating global repository usage in unpack_trees(). Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The include_by_gitdir() function matches the realpath of a given path against a glob pattern, but its interface is tightly coupled to the gitdir condition: it takes a struct config_options *opts and extracts opts->git_dir internally. Refactor it into a more generic include_by_path() helper that takes a const char *path parameter directly, and update the gitdir and gitdir/i callers to pass opts->git_dir explicitly. No behavior change, just preparing for the addition of a new worktree condition that will reuse the same path-matching logic with a different path. Signed-off-by: Chen Linxuan <me@black-desk.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The includeIf mechanism already supports matching on the .git
directory path (gitdir) and the currently checked out branch
(onbranch). But in multi-worktree setups the .git directory of a
linked worktree points into the main repository's .git/worktrees/
area, which makes gitdir patterns cumbersome when one wants to
include config based on the working tree's checkout path instead.
Introduce two new condition keywords:
- worktree:<pattern> matches the realpath of the current worktree's
working directory (i.e. repo_get_work_tree()) against a glob
pattern. This is the path returned by git rev-parse
--show-toplevel.
- worktree/i:<pattern> is the case-insensitive variant.
The implementation reuses the include_by_path() helper introduced in
the previous commit, passing the worktree path in place of the
gitdir. The condition never matches in bare repositories (where
there is no worktree) or during early config reading (where no
repository is available).
Add documentation describing the new conditions and their supported
pattern features (glob wildcards, **/ and /**, ~ expansion, ./
relative paths, and trailing-/ prefix matching). Add tests covering
bare repositories, multiple worktrees, and symlinked worktree paths.
Signed-off-by: Chen Linxuan <me@black-desk.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When multiple processes write to a config file concurrently, they contend on its ".lock" file, which is acquired via open(O_EXCL) with no retry. The losers fail immediately with "could not lock config file". Two processes writing unrelated keys (say, "branch.a.remote" and "branch.b.remote") have no semantic conflict, yet one of them fails for a purely mechanical reason. This bites in practice when running `git worktree add -b` concurrently against the same repository. Each invocation makes several writes to ".git/config" to set up branch tracking, and tooling that creates worktrees in parallel sees intermittent failures. Worse, `git worktree add` does not propagate the failed config write to its exit code: the worktree is created and the command exits 0, but tracking configuration is silently dropped. The lock is held only for the duration of rewriting a small file, so retrying for 100 ms papers over any realistic contention while still failing fast if a stale lock has been left behind by a crashed process. This mirrors what we already do for individual reference locks (4ff0f01 (refs: retry acquiring reference locks for 100ms, 2017-08-21)). Signed-off-by: Jörg Thalheim <joerg@thalheim.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Simplify the first 2 for loops by directly indexing the xdfile.recs. recs is unused in the last 2 for loops, remove it. Best viewed with --color-words. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
There is no real square root for a negative number and size_t may not be large enough for certain applications, replace long with uint64_t. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Change the parameters of xdl_clean_mmatch() and the local variables i, nm, mlim in xdl_cleanup_records() to use unambiguous types. Best viewed with --color-words. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Make the handling of per-file limits and the minimal-case clearer.
* Use explicit per-file limit variables (mlim1, mlim2) and initialize
them.
* The additional condition `!need_min` is redudant now, remove it.
Best viewed with --color-words.
Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rewrite nested ternaries with a clear if/else ladder for action1/action2 to improve readability while preserving behavior. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
…tion * en/xdiff-cleanup-3: xdiff/xdl_cleanup_records: put braces around the else clause xdiff/xdl_cleanup_records: make setting action easier to follow xdiff/xdl_cleanup_records: make limits more clear xdiff/xdl_cleanup_records: use unambiguous types xdiff: use unambiguous types in xdl_bogo_sqrt() xdiff/xdl_cleanup_records: delete local recs pointer
When the myers algorithm is selected the input files are pre-processed to remove any common prefix and suffix. Then any lines that appear only in one side of the diff are marked as changed and frequently occurring lines are marked as changed if they are adjacent to a changed line. This step requires a couple of temporary arrays. As as the common prefix and suffix have already been removed, the arrays only need to be big enough to hold the lines between them, not the whole file. Reduce the size of the arrays and adjust the loops that use them accordingly while taking care to keep indexing the arrays in xdfile_t with absolute line numbers. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Remove the "s" parameter as, since the last commit, this function is always called with s == 0. Also change parameter "e" to expect a length, rather than the index of the last line to simplify the caller. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
If either of the two allocations fail we want to take the same action so use a single if statement. This saves a few lines and makes it easier for the next commit to add a couple more allocations. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
When the myers algorithm is selected the input files are pre-processed to remove any common prefix and suffix and any lines that appear in only one file. This requires a map to be created between the lines that are processed by the myers algorithm and the lines in the original file. That map does not include the common lines at the beginning and end of the files but the array is allocated to be the size of the whole file. Move the allocation into xdl_cleanup_records() where the map is populated and we know how big it needs to be. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The userdiff driver for the Scheme language has been extended to cover other Lisp dialects. * sb/userdiff-lisp-family: userdiff: extend Scheme support to cover other Lisp dialects userdiff: tighten word-diff test case of the scheme driver
The 'http.emptyAuth=auto' configuration now correctly attempts Negotiate authentication before falling back to manual credentials. This allows seamless Kerberos ticket-based authentication without requiring users to explicitly set 'http.emptyAuth=true'. * mc/http-emptyauth-negotiate-fix: t5563: add tests for http.emptyAuth with Negotiate http: attempt Negotiate auth in http.emptyAuth=auto mode http: extract http_reauth_prepare() from retry paths
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 sequences" 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
Rust support is enabled by default (but still allows opting out) in some future version of Git. * bc/rust-by-default: Enable Rust by default Linux: link against libdl ci: install cargo on Alpine docs: update version with default Rust support
The test suite harness and many individual test scripts have been updated to work correctly when 'set -e' is in effect, which helps detect misspelled test commands. * ps/test-set-e-clean: t: detect errors outside of test cases t9902: fix use of `read` with `set -e` t6002: fix use of `expr` with `set -e` t1301: don't fail in case setfacl(1) doesn't exist or fails t0008: silence error in subshell when using `grep -v` t: prepare `test_when_finished ()`/`test_atexit()` for `set -e` t: prepare execution of potentially failing commands for `set -e` t: prepare conditional test execution for `set -e` t: prepare `git config --unset` calls for `set -e` t: prepare `stop_git_daemon ()` for `set -e` t: prepare `test_must_fail ()` for `set -e` t: prepare `test_match_signal ()` calls for `set -e`
Revert "Jch"
There was a problem hiding this comment.
Pull request overview
This PR makes several cross-cutting improvements to Git’s runtime behavior, configuration surface, build defaults, and test robustness—most notably around hook execution parallelism and sanitizing sideband output.
Changes:
- Add configurable sanitization of control characters in sideband remote output, including URL-scoped config and tests.
- Add hook parallelism support (
hook.jobs,hook.<event>.jobs,hook.<friendly>.parallel, event-level enable/disable) and update callers/tests/docs accordingly. - Adjust promisor-remote handling to prioritize accepted remotes and tighten advertised-remote validation, plus extend related documentation/tests.
Reviewed changes
Copilot reviewed 84 out of 85 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| userdiff.c | Expand scheme/Lisp userdiff patterns and behavior. |
| transport.c | Apply sideband URL config on transport creation; update hook stdout/stderr commentary. |
| t/test-lib.sh | Add optional set -e enablement to harden tests; adjust binary probing. |
| t/test-lib-functions.sh | Make helper functions more set -e-friendly by avoiding $? patterns. |
| t/t9902-completion.sh | Adjust test data setup for set -e-compatibility. |
| t/t9402-git-cvsserver-refs.sh | Make CVS presence check set -e-safe. |
| t/t9401-git-cvsserver-crlf.sh | Make CVS presence check set -e-safe. |
| t/t9400-git-cvsserver-server.sh | Make CVS presence check set -e-safe. |
| t/t9200-git-cvsexportcommit.sh | Make CVS presence check set -e-safe. |
| t/t9138-git-svn-authors-prog.sh | Make config unsets resilient under set -e. |
| t/t7508-status.sh | Make cleanup unsets resilient under set -e. |
| t/t7450-bad-git-dotfiles.sh | Replace && short-circuit test definition with explicit if block. |
| t/t7422-submodule-output.sh | Make SIGPIPE/status capture set -e-safe. |
| t/t6002-rev-list-bisect.sh | Replace expr with arithmetic expansion; improve set -e safety. |
| t/t5710-promisor-remote-capability.sh | Improve file:// URL handling/encoding and add promisor-order tests. |
| t/t5563-simple-http-auth.sh | Add SPNEGO/Negotiate behavior tests for http.emptyAuth. |
| t/t5409-colorize-remote-messages.sh | Add tests for sideband control-sequence sanitization and URL scoping. |
| t/t5000-tar-tree.sh | Make exit-code capture set -e-safe. |
| t/t4034/scheme/pre | Extend Scheme/Lisp fixtures for new symbol parsing. |
| t/t4034/scheme/post | Extend Scheme/Lisp fixtures for new symbol parsing. |
| t/t4034/scheme/expect | Update expected diff output for expanded Scheme/Lisp fixtures. |
| t/t4032-diff-inter-hunk-context.sh | Make config unset and conditional checks set -e-safe. |
| t/t4018/scheme-module-b | Add new Scheme/Lisp fixtures for userdiff pattern tests. |
| t/t4018/scheme-module-a | Add new Scheme/Lisp fixtures for userdiff pattern tests. |
| t/t4018/scheme-lisp-eval-when | Add new Scheme/Lisp fixtures for userdiff pattern tests. |
| t/t4018/scheme-lisp-defun-b | Add new Scheme/Lisp fixtures for userdiff pattern tests. |
| t/t4018/scheme-lisp-defun-a | Add new Scheme/Lisp fixtures for userdiff pattern tests. |
| t/t3901-i18n-patch.sh | Make grep/exit handling set -e-safe. |
| t/t3600-rm.sh | Make SIGPIPE/status capture set -e-safe. |
| t/t1800-hook.sh | Add extensive coverage for hook parallelism, tty behavior, ordering, and jobs config. |
| t/t1410-reflog.sh | Make fsck invocation set -e-safe. |
| t/t1301-shared-repo.sh | Make optional setfacl step set -e-safe. |
| t/t0090-cache-tree.sh | Add test coverage for cache-tree reuse by write-tree. |
| t/t0008-ignores.sh | Make pipeline usage set -e-safe. |
| t/t0005-signals.sh | Make SIGPIPE/status capture set -e-safe. |
| t/lib-httpd.sh | Make httpd startup check set -e-safe. |
| t/lib-git-svn.sh | Make svn detection and perl invocation set -e-safe. |
| t/lib-git-daemon.sh | Make daemon shutdown/wait behavior set -e-safe. |
| src/meson.build | Require cargo depending on rust feature; add Meson test runner for Rust tests. |
| sideband.h | Add sideband URL-config API and config parsing API declaration. |
| sideband.c | Implement control-character sanitization and URL-matched configuration. |
| repository.h | Add repository fields for cached hook jobs and disabled events. |
| repository.c | Ensure repository format cleared on error; clear new hook-related caches. |
| remote-curl.c | Switch HTTP reauth path to new http_reauth_prepare(). |
| refs/reftable-backend.c | Use repository instance rather than the_repository for permissions/config. |
| refs/refs-internal.h | Change ref lock timeout helper to accept repository parameter. |
| refs/files-backend.c | Thread repo through ref lock timeout; adjust callback data. |
| refs.c | Use repo-specific hash algo in transactions; add repo parameter to timeout helper. |
| promisor-remote.c | Prefer accepted promisors first; tighten remote acceptance and field matching logic. |
| parse.h | Add git_parse_uint() declaration. |
| parse.c | Implement git_parse_uint() using existing unsigned parsing helpers. |
| meson.build | Move hook-list generation to libgit; adjust rust option handling and build flow. |
| meson_options.txt | Change default rust feature option value to enabled. |
| Makefile | Introduce NO_RUST build switch and adjust related build conditions/deps. |
| http.h | Add http_reauth_prepare() API. |
| http.c | Implement http_reauth_prepare() and refine Negotiate/empty-auth retry behavior. |
| hook.h | Extend hook structs; add jobs semantics and initializers; add is_known_hook(). |
| hook.c | Implement known-hook lookup; add hook config parsing/caching; add parallel execution support. |
| Documentation/gitprotocol-v2.adoc | Document accepted promisor remotes being tried first. |
| Documentation/gitattributes.adoc | Document scheme patterns as covering broader Lisp dialects. |
| Documentation/git-shortlog.adoc | Convert synopsis/options formatting to modern AsciiDoc style. |
| Documentation/git-range-diff.adoc | Convert synopsis/options formatting to modern AsciiDoc style. |
| Documentation/git-hook.adoc | Document -j/--jobs and parallel hook behavior plus force-serial events. |
| Documentation/git-difftool.adoc | Convert synopsis/options formatting to modern AsciiDoc style. |
| Documentation/git-describe.adoc | Convert synopsis/options formatting to modern AsciiDoc style. |
| Documentation/config/sideband.adoc | Add documentation for sideband.allowControlCharacters and URL scoping. |
| Documentation/config/mergetool.adoc | Fix layout docs wording/structure around backend hints. |
| Documentation/config/hook.adoc | Document hook parallelism, jobs config, event-level enable/disable rules. |
| Documentation/config/difftool.adoc | Improve formatting and quoting of config keys/variables. |
| Documentation/config.adoc | Include new sideband config documentation. |
| Documentation/CodingGuidelines | Add guidance about portable stat timestamp members. |
| config.mak.uname | Add -ldl to Linux EXTLIBS. |
| config.h | Add unsigned-int config APIs and repo getters. |
| config.c | Implement git_config_uint(), configset getter, and repo getter for uint. |
| commit.c | Force commit hooks to use force-serial hooks options initializer. |
| ci/run-build-and-tests.sh | Adjust CI for set -e tests; configure rust disablement in certain jobs. |
| ci/lib.sh | Disable Rust for Windows CI jobs via NO_RUST. |
| ci/install-dependencies.sh | Install cargo in Alpine CI environment. |
| cache-tree.c | Fix cache-tree validity check logic against object existence. |
| builtin/worktree.c | Force post-checkout hook to run serially via new initializer. |
| builtin/receive-pack.c | Force push-to-checkout hook to run serially via new initializer. |
| builtin/hook.c | Add -j/--jobs CLI option and show event-disabled status in listing output. |
| builtin/clone.c | Force post-checkout hook to run serially and switch to run_hooks_opt API. |
| builtin/checkout.c | Force post-checkout hook to run serially and switch to run_hooks_opt API. |
| builtin/am.c | Force applypatch-msg hook to run serially and switch to run_hooks_opt API. |
Suppressed comments (1)
refs.c:996
- get_files_ref_lock_timeout_ms() now takes a
repoparameter but still caches the timeout in a process-global static. If multiple repositories with different core.filesRefLockTimeout values are used in one process (e.g. submodules), only the first repo's value will apply.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # abort tests, even when outside of a specific test case. | ||
| # | ||
| # Note that we only enable this on Bash 5 and newer, or when explicitly | ||
| # requested by the user via `GIT_TEST_USE_SET_E=true`. This ib secause `set -e` |
Comment on lines
+12
to
+17
| `cursor:`: | ||
| Allow control sequences that move the cursor. This is | ||
| disabled by default. | ||
| `erase`:: | ||
| Allow control sequences that erase charactrs. This is | ||
| disabled by default. |
Comment on lines
+40
to
+44
| /* | ||
| * Parse and set the sideband allow control characters configuration. | ||
| * The var parameter should be the key name (without section prefix). | ||
| * Returns 0 if the variable was recognized and handled, non-zero otherwise. | ||
| */ |
Comment on lines
+203
to
+215
| for (i = 2; i < n; i++) { | ||
| if (((allow_control_characters & ALLOW_ANSI_COLOR_SEQUENCES) && | ||
| src[i] == 'm') || | ||
| ((allow_control_characters & ALLOW_ANSI_CURSOR_MOVEMENTS) && | ||
| strchr("ABCDEFGHf", src[i])) || | ||
| ((allow_control_characters & ALLOW_ANSI_ERASE) && | ||
| strchr("JKMPX", src[i]))) { | ||
| strbuf_add(dest, src, i + 1); | ||
| return i; | ||
| } | ||
| if (!isdigit(src[i]) && src[i] != ';') | ||
| break; | ||
| } |
Comment on lines
+645
to
+651
| static bool has_control_char(const char *s) | ||
| { | ||
| for (const char *c = s; *c; c++) | ||
| if (iscntrl(*c)) | ||
| return true; | ||
| return false; | ||
| } |
Comment on lines
+431
to
438
| if (r) { | ||
| r->hook_jobs = cb_data.jobs; | ||
| r->event_jobs = cb_data.event_jobs; | ||
| } | ||
|
|
||
| strmap_clear(&cb_data.commands, 1); | ||
| strmap_clear(&cb_data.parallel_hooks, 0); /* values are uintptr_t, not heap ptrs */ | ||
| string_list_clear(&cb_data.disabled_hooks, 0); |
Comment on lines
527
to
532
| if (!r || !r->gitdir) { | ||
| hook_cache_clear(cache); | ||
| free(cache); | ||
| if (r) | ||
| string_list_clear(&r->disabled_events, 0); | ||
| } |
Comment on lines
+762
to
+768
| /* | ||
| * Cap to serial any configured hook not marked as parallel = true. | ||
| * This enforces the parallel = false default, even for "traditional" | ||
| * hooks from the hookdir which cannot be marked parallel = true. | ||
| * The same restriction applies whether jobs came from hook.jobs or | ||
| * hook.<event>.jobs. | ||
| */ |
Comment on lines
+1747
to
1750
| rust_option = get_option('rust') | ||
| if rust_option.allowed() | ||
| subdir('src') | ||
| libgit_c_args += '-DWITH_RUST' |
|
|
||
| test_expect_success TTY 'git hook run -jN: stdout and stderr are not connected to a TTY' ' | ||
| # Hooks are not connected to the tty when run in parallel, instead they | ||
| # output to a pipe through which run-command collects and de-interlaces |
gitster
force-pushed
the
jch
branch
10 times, most recently
from
August 14, 2026 16:30
31b9342 to
faf3f71
Compare
gitster
force-pushed
the
jch
branch
3 times, most recently
from
August 16, 2026 19:34
be268fe to
b606033
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.
For a single-commit pull request, please leave the pull request description
empty: your commit message itself should describe your changes.
Please read the "guidelines for contributing" linked above!