aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-03-02Merge branch 'pw/meson-doc-mergetool'Junio C Hamano
Update build precedure for mergetool documentation in meson-based builds. * pw/meson-doc-mergetool: meson: fix building mergetool docs
2026-03-02Merge branch 'kh/doc-am-xref'Junio C Hamano
Doc update. * kh/doc-am-xref: doc: am: fill out hook discussion doc: am: add missing config am.messageId doc: am: say that --message-id adds a trailer doc: am: normalize git(1) command links
2026-03-02Merge branch 'ps/object-info-bits-cleanup'Junio C Hamano
A couple of bugs in use of flag bits around odb API has been corrected, and the flag bits reordered. * ps/object-info-bits-cleanup: odb: convert `odb_has_object()` flags into an enum odb: convert object info flags into an enum odb: drop gaps in object info flag values builtin/fsck: fix flags passed to `odb_has_object()` builtin/backfill: fix flags passed to `odb_has_object()`
2026-03-02Merge branch 'ag/http-netrc-tests'Junio C Hamano
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
2026-03-02Merge branch 'ty/symlinks-use-unsigned-for-bitset'Junio C Hamano
Code clean-up. * ty/symlinks-use-unsigned-for-bitset: symlinks: use unsigned int for flags
2026-03-02Merge branch 'ps/validate-prefix-in-subtree-split'Junio C Hamano
"git subtree split --prefix=P <commit>" now checks the prefix P against the tree of the (potentially quite different from the current working tree) given commit. * ps/validate-prefix-in-subtree-split: subtree: validate --prefix against commit in split
2026-03-02Merge branch 'uk/signature-is-good-after-key-expires'Junio C Hamano
A signature on a commit that was GPG signed long time ago ought to be still valid after the key that was used to sign it has expired, but we showed them in alarming red. * uk/signature-is-good-after-key-expires: gpg-interface: signatures by expired keys are fine
2026-03-02Merge branch 'ps/odb-for-each-object'Junio C Hamano
Revamp object enumeration API around odb. * ps/odb-for-each-object: odb: drop unused `for_each_{loose,packed}_object()` functions reachable: convert to use `odb_for_each_object()` builtin/pack-objects: use `packfile_store_for_each_object()` odb: introduce mtime fields for object info requests treewide: drop uses of `for_each_{loose,packed}_object()` treewide: enumerate promisor objects via `odb_for_each_object()` builtin/fsck: refactor to use `odb_for_each_object()` odb: introduce `odb_for_each_object()` packfile: introduce function to iterate through objects packfile: extract function to iterate through objects of a store object-file: introduce function to iterate through objects object-file: extract function to read object info from path odb: fix flags parameter to be unsigned odb: rename `FOR_EACH_OBJECT_*` flags
2026-03-02Merge branch 'ar/run-command-hook-take-2' into ar/config-hooksJunio C Hamano
* ar/run-command-hook-take-2: builtin/receive-pack: avoid spinning no-op sideband async threads
2026-03-02builtin/receive-pack: avoid spinning no-op sideband async threadsAdrian Ratiu
Exit early if the hooks do not exist, to avoid spinning up/down sideband async threads which no-op. It is important to call the hook_exists() API provided by hook.[ch] because it covers both config-defined hooks and the "traditional" hooks from the hookdir. find_hook() only covers the hookdir hooks. The regression happened because the no-op async threads add some additional overhead which can be measured with the receive-refs test of the benchmarks suite [1]. Reproduced using: cd benchmarks/receive-refs && \ ./run --revisions /path/to/git \ fc148b146ad41be71a7852c4867f0773cbfe1ff9~,fc148b146ad41be71a7852c4867f0773cbfe1ff9 \ --parameter-list refformat reftable --parameter-list refcount 10000 1: https://gitlab.com/gitlab-org/data-access/git/benchmarks Fixes: fc148b146ad4 ("receive-pack: convert update hooks to new API") Reported-by: Patrick Steinhardt <ps@pks.im> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> [jc: avoid duplicated hardcoded hook names] Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02builtin/repo: find tree with most entriesJustin Tobler
The size of a tree object usually corresponds with the number of entries it has. While iterating through objects in the repository for git-repo-structure, identify the tree with the most entries and display it in the output. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02builtin/repo: find commit with most parentsJustin Tobler
Complex merge events may produce an octopus merge where the resulting merge commit has more than two parents. While iterating through objects in the repository for git-repo-structure, identify the commit with the most parents and display it in the output. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02builtin/repo: add OID annotations to table outputJustin Tobler
The "structure" output for git-repo(1) does not show the corresponding OIDs for the largest objects in its "table" output. Update the output to include a list of OID annotations with an index to the corresponding row in the table. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02builtin/repo: collect largest inflated objectsJustin Tobler
The "structure" output for git-repo(1) shows the total inflated and disk sizes of reachable objects in the repository, but doesn't show the size of the largest individual objects. Since an individual object may be a large contributor to the overall repository size, it is useful for users to know the maximum size of individual objects. While interating across objects, record the size and OID of the largest objects encountered for each object type to provide as output. Note that the default "table" output format only displays size information and not the corresponding OID. In a subsequent commit, the table format is updated to add table annotations that mention the OID. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02builtin/repo: add helper for printing keyvalue outputJustin Tobler
The machine-parsable formats for the git-repo(1) "structure" subcommand print output in keyvalue pairs. Introduce the helper function `print_keyvalue()` to remove some code duplication and improve readability. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02builtin/repo: update stats for each objectJustin Tobler
When walking reachable objects in the repository, `count_objects()` processes a set of objects and updates the `struct object_stats`. In preparation for more granular statistics being collected, update the `struct object_stats` for each individual object instead. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02t: fix "that that" typo in lib-unicode-nfc-nfd.shSiddharth Shrimali
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>
2026-03-02t3310: replace test -f/-d with test_path_is_file/test_path_is_dirFrancesco Paparatto
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>
2026-03-02ci: unset GITLAB_FEATURES envvar to not bust xargs(1) limitsPatrick Steinhardt
We have started to see the following assert happen in our GitLab CI pipelines for jobs that use Windows with Meson: assertion "bc_ctl.arg_max >= LINE_MAX" failed: file "xargs.c", line 512, function: main The assert in question verifies that we have enough room available to pass at least `LINE_MAX` many bytes via the command line. The xargs(1) binary in those jobs comes from Git for Windows, which in turn sources the binaries from MSYS2, and has the following limits in place: $ & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'xargs --show-limits </dev/null' Your environment variables take up 17373 bytes POSIX upper limit on argument length (this system): 12579 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 18446744073709546822 Size of command buffer we are actually using: 12579 Maximum parallelism (--max-procs must be no greater): 2147483647 What's interesting to see is the limit of 16 exabits for the maximum command line length. This value might seem a bit high, and it is indeed the result of an underflow: our environment is larger than the POSIX upper limit on argument length, and the value is computed by subtracting the former from the latter. So what we get is the result of `2^64 - (17373 - 12579)`. This makes it clear that the problem here is the size of our environment variables. A listing sorted by length yields the following result: $ Get-ChildItem "Env:" | Sort-Object { $_.Value.Length } -Descending | Select-Object Name, @{Name="Length"; Expression={$_.Value.Length}} Name Length ---- ------ GITLAB_FEATURES 6386 Path 706 PSModulePath 229 The GITLAB_FEATURES environment variable makes up for roughly a third of the complete environment. This variable is a comma-separated list of features available for the GitLab instance, and seemingly it has been growing over time as GitLab added more and more features. Fix the issue by unsetting the environment variable in "ci/lib.sh". This ensures that the environment variables are now smaller than the upper limit on argument length again, and that in turn fixes the assert in xargs(1). Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02doc: diff-options.adoc: make *.noprefix split translatableKristoffer Haugsbakk
We cannot split single words like what we did in the previous commit. That is because the doc translations are processed in bigger chunks. Instead write the two paragraphs with the only variations being this configuration variable. Reported-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02send-email: add client certificate optionsDavid Timber
For SMTP servers that do "mutual certificate verification", the mail client is required to present its own TLS certificate as well. This patch adds --smtp-ssl-client-cert and --smtp-ssl-client-key for such servers. The problem of which private key for the certificate is chosen arises when there are private keys in both the certificate and private key file. According to the documentation of IO::Socket::SSL(link supplied), the behaviour(the private key chosen) depends on the format of the certificate. In a nutshell, - PKCS12: the key in the cert always takes the precedence - PEM: if the key file is not given, it will "try" to read one from the cert PEM file Many users may find this discrepancy unintuitive. In terms of client certificate, git-send-email is implemented in a way that what's possible with perl's SSL library is exposed to the user as much as possible. In this instance, the user may choose to use a PEM file that contains both certificate and private key should be at their discretion despite the implications. Link: https://metacpan.org/pod/IO::Socket::SSL#SSL_cert_file-%7C-SSL_cert-%7C-SSL_key_file-%7C-SSL_key Link: https://lore.kernel.org/all/319bf98c-52df-4bf9-b157-e4bc2bf087d6@dev.snart.me/ Signed-off-by: David Timber <dxdt@dev.snart.me> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-02diff: fix crash with --find-object outside repositoryMichael Montalbo
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>
2026-03-02fsmonitor-watchman: fix variable reference and remove redundant codePaul Tarjan
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>
2026-03-02send-email: validate charset name in 8bit encoding promptShreyansh Paliwal
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-03-02parseopt: check for duplicate long names and numerical optionsRené Scharfe
We already check for duplicate short names. Check for and report duplicate long names and numerical options as well. Perform the slightly expensive string duplicate check only when showing the usage to keep the cost of normal invocations low. t0012-help.sh covers it. Helped-by: Jeff King <peff@peff.net> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-01gitk: support link color in the Preferences dialogWang Zichong
As a dark-theme user, I use the Preferences dialog to set colors for gitk. The only color I cannot change via that dialog is the link foreground color, which leads to using the default link color on a dark background that makes it hard to read. Make the link foreground color also configurable in the Gitk Preferences dialog's Color tab, so users won't need to dig into the code/manual to check if it is configurable and can simply set the color there. Signed-off-by: Wang Zichong <wangzichong@deepin.org> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2026-02-27The 8th batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-27Merge branch 'ap/use-test-seq-f-more'Junio C Hamano
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 'db/doc-fetch-jobs-auto'Junio C Hamano
Doc update. * db/doc-fetch-jobs-auto: doc: fetch: document `--jobs=0` behavior
2026-02-27Merge branch 'mf/format-patch-honor-from-for-cover-letter'Junio C Hamano
"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
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
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
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
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
"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 'jk/ref-filter-lrstrip-optim'Junio C Hamano
Code clean-up. * jk/ref-filter-lrstrip-optim: ref-filter: clarify lstrip/rstrip component counting ref-filter: avoid strrchr() in rstrip_ref_components() ref-filter: simplify rstrip_ref_components() memory handling ref-filter: simplify lstrip_ref_components() memory handling ref-filter: factor out refname component counting
2026-02-27Merge branch 'ps/history-ergonomics-updates'Junio C Hamano
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
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
"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
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-27diff: handle ANSI escape codes in prefix when calculating diffstat widthLorenzoPegorari
The diffstat width is calculated by taking the terminal width and incorrectly subtracting the `strlen()` of `line_prefix`, instead of the actual display width of `line_prefix`, which may contain ANSI escape codes (e.g., ANSI-colored strings in `log --graph --stat`). Utilize the display width instead, obtained via `utf8_strnwidth()` with the flag `skip_ansi`. Signed-off-by: LorenzoPegorari <lorenzo.pegorari2002@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-27pack-objects: remove duplicate --stdin-packs definitionRené Scharfe
cd846bacc7 (pack-objects: introduce '--stdin-packs=follow', 2025-06-23) added a new definition of the option --stdin-packs that accepts an argument. It kept the old definition, which still shows up in the short help, but is shadowed by the new one. Remove it. Hinted-at-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-27repo: remove unnecessary variable shadowK Jayatheerth
Avoid redeclaring `entry` inside the conditional block, removing unnecessary variable shadowing and improving code clarity without changing behavior. Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com> Acked-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26git, help: fix memory leaks in alias listingJonatan Holmgren
The list_aliases() function sets the util pointer of each list item to a heap-allocated copy of the alias command value. Two callers failed to free these util pointers: - list_cmds() in git.c collects a string list with STRING_LIST_INIT_DUP and clears it with string_list_clear(&list, 0), which frees the duplicated strings (strdup_strings=1) but not the util pointers. Pass free_util=1 to free them. - list_cmds_by_config() in help.c calls string_list_sort_u(list, 0) to deduplicate the list before processing completion.commands overrides. When duplicate entries are removed, the util pointer of each discarded item is leaked because free_util=0. Pass free_util=1 to free them. Reported-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jonatan Holmgren <jonatan@jontes.page> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26alias: treat empty subsection [alias ""] as plain [alias]Jonatan Holmgren
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>
2026-02-26doc: fix list continuation in alias subsection exampleJonatan Holmgren
The example showing the equivalence between alias.last and alias.last.command was missing the list continuation marks (+ between the shell session block and the following prose, leaving the paragraph detached from the list item in the rendered output. Signed-off-by: Jonatan Holmgren <jonatan@jontes.page> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26status: add status.compareBranches config for multiple branch comparisonsHarald Nordgren
Add a new configuration variable status.compareBranches that allows users to specify a space-separated list of branch comparisons in git status output. Supported values: - @{upstream} for the current branch's upstream tracking branch - @{push} for the current branch's push destination Any other value is ignored and a warning is shown. When not configured, the default behavior is equivalent to setting `status.compareBranches = @{upstream}`, preserving backward compatibility. The advice messages shown are context-aware: - "git pull" advice is shown only when comparing against @{upstream} - "git push" advice is shown only when comparing against @{push} - Divergence advice is shown for upstream branch comparisons This is useful for triangular workflows where the upstream tracking branch differs from the push destination, allowing users to see their status relative to both branches at once. Example configuration: [status] compareBranches = @{upstream} @{push} Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26refactor format_branch_comparison in preparationHarald Nordgren
Refactor format_branch_comparison function in preparation for showing comparison with push remote tracking branch. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26environment: move "branch.autoSetupMerge" into `struct repo_config_values`Olamide Caleb Bello
The config value `branch.autoSetupMerge` is parsed in `git_default_branch_config()` and stored in the global variable `git_branch_track`. This global variable can be overwritten by another repository when multiple Git repos run in the the same process. Move this value into `struct repo_config_values` in the_repository to retain current behaviours and move towards libifying Git. Since the variable is no longer a global variable, it has been renamed to `branch_track` in the struct `repo_config_values`. Suggested-by: Phillip Wood <phillip.wood123@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Usman Akinyemi <usmanakinyemi202@gmail.com> Signed-off-by: Olamide Caleb Bello <belkid98@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-26environment: stop using core.sparseCheckout globallyOlamide Caleb Bello
The config value `core.sparseCheckout` is parsed in `git_default_core_config()` and stored globally in `core_apply_sparse_checkout`. This could cause it to be overwritten by another repository when different Git repositories run in the same process. Move the parsed value into `struct repo_config_values` in the_repository to retain current behaviours and move towards libifying Git. Suggested-by: Phillip Wood <phillip.wood123@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Usman Akinyemi <usmanakinyemi202@gmail.com> Signed-off-by: Olamide Caleb Bello <belkid98@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>