summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2026-07-19Merge branch 'mm/test-grep-lint'Junio C Hamano385-3328/+3810
The test suite has been updated to use the 'test_grep' helper instead of bare 'grep' for test assertions, allowing file contents to be printed on failure for easier debugging. A new 'greplint' linter has been introduced to detect and prevent new bare 'grep' assertions from being added to the test suite. * mm/test-grep-lint: t: add greplint to detect bare grep assertions t: convert grep assertions to test_grep t: fix Lexer line count for $() inside double-quoted strings t: extract chainlint's parser into shared module t: fix grep assertions missing file arguments t/README: document test_grep helper
2026-07-19Merge branch 'sn/osxkeychain-rust-universal'Junio C Hamano3-6/+56
The build system has been updated to support building universal macOS binaries when 'Rust' is enabled, by compiling separate static archives for each target triple listed in 'RUST_TARGETS' and combining them using the macOS 'lipo' tool. The 'git-credential-osxkeychain' helper has been updated to link against '$(RUST_LIB)' when 'Rust' is enabled. * sn/osxkeychain-rust-universal: contrib: wire up osxkeychain in contrib/Makefile on macOS Makefile: support universal macOS builds via RUST_TARGETS Makefile: add $(RUST_LIB) prerequisite to osxkeychain
2026-07-19Merge branch 'bc/parse-options-exit-0-on-help'Junio C Hamano40-74/+113
Option parsing with 'git rev-parse --parseopt' and in most 'git' subcommands has been updated to exit with 0 (instead of 129) when the help option ('-h' or '--help') is requested directly by the user, aligning with standard Unix convention. * bc/parse-options-exit-0-on-help: parse-options: exit 0 on -h rev-parse: have --parseopt callers exit 0 on --help parse-options: add a separate case for help output on error t1517: skip svn tests if svn is not installed
2026-07-19Merge branch 'jc/submitting-patches-abandoning'Junio C Hamano1-0/+14
The 'SubmittingPatches' document has been updated to explicitly describe the expectation for contributors to retract or abandon their patch series when they are no longer pursuing it. * jc/submitting-patches-abandoning: SubmittingPatches: document how to retract a topic
2026-07-19Merge branch 'kk/commit-reach-find-all-fix'Junio C Hamano2-3/+48
The early-exit optimization in 'paint_down_to_common()' has been gated on the queue being generation-ordered, fixing a bug where 'git merge-base' (without '--all') could return incorrect results on repositories with v1 commit graphs and clock skew. * kk/commit-reach-find-all-fix: commit-reach: guard !FIND_ALL early exit with generation ordering check t6600: add test for merge-base early exit with clock skew
2026-07-19Merge branch 'jc/relnotes-2.55-rust-fix'Junio C Hamano1-2/+2
A description in the release notes for Git 2.55.0 has been retroactively updated to clarify that Rust support is enabled by default, but still optional, and will become mandatory in Git 3.0. * jc/relnotes-2.55-rust-fix: Rust: fix description in Release Notes to 2.55
2026-07-19Merge branch 'ps/setup-split-discovery-and-setup'Junio C Hamano15-245/+285
The repository discovery and repository configuration phases, which were previously intertwined in 'setup.c', have been split. Repository discovery has been updated to populate a 'struct repo_discovery' without modifying the repository state, which is then taken by repository configuration to initialize the repository, paving the way for clean unification of repository configuration. * ps/setup-split-discovery-and-setup: setup: mark `set_git_work_tree()` as file-local setup: pass worktree to `init_db()` setup: drop redundant configuration of `startup_info->have_repository` setup: make repository discovery self-contained setup: propagate prefix via repository discovery setup: drop static `cwd` variable setup: move prefix into repository setup: embed repository format in discovery setup: introduce explicit repository discovery setup: split up concerns of `setup_git_env_internal()` setup: unify setup of shallow file setup: mark bogus worktree in `apply_repository_format()` setup: rename `check_repository_format_gently()`
2026-07-19Merge branch 'ps/reftable-hardening'Junio C Hamano15-26/+441
The 'reftable' code has been hardened against corrupted tables by fixing out-of-bounds writes, out-of-bounds reads, and abort calls during parsing. * ps/reftable-hardening: reftable/table: fix OOB read on truncated table reftable/table: fix NULL pointer access when seeking to bogus offsets reftable/block: fix OOB read with bogus restart offset reftable/block: fix use of uninitialized memory when binsearch fails reftable/block: fix OOB read with bogus restart count reftable/block: fix OOB read with bogus block size reftable/block: fix OOB write with bogus inflated log size t/unit-tests: introduce test helper to write reftable blocks reftable/record: don't abort when decoding invalid ref value type reftable/basics: fix OOB read on binary search of empty range oss-fuzz: add fuzzer for parsing reftables meson: support building fuzzers with libFuzzer
2026-07-18object-file: move logic to write loose objectsPatrick Steinhardt3-379/+357
The logic to write loose objects is split up across "object-file.c" and "odb/source-loose.c". This split is somewhat weird, but it is the result of two things: - `force_object_loose()` used to reach into internals of how exactly we write objects. - The logic of writing objects is intertwined with potentially starting a transaction. We have refactored `force_object_loose()` over preceding commits to work via generic interfaces now, so this reason doesn't exist anymore. But the second reason still does, as our management of "files" transactions and their ad-hoc creation is still very messy. This area definitely requires further work, and that work is indeed ongoing. That being said, we can already move the writing logic into the "loose" backend rather easily. All we have to do is to expose two functions that relate to the transactions. Expose these two functions and move the writing logic into the "loose" backend accordingly so that it becomes more self-contained. Note that this requires us to drop a reference to `the_repository` in favor of using the source's repository in `start_loose_object_common()`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18object-file: move `force_object_loose()`Patrick Steinhardt3-48/+46
In the preceding commits we have refactored `force_object_loose()` to not call internal functions anymore for writing the object. Instead, it now only uses generic functions that are accessible to all callers. Consequently, we can now easily move the function to its only caller, which is git-pack-objects(1). Do so. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18object-file: force objects loose via generic interfacePatrick Steinhardt1-12/+7
When repacking objects we may end up "loosening" objects via `force_objects_loose()`. The implementation of this logic still sits with "object-file.c" even though it is ultimately an implementation detail of the "files" backend. Moving this logic around is non-trivial though as we depend on `write_loose_object()`, which is an internal implementation detail of how we write loose objects. Until now it wasn't possible to use the generic function `odb_source_write_object()` though, because the "loose" implementation thereof would skip writing the object in case it already exists in any other source. This restriction was lifted over the preceding commits though, where this object existence check is now handled on the object database level and not on the individual source level anymore. Consequently, it is now possible to use generic interfaces. Refactor the code accordingly so that we can move the logic around in a subsequent commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18object-file: fix memory leak in `force_object_loose()`Patrick Steinhardt1-8/+18
We return an error when converting the given object to the compatibility hash algorithm fails. This early return causes a memory leak though, because we don't free the content buffer that we've already read before via `odb_read_object_info_extended()`. Plug the memory leak by creating a common exit path where the buffer gets free'd. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18odb: support setting mtime when writing objectsPatrick Steinhardt11-35/+67
The function `force_object_loose()` is used to loosen packed objects before repacking. It passes the pack's mtime along so that the newly written loose object inherits the same timestamp. This matters for object pruning, which uses the mtime to determine whether an object is old enough to be pruned. In a subsequent commit, `force_object_loose()` will be converted to use the generic `odb_source_write_object()` interface instead of calling `write_loose_object()` directly. But the generic interface doesn't yet support setting a specific mtime, which makes it impossible to implement the logic as of now. Prepare for the change by introducing a new `mtime` parameter to this function that we plumb through the stack. If set, the backends are instructed to set the object's mtime accordingly. If unset, the backends are expected to use the current time instead. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18odb: lift object existence check out of the "loose" backendPatrick Steinhardt2-6/+9
Before writing a new loose object we first check whether the object already exists in any of the sources attached to the object database. This results in a couple of issues: - We have a layering violation, where the source needs to be aware of objects stored in any of the other sources. - Every backend would have to reimplement this check, which feels somewhat pointless. - It is not possible to easily write an object into a source in case the same object already exists in another source. Refactor the code and lift up the object existence check from the "loose" backend into the generic ODB layer. No callers need adjustment as none of them write via a specific source, but via the ODB layer. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18odb: compute object hash in `odb_write_object_ext()`Patrick Steinhardt9-43/+25
Same as in a preceding commit, compute the object hash in `odb_write_object_ext()` so that we can unify this logic. Besides unification, this change also allows us to lift the object existence check out of the "loose" backend into the generic layer, which will happen in the next commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18t/u-odb-inmemory: implement wrapper for writing objectsPatrick Steinhardt1-25/+23
In the next commit we're about to change how objects are being written into the object database source. Prepare for this refactoring by introducing a wrapper function into our unit tests so that we don't have to adjust all callsites. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18odb: compute compat object ID in `odb_write_object_ext()`Patrick Steinhardt7-32/+38
Repositories can have a compatibility hash configured, which means that such a repository is expected to maintain a mapping between canonical and compatibility object hashes. Maintaining this mapping is the responsibility of the object database sources, where we either store them as part of the loose objects map or in packfile indices v3 (once we gain support for this feature). But besides storing these compatibility hashes, the sources are also responsible for generating the compatibility hash in the first place. This is somewhat unnecessary though, as the compatibility hash should be computed the same no matter which source is being used. The consequence is that we need to duplicate this functionality across the different backends, which does not make a lot of sense. Refactor the code so that we instead compute the compatibility hash in `odb_write_object_ext()` and then pass the computed value to the sources. No callers need adjustment as there are none that write objects via the source interfaces directly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-18Merge branch 'jt/receive-pack-use-odb-transactions' into HEADJunio C Hamano15-131/+246
'git receive-pack' has been refactored to use ODB transaction interfaces instead of directly managing 'tmp_objdir' for staging incoming objects, bringing it closer to being ODB backend agnostic. * jt/receive-pack-use-odb-transactions: builtin/receive-pack: stage incoming objects via ODB transactions builtin/receive-pack: drop redundant tmpdir env odb/transaction: introduce ODB transaction flags odb/transaction: add transaction env interface odb/transaction: propagate commit errors odb/transaction: propagate begin errors object-file: propagate files transaction errors object-file: drop check for inflight transactions object-file: embed transaction flush logic in commit function object-file: rename files transaction fsync function object-file: rename files transaction prepare function
2026-07-17gitweb: shorten index hashes with trailing file modesTravor Liu2-5/+26
Diff index lines have included a trailing file mode since ec1fcc16af (Show original and resulting blob object info in diff output, 2005-10-07) when the old and new file modes match: index <old>..<new> 100644 gitweb recognizes that trailing mode before it tries to shorten and link the object IDs. This appends the file-type annotation first, but the object-ID matcher requires the ID range to end the line. As a result, this common form keeps both full object IDs as plain text. That is inconsistent with other hash displays and makes commitdiff output wider than necessary. Recent gitweb changes have fixed mobile overflow in log, commit, blob and diff views; leaving two full object IDs in this header preserves an avoidable long line in the diff header. * gitweb/gitweb.perl: Remove the trailing mode before matching the index IDs, then append it again after the IDs have been shortened and linked. This preserves the mode display while letting ordinary and combined index lines use the existing object-ID formatting paths. * t/t9502-gitweb-standalone-parse-output.sh: Add coverage for that common form by rendering a commitdiff for a regular file modification. Check that the visible index line contains linked short blob IDs followed by the mode and file-type annotation, and that the full unlinked form is not emitted. Signed-off-by: Travor Liu <travor_lzh@outlook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16The 4th batch for Git 2.56Junio C Hamano1-0/+46
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16Merge branch 'mm/sideband-ansi-sgr-colon-fix'Junio C Hamano1-1/+5
The sideband demultiplexer has been updated to recognize ANSI SGR escape sequences that use colon-separated subfields (e.g., for 256-color or true-color codes). * mm/sideband-ansi-sgr-colon-fix: sideband: allow ANSI SGR with colon-separated subfields
2026-07-16Merge branch 'jk/git-hash-cleanups'Junio C Hamano24-88/+177
The 'git_hash_*()' wrappers have been updated to be used consistently across the codebase instead of direct calls to members of 'struct git_hash_algo', and 'git_hash_discard()' has been made idempotent to simplify cleanups. * jk/git-hash-cleanups: hash: check ctx->active flag in all wrapper functions http: use idempotent git_hash_discard() csum-file: use idempotent git_hash_discard() hash: make git_hash_discard() idempotent hash: document function pointers and wrappers hash: convert remaining direct function calls hash: use git_hash_init() consistently
2026-07-16Merge branch 'ih/precompose-flex-array'Junio C Hamano3-8/+29
The UTF-8 precomposition wrapper on macOS has been updated to use a flexible array member to represent the name of a directory entry, preventing fortified libc checks from failing when the name is reallocated to be larger than 'NAME_MAX' bytes. * ih/precompose-flex-array: precompose_utf8: use a flex array for d_name
2026-07-16Merge branch 'ps/t-fixes-for-git-test-long'Junio C Hamano9-72/+91
Various test scripts have been updated to clean up large temporary files and repositories, reducing peak disk usage during testing. Also, expensive tests have been disabled on platforms that lack sufficient resources (like 32-bit platforms and Windows CI runners), and the long test suite has been enabled in GitLab CI. * ps/t-fixes-for-git-test-long: gitlab-ci: enable "GIT_TEST_LONG" gitlab-ci: disable RAM disk on macOS jobs t: use `test_bool_env` to parse GIT_TEST_LONG t7900: clean up large EXPENSIVE repository t7508: skip EXPENSIVE test that is broken without SIZE_T_IS_64BIT t5608: reduce maximum disk usage t4141: fix inefficient use of dd(1) t0021: skip EXPENSIVE test that is broken without SIZE_T_IS_64BIT README: add GitLab CI badge to make it more discoverable
2026-07-16Merge branch 'js/ci-dockerized-pid-limit'Junio C Hamano1-1/+3
Dockerized CI jobs running in private GitHub repositories have been adjusted to use explicit process and file limits, preventing resource exhaustion errors on private runners. * js/ci-dockerized-pid-limit: ci(dockerized): raise the PID limit for private repositories
2026-07-16Merge branch 'js/coverity-fixes'Junio C Hamano11-26/+41
Various resource leaks, invalid file descriptor closures, and process handle ownership issues flagged by Coverity have been fixed. * js/coverity-fixes: mingw: make `exit_process()` own the process handle on all paths fsmonitor: plug token-data leak on early daemon-startup failures reftable/table: release filter on error path imap-send: avoid leaking the IMAP upload buffer worktree: fix resource leaks when branch creation fails submodule: fix cwd leak in `get_superproject_working_tree()` dir: free allocations on parse-error paths in `read_one_dir()` line-log: avoid redundant copy that leaks in process_ranges run-command: avoid `close(-1)` in `start_command()` error paths download_https_uri_to_file(): do not leak fd upon failure loose: avoid closing invalid fd on error path load_one_loose_object_map(): fix resource leak
2026-07-16Merge branch 'jk/hash-algo-leak-fixes'Junio C Hamano13-14/+100
Various code paths that initialize a cryptographic hash context but bail out or finish without calling 'git_hash_final()' have been taught to call 'git_hash_discard()' to release allocated resources, fixing memory leaks when Git is built with non-default backends like 'OpenSSL' or 'libgcrypt'. * jk/hash-algo-leak-fixes: hash: add platform-specific discard functions hash: fix memory leak copying sha256 gcrypt handles http: discard hash in dumb-http http_object_request check_stream_oid(): discard hash on read error patch-id: discard hash when done csum-file: provide a function to release checkpoints csum-file: always finalize or discard hash hash: add discard primitive csum-file: drop discard_hashfile()
2026-07-16Merge branch 'js/wincred-fixes'Junio C Hamano1-6/+6
The wincred credential helper has been updated to avoid memory corruption when erasing credentials and to prevent silent credential loss when storing OAuth tokens, by correcting buffer allocations and arguments passed to safe-CRT APIs. * js/wincred-fixes: wincred: prevent silent credential loss when storing OAuth tokens wincred: avoid memory corruption when erasing a credential
2026-07-16copy: drop dependency on `the_repository`Patrick Steinhardt10-20/+24
When copying a file we need to potentially adapt permissions of the new file based on whether or not "core.shared" is enabled. Parsing this configuration makes us implicitly depend on `the_repository`. Refactor the code to instead require the caller to pass in a repository so that we can remove `USE_THE_REPOSITORY_VARIABLE`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16refspec: stop depending on `the_repository`Patrick Steinhardt10-22/+37
The only remaining user of `the_hash_algo` in "refspec.c" is `refspec_append()`, which needs to know the hash algorithm so that it can parse the appended refspec item. In contrast to the functions adapted in the preceding commit, this function always operates on a `struct refspec`. As that structure is expected to only ever contain refspecs that all use the same hash function it doesn't make sense though to adapt each caller. Instead, adapt the structure itself so that it gets initialized with a hash function and use that hash function to parse new refspec items. Adapt callers accordingly. This removes the final dependency on the global repository variable in "refspec.c", so we can drop `USE_THE_REPOSITORY_VARIABLE`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16refspec: let callers pass in hash algorithm when parsing itemsPatrick Steinhardt5-19/+27
When parsing a refspec item we need to know about the hash algorithm used by the repository so that we can decide whether or not a given string is an exact object ID. We use `the_hash_algo` for this, which makes the code implicitly depend on `the_repository`. Refactor `refspec_item_init_fetch()`, `refspec_item_init_push()` and `valid_fetch_refspec()` so that callers have to pass in the hash algorithm explicitly and adapt callers accordingly. For now, all of the callers simply pass `the_hash_algo`, so there is no change in behaviour. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16refspec: group related structures and functionsPatrick Steinhardt1-12/+14
Reorganize the refspec header a bit so that structures and their related functions are grouped closer together. While at it, fix a couple of style violations. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16wincred: prevent silent credential loss when storing OAuth tokensJohannes Schindelin1-2/+2
When `git credential approve` hands the wincred helper a password together with an `oauth_refresh_token`, the OAuth branch of `store_credential()` writes one WCHAR past the allocation while formatting both fields into a single `CredentialBlob`. On Windows this trips heap verification and tears the helper down with status `0xC0000374`; `approve` masks the failure, so the credential the user meant to save never reaches `CredWriteW()` and the next session prompts for it again. The bug has the same shape as the one fixed in the previous commit: the allocation leaves no room for the terminating NUL, and the `sizeOfBuffer` argument to `_snwprintf_s()` is a byte count where the API expects a WCHAR count, which lets the safe-CRT runtime write the terminator out of bounds. Apply the same remedy d22a488482 (wincred: avoid memory corruption, 2025-11-17) applied in `get_credential()`: allocate `(wlen + 1) * sizeof(WCHAR)` bytes and pass `wlen + 1` as the destination capacity in WCHARs. This closes the second of the two heap writes tracked under GHSA-rxqw-wxqg-g7hw. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16wincred: avoid memory corruption when erasing a credentialJohannes Schindelin1-4/+4
The earlier d22a488482 (wincred: avoid memory corruption, 2025-11-17) repaired only get_credential(); match_cred_password() has the same defect and is reached on `git credential reject`. When Git asks the helper to erase a stored credential whose password was supplied by the caller, the helper copies the candidate's password into a freshly allocated buffer for comparison. That copy overruns the allocation by one WCHAR of NUL, which on uninstrumented Windows manifests as process termination with status 0xC0000374. Because the helper can die before reaching CredDeleteW(), `git credential reject` masks the failure and the rejected credential remains stored. CredentialBlobSize is documented as a byte count, so for an N-WCHAR blob it equals N * sizeof(WCHAR). The pre-fix code allocated that many bytes and asked wcsncpy_s to copy N wide characters, but wcsncpy_s always appends a terminating NUL WCHAR, writing one WCHAR past the allocation. The destination-capacity argument was also passed in bytes rather than in WCHAR elements as the API requires, so the safe-CRT runtime never rejected the copy. See GHSA-rxqw-wxqg-g7hw. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16revision: fix --no-walk path filtering regressionKristofer Karlsson2-1/+19
Since dd4bc01c0a (revision: use priority queue for non-limited streaming walks, 2026-05-27), "git rev-list --no-walk <commit> -- <path>" ignores the path arguments and outputs all commits regardless of whether they touch the given paths. That commit introduced a REV_WALK_NO_WALK enum value to separate --no-walk from the streaming walk in get_revision_1(). The new case skips process_parents(), which is correct for not enqueuing parents, but also skips try_to_simplify_commit() which process_parents() calls to evaluate whether each commit touches the given paths. Add a call to try_to_simplify_commit() for the REV_WALK_NO_WALK case, folding it into the existing REV_WALK_REFLOG case which already does the same. Add tests for --no-walk path filtering to t6017. The "single commit, match" test is defensive and passes without the fix, while the other two fail without it. Reported-by: Peter Colberg <pcolberg@redhat.com> Signed-off-by: Kristofer Karlsson <krka@spotify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16Merge branch 'kk/streaming-walk-pqueue' into kk/no-walk-pathspec-fixJunio C Hamano387-9549/+12553
* kk/streaming-walk-pqueue: (280 commits) revision: use priority queue for non-limited streaming walks revision: introduce rev_walk_mode to clarify get_revision_1() pack-objects: call release_revisions() after cruft traversal The 9th batch The 8th batch The 7th batch Start preparing for 2.54.1 The 6th batch send-pack: pass negotiation config in push remote: add remote.*.negotiationInclude config fetch: add --negotiation-include option for negotiation negotiator: add have_sent() interface remote: add remote.*.negotiationRestrict config transport: rename negotiation_tips fetch: add --negotiation-restrict option t5516: fix test order flakiness repack: allow `--write-midx=incremental` without `--geometric` repack: introduce `--write-midx=incremental` repack: implement incremental MIDX repacking packfile: ensure `close_pack_revindex()` frees in-memory revindex ...
2026-07-16Merge branch 'master' of https://github.com/j6t/git-guiJunio C Hamano3-15/+29
* 'master' of https://github.com/j6t/git-gui: git-gui: allow larger width for the commit message field git-gui: reduce complexity of the quiet msgfmt rule git-gui: drop msgfmt --statistics output git-gui i18n: Update Bulgarian translation (562t)
2026-07-16Merge branch 'master' of https://github.com/j6t/gitkJunio C Hamano3-218/+321
* 'master' of https://github.com/j6t/gitk: gitk: make "make -s" silent gitk i18n: Update Bulgarian translation (329t) gitk: spanish translations
2026-07-16refs: remove remaining uses of `the_repository`Patrick Steinhardt8-29/+29
There are still a couple of callsites that use `the_repository`. Convert these to instead use a repository injected by the caller. This allows us to remove `USE_THE_REPOSITORY_VARIABLE`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16worktree: pass repository to public functionsPatrick Steinhardt19-97/+120
Refactor remaining public functions that still depend on `the_repository` to instead receive a repository as parameter. This allows us to get rid of `USE_THE_REPOSITORY_VARIABLE`. Adapt callers accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16worktree: pass repository to file-local functionsPatrick Steinhardt1-21/+26
We have a bunch of file-local functions that use `the_repository`. Adapt them so that the repository is instead passed as a parameter so that we can get rid of this dependency. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16worktree: refactor code to use available repositoriesPatrick Steinhardt1-7/+7
In "worktree.c" we have lots of users of `the_repository` that already have a repository available to them. Convert all of them to use that repository instead. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16refs/files: drop `USE_THE_REPOSITORY_VARIABLE`Patrick Steinhardt1-14/+17
We have a bunch of users of `the_repository` in the "files" backend, all of which are trivial to convert to instead use the backend's own repo. Do so. There is one more dependency on global state though via `ignore_case`, and thus we can't trivially remove `USE_THE_REPOSITORY_VARIABLE`. But this is the only use of global state, and we want to ensure that we don't unwittingly reintroduce a dependency on `the_repository` going forward. Add an extern declaration for `ignore_case` so that it becomes accessible even without `USE_THE_REPOSITORY_VARIABLE` and drop the define itself. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16refs/packed: de-globalize handling of "core.packedRefsTimeout"Patrick Steinhardt1-7/+13
When locking the "packed-refs" file we allow the user to configure a timeout for how long we try taking the lock. This is configurable via "core.packedRefsTimeout", which we parse in `packed_refs_lock()`. The parsed value is stored in function-static variables though, which of course has the effect that we'll only ever use the timeout configured in the first packed reference store that we see. Consequently, if we ever were to handle stores from different repositories, then we'd use the same configuration for both stores even if they diverge. This is of course a somewhat theoretical concern -- we don't typically handle multiple packed stores, and even if we did it's very unlikely that the user has configured different timeout values for each of them. But still, this is a code smell, and an unnecessary one, too. Fix the issue by moving the value into `struct packed_ref_store` so that it can be parsed per store. This removes the last callsite that still used `the_repository`, so drop the `USE_THE_REPOSITORY_VARIABLE` define. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-16Merge branch 'master' of github.com:alshopov/git-guiJohannes Sixt1-1/+1
* 'master' of github.com:alshopov/git-gui: git-gui: allow larger width for the commit message field Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2026-07-16Merge branch 'hn/silence-make-s'Johannes Sixt1-3/+2
* hn/silence-make-s: git-gui: reduce complexity of the quiet msgfmt rule git-gui: drop msgfmt --statistics output
2026-07-16Merge branch 'spanish_pr_bis' of github.com:basuradeluis/gitkbisJohannes Sixt1-204/+284
* 'spanish_pr_bis' of github.com:basuradeluis/gitkbis: gitk: spanish translations Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2026-07-15revision: make get_commit_action() a pure predicateMichael Montalbo3-26/+127
get_commit_action() reads as a predicate that decides whether a commit is shown or ignored, but for a line-level log without parent rewriting it also calls line_log_process_ranges_arbitrary_commit(), which mutates the tracked line ranges. That hidden side effect makes it unsafe to evaluate ahead of the walk, the way a lookahead would. get_commit_action() was split out of simplify_commit() in beb5af43a6 (graph API: fix bug in graph_is_interesting(), 2009-08-18) as the show/ignore decision minus the parent rewriting, so the graph renderer could reuse it; line-level log later routed its filtering through it as well, in 3cb9d2b6 (line-log: more responsive, incremental 'git log -L', 2020-05-11). Besides simplify_commit(), the walk driver, graph_is_interesting() is its only other caller, and it runs only under --graph, which sets rewrite_parents and therefore want_ancestry(); the "-L without ancestry" branch that holds the side effect never fires there, so it is dormant today. The line-level processing folds a commit's tracked ranges onto its parents, which must happen even for a commit that get_commit_action() filters from the output, or the ranges never reach the parents. Move it to simplify_commit() and run it before get_commit_action(), gated by get_commit_action()'s leading checks (already shown, uninteresting, and the like) so a commit ignored by those is not folded, as before; factor those checks out as commit_early_ignore(). get_commit_action() is then side-effect free. commit_early_ignore() runs twice on the -L path, once for that gate and once inside get_commit_action(), but it reads only object flags and pack membership, disjoint from the TREESAME flag the fold sets, so the repeat is harmless. Add a "line-log-peek" subcommand to the revision-walking test helper that evaluates get_commit_action() on a commit the walk has not reached yet, plus a t4211 check that the call leaves the commit's flags unchanged. The flags are compared rather than the commit list because add_line_range() merges ranges by union, which is idempotent, so the side effect never changed which commits a linear -L history shows. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-15remote-curl: simplify passing of push specsRené Scharfe1-11/+9
The push specs are kept in a strvec, whose array is NULL-terminated. Pass only that to the protocol handlers, which avoids dealing with item counts and their conversions from size_t to int, slightly simplifying the code. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-07-15The 3rd batch for Git 2.56Junio C Hamano1-0/+29
Signed-off-by: Junio C Hamano <gitster@pobox.com>