In c0192df630 (refspec: add support for negative refspecs, 2020-09-30) query_matches_negative_refspec() was introduced. The function was implemented as a two-loop process, where the former loop accumulates and the latter evaluates. To accumulate, a string_list is used. Within the first loop, there are three cases where a string is added to the string_list. Two of them add strings that do not need to be freed. But in the third case, the string added is returned by match_name_with_pattern(), which needs to be freed. The string_list is initialized with STRING_LIST_INIT_NODUP, i.e. when cleared, the strings added are not freed. Therefore, the string returned by match_name_with_pattern() is not freed, so we have a leak. $ git remote add local . $ git update-ref refs/remotes/local/foo HEAD $ git branch --track bar local/foo Direct leak of 24 byte(s) in 1 object(s) allocated from: ... in xrealloc wrapper.c ... in strbuf_grow strbuf.c ... in strbuf_add strbuf.c ... in match_name_with_pattern remote.c ... in query_matches_negative_refspec remote.c ... in query_refspecs remote.c ... in remote_find_tracking remote.c ... in find_tracked_branch branch.c ... in for_each_remote remote.c ... in setup_tracking branch.c ... in create_branch branch.c ... in cmd_branch builtin/branch.c ... in run_builtin git.c Direct leak of 24 byte(s) in 1 object(s) allocated from: ... in xrealloc wrapper.c ... in strbuf_grow strbuf.c ... in strbuf_add strbuf.c ... in match_name_with_pattern remote.c ... in query_matches_negative_refspec remote.c ... in query_refspecs remote.c ... in remote_find_tracking remote.c ... in check_tracking_branch branch.c ... in for_each_remote remote.c ... in validate_remote_tracking_branch branch.c ... in dwim_branch_start branch.c ... in create_branch branch.c ... in cmd_branch builtin/branch.c ... in run_builtin git.c An interesting point to note is that while string_list_append() is used in the first two cases described, string_list_append_nodup() is used in the third. This seems to indicate an intention to delegate the responsibility for freeing the string, to the string_list. As if the string_list had been initialized with STRING_LIST_INIT_DUP, i.e. the strings are strdup()'d when added (except if the "_nodup" API is used) and freed when cleared. Switching to STRING_LIST_INIT_DUP fixes the leak and probably is what we wanted to do originally. Let's do it. Signed-off-by: Rubén Justo <rjusto@gmail.com> --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote.c b/remote.c index 0764fca0db..1bcd36e358 100644 --- a/remote.c +++ b/remote.c @@ -890,7 +890,7 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite { int i, matched_negative = 0; int find_src = !query->src; - struct string_list reversed = STRING_LIST_INIT_NODUP; + struct string_list reversed = STRING_LIST_INIT_DUP; const char *needle = find_src ? query->dst : query->src; /* -- 2.40.1
The latest feature release Git v2.38.0 is now available at the usual places. It is comprised of 699 non-merge commits since v2.37.0, contributed by 92 people, 24 of which are new faces [*]. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/ The following public repositories all have a copy of the 'v2.38.0' tag and the 'master' branch that the tag points at: url = https://git.kernel.org/pub/scm/git/git url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.37.0 are as follows. Welcome to the Git development community! Andrew Olsen, Anthony Delannoy, Carlos López, Celeste Liu, Cleber Rosa, David Plumpton, Elijah Conners, Eric DeCosta, Goss Geppert, Hubert Bossot, Ilya K, Ingy dot Net, Jacob Stopak, Julien Rouhaud, Kilian Kilger, Lana Deere, Manuel Boni, Matthew Klein, Miaoqian Lin, Moritz Baumann, Pavel Rappo, Pierre Garnier, Richard Oliver, and Xavier Morel. Returning contributors who helped this release are as follows. Thanks for your continued support. Abhradeep Chakraborty, Adam Dinwoodie, Ævar Arnfjörð Bjarmason, Alexander Shopov, Alex Henrie, Arthur Milchior, Bagas Sanjaya, brian m. carlson, Calvin Wan, Carlo Marcelo Arenas Belón, Christian Couder, Christoph Reiter, Derrick Stolee, Dimitriy Ryazantcev, Đoàn Trần Công Danh, Elijah Newren, Emily Shaffer, Emir SARI, Eric Sunshine, Fangyi Zhou, Felipe Contreras, Fernando Ramos, Glen Choo, Han Xin, Hariom Verma, Jacob Keller, Jaydeep Das, Jean-Noël Avila, Jeff King, Jiang Xin, Joey Hess, Johannes Schindelin, John Cai, Jonathan Tan, Jordi Mas, Josh Steadmon, Junio C Hamano, Justin Donnelly, Kyle Zhao, Lessley Dennington, Li Linchao, Linus Torvalds, Martin Ågren, Matheus Tavares, Matthew John Cheetham, Michael J Gruber, Øystein Walle, Peter Krefting, Philip Oakley, Philippe Blain, Phillip Szelat, Phillip Wood, Ralf Thielow, Randall S. Becker, Renato Botelho, René Scharfe, Shaoxuan Yuan, Siddharth Asthana, SZEDER Gábor, Tao Klerks, Taylor Blau, Teng Long, Todd Zullinger, Torsten Bögershausen, Victoria Dye, Yi-Jyun Pan, ZheNing Hu, and 依云. [*] We are counting not just the authorship contribution but issue reporting, mentoring, helping and reviewing that are recorded in the commit trailers. ---------------------------------------------------------------- Git v2.38 Release Notes ======================= UI, Workflows & Features * "git remote show [-n] frotz" now pays attention to negative pathspec. * "git push" sometimes performs poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". * "git grep -m<max-hits>" is a way to limit the hits shown per file. * "git merge-tree" learned a new mode where it takes two commits and computes a tree that would result in the merge commit, if the histories leading to these two commits were to be merged. * "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. * Earlier, HTTP transport clients learned to tell the server side what locale they are in by sending Accept-Language HTTP header, but this was done only for some requests but not others. * Introduce a safe.barerepository configuration variable that allows users to forbid discovery of bare repositories. * Various messages that come from the pack-bitmap codepaths have been tweaked. * "git rebase -i" learns to update branches whose tip appear in the rebased range with "--update-refs" option. * "git ls-files" learns the "--format" option to tweak its output. * "git cat-file" learned an option to use the mailmap when showing commit and tag objects. * When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. * Operating modes like "--batch" of "git cat-file" command learned to take NUL-terminated input, instead of one-item-per-line. * "git rm" has become more aware of the sparse-index feature. * "git rev-list --disk-usage" learned to take an optional value "human" to show the reported value in human-readable format, like "3.40MiB". * The "diagnose" feature to create a zip archive for diagnostic material has been lifted from "scalar" and made into a feature of "git bugreport". * The namespaces used by "log --decorate" from "refs/" hierarchy by default has been tightened. * "git rev-list --ancestry-path=C A..B" is a natural extension of "git rev-list A..B"; instead of choosing a subset of A..B to those that have ancestry relationship with A, it lets a subset with ancestry relationship with C. * "scalar" now enables built-in fsmonitor on enlisted repositories, when able. * The bash prompt (in contrib/) learned to optionally indicate when the index is unmerged. * "git clone" command learned the "--bundle-uri" option to coordinate with hosting sites the use of pre-prepared bundle files. * "git range-diff" learned to honor pathspec argument if given. * "git format-patch --from=<ident>" can be told to add an in-body "From:" line even for commits that are authored by the given <ident> with "--force-in-body-from" option. * The built-in fsmonitor refuses to work on a network mounted repositories; a configuration knob for users to override this has been introduced. * The "scalar" addition from Microsoft is now part of the core Git installation. Performance, Internal Implementation, Development Support etc. * Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. * Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. * Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. * Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. * Further preparation to turn git-submodule.sh into a builtin continues. * Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. * Teach "make all" to build gitweb as well. * Tweak tests so that they still work when the "git init" template did not create .git/info directory. * Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused variable. * The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. * Support for libnettle as SHA256 implementation has been added. * The way "git multi-pack" uses parse-options API has been improved. * A Coccinelle rule (in contrib/) to encourage use of COPY_ARRAY macro has been improved. * API tweak to make it easier to run fuzz testing on commit-graph parser. * Omit fsync-related trace2 entries when their values are all zero. * The codepath to write multi-pack index has been taught to release a large chunk of memory that holds an array of objects in the packs, as soon as it is done with the array, to reduce memory consumption. * Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. * "git fetch" client logs the partial clone filter used in the trace2 output. * The "bundle URI" design gets documented. * The common ancestor negotiation exchange during a "git fetch" session now leaves trace log. * Test portability improvements. (merge 4d1d843be7 mt/rot13-in-c later to maint). * The "subcommand" mode is introduced to parse-options API and update the command line parser of Git commands with subcommands. * The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. * The assembly version of SHA-1 implementation for PPC has been removed. * The server side that responds to "git fetch" and "git clone" request has been optimized by allowing it to send objects in its object store without recomputing and validating the object names. * Annotate function parameters that are not used (but cannot be removed for structural reasons), to prepare us to later compile with -Wunused warning turned on. * Share the text used to explain configuration variables used by "git <subcmd>" in "git help <subcmd>" with the text from "git help config". * "git mv A B" in a sparsely populated working tree can be asked to move a path from a directory that is "in cone" to another directory that is "out of cone". Handling of such a case has been improved. * The chainlint script for our tests has been revamped. Fixes since v2.37 ----------------- * Rewrite of "git add -i" in C that appeared in Git 2.25 didn't correctly record a removed file to the index, which was fixed. * Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. * Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. * Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. * "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. * Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. * References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. * In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. * Recent update to vimdiff layout code has been made more robust against different end-user vim settings. * Plug various memory leaks, both in the main code and in test-tool commands. * Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. * The resolve-undo information in the index was not protected against GC, which has been corrected. * A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. * "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. * An earlier attempt to plug leaks placed a clean-up label to jump to at a bogus place, which as been corrected. * Variable quoting fix in the vimdiff driver of "git mergetool" * "git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. * A fix for a regression in test framework. * mkstemp() emulation on Windows has been improved. * Add missing documentation for "include" and "includeIf" features in "git config" file format, which incidentally teaches the command line completion to include them in its offerings. * Avoid "white/black-list" in documentation and code comments. * Workaround for a compiler warning against use of die() in osx-keychain (in contrib/). * Workaround for a false positive compiler warning. * "git p4" working on UTF-16 files on Windows did not implement CRLF-to-LF conversion correctly, which has been corrected. * "git p4" did not handle non-ASCII client name well, which has been corrected. * "rerere-train" script (in contrib/) used to honor commit.gpgSign while recreating the throw-away merges. * "git checkout" miscounted the paths it updated, which has been corrected. * Fix for a bug that makes write-tree to fail to write out a non-existent index as a tree, introduced in 2.37. * There was a bug in the codepath to upgrade generation information in commit-graph from v1 to v2 format, which has been corrected. * Gitweb had legacy URL shortener that is specific to the way projects hosted on kernel.org used to (but no longer) work, which has been removed. * Fix build procedure for Windows that uses CMake so that it can pick up the shell interpreter from local installation location. * Conditionally allow building Python interpreter on Windows * Fix to lstat() emulation on Windows. * Older gcc with -Wall complains about the universal zero initializer "struct s = { 0 };" idiom, which makes developers' lives inconvenient (as -Werror is enabled by DEVELOPER=YesPlease). The build procedure has been tweaked to help these compilers. * Plug memory leaks in the failure code path in the "merge-ort" merge strategy backend. * "git symbolic-ref symref non..sen..se" is now diagnosed as an error. * A follow-up fix to a fix for a regression in 2.36 around hooks. * Avoid repeatedly running getconf to ask libc version in the test suite, and instead just as it once per script. * Platform-specific code that determines if a directory is OK to use as a repository has been taught to report more details, especially on Windows. * "vimdiff3" regression fix. * "git fsck" reads mode from tree objects but canonicalizes the mode before passing it to the logic to check object sanity, which has hid broken tree objects from the checking logic. This has been corrected, but to help existing projects with broken tree objects that they cannot fix retroactively, the severity of anomalies this code detects has been demoted to "info" for now. * Fixes to sparse index compatibility work for "reset" and "checkout" commands. * An earlier optimization discarded a tree-object buffer that is still in use, which has been corrected. * Fix deadlocks between main Git process and subprocess spawned via the pipe_command() API, that can kill "git add -p" that was reimplemented in C recently. * The sequencer machinery translated messages left in the reflog by mistake, which has been corrected. * xcalloc(), imitating calloc(), takes "number of elements of the array", and "size of a single element", in this order. A call that does not follow this ordering has been corrected. * The preload-index codepath made copies of pathspec to give to multiple threads, which were left leaked. * Update the version of Ubuntu used for GitHub Actions CI from 18.04 to 22.04. * The auto-stashed local changes created by "git merge --autostash" was mixed into a conflicted state left in the working tree, which has been corrected. * Multi-pack index got corrupted when preferred pack changed from one pack to another in a certain way, which has been corrected. (merge 99e4d084ff tb/midx-with-changing-preferred-pack-fix later to maint). * The clean-up of temporary files created via mks_tempfile_dt() was racy and attempted to unlink() the leading directory when signals are involved, which has been corrected. (merge babe2e0559 rs/tempfile-cleanup-race-fix later to maint). * FreeBSD portability fix for "git maintenance" that spawns "crontab" to schedule tasks. (merge ee69e7884e bc/gc-crontab-fix later to maint). * Those who use diff-so-fancy as the diff-filter noticed a regression or two in the code that parses the diff output in the built-in version of "add -p", which has been corrected. (merge 0a101676e5 js/add-p-diff-parsing-fix later to maint). * Segfault fix-up to an earlier fix to the topic to teach "git reset" and "git checkout" work better in a sparse checkout. (merge 037f8ea6d9 vd/sparse-reset-checkout-fixes later to maint). * "git diff --no-index A B" managed its the pathnames of its two input files rather haphazardly, sometimes leaking them. The command line argument processing has been straightened out to clean it up. (merge 2b43dd0eb5 rs/diff-no-index-cleanup later to maint). * "git rev-list --verify-objects" ought to inspect the contents of objects and notice corrupted ones, but it didn't when the commit graph is in use, which has been corrected. (merge b27ccae34b jk/rev-list-verify-objects-fix later to maint). * More fixes to "add -p" (merge 64ec8efb83 js/builtin-add-p-portability-fix later to maint). * The parser in the script interface to parse-options in "git rev-parse" has been updated to diagnose a bogus input correctly. (merge f20b9c36d0 ow/rev-parse-parseopt-fix later to maint). * The code that manages list-object-filter structure, used in partial clones, leaked the instances, which has been plugged. (merge 66eede4a37 jk/plug-list-object-filter-leaks later to maint). * Fix another UI regression in the reimplemented "add -p". (merge f6f0ee247f rs/add-p-worktree-mode-prompt-fix later to maint). * "git fetch" over protocol v2 sent an incorrect ref prefix request to the server and made "git pull" with configured fetch refspec that does not cover the remote branch to merge with fail, which has been corrected. (merge 49ca2fba39 jk/proto-v2-ref-prefix-fix later to maint). * A result from opendir() was leaking in the commit-graph expiration codepath, which has been plugged. (merge 12f1ae5324 ml/commit-graph-expire-dir-leak-fix later to maint). * Just like we have coding guidelines, we now have guidelines for reviewers. (merge e01b851923 vd/doc-reviewing-guidelines later to maint). * Other code cleanup, docfix, build fix, etc. (merge 77b9e85c0f vd/fix-perf-tests later to maint). (merge 0682bc43f5 jk/test-crontab-fixes later to maint). (merge b46dd1726c cc/doc-trailer-whitespace-rules later to maint). ---------------------------------------------------------------- Changes since v2.37.0 are as follows: Abhradeep Chakraborty (9): bitmap-format.txt: feed the file to asciidoc to generate html bitmap-format.txt: fix some formatting issues bitmap-format.txt: add information for trailing checksum Documentation/technical: describe bitmap lookup table extension bitmap: move `get commit positions` code to `bitmap_writer_finish` pack-bitmap-write.c: write lookup table extension pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests pack-bitmap: prepare to read lookup table extension bitmap-lookup-table: add performance tests for lookup table Adam Dinwoodie (1): t1800: correct test to handle Cygwin Alex Henrie (5): gc: don't translate literal commands builtin/diagnose.c: don't translate the two mode values pack-bitmap: improve grammar of "xor chain" error message l10n: fr: don't say that merge is "the default strategy" l10n: es: update translation Alexander Shopov (3): l10n: bg.po: Updated Bulgarian translation (5482t) l10n: bg.po: Updated Bulgarian translation (5484t) l10n: bg.po: Updated Bulgarian translation (5484t) Anthony Delannoy (1): preload-index: fix memleak Bagas Sanjaya (3): l10n: po-id for 2.38 (round 1) l10n: po-id for 2.38 (round 2) l10n: po-id for 2.38 (round 3) Calvin Wan (1): submodule merge: update conflict error message Carlo Marcelo Arenas Belón (2): setup: tighten ownership checks post CVE-2022-24765 cmake: support local installations of git Carlos López (1): grep: add --max-count command line option Celeste Liu (1): contrib/rerere-train: avoid useless gpg sign in training Christian Couder (1): Documentation: clarify whitespace rules for trailers Cleber Rosa (1): setup: fix function name in a BUG() message Derrick Stolee (51): branch: add branch_checked_out() helper branch: check for bisects and rebases fetch: use new branch_checked_out() and add tests branch: use branch_checked_out() when deleting refs branch: fix branch_checked_out() leaks t5510: replace 'origin' with URL more carefully vscode: improve tab size and wrapping git-rebase.txt: use back-ticks consistently pack-bitmap-write: use const for hashes midx: extract bitmap write setup midx: reduce memory pressure while writing bitmaps daemon: clarify directory arguments git-cvsserver: clarify directory list git.txt: remove redundant language t: avoid "whitelist" transport.c: avoid "whitelist" t2407: test bisect and rebase as black-boxes t2407: test branches currently using apply backend branch: consider refs under 'update-refs' rebase-interactive: update 'merge' description sequencer: define array with enum values sequencer: add update-ref command rebase: add --update-refs option rebase: update refs from 'update-ref' commands sequencer: rewrite update-refs as user edits todo list rebase: add rebase.updateRefs config option sequencer: ignore HEAD ref under --update-refs sequencer: notify user of --update-refs activity compat/win32: correct for incorrect compiler warning refs: allow "HEAD" as decoration filter t4207: modernize test t4207: test coloring of grafted decorations refs: add array of ref namespaces refs: use ref_namespaces for replace refs base log-tree: use ref_namespaces instead of if/else-if log: add default decoration filter log: add --clear-decorations option log: create log.initialDecorationSet=all maintenance: stop writing log.excludeDecoration fetch: use ref_namespaces during prefetch docs: document bundle URI standard bundle-uri: add example bundle organization remote-curl: add 'get' capability bundle-uri: create basic file-copy logic clone: add --bundle-uri option bundle-uri: add support for http(s):// and file:// clone: --bundle-uri cannot be combined with --depth t6019: modernize tests with helper clone: warn on failure to repo_init() ci: update 'static-analysis' to Ubuntu 22.04 pack-bitmap: remove trace2 region from hot path Dimitriy Ryazantcev (1): i18n: mark message helpers prefix for translation Elijah Conners (1): reftable: use a pointer for pq_entry param Elijah Newren (43): merge-tree: rename merge_trees() to trivial_merge_trees() merge-tree: move logic for existing merge into new function merge-tree: add option parsing and initial shell for real merge function merge-tree: implement real merges merge-ort: split out a separate display_update_messages() function merge-tree: support including merge messages in output merge-ort: provide a merge_get_conflicted_files() helper function merge-ort: remove command-line-centric submodule message from merge-ort merge-tree: provide a list of which files have conflicts merge-tree: provide easy access to `ls-files -u` style info merge-ort: store more specific conflict information merge-ort: optionally produce machine-readable output merge-tree: allow `ls-files -u` style info to be NUL terminated merge-tree: add a --allow-unrelated-histories flag git-merge-tree.txt: add a section on potentional usage mistakes t6429: fix use of non-existent function t6423: add tests of dual directory rename plus add/add conflict merge-ort: small cleanups of check_for_directory_rename merge-ort: make a separate function for freeing struct collisions merge-ort: shuffle the computation and cleanup of potential collisions merge-ort: fix issue with dual rename and add/add conflict merge-ort-wrappers: make printed message match the one from recursive merge-resolve: abort if index does not match HEAD merge: abort if index does not match HEAD for trivial merges merge: do not abort early if one strategy fails to handle the merge merge: fix save_state() to work when there are stat-dirty files merge: make restore_state() restore staged state too merge: ensure we can actually restore pre-merge state merge: do not exit restore_state() prematurely merge-ort: remove translator lego in new "submodule conflict suggestion" merge-ort: avoid surprise with new sub_flag variable merge-ort: provide helpful submodule update message when possible merge-ort: remove code obsoleted by other changes rev-list-options.txt: fix simple typo revision: allow --ancestry-path to take an argument merge: only apply autostash when appropriate merge: cleanup confusing logic for handling successful merges merge: small code readability improvement t4301: add more interesting merge-tree testcases t64xx: convert 'test_create_repo' to 'git init' diff: have submodule_format logic avoid additional diff headers diff: fix filtering of additional headers under --remerge-diff diff: fix filtering of merge commits under --remerge-diff Emir SARI (3): l10n: tr: Update translations for v2.38.0 round #1 l10n: tr: v2.38.0 round 2 l10n: tr: v2.38.0 3rd round Eric DeCosta (1): fsmonitor: option to allow fsmonitor to run against network-mounted repos Eric Sunshine (25): t2407: fix broken &&-chains in compound statement t1092: fix buggy sparse "blame" test t: detect and signal failure within loop t4301: account for behavior differences between sed implementations t4301: fix broken &&-chains and add missing loop termination t4301: emit blank line in more idiomatic fashion t: add skeleton chainlint.pl chainlint.pl: add POSIX shell lexical analyzer chainlint.pl: add POSIX shell parser chainlint.pl: add parser to validate tests chainlint.pl: add parser to identify test definitions chainlint.pl: validate test scripts in parallel chainlint.pl: don't require `return|exit|continue` to end with `&&` t/Makefile: apply chainlint.pl to existing self-tests chainlint.pl: don't require `&` background command to end with `&&` chainlint.pl: don't flag broken &&-chain if `$?` handled explicitly chainlint.pl: don't flag broken &&-chain if failure indicated explicitly chainlint.pl: complain about loops lacking explicit failure handling chainlint.pl: allow `|| echo` to signal failure upstream of a pipe t/chainlint: add more chainlint.pl self-tests test-lib: retire "lint harder" optimization hack test-lib: replace chainlint.sed with chainlint.pl t/Makefile: teach `make test` and `make prove` to run chainlint.pl t: retire unused chainlint.sed chainlint: colorize problem annotations and test delimiters Fangyi Zhou (3): help: fix doubled words in explanation for developer interfaces l10n: zh_CN v2.38.0 rounds 1 & 2 l10n: zh_CN: 2.38.0 round 3 Felipe Contreras (7): mergetools: vimdiff: fix comment mergetools: vimdiff: make vimdiff3 actually work mergetools: vimdiff: silence annoying messages mergetools: vimdiff: fix for diffopt mergetools: vimdiff: rework tab logic mergetools: vimdiff: fix single window layouts mergetools: vimdiff: simplify tabfirst Fernando Ramos (1): vimdiff: make layout engine more robust against user vim settings Glen Choo (16): submodule--helper: eliminate internal "--update" option submodule--helper tests: add missing "display path" coverage submodule--helper update: use display path helper submodule--helper: don't recreate recursive prefix submodule--helper: use correct display path helper submodule--helper update: use --super-prefix submodule--helper: remove display path helper Documentation/git-config.txt: add SCOPES section Documentation: define protected configuration config: learn `git_protected_config()` safe.directory: use git_protected_config() setup.c: create `safe.bareRepository` config.c: NULL check when reading protected config Documentation/git-reflog: remove unneeded \ from \{ submodule--helper: add "const" to copy of "update_data" submodule--helper: refactor "errmsg_str" to be a "struct strbuf" Goss Geppert (2): dir: traverse into repository dir: minor refactoring / clean-up Han Xin (6): unpack-objects: low memory footprint for get_data() in dry_run mode object-file.c: refactor write_loose_object() to several steps object-file.c: add "stream_loose_object()" to handle large object unpack-objects: use stream_loose_object() to unpack large objects commit-graph.c: no lazy fetch in lookup_commit_in_graph() t5330: remove run_with_limited_processses() Hubert Bossot (1): l10n: fr: The word 'branche' is only feminine Jacob Keller (1): remote: handle negative refspecs in git remote show Jacob Stopak (3): Documentation: fix various repeat word typos Documentation: clean up a few misspelled word typos Documentation: clean up various typos in technical docs Jaydeep Das (1): gpg-interface: add function for converting trust level to string Jean-Noël Avila (3): l10n: fr: v2.38 round 1 l10n: fr: v2.38.0 round 2 l10n: fr: v2.38.0 round 3 Jeff King (64): is_promisor_object(): walk promisor packs in pack-order fetch: stop passing around unused worktrees variable branch: drop unused worktrees variable revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis clone: drop extra newline from warning message clone: propagate empty remote HEAD even with other branches clone: use remote branch if it matches default HEAD clone: move unborn head creation to update_head() ref-filter: disable save_commit_buffer while traversing diff-files: move misplaced cleanup label write_midx_bitmap(): drop unused refs_snapshot parameter config.mak.dev: squelch -Wno-missing-braces for older gcc tree-walk: add a mechanism for getting non-canonicalized modes fsck: actually detect bad file modes in trees fsck: downgrade tree badFilemode to "info" is_promisor_object(): fix use-after-free of tree buffer compat: add function to enable nonblocking pipes git-compat-util: make MAX_IO_SIZE define globally available pipe_command(): avoid xwrite() for writing to pipe pipe_command(): handle ENOSPC when writing to a pipe pipe_command(): mark stdin descriptor as non-blocking git-compat-util: add UNUSED macro refs: mark unused each_ref_fn parameters refs: mark unused reflog callback parameters refs: mark unused virtual method parameters transport: mark bundle transport_options as unused streaming: mark unused virtual method parameters config: mark unused callback parameters hashmap: mark unused callback parameters mark unused read_tree_recursive() callback parameters run-command: mark unused async callback parameters is_path_owned_by_current_uid(): mark "report" parameter as unused xdiff: drop unused mmfile parameters from xdl_do_histogram_diff() log-tree: drop unused commit param in remerge_diff() match_pathname(): drop unused "flags" parameter verify_one_sparse(): drop unused parameters reftable: drop unused parameter from reader_seek_linear() reflog: assert PARSE_OPT_NONEG in parse-options callbacks xdiff: drop unused mmfile parameters from xdl_do_patience_diff() pass subcommand "prefix" arguments to parse_options() maintenance: add parse-options boilerplate for subcommands remote: run "remote rm" argv through parse_options() pack-bitmap-write: drop unused pack_idx_entry parameters tempfile: drop active flag tempfile: update comment describing state transitions test-crontab: minor memory and error handling fixes lookup_commit_in_graph(): use prepare_commit_graph() to check for graph rev-list: disable commit graph with --verify-objects parse_object(): allow skipping hash check upload-pack: skip parse-object re-hashing of "want" objects parse_object(): check commit-graph when skip_hash set t1060: check partial clone of misnamed blob list_objects_filter_copy(): deep-copy sparse_oid_name field transport: deep-copy object-filter struct for fetch-pack transport: free filter options in disconnect_git() list_objects_filter_options: plug leak of filter_spec strings prepare_repo_settings(): plug leak of config values fetch: stop checking for NULL transport->remote in do_fetch() fetch: add branch.*.merge to default ref-prefix extension list-objects-filter: don't memset after releasing filter struct list-objects-filter: handle null default filter spec list-objects-filter: add and use initializers list-objects-filter: convert filter_spec to a strbuf list-objects-filter: initialize sub-filter structs Johannes Schindelin (38): merge-ort: store messages in a list, not in a single strbuf merge-ort: make `path_messages` a strmap to a string_list Git 2.30.5 Git 2.31.4 Git 2.32.3 Git 2.33.4 Git 2.34.4 Git 2.35.4 Git 2.36.2 add --interactive: allow `update` to stage deleted files tests: fix incorrect --write-junit-xml code mergetool(vimdiff): allow paths to contain spaces again shortlog: use a stable sort t5351: avoid relying on `core.fsyncMethod = batch` to be supported t5351: avoid using `test_cmp` for binary data windows: include the Python bits when building Git for Windows mingw: remove unneeded `NO_GETTEXT` directive mingw: remove unneeded `NO_CURL` directive lstat(mingw): correctly detect ENOTDIR scenarios merge-ort: clean up after failed merge merge-ort: do leave trace2 region even if checkout fails setup: fix some formatting setup: prepare for more detailed "dubious ownership" messages mingw: provide details about unsafe directories' ownership mingw: be more informative when ownership check fails on FAT32 mingw: handle a file owned by the Administrators group correctly scalar unregister: stop FSMonitor daemon range-diff: reorder argument handling range-diff: consistently validate the arguments range-diff: optionally accept pathspecs add -p: avoid ambiguous signed/unsigned comparison t3701: test the built-in `add -i` regardless of NO_PERL t6132(NO_PERL): do not run the scripted `add -p` add -p: detect more mismatches between plain vs colored diffs add -p: gracefully handle unparseable hunk headers in colored diffs add -p: ignore dirty submodules git help: special-case `scalar` scalar: implement the `help` subcommand Jonathan Tan (1): fetch-pack: write effective filter to trace2 Jordi Mas (3): l10n: Update Catalan translation l10n: Update Catalan translation l10n: Update Catalan translation Josh Steadmon (1): fetch-pack: add tracing for negotiation rounds Julien Rouhaud (1): gitweb: remove title shortening heuristics Junio C Hamano (45): revision: mark blobs needed for resolve-undo as reachable A regression fix for 2.37 Git 2.37.1 builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() The first batch after Git 2.37 fsck: do not dereference NULL while checking resolve-undo data The second batch The third batch The fourth batch The fifth batch builtin/remote.c: use the right kind of STRING_LIST_INIT The sixth batch The seventh batch Downmerge a handful of fixes for 2.37.x maintenance track The eighth batch The ninth batch doc: consolidate --rerere-autoupdate description doc: clarify rerere-autoupdate Downmerge a bit more for 2.37.x The tenth batch The eleventh batch Git 2.37.2 The twelfth batch The thirteenth batch The fourteenth batch t5329: notice a failure within a loop The fifteenth batch A handful more topics from the 'master' front for 2.37.3 pretty: separate out the logic to decide the use of in-body from format-patch: allow forcing the use of in-body From: header format-patch: learn format.forceInBodyFrom configuration variable The sixteenth batch Git 2.37.3 The seventeenth batch The eighteenth batch The nineteenth batch The twentieth batch Merge a handful of topics from the 'master' front Prepare for 2.38-rc0 Git 2.38-rc0 A bit more of remaining topics before -rc1 Final batch before -rc1 Git 2.38-rc1 Git 2.38-rc2 Git 2.38 Justin Donnelly (1): git-prompt: show presence of unresolved conflicts at command prompt Kilian Kilger (2): git-p4: fix bug with encoding of p4 client name git-p4: refactoring of p4CmdList() Kyle Zhao (1): send-pack.c: add config push.useBitmaps Lessley Dennington (1): osx-keychain: fix compiler warning Li Linchao (3): ls-files: update test style remote-curl: send Accept-Language header to server rev-list: support human-readable output for `--disk-usage` Linus Torvalds (1): symbolic-ref: refuse to set syntactically invalid target Manuel Boni (1): config.txt: document include, includeIf Martin Ågren (4): config/core.txt: fix minor issues for `core.sparseCheckoutCone` t4200: drop irrelevant code read-cache: make `do_read_index()` always set up `istate->repo` cmd-list.perl: fix identifying man sections Matheus Tavares (7): checkout: document bug where delayed checkout counts entries twice checkout: show bug about failed entries being included in final report checkout: fix two bugs on the final count of updated entries pkt-line.h: move comment closer to the associated code t0021: avoid grepping for a Perl-specific string at filter output t0021: implementation the rot13-filter.pl script in C tests: use the new C rot13-filter helper to avoid PERL prereq Matthew John Cheetham (1): scalar: enable built-in FSMonitor on `register` Miaoqian Lin (1): commit-graph: Fix missing closedir in expire_commit_graphs Michael J Gruber (3): sequencer: do not translate reflog messages sequencer: do not translate parameters to error_resolve_conflict() sequencer: do not translate command names Moritz Baumann (3): git-p4: fix CR LF handling for utf16 files git-p4: fix typo in P4Submit.applyCommit() git-p4: fix error handling in P4Unshelve.renameBranch() Peter Krefting (2): l10n: sv.po: Update Swedish translation (5482t0f0u) l10n: sv.po: Update Swedish translation (5484t0f0u) Philip Oakley (1): doc add: renormalize is not idempotent for CRCRLF Philippe Blain (3): diff-format.txt: dst can be 0* SHA-1 when path is deleted, too diff-format.txt: correct misleading wording diff-index.txt: update raw output format in examples Phillip Wood (5): xdiff: introduce XDL_ALLOC_ARRAY() xdiff: introduce xdl_calloc xdiff: introduce XDL_CALLOC_ARRAY() xdiff: introduce XDL_ALLOC_GROW() tests: cache glibc version check Ralf Thielow (2): l10n: de.po: update German translation l10n: de.po: update German translation René Scharfe (28): archive: update format documentation archive: rename archiver data field to filter_command archive-tar: factor out write_block() archive-tar: add internal gzip implementation archive-tar: use OS_CODE 3 (Unix) for internal gzip archive-tar: use internal gzip by default combine-diff: abort if --ignore-matching-lines is given combine-diff: abort if --output is given cocci: avoid normalization rules for memcpy mingw: avoid mktemp() in mkstemp() implementation mergesort: unify ranks loops mergesort: tighten merge loop mergesort: add macros for typed sort of linked lists test-mergesort: use DEFINE_LIST_SORT_DEBUG test-mergesort: use DEFINE_LIST_SORT blame: use DEFINE_LIST_SORT commit: use DEFINE_LIST_SORT fetch-pack: use DEFINE_LIST_SORT packfile: use DEFINE_LIST_SORT mergesort: remove llist_mergesort() nonblock: support Windows tempfile: avoid directory cleanup race test-mergesort: read sort input all at once test-mergesort: use mem_pool for sort input diff-no-index: release strbuf on queue error diff-no-index: release prefixed filenames diff-no-index: simplify argv index calculation add -p: fix worktree patch mode prompts Richard Oliver (1): mktree: do not check type of remote objects SZEDER Gábor (30): Makefile: build 'gitweb' in the default target multi-pack-index: simplify handling of unknown --options index-format.txt: remove outdated list of supported extensions git.c: update NO_PARSEOPT markings t3301-notes.sh: check that default operation mode doesn't take arguments t5505-remote.sh: check the behavior without a subcommand t0040-parse-options: test parse_options() with various 'parse_opt_flags' api-parse-options.txt: fix description of OPT_CMDMODE parse-options: PARSE_OPT_KEEP_UNKNOWN only applies to --options parse-options: clarify the limitations of PARSE_OPT_NODASH parse-options: drop leading space from '--git-completion-helper' output parse-options: add support for parsing subcommands builtin/bundle.c: let parse-options parse subcommands builtin/commit-graph.c: let parse-options parse subcommands builtin/gc.c: let parse-options parse 'git maintenance's subcommands builtin/hook.c: let parse-options parse subcommands builtin/multi-pack-index.c: let parse-options parse subcommands builtin/notes.c: let parse-options parse subcommands builtin/reflog.c: let parse-options parse subcommands builtin/remote.c: let parse-options parse subcommands builtin/sparse-checkout.c: let parse-options parse subcommands builtin/stash.c: let parse-options parse subcommands builtin/worktree.c: let parse-options parse subcommands promisor-remote: fix xcalloc() argument order t0040-parse-options: remove leftover debugging test-parse-options.c: don't use for loop initial declaration test-parse-options.c: fix style of comparison with zero notes: simplify default operation mode arguments check notes, remote: show unknown subcommands between `' t/Makefile: remove 'test-results' on 'make clean' Shaoxuan Yuan (22): t7002: add tests for moving out-of-cone file/directory t1092: mv directory from out-of-cone to in-cone mv: update sparsity after moving from out-of-cone to in-cone mv: decouple if/else-if checks using goto mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit mv: check if <destination> exists in index to handle overwriting mv: use flags mode for update_mode mv: add check_dir_in_index() and solve general dir check issue t1092: add tests for `git-rm` pathspec.h: move pathspec_needs_expanded_index() from reset.c to here rm: expand the index only when necessary rm: integrate with sparse-index t7002: add tests for moving from in-cone to out-of-cone mv: rename check_dir_in_index() to empty_dir_has_sparse_contents() mv: free the with_slash in check_dir_in_index() mv: check if <destination> is a SKIP_WORKTREE_DIR mv: remove BOTH from enum update_mode mv: from in-cone to out-of-cone mv: cleanup empty WORKING_DIRECTORY advice.h: add advise_on_moving_dirty_path() mv: check overwrite for in-to-out move builtin/mv.c: fix possible segfault in add_slash() Siddharth Asthana (4): revision: improve commit_rewrite_person() ident: move commit_rewrite_person() to ident.c ident: rename commit_rewrite_person() to apply_mailmap_to_header() cat-file: add mailmap support Tao Klerks (1): rev-parse: documentation adjustment - mention remote tracking with @{u} Taylor Blau (14): pack-objects.h: remove outdated pahole results commit-graph: pass repo_settings instead of repository t5318: demonstrate commit-graph generation v2 corruption commit-graph: introduce `repo_find_commit_pos_in_graph()` commit-graph: fix corrupt upgrade from generation v1 to v2 t1006: extract --batch-command inputs to variables builtin/cat-file.c: support NUL-delimited input with `-z` t5326: demonstrate potential bitmap corruption t/lib-bitmap.sh: avoid silencing stderr midx.c: extract `struct midx_fanout` midx.c: extract `midx_fanout_add_midx_fanout()` midx.c: extract `midx_fanout_add_pack_fanout()` midx.c: include preferred pack correctly with existing MIDX midx.c: avoid adding preferred objects twice Teng Long (8): pack-bitmap.c: fix formatting of error messages pack-bitmap.c: mark more strings for translations pack-bitmap.c: rename "idx_name" to "bitmap_name" pack-bitmap.c: do not ignore error when opening a bitmap file pack-bitmap.c: using error() instead of silently returning -1 pack-bitmap.c: continue looping when first MIDX bitmap is found api-trace2.txt: print config key-value pair tr2: shows scope unconditionally in addition to key-value pair Todd Zullinger (2): docs: fix a few recently broken links api docs: link to html version of api-trace2 Victoria Dye (37): scalar: reword command documentation to clarify purpose scalar: convert README.md into a technical design doc checkout: fix nested sparse directory diff in sparse index oneway_diff: handle removed sparse directories cache.h: create 'index_name_pos_sparse()' unpack-trees: unpack new trees as sparse directories scalar-diagnose: use "$GIT_UNZIP" in test scalar-diagnose: avoid 32-bit overflow of size_t scalar-diagnose: add directory to archiver more gently scalar-diagnose: move 'get_disk_info()' to 'compat/' scalar-diagnose: move functionality to common location diagnose.c: add option to configure archive contents builtin/diagnose.c: create 'git diagnose' builtin builtin/diagnose.c: add '--mode' option builtin/bugreport.c: create '--diagnose' option scalar-diagnose: use 'git diagnose --mode=all' scalar: update technical doc roadmap scalar: constrain enlistment search scalar-unregister: handle error codes greater than 0 scalar-[un]register: clearly indicate source of error scalar-delete: do not 'die()' in 'delete_enlistment()' scalar: move config setting logic into its own function scalar: update technical doc roadmap with FSMonitor support p0004: fix prereq declaration p0006: fix 'read-tree' argument ordering unpack-trees: fix sparse directory recursion check scalar: fix command documentation section header scalar: include in standard Git build & installation scalar: add to 'git help -a' command list scalar-clone: add test coverage t/perf: add Scalar performance tests t/perf: add 'GIT_PERF_USE_SCALAR' run option Documentation/technical: include Scalar technical doc diagnose.c: refactor to safely use 'd_type' Documentation: add ReviewingGuidelines diagnose: add to command-list.txt version: fix builtin linking & documentation Yi-Jyun Pan (1): l10n: zh_TW.po: Git 2.38.0, round 3 ZheNing Hu (2): ls-files: introduce "--format" option ls-files: fix black space in error message brian m. carlson (2): sha256: add support for Nettle gc: use temporary file for editing crontab Ævar Arnfjörð Bjarmason (153): t0008: don't rely on default ".git/info/exclude" tests: don't depend on template-created .git/branches tests: don't assume a .git/info for .git/info/grafts tests: don't assume a .git/info for .git/info/attributes tests: don't assume a .git/info for .git/info/refs tests: don't assume a .git/info for .git/info/exclude tests: don't assume a .git/info for .git/info/sparse-checkout object-file.c: factor out deflate part of write_loose_object() core doc: modernize core.bigFileThreshold documentation git-submodule.sh: remove unused sanitize_submodule_env() git-submodule.sh: remove unused $prefix variable git-submodule.sh: make the "$cached" variable a boolean git-submodule.sh: remove unused top-level "--branch" argument submodule--helper: have --require-init imply --init submodule update: remove "-v" option submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" submodule--helper: report "submodule" as our name in some "-h" output submodule--helper: understand --checkout, --merge and --rebase synonyms git-submodule.sh: use "$quiet", not "$GIT_QUIET" git-sh-setup.sh: remove "say" function, change last users gitweb/Makefile: define all .PHONY prerequisites inline gitweb/Makefile: add a $(GITWEB_ALL) variable gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars gitweb/Makefile: prepare to merge into top-level Makefile gitweb: remove "test" and "test-installed" targets gitweb/Makefile: include in top-level Makefile gitweb/Makefile: add a "NO_GITWEB" parameter tests: add missing double quotes to included library paths test-lib.sh: fix prepend_var() quoting issue config tests: fix harmless but broken "rm -r" cleanup submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags check-ref-format: fix trivial memory leak clone: fix memory leak in wanted_peer_refs() submodule.c: free() memory from xgetcwd() revert: free "struct replay_opts" members cat-file: fix a memory leak in --batch-command mode merge-file: refactor for subsequent memory leak fix merge-file: fix memory leaks on error path checkout: avoid "struct unpack_trees_options" leak gc: fix a memory leak cat-file: fix a common "struct object_context" memory leak pull: fix a "struct oid_array" memory leak test-tool test-hash: fix a memory leak test-tool path-utils: fix a memory leak test-tool {dump,scrap}-cache-tree: fix memory leaks test-tool urlmatch-normalization: fix a memory leak test-tool regex: call regfree(), fix memory leaks test-tool json-writer: fix memory leaks test-tool bloom: fix memory leaks test-tool ref-store: fix a memory leak test-tool delta: fix a memory leak Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Makefile & .gitignore: ignore & clean "git.res", not "*.res" cocci: add a "coccicheck-test" target and test *.cocci rules cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" cocci: add and apply a rule to find "unused" strbufs cocci: generalize "unused" rule to cover more than "strbuf" trace2: only include "fsync" events if we git_fsync() test-lib: use $1, not $@ in test_known_broken_{ok,failure}_ test-lib: don't set GIT_EXIT_OK before calling test_atexit_handler test-lib: fix GIT_EXIT_OK logic errors, use BAIL_OUT test-lib: add a --invert-exit-code switch t/README: reword the "GIT_TEST_PASSING_SANITIZE_LEAK" description test-lib: add a SANITIZE=leak logging mode t/Makefile: don't remove test-results in "clean-except-prove-cache" tests: move copy/pasted PERL + Test::More checks to a lib-perl.sh test-lib: simplify by removing test_external test-lib: add a GIT_TEST_PASSING_SANITIZE_LEAK=check mode test-lib: have the "check" mode for SANITIZE=leak consider leak logs leak tests: don't skip some tests under SANITIZE=leak leak tests: mark passing SANITIZE=leak tests as leak-free upload-pack: fix a memory leak in create_pack_file() CI: use "GIT_TEST_SANITIZE_LEAK_LOG=true" in linux-leaks bisect.c: add missing "goto" for release_revisions() test-fast-rebase helper: use release_revisions() (again) log: fix a memory leak in "git show <revision>..." log: refactor "rev.pending" code in cmd_show() bisect.c: partially fix bisect_rev_setup() memory leak revisions API: don't leak memory on argv elements that need free()-ing help.c: refactor drop_prefix() to use a "switch" statement" help.c: remove common category behavior from drop_prefix() behavior git help doc: use "<doc>" instead of "<guide>" git docs: add a category for user-facing file, repo and command UX git docs: add a category for file formats, protocols and interfaces docs: move commit-graph format docs to man section 5 docs: move protocol-related docs to man section 5 docs: move index format docs to man section 5 docs: move signature docs to man section 5 docs: move pack format docs to man section 5 docs: move cruft pack docs to gitformat-pack docs: move http-protocol docs to man section 5 hook API: don't segfault on strbuf_addf() to NULL "out" Makefile + hash.h: remove PPC_SHA1 implementation Makefile: use $(OBJECTS) instead of $(C_OBJ) git-compat-util.h: use "UNUSED", not "UNUSED(var)" git-compat-util.h: use "deprecated" for UNUSED variables submodule tests: test usage behavior submodule tests: test for "add <repository> <abs-path>" submodule--helper: remove unused "name" helper submodule--helper: remove unused "list" helper test-tool submodule-config: remove unused "--url" handling submodule--helper: move "is-active" to a test-tool submodule--helper: move "check-name" to a test-tool submodule--helper: move "resolve-relative-url-test" to a test-tool submodule--helper style: don't separate declared variables with \n\n submodule--helper style: add \n\n after variable declarations submodule--helper: replace memset() with { 0 }-initialization submodule--helper: use xstrfmt() in clone_submodule() submodule--helper: move "sb" in clone_submodule() to its own scope submodule--helper: add "const" to passed "module_clone_data" submodule--helper: add "const" to passed "struct update_data" submodule--helper: don't redundantly check "else if (res)" submodule--helper: rename "int res" to "int ret" submodule--helper: return "ret", not "1" from update_submodule() submodule--helper: add missing braces to "else" arm submodule--helper: don't call submodule_strategy_to_string() in BUG() submodule API: don't handle SM_..{UNSPECIFIED,COMMAND} in to_string() submodule--helper: use "code" in run_update_command() submodule--helper: don't exit() on failure, return submodule--helper: libify determine_submodule_update_strategy() submodule--helper: libify "must_die_on_failure" code paths submodule--helper update: don't override 'checkout' exit code submodule--helper: libify "must_die_on_failure" code paths (for die) submodule--helper: check repo{_submodule,}_init() return values submodule--helper: libify more "die" paths for module_update() submodule--helper: libify even more "die" paths for module_update() submodule--helper: fix bad config API usage submodule--helper: fix a leak in "clone_submodule" submodule--helper: fix trivial get_default_remote_submodule() leak submodule--helper: fix most "struct pathspec" memory leaks submodule--helper: "struct pathspec" memory leak in module_update() submodule--helper: don't leak {run,capture}_command() cp.dir argument submodule--helper: add and use *_release() functions submodule--helper: fix "errmsg_str" memory leak submodule--helper: fix "sm_path" and other "module_cb_list" leaks submodule--helper: fix a leak with repo_clear() submodule--helper: fix a memory leak in get_default_remote_submodule() submodule--helper: fix "reference" leak submodule--helper: fix obscure leak in module_add() submodule--helper: fix a leak in module_add() submodule--helper: fix a memory leak in print_status() submodule--helper: free some "displaypath" in "struct update_data" submodule--helper: free rest of "displaypath" in "struct update_data" submodule--helper: fix a configure_added_submodule() leak docs: add and use include template for config/* includes grep docs: de-duplicate configuration sections send-email docs: de-duplicate configuration sections apply docs: de-duplicate configuration sections notes docs: de-duplicate and combine configuration sections difftool docs: de-duplicate configuration sections log docs: de-duplicate configuration sections docs: add CONFIGURATION sections that map to a built-in docs: add CONFIGURATION sections that fuzzy map to built-ins Øystein Walle (1): rev-parse --parseopt: detect missing opt-spec
A release candidate Git v2.38.0-rc2 is now available for testing at the usual places. It is comprised of 673 non-merge commits since v2.37.0, contributed by 81 people, 23 of which are new faces [*]. The manpage generation problem in -rc1 has been corrected. Other than that, there aren't that many changes since -rc1. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/testing/ The following public repositories all have a copy of the 'v2.38.0-rc2' tag and the 'master' branch that the tag points at: url = https://git.kernel.org/pub/scm/git/git url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.37.0 are as follows. Welcome to the Git development community! Andrew Olsen, Anthony Delannoy, Carlos López, Celeste Liu, Cleber Rosa, David Plumpton, Elijah Conners, Eric DeCosta, Goss Geppert, Ilya K, Ingy dot Net, Jacob Stopak, Julien Rouhaud, Kilian Kilger, Lana Deere, Manuel Boni, Matthew Klein, Miaoqian Lin, Moritz Baumann, Pavel Rappo, Pierre Garnier, Richard Oliver, and Xavier Morel. Returning contributors who helped this release are as follows. Thanks for your continued support. Abhradeep Chakraborty, Adam Dinwoodie, Ævar Arnfjörð Bjarmason, Alex Henrie, Arthur Milchior, brian m. carlson, Calvin Wan, Carlo Marcelo Arenas Belón, Christian Couder, Christoph Reiter, Derrick Stolee, Dimitriy Ryazantcev, Đoàn Trần Công Danh, Elijah Newren, Emily Shaffer, Eric Sunshine, Fangyi Zhou, Felipe Contreras, Fernando Ramos, Glen Choo, Han Xin, Hariom Verma, Jacob Keller, Jaydeep Das, Jeff King, Jiang Xin, Joey Hess, Johannes Schindelin, John Cai, Jonathan Tan, Josh Steadmon, Junio C Hamano, Justin Donnelly, Kyle Zhao, Lessley Dennington, Li Linchao, Linus Torvalds, Martin Ågren, Matheus Tavares, Matthew John Cheetham, Michael J Gruber, Øystein Walle, Philip Oakley, Philippe Blain, Phillip Wood, Randall S. Becker, Renato Botelho, René Scharfe, Shaoxuan Yuan, Siddharth Asthana, SZEDER Gábor, Tao Klerks, Taylor Blau, Teng Long, Todd Zullinger, Torsten Bögershausen, Victoria Dye, and ZheNing Hu. [*] We are counting not just the authorship contribution but issue reporting, mentoring, helping and reviewing that are recorded in the commit trailers. ---------------------------------------------------------------- Git v2.38 Release Notes (draft) =============================== UI, Workflows & Features * "git remote show [-n] frotz" now pays attention to negative pathspec. * "git push" sometimes performs poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". * "git grep -m<max-hits>" is a way to limit the hits shown per file. * "git merge-tree" learned a new mode where it takes two commits and computes a tree that would result in the merge commit, if the histories leading to these two commits were to be merged. * "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. * Earlier, HTTP transport clients learned to tell the server side what locale they are in by sending Accept-Language HTTP header, but this was done only for some requests but not others. * Introduce a safe.barerepository configuration variable that allows users to forbid discovery of bare repositories. * Various messages that come from the pack-bitmap codepaths have been tweaked. * "git rebase -i" learns to update branches whose tip appear in the rebased range with "--update-refs" option. * "git ls-files" learns the "--format" option to tweak its output. * "git cat-file" learned an option to use the mailmap when showing commit and tag objects. * When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. * Operating modes like "--batch" of "git cat-file" command learned to take NUL-terminated input, instead of one-item-per-line. * "git rm" has become more aware of the sparse-index feature. * "git rev-list --disk-usage" learned to take an optional value "human" to show the reported value in human-readable format, like "3.40MiB". * The "diagnose" feature to create a zip archive for diagnostic material has been lifted from "scalar" and made into a feature of "git bugreport". * The namespaces used by "log --decorate" from "refs/" hierarchy by default has been tightened. * "git rev-list --ancestry-path=C A..B" is a natural extension of "git rev-list A..B"; instead of choosing a subset of A..B to those that have ancestry relationship with A, it lets a subset with ancestry relationship with C. * "scalar" now enables built-in fsmonitor on enlisted repositories, when able. * The bash prompt (in contrib/) learned to optionally indicate when the index is unmerged. * "git clone" command learned the "--bundle-uri" option to coordinate with hosting sites the use of pre-prepared bundle files. * "git range-diff" learned to honor pathspec argument if given. * "git format-patch --from=<ident>" can be told to add an in-body "From:" line even for commits that are authored by the given <ident> with "--force-in-body-from" option. * The built-in fsmonitor refuses to work on a network mounted repositories; a configuration knob for users to override this has been introduced. * The "scalar" addition from Microsoft is now part of the core Git installation. Performance, Internal Implementation, Development Support etc. * Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. * Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. * Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. * Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. * Further preparation to turn git-submodule.sh into a builtin continues. * Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. * Teach "make all" to build gitweb as well. * Tweak tests so that they still work when the "git init" template did not create .git/info directory. * Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused variable. * The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. * Support for libnettle as SHA256 implementation has been added. * The way "git multi-pack" uses parse-options API has been improved. * A Coccinelle rule (in contrib/) to encourage use of COPY_ARRAY macro has been improved. * API tweak to make it easier to run fuzz testing on commit-graph parser. * Omit fsync-related trace2 entries when their values are all zero. * The codepath to write multi-pack index has been taught to release a large chunk of memory that holds an array of objects in the packs, as soon as it is done with the array, to reduce memory consumption. * Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. * "git fetch" client logs the partial clone filter used in the trace2 output. * The "bundle URI" design gets documented. * The common ancestor negotiation exchange during a "git fetch" session now leaves trace log. * Test portability improvements. (merge 4d1d843be7 mt/rot13-in-c later to maint). * The "subcommand" mode is introduced to parse-options API and update the command line parser of Git commands with subcommands. * The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. * The assembly version of SHA-1 implementation for PPC has been removed. * The server side that responds to "git fetch" and "git clone" request has been optimized by allowing it to send objects in its object store without recomputing and validating the object names. * Annotate function parameters that are not used (but cannot be removed for structural reasons), to prepare us to later compile with -Wunused warning turned on. * Share the text used to explain configuration variables used by "git <subcmd>" in "git help <subcmd>" with the text from "git help config". * "git mv A B" in a sparsely populated working tree can be asked to move a path from a directory that is "in cone" to another directory that is "out of cone". Handling of such a case has been improved. * The chainlint script for our tests has been revamped. Fixes since v2.37 ----------------- * Rewrite of "git add -i" in C that appeared in Git 2.25 didn't correctly record a removed file to the index, which was fixed. * Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. * Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. * Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. * "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. * Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. * References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. * In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. * Recent update to vimdiff layout code has been made more robust against different end-user vim settings. * Plug various memory leaks, both in the main code and in test-tool commands. * Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. * The resolve-undo information in the index was not protected against GC, which has been corrected. * A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. * "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. * An earlier attempt to plug leaks placed a clean-up label to jump to at a bogus place, which as been corrected. * Variable quoting fix in the vimdiff driver of "git mergetool" * "git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. * A fix for a regression in test framework. * mkstemp() emulation on Windows has been improved. * Add missing documentation for "include" and "includeIf" features in "git config" file format, which incidentally teaches the command line completion to include them in its offerings. * Avoid "white/black-list" in documentation and code comments. * Workaround for a compiler warning against use of die() in osx-keychain (in contrib/). * Workaround for a false positive compiler warning. * "git p4" working on UTF-16 files on Windows did not implement CRLF-to-LF conversion correctly, which has been corrected. * "git p4" did not handle non-ASCII client name well, which has been corrected. * "rerere-train" script (in contrib/) used to honor commit.gpgSign while recreating the throw-away merges. * "git checkout" miscounted the paths it updated, which has been corrected. * Fix for a bug that makes write-tree to fail to write out a non-existent index as a tree, introduced in 2.37. * There was a bug in the codepath to upgrade generation information in commit-graph from v1 to v2 format, which has been corrected. * Gitweb had legacy URL shortener that is specific to the way projects hosted on kernel.org used to (but no longer) work, which has been removed. * Fix build procedure for Windows that uses CMake so that it can pick up the shell interpreter from local installation location. * Conditionally allow building Python interpreter on Windows * Fix to lstat() emulation on Windows. * Older gcc with -Wall complains about the universal zero initializer "struct s = { 0 };" idiom, which makes developers' lives inconvenient (as -Werror is enabled by DEVELOPER=YesPlease). The build procedure has been tweaked to help these compilers. * Plug memory leaks in the failure code path in the "merge-ort" merge strategy backend. * "git symbolic-ref symref non..sen..se" is now diagnosed as an error. * A follow-up fix to a fix for a regression in 2.36 around hooks. * Avoid repeatedly running getconf to ask libc version in the test suite, and instead just as it once per script. * Platform-specific code that determines if a directory is OK to use as a repository has been taught to report more details, especially on Windows. * "vimdiff3" regression fix. * "git fsck" reads mode from tree objects but canonicalizes the mode before passing it to the logic to check object sanity, which has hid broken tree objects from the checking logic. This has been corrected, but to help existing projects with broken tree objects that they cannot fix retroactively, the severity of anomalies this code detects has been demoted to "info" for now. * Fixes to sparse index compatibility work for "reset" and "checkout" commands. * An earlier optimization discarded a tree-object buffer that is still in use, which has been corrected. * Fix deadlocks between main Git process and subprocess spawned via the pipe_command() API, that can kill "git add -p" that was reimplemented in C recently. * The sequencer machinery translated messages left in the reflog by mistake, which has been corrected. * xcalloc(), imitating calloc(), takes "number of elements of the array", and "size of a single element", in this order. A call that does not follow this ordering has been corrected. * The preload-index codepath made copies of pathspec to give to multiple threads, which were left leaked. * Update the version of Ubuntu used for GitHub Actions CI from 18.04 to 22.04. * The auto-stashed local changes created by "git merge --autostash" was mixed into a conflicted state left in the working tree, which has been corrected. * Multi-pack index got corrupted when preferred pack changed from one pack to another in a certain way, which has been corrected. (merge 99e4d084ff tb/midx-with-changing-preferred-pack-fix later to maint). * The clean-up of temporary files created via mks_tempfile_dt() was racy and attempted to unlink() the leading directory when signals are involved, which has been corrected. (merge babe2e0559 rs/tempfile-cleanup-race-fix later to maint). * FreeBSD portability fix for "git maintenance" that spawns "crontab" to schedule tasks. (merge ee69e7884e bc/gc-crontab-fix later to maint). * Those who use diff-so-fancy as the diff-filter noticed a regression or two in the code that parses the diff output in the built-in version of "add -p", which has been corrected. (merge 0a101676e5 js/add-p-diff-parsing-fix later to maint). * Segfault fix-up to an earlier fix to the topic to teach "git reset" and "git checkout" work better in a sparse checkout. (merge 037f8ea6d9 vd/sparse-reset-checkout-fixes later to maint). * "git diff --no-index A B" managed its the pathnames of its two input files rather haphazardly, sometimes leaking them. The command line argument processing has been straightened out to clean it up. (merge 2b43dd0eb5 rs/diff-no-index-cleanup later to maint). * "git rev-list --verify-objects" ought to inspect the contents of objects and notice corrupted ones, but it didn't when the commit graph is in use, which has been corrected. (merge b27ccae34b jk/rev-list-verify-objects-fix later to maint). * More fixes to "add -p" (merge 64ec8efb83 js/builtin-add-p-portability-fix later to maint). * The parser in the script interface to parse-options in "git rev-parse" has been updated to diagnose a bogus input correctly. (merge f20b9c36d0 ow/rev-parse-parseopt-fix later to maint). * The code that manages list-object-filter structure, used in partial clones, leaked the instances, which has been plugged. (merge 66eede4a37 jk/plug-list-object-filter-leaks later to maint). * Fix another UI regression in the reimplemented "add -p". (merge f6f0ee247f rs/add-p-worktree-mode-prompt-fix later to maint). * "git fetch" over protocol v2 sent an incorrect ref prefix request to the server and made "git pull" with configured fetch refspec that does not cover the remote branch to merge with fail, which has been corrected. (merge 49ca2fba39 jk/proto-v2-ref-prefix-fix later to maint). * A result from opendir() was leaking in the commit-graph expiration codepath, which has been plugged. (merge 12f1ae5324 ml/commit-graph-expire-dir-leak-fix later to maint). * Just like we have coding guidelines, we now have guidelines for reviewers. (merge e01b851923 vd/doc-reviewing-guidelines later to maint). * Other code cleanup, docfix, build fix, etc. (merge 77b9e85c0f vd/fix-perf-tests later to maint). (merge 0682bc43f5 jk/test-crontab-fixes later to maint). (merge b46dd1726c cc/doc-trailer-whitespace-rules later to maint). ---------------------------------------------------------------- Changes since v2.37.0 are as follows: Abhradeep Chakraborty (9): bitmap-format.txt: feed the file to asciidoc to generate html bitmap-format.txt: fix some formatting issues bitmap-format.txt: add information for trailing checksum Documentation/technical: describe bitmap lookup table extension bitmap: move `get commit positions` code to `bitmap_writer_finish` pack-bitmap-write.c: write lookup table extension pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests pack-bitmap: prepare to read lookup table extension bitmap-lookup-table: add performance tests for lookup table Adam Dinwoodie (1): t1800: correct test to handle Cygwin Alex Henrie (3): gc: don't translate literal commands builtin/diagnose.c: don't translate the two mode values pack-bitmap: improve grammar of "xor chain" error message Anthony Delannoy (1): preload-index: fix memleak Calvin Wan (1): submodule merge: update conflict error message Carlo Marcelo Arenas Belón (2): setup: tighten ownership checks post CVE-2022-24765 cmake: support local installations of git Carlos López (1): grep: add --max-count command line option Celeste Liu (1): contrib/rerere-train: avoid useless gpg sign in training Christian Couder (1): Documentation: clarify whitespace rules for trailers Cleber Rosa (1): setup: fix function name in a BUG() message Derrick Stolee (51): branch: add branch_checked_out() helper branch: check for bisects and rebases fetch: use new branch_checked_out() and add tests branch: use branch_checked_out() when deleting refs branch: fix branch_checked_out() leaks t5510: replace 'origin' with URL more carefully vscode: improve tab size and wrapping git-rebase.txt: use back-ticks consistently pack-bitmap-write: use const for hashes midx: extract bitmap write setup midx: reduce memory pressure while writing bitmaps daemon: clarify directory arguments git-cvsserver: clarify directory list git.txt: remove redundant language t: avoid "whitelist" transport.c: avoid "whitelist" t2407: test bisect and rebase as black-boxes t2407: test branches currently using apply backend branch: consider refs under 'update-refs' rebase-interactive: update 'merge' description sequencer: define array with enum values sequencer: add update-ref command rebase: add --update-refs option rebase: update refs from 'update-ref' commands sequencer: rewrite update-refs as user edits todo list rebase: add rebase.updateRefs config option sequencer: ignore HEAD ref under --update-refs sequencer: notify user of --update-refs activity compat/win32: correct for incorrect compiler warning refs: allow "HEAD" as decoration filter t4207: modernize test t4207: test coloring of grafted decorations refs: add array of ref namespaces refs: use ref_namespaces for replace refs base log-tree: use ref_namespaces instead of if/else-if log: add default decoration filter log: add --clear-decorations option log: create log.initialDecorationSet=all maintenance: stop writing log.excludeDecoration fetch: use ref_namespaces during prefetch docs: document bundle URI standard bundle-uri: add example bundle organization remote-curl: add 'get' capability bundle-uri: create basic file-copy logic clone: add --bundle-uri option bundle-uri: add support for http(s):// and file:// clone: --bundle-uri cannot be combined with --depth t6019: modernize tests with helper clone: warn on failure to repo_init() ci: update 'static-analysis' to Ubuntu 22.04 pack-bitmap: remove trace2 region from hot path Dimitriy Ryazantcev (1): i18n: mark message helpers prefix for translation Elijah Conners (1): reftable: use a pointer for pq_entry param Elijah Newren (43): merge-tree: rename merge_trees() to trivial_merge_trees() merge-tree: move logic for existing merge into new function merge-tree: add option parsing and initial shell for real merge function merge-tree: implement real merges merge-ort: split out a separate display_update_messages() function merge-tree: support including merge messages in output merge-ort: provide a merge_get_conflicted_files() helper function merge-ort: remove command-line-centric submodule message from merge-ort merge-tree: provide a list of which files have conflicts merge-tree: provide easy access to `ls-files -u` style info merge-ort: store more specific conflict information merge-ort: optionally produce machine-readable output merge-tree: allow `ls-files -u` style info to be NUL terminated merge-tree: add a --allow-unrelated-histories flag git-merge-tree.txt: add a section on potentional usage mistakes t6429: fix use of non-existent function t6423: add tests of dual directory rename plus add/add conflict merge-ort: small cleanups of check_for_directory_rename merge-ort: make a separate function for freeing struct collisions merge-ort: shuffle the computation and cleanup of potential collisions merge-ort: fix issue with dual rename and add/add conflict merge-ort-wrappers: make printed message match the one from recursive merge-resolve: abort if index does not match HEAD merge: abort if index does not match HEAD for trivial merges merge: do not abort early if one strategy fails to handle the merge merge: fix save_state() to work when there are stat-dirty files merge: make restore_state() restore staged state too merge: ensure we can actually restore pre-merge state merge: do not exit restore_state() prematurely merge-ort: remove translator lego in new "submodule conflict suggestion" merge-ort: avoid surprise with new sub_flag variable merge-ort: provide helpful submodule update message when possible merge-ort: remove code obsoleted by other changes rev-list-options.txt: fix simple typo revision: allow --ancestry-path to take an argument merge: only apply autostash when appropriate merge: cleanup confusing logic for handling successful merges merge: small code readability improvement t4301: add more interesting merge-tree testcases t64xx: convert 'test_create_repo' to 'git init' diff: have submodule_format logic avoid additional diff headers diff: fix filtering of additional headers under --remerge-diff diff: fix filtering of merge commits under --remerge-diff Eric DeCosta (1): fsmonitor: option to allow fsmonitor to run against network-mounted repos Eric Sunshine (25): t2407: fix broken &&-chains in compound statement t1092: fix buggy sparse "blame" test t: detect and signal failure within loop t4301: account for behavior differences between sed implementations t4301: fix broken &&-chains and add missing loop termination t4301: emit blank line in more idiomatic fashion t: add skeleton chainlint.pl chainlint.pl: add POSIX shell lexical analyzer chainlint.pl: add POSIX shell parser chainlint.pl: add parser to validate tests chainlint.pl: add parser to identify test definitions chainlint.pl: validate test scripts in parallel chainlint.pl: don't require `return|exit|continue` to end with `&&` t/Makefile: apply chainlint.pl to existing self-tests chainlint.pl: don't require `&` background command to end with `&&` chainlint.pl: don't flag broken &&-chain if `$?` handled explicitly chainlint.pl: don't flag broken &&-chain if failure indicated explicitly chainlint.pl: complain about loops lacking explicit failure handling chainlint.pl: allow `|| echo` to signal failure upstream of a pipe t/chainlint: add more chainlint.pl self-tests test-lib: retire "lint harder" optimization hack test-lib: replace chainlint.sed with chainlint.pl t/Makefile: teach `make test` and `make prove` to run chainlint.pl t: retire unused chainlint.sed chainlint: colorize problem annotations and test delimiters Fangyi Zhou (1): help: fix doubled words in explanation for developer interfaces Felipe Contreras (7): mergetools: vimdiff: fix comment mergetools: vimdiff: make vimdiff3 actually work mergetools: vimdiff: silence annoying messages mergetools: vimdiff: fix for diffopt mergetools: vimdiff: rework tab logic mergetools: vimdiff: fix single window layouts mergetools: vimdiff: simplify tabfirst Fernando Ramos (1): vimdiff: make layout engine more robust against user vim settings Glen Choo (16): submodule--helper: eliminate internal "--update" option submodule--helper tests: add missing "display path" coverage submodule--helper update: use display path helper submodule--helper: don't recreate recursive prefix submodule--helper: use correct display path helper submodule--helper update: use --super-prefix submodule--helper: remove display path helper Documentation/git-config.txt: add SCOPES section Documentation: define protected configuration config: learn `git_protected_config()` safe.directory: use git_protected_config() setup.c: create `safe.bareRepository` config.c: NULL check when reading protected config Documentation/git-reflog: remove unneeded \ from \{ submodule--helper: add "const" to copy of "update_data" submodule--helper: refactor "errmsg_str" to be a "struct strbuf" Goss Geppert (2): dir: traverse into repository dir: minor refactoring / clean-up Han Xin (6): unpack-objects: low memory footprint for get_data() in dry_run mode object-file.c: refactor write_loose_object() to several steps object-file.c: add "stream_loose_object()" to handle large object unpack-objects: use stream_loose_object() to unpack large objects commit-graph.c: no lazy fetch in lookup_commit_in_graph() t5330: remove run_with_limited_processses() Jacob Keller (1): remote: handle negative refspecs in git remote show Jacob Stopak (3): Documentation: fix various repeat word typos Documentation: clean up a few misspelled word typos Documentation: clean up various typos in technical docs Jaydeep Das (1): gpg-interface: add function for converting trust level to string Jeff King (64): is_promisor_object(): walk promisor packs in pack-order fetch: stop passing around unused worktrees variable branch: drop unused worktrees variable revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis clone: drop extra newline from warning message clone: propagate empty remote HEAD even with other branches clone: use remote branch if it matches default HEAD clone: move unborn head creation to update_head() ref-filter: disable save_commit_buffer while traversing diff-files: move misplaced cleanup label write_midx_bitmap(): drop unused refs_snapshot parameter config.mak.dev: squelch -Wno-missing-braces for older gcc tree-walk: add a mechanism for getting non-canonicalized modes fsck: actually detect bad file modes in trees fsck: downgrade tree badFilemode to "info" is_promisor_object(): fix use-after-free of tree buffer compat: add function to enable nonblocking pipes git-compat-util: make MAX_IO_SIZE define globally available pipe_command(): avoid xwrite() for writing to pipe pipe_command(): handle ENOSPC when writing to a pipe pipe_command(): mark stdin descriptor as non-blocking git-compat-util: add UNUSED macro refs: mark unused each_ref_fn parameters refs: mark unused reflog callback parameters refs: mark unused virtual method parameters transport: mark bundle transport_options as unused streaming: mark unused virtual method parameters config: mark unused callback parameters hashmap: mark unused callback parameters mark unused read_tree_recursive() callback parameters run-command: mark unused async callback parameters is_path_owned_by_current_uid(): mark "report" parameter as unused xdiff: drop unused mmfile parameters from xdl_do_histogram_diff() log-tree: drop unused commit param in remerge_diff() match_pathname(): drop unused "flags" parameter verify_one_sparse(): drop unused parameters reftable: drop unused parameter from reader_seek_linear() reflog: assert PARSE_OPT_NONEG in parse-options callbacks xdiff: drop unused mmfile parameters from xdl_do_patience_diff() pass subcommand "prefix" arguments to parse_options() maintenance: add parse-options boilerplate for subcommands remote: run "remote rm" argv through parse_options() pack-bitmap-write: drop unused pack_idx_entry parameters tempfile: drop active flag tempfile: update comment describing state transitions test-crontab: minor memory and error handling fixes lookup_commit_in_graph(): use prepare_commit_graph() to check for graph rev-list: disable commit graph with --verify-objects parse_object(): allow skipping hash check upload-pack: skip parse-object re-hashing of "want" objects parse_object(): check commit-graph when skip_hash set t1060: check partial clone of misnamed blob list_objects_filter_copy(): deep-copy sparse_oid_name field transport: deep-copy object-filter struct for fetch-pack transport: free filter options in disconnect_git() list_objects_filter_options: plug leak of filter_spec strings prepare_repo_settings(): plug leak of config values fetch: stop checking for NULL transport->remote in do_fetch() fetch: add branch.*.merge to default ref-prefix extension list-objects-filter: don't memset after releasing filter struct list-objects-filter: handle null default filter spec list-objects-filter: add and use initializers list-objects-filter: convert filter_spec to a strbuf list-objects-filter: initialize sub-filter structs Johannes Schindelin (38): merge-ort: store messages in a list, not in a single strbuf merge-ort: make `path_messages` a strmap to a string_list Git 2.30.5 Git 2.31.4 Git 2.32.3 Git 2.33.4 Git 2.34.4 Git 2.35.4 Git 2.36.2 add --interactive: allow `update` to stage deleted files tests: fix incorrect --write-junit-xml code mergetool(vimdiff): allow paths to contain spaces again shortlog: use a stable sort t5351: avoid relying on `core.fsyncMethod = batch` to be supported t5351: avoid using `test_cmp` for binary data windows: include the Python bits when building Git for Windows mingw: remove unneeded `NO_GETTEXT` directive mingw: remove unneeded `NO_CURL` directive lstat(mingw): correctly detect ENOTDIR scenarios merge-ort: clean up after failed merge merge-ort: do leave trace2 region even if checkout fails setup: fix some formatting setup: prepare for more detailed "dubious ownership" messages mingw: provide details about unsafe directories' ownership mingw: be more informative when ownership check fails on FAT32 mingw: handle a file owned by the Administrators group correctly scalar unregister: stop FSMonitor daemon range-diff: reorder argument handling range-diff: consistently validate the arguments range-diff: optionally accept pathspecs add -p: avoid ambiguous signed/unsigned comparison t3701: test the built-in `add -i` regardless of NO_PERL t6132(NO_PERL): do not run the scripted `add -p` add -p: detect more mismatches between plain vs colored diffs add -p: gracefully handle unparseable hunk headers in colored diffs add -p: ignore dirty submodules git help: special-case `scalar` scalar: implement the `help` subcommand Jonathan Tan (1): fetch-pack: write effective filter to trace2 Josh Steadmon (1): fetch-pack: add tracing for negotiation rounds Julien Rouhaud (1): gitweb: remove title shortening heuristics Junio C Hamano (44): revision: mark blobs needed for resolve-undo as reachable A regression fix for 2.37 Git 2.37.1 builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() The first batch after Git 2.37 fsck: do not dereference NULL while checking resolve-undo data The second batch The third batch The fourth batch The fifth batch builtin/remote.c: use the right kind of STRING_LIST_INIT The sixth batch The seventh batch Downmerge a handful of fixes for 2.37.x maintenance track The eighth batch The ninth batch doc: consolidate --rerere-autoupdate description doc: clarify rerere-autoupdate Downmerge a bit more for 2.37.x The tenth batch The eleventh batch Git 2.37.2 The twelfth batch The thirteenth batch The fourteenth batch t5329: notice a failure within a loop The fifteenth batch A handful more topics from the 'master' front for 2.37.3 pretty: separate out the logic to decide the use of in-body from format-patch: allow forcing the use of in-body From: header format-patch: learn format.forceInBodyFrom configuration variable The sixteenth batch Git 2.37.3 The seventeenth batch The eighteenth batch The nineteenth batch The twentieth batch Merge a handful of topics from the 'master' front Prepare for 2.38-rc0 Git 2.38-rc0 A bit more of remaining topics before -rc1 Final batch before -rc1 Git 2.38-rc1 Git 2.38-rc2 Justin Donnelly (1): git-prompt: show presence of unresolved conflicts at command prompt Kilian Kilger (2): git-p4: fix bug with encoding of p4 client name git-p4: refactoring of p4CmdList() Kyle Zhao (1): send-pack.c: add config push.useBitmaps Lessley Dennington (1): osx-keychain: fix compiler warning Li Linchao (3): ls-files: update test style remote-curl: send Accept-Language header to server rev-list: support human-readable output for `--disk-usage` Linus Torvalds (1): symbolic-ref: refuse to set syntactically invalid target Manuel Boni (1): config.txt: document include, includeIf Martin Ågren (4): config/core.txt: fix minor issues for `core.sparseCheckoutCone` t4200: drop irrelevant code read-cache: make `do_read_index()` always set up `istate->repo` cmd-list.perl: fix identifying man sections Matheus Tavares (7): checkout: document bug where delayed checkout counts entries twice checkout: show bug about failed entries being included in final report checkout: fix two bugs on the final count of updated entries pkt-line.h: move comment closer to the associated code t0021: avoid grepping for a Perl-specific string at filter output t0021: implementation the rot13-filter.pl script in C tests: use the new C rot13-filter helper to avoid PERL prereq Matthew John Cheetham (1): scalar: enable built-in FSMonitor on `register` Miaoqian Lin (1): commit-graph: Fix missing closedir in expire_commit_graphs Michael J Gruber (3): sequencer: do not translate reflog messages sequencer: do not translate parameters to error_resolve_conflict() sequencer: do not translate command names Moritz Baumann (3): git-p4: fix CR LF handling for utf16 files git-p4: fix typo in P4Submit.applyCommit() git-p4: fix error handling in P4Unshelve.renameBranch() Philip Oakley (1): doc add: renormalize is not idempotent for CRCRLF Philippe Blain (3): diff-format.txt: dst can be 0* SHA-1 when path is deleted, too diff-format.txt: correct misleading wording diff-index.txt: update raw output format in examples Phillip Wood (5): xdiff: introduce XDL_ALLOC_ARRAY() xdiff: introduce xdl_calloc xdiff: introduce XDL_CALLOC_ARRAY() xdiff: introduce XDL_ALLOC_GROW() tests: cache glibc version check René Scharfe (28): archive: update format documentation archive: rename archiver data field to filter_command archive-tar: factor out write_block() archive-tar: add internal gzip implementation archive-tar: use OS_CODE 3 (Unix) for internal gzip archive-tar: use internal gzip by default combine-diff: abort if --ignore-matching-lines is given combine-diff: abort if --output is given cocci: avoid normalization rules for memcpy mingw: avoid mktemp() in mkstemp() implementation mergesort: unify ranks loops mergesort: tighten merge loop mergesort: add macros for typed sort of linked lists test-mergesort: use DEFINE_LIST_SORT_DEBUG test-mergesort: use DEFINE_LIST_SORT blame: use DEFINE_LIST_SORT commit: use DEFINE_LIST_SORT fetch-pack: use DEFINE_LIST_SORT packfile: use DEFINE_LIST_SORT mergesort: remove llist_mergesort() nonblock: support Windows tempfile: avoid directory cleanup race test-mergesort: read sort input all at once test-mergesort: use mem_pool for sort input diff-no-index: release strbuf on queue error diff-no-index: release prefixed filenames diff-no-index: simplify argv index calculation add -p: fix worktree patch mode prompts Richard Oliver (1): mktree: do not check type of remote objects SZEDER Gábor (30): Makefile: build 'gitweb' in the default target multi-pack-index: simplify handling of unknown --options index-format.txt: remove outdated list of supported extensions git.c: update NO_PARSEOPT markings t3301-notes.sh: check that default operation mode doesn't take arguments t5505-remote.sh: check the behavior without a subcommand t0040-parse-options: test parse_options() with various 'parse_opt_flags' api-parse-options.txt: fix description of OPT_CMDMODE parse-options: PARSE_OPT_KEEP_UNKNOWN only applies to --options parse-options: clarify the limitations of PARSE_OPT_NODASH parse-options: drop leading space from '--git-completion-helper' output parse-options: add support for parsing subcommands builtin/bundle.c: let parse-options parse subcommands builtin/commit-graph.c: let parse-options parse subcommands builtin/gc.c: let parse-options parse 'git maintenance's subcommands builtin/hook.c: let parse-options parse subcommands builtin/multi-pack-index.c: let parse-options parse subcommands builtin/notes.c: let parse-options parse subcommands builtin/reflog.c: let parse-options parse subcommands builtin/remote.c: let parse-options parse subcommands builtin/sparse-checkout.c: let parse-options parse subcommands builtin/stash.c: let parse-options parse subcommands builtin/worktree.c: let parse-options parse subcommands promisor-remote: fix xcalloc() argument order t0040-parse-options: remove leftover debugging test-parse-options.c: don't use for loop initial declaration test-parse-options.c: fix style of comparison with zero notes: simplify default operation mode arguments check notes, remote: show unknown subcommands between `' t/Makefile: remove 'test-results' on 'make clean' Shaoxuan Yuan (22): t7002: add tests for moving out-of-cone file/directory t1092: mv directory from out-of-cone to in-cone mv: update sparsity after moving from out-of-cone to in-cone mv: decouple if/else-if checks using goto mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit mv: check if <destination> exists in index to handle overwriting mv: use flags mode for update_mode mv: add check_dir_in_index() and solve general dir check issue t1092: add tests for `git-rm` pathspec.h: move pathspec_needs_expanded_index() from reset.c to here rm: expand the index only when necessary rm: integrate with sparse-index t7002: add tests for moving from in-cone to out-of-cone mv: rename check_dir_in_index() to empty_dir_has_sparse_contents() mv: free the with_slash in check_dir_in_index() mv: check if <destination> is a SKIP_WORKTREE_DIR mv: remove BOTH from enum update_mode mv: from in-cone to out-of-cone mv: cleanup empty WORKING_DIRECTORY advice.h: add advise_on_moving_dirty_path() mv: check overwrite for in-to-out move builtin/mv.c: fix possible segfault in add_slash() Siddharth Asthana (4): revision: improve commit_rewrite_person() ident: move commit_rewrite_person() to ident.c ident: rename commit_rewrite_person() to apply_mailmap_to_header() cat-file: add mailmap support Tao Klerks (1): rev-parse: documentation adjustment - mention remote tracking with @{u} Taylor Blau (14): pack-objects.h: remove outdated pahole results commit-graph: pass repo_settings instead of repository t5318: demonstrate commit-graph generation v2 corruption commit-graph: introduce `repo_find_commit_pos_in_graph()` commit-graph: fix corrupt upgrade from generation v1 to v2 t1006: extract --batch-command inputs to variables builtin/cat-file.c: support NUL-delimited input with `-z` t5326: demonstrate potential bitmap corruption t/lib-bitmap.sh: avoid silencing stderr midx.c: extract `struct midx_fanout` midx.c: extract `midx_fanout_add_midx_fanout()` midx.c: extract `midx_fanout_add_pack_fanout()` midx.c: include preferred pack correctly with existing MIDX midx.c: avoid adding preferred objects twice Teng Long (8): pack-bitmap.c: fix formatting of error messages pack-bitmap.c: mark more strings for translations pack-bitmap.c: rename "idx_name" to "bitmap_name" pack-bitmap.c: do not ignore error when opening a bitmap file pack-bitmap.c: using error() instead of silently returning -1 pack-bitmap.c: continue looping when first MIDX bitmap is found api-trace2.txt: print config key-value pair tr2: shows scope unconditionally in addition to key-value pair Todd Zullinger (2): docs: fix a few recently broken links api docs: link to html version of api-trace2 Victoria Dye (37): scalar: reword command documentation to clarify purpose scalar: convert README.md into a technical design doc checkout: fix nested sparse directory diff in sparse index oneway_diff: handle removed sparse directories cache.h: create 'index_name_pos_sparse()' unpack-trees: unpack new trees as sparse directories scalar-diagnose: use "$GIT_UNZIP" in test scalar-diagnose: avoid 32-bit overflow of size_t scalar-diagnose: add directory to archiver more gently scalar-diagnose: move 'get_disk_info()' to 'compat/' scalar-diagnose: move functionality to common location diagnose.c: add option to configure archive contents builtin/diagnose.c: create 'git diagnose' builtin builtin/diagnose.c: add '--mode' option builtin/bugreport.c: create '--diagnose' option scalar-diagnose: use 'git diagnose --mode=all' scalar: update technical doc roadmap scalar: constrain enlistment search scalar-unregister: handle error codes greater than 0 scalar-[un]register: clearly indicate source of error scalar-delete: do not 'die()' in 'delete_enlistment()' scalar: move config setting logic into its own function scalar: update technical doc roadmap with FSMonitor support p0004: fix prereq declaration p0006: fix 'read-tree' argument ordering unpack-trees: fix sparse directory recursion check scalar: fix command documentation section header scalar: include in standard Git build & installation scalar: add to 'git help -a' command list scalar-clone: add test coverage t/perf: add Scalar performance tests t/perf: add 'GIT_PERF_USE_SCALAR' run option Documentation/technical: include Scalar technical doc diagnose.c: refactor to safely use 'd_type' Documentation: add ReviewingGuidelines diagnose: add to command-list.txt version: fix builtin linking & documentation ZheNing Hu (2): ls-files: introduce "--format" option ls-files: fix black space in error message brian m. carlson (2): sha256: add support for Nettle gc: use temporary file for editing crontab Ævar Arnfjörð Bjarmason (153): t0008: don't rely on default ".git/info/exclude" tests: don't depend on template-created .git/branches tests: don't assume a .git/info for .git/info/grafts tests: don't assume a .git/info for .git/info/attributes tests: don't assume a .git/info for .git/info/refs tests: don't assume a .git/info for .git/info/exclude tests: don't assume a .git/info for .git/info/sparse-checkout object-file.c: factor out deflate part of write_loose_object() core doc: modernize core.bigFileThreshold documentation git-submodule.sh: remove unused sanitize_submodule_env() git-submodule.sh: remove unused $prefix variable git-submodule.sh: make the "$cached" variable a boolean git-submodule.sh: remove unused top-level "--branch" argument submodule--helper: have --require-init imply --init submodule update: remove "-v" option submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" submodule--helper: report "submodule" as our name in some "-h" output submodule--helper: understand --checkout, --merge and --rebase synonyms git-submodule.sh: use "$quiet", not "$GIT_QUIET" git-sh-setup.sh: remove "say" function, change last users gitweb/Makefile: define all .PHONY prerequisites inline gitweb/Makefile: add a $(GITWEB_ALL) variable gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars gitweb/Makefile: prepare to merge into top-level Makefile gitweb: remove "test" and "test-installed" targets gitweb/Makefile: include in top-level Makefile gitweb/Makefile: add a "NO_GITWEB" parameter tests: add missing double quotes to included library paths test-lib.sh: fix prepend_var() quoting issue config tests: fix harmless but broken "rm -r" cleanup submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags check-ref-format: fix trivial memory leak clone: fix memory leak in wanted_peer_refs() submodule.c: free() memory from xgetcwd() revert: free "struct replay_opts" members cat-file: fix a memory leak in --batch-command mode merge-file: refactor for subsequent memory leak fix merge-file: fix memory leaks on error path checkout: avoid "struct unpack_trees_options" leak gc: fix a memory leak cat-file: fix a common "struct object_context" memory leak pull: fix a "struct oid_array" memory leak test-tool test-hash: fix a memory leak test-tool path-utils: fix a memory leak test-tool {dump,scrap}-cache-tree: fix memory leaks test-tool urlmatch-normalization: fix a memory leak test-tool regex: call regfree(), fix memory leaks test-tool json-writer: fix memory leaks test-tool bloom: fix memory leaks test-tool ref-store: fix a memory leak test-tool delta: fix a memory leak Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Makefile & .gitignore: ignore & clean "git.res", not "*.res" cocci: add a "coccicheck-test" target and test *.cocci rules cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" cocci: add and apply a rule to find "unused" strbufs cocci: generalize "unused" rule to cover more than "strbuf" trace2: only include "fsync" events if we git_fsync() test-lib: use $1, not $@ in test_known_broken_{ok,failure}_ test-lib: don't set GIT_EXIT_OK before calling test_atexit_handler test-lib: fix GIT_EXIT_OK logic errors, use BAIL_OUT test-lib: add a --invert-exit-code switch t/README: reword the "GIT_TEST_PASSING_SANITIZE_LEAK" description test-lib: add a SANITIZE=leak logging mode t/Makefile: don't remove test-results in "clean-except-prove-cache" tests: move copy/pasted PERL + Test::More checks to a lib-perl.sh test-lib: simplify by removing test_external test-lib: add a GIT_TEST_PASSING_SANITIZE_LEAK=check mode test-lib: have the "check" mode for SANITIZE=leak consider leak logs leak tests: don't skip some tests under SANITIZE=leak leak tests: mark passing SANITIZE=leak tests as leak-free upload-pack: fix a memory leak in create_pack_file() CI: use "GIT_TEST_SANITIZE_LEAK_LOG=true" in linux-leaks bisect.c: add missing "goto" for release_revisions() test-fast-rebase helper: use release_revisions() (again) log: fix a memory leak in "git show <revision>..." log: refactor "rev.pending" code in cmd_show() bisect.c: partially fix bisect_rev_setup() memory leak revisions API: don't leak memory on argv elements that need free()-ing help.c: refactor drop_prefix() to use a "switch" statement" help.c: remove common category behavior from drop_prefix() behavior git help doc: use "<doc>" instead of "<guide>" git docs: add a category for user-facing file, repo and command UX git docs: add a category for file formats, protocols and interfaces docs: move commit-graph format docs to man section 5 docs: move protocol-related docs to man section 5 docs: move index format docs to man section 5 docs: move signature docs to man section 5 docs: move pack format docs to man section 5 docs: move cruft pack docs to gitformat-pack docs: move http-protocol docs to man section 5 hook API: don't segfault on strbuf_addf() to NULL "out" Makefile + hash.h: remove PPC_SHA1 implementation Makefile: use $(OBJECTS) instead of $(C_OBJ) git-compat-util.h: use "UNUSED", not "UNUSED(var)" git-compat-util.h: use "deprecated" for UNUSED variables submodule tests: test usage behavior submodule tests: test for "add <repository> <abs-path>" submodule--helper: remove unused "name" helper submodule--helper: remove unused "list" helper test-tool submodule-config: remove unused "--url" handling submodule--helper: move "is-active" to a test-tool submodule--helper: move "check-name" to a test-tool submodule--helper: move "resolve-relative-url-test" to a test-tool submodule--helper style: don't separate declared variables with \n\n submodule--helper style: add \n\n after variable declarations submodule--helper: replace memset() with { 0 }-initialization submodule--helper: use xstrfmt() in clone_submodule() submodule--helper: move "sb" in clone_submodule() to its own scope submodule--helper: add "const" to passed "module_clone_data" submodule--helper: add "const" to passed "struct update_data" submodule--helper: don't redundantly check "else if (res)" submodule--helper: rename "int res" to "int ret" submodule--helper: return "ret", not "1" from update_submodule() submodule--helper: add missing braces to "else" arm submodule--helper: don't call submodule_strategy_to_string() in BUG() submodule API: don't handle SM_..{UNSPECIFIED,COMMAND} in to_string() submodule--helper: use "code" in run_update_command() submodule--helper: don't exit() on failure, return submodule--helper: libify determine_submodule_update_strategy() submodule--helper: libify "must_die_on_failure" code paths submodule--helper update: don't override 'checkout' exit code submodule--helper: libify "must_die_on_failure" code paths (for die) submodule--helper: check repo{_submodule,}_init() return values submodule--helper: libify more "die" paths for module_update() submodule--helper: libify even more "die" paths for module_update() submodule--helper: fix bad config API usage submodule--helper: fix a leak in "clone_submodule" submodule--helper: fix trivial get_default_remote_submodule() leak submodule--helper: fix most "struct pathspec" memory leaks submodule--helper: "struct pathspec" memory leak in module_update() submodule--helper: don't leak {run,capture}_command() cp.dir argument submodule--helper: add and use *_release() functions submodule--helper: fix "errmsg_str" memory leak submodule--helper: fix "sm_path" and other "module_cb_list" leaks submodule--helper: fix a leak with repo_clear() submodule--helper: fix a memory leak in get_default_remote_submodule() submodule--helper: fix "reference" leak submodule--helper: fix obscure leak in module_add() submodule--helper: fix a leak in module_add() submodule--helper: fix a memory leak in print_status() submodule--helper: free some "displaypath" in "struct update_data" submodule--helper: free rest of "displaypath" in "struct update_data" submodule--helper: fix a configure_added_submodule() leak docs: add and use include template for config/* includes grep docs: de-duplicate configuration sections send-email docs: de-duplicate configuration sections apply docs: de-duplicate configuration sections notes docs: de-duplicate and combine configuration sections difftool docs: de-duplicate configuration sections log docs: de-duplicate configuration sections docs: add CONFIGURATION sections that map to a built-in docs: add CONFIGURATION sections that fuzzy map to built-ins Øystein Walle (1): rev-parse --parseopt: detect missing opt-spec
A release candidate Git v2.38.0-rc1 is now available for testing at the usual places. It is comprised of 668 non-merge commits since v2.37.0, contributed by 81 people, 23 of which are new faces [*]. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/testing/ The following public repositories all have a copy of the 'v2.38.0-rc1' tag and the 'master' branch that the tag points at: url = https://git.kernel.org/pub/scm/git/git url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.37.0 are as follows. Welcome to the Git development community! Andrew Olsen, Anthony Delannoy, Carlos López, Celeste Liu, Cleber Rosa, David Plumpton, Elijah Conners, Eric DeCosta, Goss Geppert, Ilya K, Ingy dot Net, Jacob Stopak, Julien Rouhaud, Kilian Kilger, Lana Deere, Manuel Boni, Matthew Klein, Miaoqian Lin, Moritz Baumann, Pavel Rappo, Pierre Garnier, Richard Oliver, and Xavier Morel. Returning contributors who helped this release are as follows. Thanks for your continued support. Abhradeep Chakraborty, Adam Dinwoodie, Ævar Arnfjörð Bjarmason, Alex Henrie, Arthur Milchior, brian m. carlson, Calvin Wan, Carlo Marcelo Arenas Belón, Christian Couder, Christoph Reiter, Derrick Stolee, Dimitriy Ryazantcev, Đoàn Trần Công Danh, Elijah Newren, Emily Shaffer, Eric Sunshine, Fangyi Zhou, Felipe Contreras, Fernando Ramos, Glen Choo, Han Xin, Hariom Verma, Jacob Keller, Jaydeep Das, Jeff King, Jiang Xin, Joey Hess, Johannes Schindelin, John Cai, Jonathan Tan, Josh Steadmon, Junio C Hamano, Justin Donnelly, Kyle Zhao, Lessley Dennington, Li Linchao, Linus Torvalds, Martin Ågren, Matheus Tavares, Matthew John Cheetham, Michael J Gruber, Øystein Walle, Philip Oakley, Philippe Blain, Phillip Wood, Randall S. Becker, Renato Botelho, René Scharfe, Shaoxuan Yuan, Siddharth Asthana, SZEDER Gábor, Tao Klerks, Taylor Blau, Teng Long, Todd Zullinger, Torsten Bögershausen, Victoria Dye, and ZheNing Hu. [*] We are counting not just the authorship contribution but issue reporting, mentoring, helping and reviewing that are recorded in the commit trailers. ---------------------------------------------------------------- Git v2.38 Release Notes (draft) =============================== UI, Workflows & Features * "git remote show [-n] frotz" now pays attention to negative pathspec. * "git push" sometimes performs poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". * "git grep -m<max-hits>" is a way to limit the hits shown per file. * "git merge-tree" learned a new mode where it takes two commits and computes a tree that would result in the merge commit, if the histories leading to these two commits were to be merged. * "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. * Earlier, HTTP transport clients learned to tell the server side what locale they are in by sending Accept-Language HTTP header, but this was done only for some requests but not others. * Introduce a safe.barerepository configuration variable that allows users to forbid discovery of bare repositories. * Various messages that come from the pack-bitmap codepaths have been tweaked. * "git rebase -i" learns to update branches whose tip appear in the rebased range with "--update-refs" option. * "git ls-files" learns the "--format" option to tweak its output. * "git cat-file" learned an option to use the mailmap when showing commit and tag objects. * When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. * Operating modes like "--batch" of "git cat-file" command learned to take NUL-terminated input, instead of one-item-per-line. * "git rm" has become more aware of the sparse-index feature. * "git rev-list --disk-usage" learned to take an optional value "human" to show the reported value in human-readable format, like "3.40MiB". * The "diagnose" feature to create a zip archive for diagnostic material has been lifted from "scalar" and made into a feature of "git bugreport". * The namespaces used by "log --decorate" from "refs/" hierarchy by default has been tightened. * "git rev-list --ancestry-path=C A..B" is a natural extension of "git rev-list A..B"; instead of choosing a subset of A..B to those that have ancestry relationship with A, it lets a subset with ancestry relationship with C. * "scalar" now enables built-in fsmonitor on enlisted repositories, when able. * The bash prompt (in contrib/) learned to optionally indicate when the index is unmerged. * "git clone" command learned the "--bundle-uri" option to coordinate with hosting sites the use of pre-prepared bundle files. * "git range-diff" learned to honor pathspec argument if given. * "git format-patch --from=<ident>" can be told to add an in-body "From:" line even for commits that are authored by the given <ident> with "--force-in-body-from" option. * The built-in fsmonitor refuses to work on a network mounted repositories; a configuration knob for users to override this has been introduced. * The "scalar" addition from Microsoft is now part of the core Git installation. Performance, Internal Implementation, Development Support etc. * Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. * Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. * Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. * Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. * Further preparation to turn git-submodule.sh into a builtin continues. * Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. * Teach "make all" to build gitweb as well. * Tweak tests so that they still work when the "git init" template did not create .git/info directory. * Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused variable. * The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. * Support for libnettle as SHA256 implementation has been added. * The way "git multi-pack" uses parse-options API has been improved. * A Coccinelle rule (in contrib/) to encourage use of COPY_ARRAY macro has been improved. * API tweak to make it easier to run fuzz testing on commit-graph parser. * Omit fsync-related trace2 entries when their values are all zero. * The codepath to write multi-pack index has been taught to release a large chunk of memory that holds an array of objects in the packs, as soon as it is done with the array, to reduce memory consumption. * Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. * "git fetch" client logs the partial clone filter used in the trace2 output. * The "bundle URI" design gets documented. * The common ancestor negotiation exchange during a "git fetch" session now leaves trace log. * Test portability improvements. (merge 4d1d843be7 mt/rot13-in-c later to maint). * The "subcommand" mode is introduced to parse-options API and update the command line parser of Git commands with subcommands. * The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. * The assembly version of SHA-1 implementation for PPC has been removed. * The server side that responds to "git fetch" and "git clone" request has been optimized by allowing it to send objects in its object store without recomputing and validating the object names. * Annotate function parameters that are not used (but cannot be removed for structural reasons), to prepare us to later compile with -Wunused warning turned on. * Share the text used to explain configuration variables used by "git <subcmd>" in "git help <subcmd>" with the text from "git help config". * "git mv A B" in a sparsely populated working tree can be asked to move a path from a directory that is "in cone" to another directory that is "out of cone". Handling of such a case has been improved. * The chainlint script for our tests has been revamped. Fixes since v2.37 ----------------- * Rewrite of "git add -i" in C that appeared in Git 2.25 didn't correctly record a removed file to the index, which was fixed. * Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. * Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. * Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. * "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. * Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. * References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. * In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. * Recent update to vimdiff layout code has been made more robust against different end-user vim settings. * Plug various memory leaks, both in the main code and in test-tool commands. * Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. * The resolve-undo information in the index was not protected against GC, which has been corrected. * A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. * "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. * An earlier attempt to plug leaks placed a clean-up label to jump to at a bogus place, which as been corrected. * Variable quoting fix in the vimdiff driver of "git mergetool" * "git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. * A fix for a regression in test framework. * mkstemp() emulation on Windows has been improved. * Add missing documentation for "include" and "includeIf" features in "git config" file format, which incidentally teaches the command line completion to include them in its offerings. * Avoid "white/black-list" in documentation and code comments. * Workaround for a compiler warning against use of die() in osx-keychain (in contrib/). * Workaround for a false positive compiler warning. * "git p4" working on UTF-16 files on Windows did not implement CRLF-to-LF conversion correctly, which has been corrected. * "git p4" did not handle non-ASCII client name well, which has been corrected. * "rerere-train" script (in contrib/) used to honor commit.gpgSign while recreating the throw-away merges. * "git checkout" miscounted the paths it updated, which has been corrected. * Fix for a bug that makes write-tree to fail to write out a non-existent index as a tree, introduced in 2.37. * There was a bug in the codepath to upgrade generation information in commit-graph from v1 to v2 format, which has been corrected. * Gitweb had legacy URL shortener that is specific to the way projects hosted on kernel.org used to (but no longer) work, which has been removed. * Fix build procedure for Windows that uses CMake so that it can pick up the shell interpreter from local installation location. * Conditionally allow building Python interpreter on Windows * Fix to lstat() emulation on Windows. * Older gcc with -Wall complains about the universal zero initializer "struct s = { 0 };" idiom, which makes developers' lives inconvenient (as -Werror is enabled by DEVELOPER=YesPlease). The build procedure has been tweaked to help these compilers. * Plug memory leaks in the failure code path in the "merge-ort" merge strategy backend. * "git symbolic-ref symref non..sen..se" is now diagnosed as an error. * A follow-up fix to a fix for a regression in 2.36 around hooks. * Avoid repeatedly running getconf to ask libc version in the test suite, and instead just as it once per script. * Platform-specific code that determines if a directory is OK to use as a repository has been taught to report more details, especially on Windows. * "vimdiff3" regression fix. * "git fsck" reads mode from tree objects but canonicalizes the mode before passing it to the logic to check object sanity, which has hid broken tree objects from the checking logic. This has been corrected, but to help existing projects with broken tree objects that they cannot fix retroactively, the severity of anomalies this code detects has been demoted to "info" for now. * Fixes to sparse index compatibility work for "reset" and "checkout" commands. * An earlier optimization discarded a tree-object buffer that is still in use, which has been corrected. * Fix deadlocks between main Git process and subprocess spawned via the pipe_command() API, that can kill "git add -p" that was reimplemented in C recently. * The sequencer machinery translated messages left in the reflog by mistake, which has been corrected. * xcalloc(), imitating calloc(), takes "number of elements of the array", and "size of a single element", in this order. A call that does not follow this ordering has been corrected. * The preload-index codepath made copies of pathspec to give to multiple threads, which were left leaked. * Update the version of Ubuntu used for GitHub Actions CI from 18.04 to 22.04. * The auto-stashed local changes created by "git merge --autostash" was mixed into a conflicted state left in the working tree, which has been corrected. * Multi-pack index got corrupted when preferred pack changed from one pack to another in a certain way, which has been corrected. (merge 99e4d084ff tb/midx-with-changing-preferred-pack-fix later to maint). * The clean-up of temporary files created via mks_tempfile_dt() was racy and attempted to unlink() the leading directory when signals are involved, which has been corrected. (merge babe2e0559 rs/tempfile-cleanup-race-fix later to maint). * FreeBSD portability fix for "git maintenance" that spawns "crontab" to schedule tasks. (merge ee69e7884e bc/gc-crontab-fix later to maint). * Those who use diff-so-fancy as the diff-filter noticed a regression or two in the code that parses the diff output in the built-in version of "add -p", which has been corrected. (merge 0a101676e5 js/add-p-diff-parsing-fix later to maint). * Segfault fix-up to an earlier fix to the topic to teach "git reset" and "git checkout" work better in a sparse checkout. (merge 037f8ea6d9 vd/sparse-reset-checkout-fixes later to maint). * "git diff --no-index A B" managed its the pathnames of its two input files rather haphazardly, sometimes leaking them. The command line argument processing has been straightened out to clean it up. (merge 2b43dd0eb5 rs/diff-no-index-cleanup later to maint). * "git rev-list --verify-objects" ought to inspect the contents of objects and notice corrupted ones, but it didn't when the commit graph is in use, which has been corrected. (merge b27ccae34b jk/rev-list-verify-objects-fix later to maint). * More fixes to "add -p" (merge 64ec8efb83 js/builtin-add-p-portability-fix later to maint). * The parser in the script interface to parse-options in "git rev-parse" has been updated to diagnose a bogus input correctly. (merge f20b9c36d0 ow/rev-parse-parseopt-fix later to maint). * The code that manages list-object-filter structure, used in partial clones, leaked the instances, which has been plugged. (merge 66eede4a37 jk/plug-list-object-filter-leaks later to maint). * Fix another UI regression in the reimplemented "add -p". (merge f6f0ee247f rs/add-p-worktree-mode-prompt-fix later to maint). * "git fetch" over protocol v2 sent an incorrect ref prefix request to the server and made "git pull" with configured fetch refspec that does not cover the remote branch to merge with fail, which has been corrected. (merge 49ca2fba39 jk/proto-v2-ref-prefix-fix later to maint). * A result from opendir() was leaking in the commit-graph expiration codepath, which has been plugged. (merge 12f1ae5324 ml/commit-graph-expire-dir-leak-fix later to maint). * Just like we have coding guidelines, we now have guidelines for reviewers. (merge e01b851923 vd/doc-reviewing-guidelines later to maint). * Other code cleanup, docfix, build fix, etc. (merge 77b9e85c0f vd/fix-perf-tests later to maint). (merge 0682bc43f5 jk/test-crontab-fixes later to maint). (merge b46dd1726c cc/doc-trailer-whitespace-rules later to maint). ---------------------------------------------------------------- Changes since v2.37.0 are as follows: Abhradeep Chakraborty (9): bitmap-format.txt: feed the file to asciidoc to generate html bitmap-format.txt: fix some formatting issues bitmap-format.txt: add information for trailing checksum Documentation/technical: describe bitmap lookup table extension bitmap: move `get commit positions` code to `bitmap_writer_finish` pack-bitmap-write.c: write lookup table extension pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests pack-bitmap: prepare to read lookup table extension bitmap-lookup-table: add performance tests for lookup table Adam Dinwoodie (1): t1800: correct test to handle Cygwin Alex Henrie (2): gc: don't translate literal commands builtin/diagnose.c: don't translate the two mode values Anthony Delannoy (1): preload-index: fix memleak Calvin Wan (1): submodule merge: update conflict error message Carlo Marcelo Arenas Belón (2): setup: tighten ownership checks post CVE-2022-24765 cmake: support local installations of git Carlos López (1): grep: add --max-count command line option Celeste Liu (1): contrib/rerere-train: avoid useless gpg sign in training Christian Couder (1): Documentation: clarify whitespace rules for trailers Cleber Rosa (1): setup: fix function name in a BUG() message Derrick Stolee (50): branch: add branch_checked_out() helper branch: check for bisects and rebases fetch: use new branch_checked_out() and add tests branch: use branch_checked_out() when deleting refs branch: fix branch_checked_out() leaks t5510: replace 'origin' with URL more carefully vscode: improve tab size and wrapping git-rebase.txt: use back-ticks consistently pack-bitmap-write: use const for hashes midx: extract bitmap write setup midx: reduce memory pressure while writing bitmaps daemon: clarify directory arguments git-cvsserver: clarify directory list git.txt: remove redundant language t: avoid "whitelist" transport.c: avoid "whitelist" t2407: test bisect and rebase as black-boxes t2407: test branches currently using apply backend branch: consider refs under 'update-refs' rebase-interactive: update 'merge' description sequencer: define array with enum values sequencer: add update-ref command rebase: add --update-refs option rebase: update refs from 'update-ref' commands sequencer: rewrite update-refs as user edits todo list rebase: add rebase.updateRefs config option sequencer: ignore HEAD ref under --update-refs sequencer: notify user of --update-refs activity compat/win32: correct for incorrect compiler warning refs: allow "HEAD" as decoration filter t4207: modernize test t4207: test coloring of grafted decorations refs: add array of ref namespaces refs: use ref_namespaces for replace refs base log-tree: use ref_namespaces instead of if/else-if log: add default decoration filter log: add --clear-decorations option log: create log.initialDecorationSet=all maintenance: stop writing log.excludeDecoration fetch: use ref_namespaces during prefetch docs: document bundle URI standard bundle-uri: add example bundle organization remote-curl: add 'get' capability bundle-uri: create basic file-copy logic clone: add --bundle-uri option bundle-uri: add support for http(s):// and file:// clone: --bundle-uri cannot be combined with --depth t6019: modernize tests with helper clone: warn on failure to repo_init() ci: update 'static-analysis' to Ubuntu 22.04 Dimitriy Ryazantcev (1): i18n: mark message helpers prefix for translation Elijah Conners (1): reftable: use a pointer for pq_entry param Elijah Newren (43): merge-tree: rename merge_trees() to trivial_merge_trees() merge-tree: move logic for existing merge into new function merge-tree: add option parsing and initial shell for real merge function merge-tree: implement real merges merge-ort: split out a separate display_update_messages() function merge-tree: support including merge messages in output merge-ort: provide a merge_get_conflicted_files() helper function merge-ort: remove command-line-centric submodule message from merge-ort merge-tree: provide a list of which files have conflicts merge-tree: provide easy access to `ls-files -u` style info merge-ort: store more specific conflict information merge-ort: optionally produce machine-readable output merge-tree: allow `ls-files -u` style info to be NUL terminated merge-tree: add a --allow-unrelated-histories flag git-merge-tree.txt: add a section on potentional usage mistakes t6429: fix use of non-existent function t6423: add tests of dual directory rename plus add/add conflict merge-ort: small cleanups of check_for_directory_rename merge-ort: make a separate function for freeing struct collisions merge-ort: shuffle the computation and cleanup of potential collisions merge-ort: fix issue with dual rename and add/add conflict merge-ort-wrappers: make printed message match the one from recursive merge-resolve: abort if index does not match HEAD merge: abort if index does not match HEAD for trivial merges merge: do not abort early if one strategy fails to handle the merge merge: fix save_state() to work when there are stat-dirty files merge: make restore_state() restore staged state too merge: ensure we can actually restore pre-merge state merge: do not exit restore_state() prematurely merge-ort: remove translator lego in new "submodule conflict suggestion" merge-ort: avoid surprise with new sub_flag variable merge-ort: provide helpful submodule update message when possible merge-ort: remove code obsoleted by other changes rev-list-options.txt: fix simple typo revision: allow --ancestry-path to take an argument merge: only apply autostash when appropriate merge: cleanup confusing logic for handling successful merges merge: small code readability improvement t4301: add more interesting merge-tree testcases t64xx: convert 'test_create_repo' to 'git init' diff: have submodule_format logic avoid additional diff headers diff: fix filtering of additional headers under --remerge-diff diff: fix filtering of merge commits under --remerge-diff Eric DeCosta (1): fsmonitor: option to allow fsmonitor to run against network-mounted repos Eric Sunshine (25): t2407: fix broken &&-chains in compound statement t1092: fix buggy sparse "blame" test t: detect and signal failure within loop t4301: account for behavior differences between sed implementations t4301: fix broken &&-chains and add missing loop termination t4301: emit blank line in more idiomatic fashion t: add skeleton chainlint.pl chainlint.pl: add POSIX shell lexical analyzer chainlint.pl: add POSIX shell parser chainlint.pl: add parser to validate tests chainlint.pl: add parser to identify test definitions chainlint.pl: validate test scripts in parallel chainlint.pl: don't require `return|exit|continue` to end with `&&` t/Makefile: apply chainlint.pl to existing self-tests chainlint.pl: don't require `&` background command to end with `&&` chainlint.pl: don't flag broken &&-chain if `$?` handled explicitly chainlint.pl: don't flag broken &&-chain if failure indicated explicitly chainlint.pl: complain about loops lacking explicit failure handling chainlint.pl: allow `|| echo` to signal failure upstream of a pipe t/chainlint: add more chainlint.pl self-tests test-lib: retire "lint harder" optimization hack test-lib: replace chainlint.sed with chainlint.pl t/Makefile: teach `make test` and `make prove` to run chainlint.pl t: retire unused chainlint.sed chainlint: colorize problem annotations and test delimiters Fangyi Zhou (1): help: fix doubled words in explanation for developer interfaces Felipe Contreras (7): mergetools: vimdiff: fix comment mergetools: vimdiff: make vimdiff3 actually work mergetools: vimdiff: silence annoying messages mergetools: vimdiff: fix for diffopt mergetools: vimdiff: rework tab logic mergetools: vimdiff: fix single window layouts mergetools: vimdiff: simplify tabfirst Fernando Ramos (1): vimdiff: make layout engine more robust against user vim settings Glen Choo (16): submodule--helper: eliminate internal "--update" option submodule--helper tests: add missing "display path" coverage submodule--helper update: use display path helper submodule--helper: don't recreate recursive prefix submodule--helper: use correct display path helper submodule--helper update: use --super-prefix submodule--helper: remove display path helper Documentation/git-config.txt: add SCOPES section Documentation: define protected configuration config: learn `git_protected_config()` safe.directory: use git_protected_config() setup.c: create `safe.bareRepository` config.c: NULL check when reading protected config Documentation/git-reflog: remove unneeded \ from \{ submodule--helper: add "const" to copy of "update_data" submodule--helper: refactor "errmsg_str" to be a "struct strbuf" Goss Geppert (2): dir: traverse into repository dir: minor refactoring / clean-up Han Xin (6): unpack-objects: low memory footprint for get_data() in dry_run mode object-file.c: refactor write_loose_object() to several steps object-file.c: add "stream_loose_object()" to handle large object unpack-objects: use stream_loose_object() to unpack large objects commit-graph.c: no lazy fetch in lookup_commit_in_graph() t5330: remove run_with_limited_processses() Jacob Keller (1): remote: handle negative refspecs in git remote show Jacob Stopak (3): Documentation: fix various repeat word typos Documentation: clean up a few misspelled word typos Documentation: clean up various typos in technical docs Jaydeep Das (1): gpg-interface: add function for converting trust level to string Jeff King (63): is_promisor_object(): walk promisor packs in pack-order fetch: stop passing around unused worktrees variable branch: drop unused worktrees variable revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis clone: drop extra newline from warning message clone: propagate empty remote HEAD even with other branches clone: use remote branch if it matches default HEAD clone: move unborn head creation to update_head() ref-filter: disable save_commit_buffer while traversing diff-files: move misplaced cleanup label write_midx_bitmap(): drop unused refs_snapshot parameter config.mak.dev: squelch -Wno-missing-braces for older gcc tree-walk: add a mechanism for getting non-canonicalized modes fsck: actually detect bad file modes in trees fsck: downgrade tree badFilemode to "info" is_promisor_object(): fix use-after-free of tree buffer compat: add function to enable nonblocking pipes git-compat-util: make MAX_IO_SIZE define globally available pipe_command(): avoid xwrite() for writing to pipe pipe_command(): handle ENOSPC when writing to a pipe pipe_command(): mark stdin descriptor as non-blocking git-compat-util: add UNUSED macro refs: mark unused each_ref_fn parameters refs: mark unused reflog callback parameters refs: mark unused virtual method parameters transport: mark bundle transport_options as unused streaming: mark unused virtual method parameters config: mark unused callback parameters hashmap: mark unused callback parameters mark unused read_tree_recursive() callback parameters run-command: mark unused async callback parameters is_path_owned_by_current_uid(): mark "report" parameter as unused xdiff: drop unused mmfile parameters from xdl_do_histogram_diff() log-tree: drop unused commit param in remerge_diff() match_pathname(): drop unused "flags" parameter verify_one_sparse(): drop unused parameters reftable: drop unused parameter from reader_seek_linear() reflog: assert PARSE_OPT_NONEG in parse-options callbacks xdiff: drop unused mmfile parameters from xdl_do_patience_diff() pass subcommand "prefix" arguments to parse_options() maintenance: add parse-options boilerplate for subcommands remote: run "remote rm" argv through parse_options() pack-bitmap-write: drop unused pack_idx_entry parameters tempfile: drop active flag tempfile: update comment describing state transitions test-crontab: minor memory and error handling fixes lookup_commit_in_graph(): use prepare_commit_graph() to check for graph rev-list: disable commit graph with --verify-objects parse_object(): allow skipping hash check upload-pack: skip parse-object re-hashing of "want" objects parse_object(): check commit-graph when skip_hash set t1060: check partial clone of misnamed blob list_objects_filter_copy(): deep-copy sparse_oid_name field transport: deep-copy object-filter struct for fetch-pack transport: free filter options in disconnect_git() list_objects_filter_options: plug leak of filter_spec strings prepare_repo_settings(): plug leak of config values fetch: stop checking for NULL transport->remote in do_fetch() fetch: add branch.*.merge to default ref-prefix extension list-objects-filter: don't memset after releasing filter struct list-objects-filter: handle null default filter spec list-objects-filter: add and use initializers list-objects-filter: convert filter_spec to a strbuf Johannes Schindelin (38): merge-ort: store messages in a list, not in a single strbuf merge-ort: make `path_messages` a strmap to a string_list Git 2.30.5 Git 2.31.4 Git 2.32.3 Git 2.33.4 Git 2.34.4 Git 2.35.4 Git 2.36.2 add --interactive: allow `update` to stage deleted files tests: fix incorrect --write-junit-xml code mergetool(vimdiff): allow paths to contain spaces again shortlog: use a stable sort t5351: avoid relying on `core.fsyncMethod = batch` to be supported t5351: avoid using `test_cmp` for binary data windows: include the Python bits when building Git for Windows mingw: remove unneeded `NO_GETTEXT` directive mingw: remove unneeded `NO_CURL` directive lstat(mingw): correctly detect ENOTDIR scenarios merge-ort: clean up after failed merge merge-ort: do leave trace2 region even if checkout fails setup: fix some formatting setup: prepare for more detailed "dubious ownership" messages mingw: provide details about unsafe directories' ownership mingw: be more informative when ownership check fails on FAT32 mingw: handle a file owned by the Administrators group correctly scalar unregister: stop FSMonitor daemon range-diff: reorder argument handling range-diff: consistently validate the arguments range-diff: optionally accept pathspecs add -p: avoid ambiguous signed/unsigned comparison t3701: test the built-in `add -i` regardless of NO_PERL t6132(NO_PERL): do not run the scripted `add -p` add -p: detect more mismatches between plain vs colored diffs add -p: gracefully handle unparseable hunk headers in colored diffs add -p: ignore dirty submodules git help: special-case `scalar` scalar: implement the `help` subcommand Jonathan Tan (1): fetch-pack: write effective filter to trace2 Josh Steadmon (1): fetch-pack: add tracing for negotiation rounds Julien Rouhaud (1): gitweb: remove title shortening heuristics Junio C Hamano (43): revision: mark blobs needed for resolve-undo as reachable A regression fix for 2.37 Git 2.37.1 builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() The first batch after Git 2.37 fsck: do not dereference NULL while checking resolve-undo data The second batch The third batch The fourth batch The fifth batch builtin/remote.c: use the right kind of STRING_LIST_INIT The sixth batch The seventh batch Downmerge a handful of fixes for 2.37.x maintenance track The eighth batch The ninth batch doc: consolidate --rerere-autoupdate description doc: clarify rerere-autoupdate Downmerge a bit more for 2.37.x The tenth batch The eleventh batch Git 2.37.2 The twelfth batch The thirteenth batch The fourteenth batch t5329: notice a failure within a loop The fifteenth batch A handful more topics from the 'master' front for 2.37.3 pretty: separate out the logic to decide the use of in-body from format-patch: allow forcing the use of in-body From: header format-patch: learn format.forceInBodyFrom configuration variable The sixteenth batch Git 2.37.3 The seventeenth batch The eighteenth batch The nineteenth batch The twentieth batch Merge a handful of topics from the 'master' front Prepare for 2.38-rc0 Git 2.38-rc0 A bit more of remaining topics before -rc1 Final batch before -rc1 Git 2.38-rc1 Justin Donnelly (1): git-prompt: show presence of unresolved conflicts at command prompt Kilian Kilger (2): git-p4: fix bug with encoding of p4 client name git-p4: refactoring of p4CmdList() Kyle Zhao (1): send-pack.c: add config push.useBitmaps Lessley Dennington (1): osx-keychain: fix compiler warning Li Linchao (3): ls-files: update test style remote-curl: send Accept-Language header to server rev-list: support human-readable output for `--disk-usage` Linus Torvalds (1): symbolic-ref: refuse to set syntactically invalid target Manuel Boni (1): config.txt: document include, includeIf Martin Ågren (3): config/core.txt: fix minor issues for `core.sparseCheckoutCone` t4200: drop irrelevant code read-cache: make `do_read_index()` always set up `istate->repo` Matheus Tavares (7): checkout: document bug where delayed checkout counts entries twice checkout: show bug about failed entries being included in final report checkout: fix two bugs on the final count of updated entries pkt-line.h: move comment closer to the associated code t0021: avoid grepping for a Perl-specific string at filter output t0021: implementation the rot13-filter.pl script in C tests: use the new C rot13-filter helper to avoid PERL prereq Matthew John Cheetham (1): scalar: enable built-in FSMonitor on `register` Miaoqian Lin (1): commit-graph: Fix missing closedir in expire_commit_graphs Michael J Gruber (3): sequencer: do not translate reflog messages sequencer: do not translate parameters to error_resolve_conflict() sequencer: do not translate command names Moritz Baumann (3): git-p4: fix CR LF handling for utf16 files git-p4: fix typo in P4Submit.applyCommit() git-p4: fix error handling in P4Unshelve.renameBranch() Philip Oakley (1): doc add: renormalize is not idempotent for CRCRLF Philippe Blain (3): diff-format.txt: dst can be 0* SHA-1 when path is deleted, too diff-format.txt: correct misleading wording diff-index.txt: update raw output format in examples Phillip Wood (5): xdiff: introduce XDL_ALLOC_ARRAY() xdiff: introduce xdl_calloc xdiff: introduce XDL_CALLOC_ARRAY() xdiff: introduce XDL_ALLOC_GROW() tests: cache glibc version check René Scharfe (28): archive: update format documentation archive: rename archiver data field to filter_command archive-tar: factor out write_block() archive-tar: add internal gzip implementation archive-tar: use OS_CODE 3 (Unix) for internal gzip archive-tar: use internal gzip by default combine-diff: abort if --ignore-matching-lines is given combine-diff: abort if --output is given cocci: avoid normalization rules for memcpy mingw: avoid mktemp() in mkstemp() implementation mergesort: unify ranks loops mergesort: tighten merge loop mergesort: add macros for typed sort of linked lists test-mergesort: use DEFINE_LIST_SORT_DEBUG test-mergesort: use DEFINE_LIST_SORT blame: use DEFINE_LIST_SORT commit: use DEFINE_LIST_SORT fetch-pack: use DEFINE_LIST_SORT packfile: use DEFINE_LIST_SORT mergesort: remove llist_mergesort() nonblock: support Windows tempfile: avoid directory cleanup race test-mergesort: read sort input all at once test-mergesort: use mem_pool for sort input diff-no-index: release strbuf on queue error diff-no-index: release prefixed filenames diff-no-index: simplify argv index calculation add -p: fix worktree patch mode prompts Richard Oliver (1): mktree: do not check type of remote objects SZEDER Gábor (30): Makefile: build 'gitweb' in the default target multi-pack-index: simplify handling of unknown --options index-format.txt: remove outdated list of supported extensions git.c: update NO_PARSEOPT markings t3301-notes.sh: check that default operation mode doesn't take arguments t5505-remote.sh: check the behavior without a subcommand t0040-parse-options: test parse_options() with various 'parse_opt_flags' api-parse-options.txt: fix description of OPT_CMDMODE parse-options: PARSE_OPT_KEEP_UNKNOWN only applies to --options parse-options: clarify the limitations of PARSE_OPT_NODASH parse-options: drop leading space from '--git-completion-helper' output parse-options: add support for parsing subcommands builtin/bundle.c: let parse-options parse subcommands builtin/commit-graph.c: let parse-options parse subcommands builtin/gc.c: let parse-options parse 'git maintenance's subcommands builtin/hook.c: let parse-options parse subcommands builtin/multi-pack-index.c: let parse-options parse subcommands builtin/notes.c: let parse-options parse subcommands builtin/reflog.c: let parse-options parse subcommands builtin/remote.c: let parse-options parse subcommands builtin/sparse-checkout.c: let parse-options parse subcommands builtin/stash.c: let parse-options parse subcommands builtin/worktree.c: let parse-options parse subcommands promisor-remote: fix xcalloc() argument order t0040-parse-options: remove leftover debugging test-parse-options.c: don't use for loop initial declaration test-parse-options.c: fix style of comparison with zero notes: simplify default operation mode arguments check notes, remote: show unknown subcommands between `' t/Makefile: remove 'test-results' on 'make clean' Shaoxuan Yuan (22): t7002: add tests for moving out-of-cone file/directory t1092: mv directory from out-of-cone to in-cone mv: update sparsity after moving from out-of-cone to in-cone mv: decouple if/else-if checks using goto mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit mv: check if <destination> exists in index to handle overwriting mv: use flags mode for update_mode mv: add check_dir_in_index() and solve general dir check issue t1092: add tests for `git-rm` pathspec.h: move pathspec_needs_expanded_index() from reset.c to here rm: expand the index only when necessary rm: integrate with sparse-index t7002: add tests for moving from in-cone to out-of-cone mv: rename check_dir_in_index() to empty_dir_has_sparse_contents() mv: free the with_slash in check_dir_in_index() mv: check if <destination> is a SKIP_WORKTREE_DIR mv: remove BOTH from enum update_mode mv: from in-cone to out-of-cone mv: cleanup empty WORKING_DIRECTORY advice.h: add advise_on_moving_dirty_path() mv: check overwrite for in-to-out move builtin/mv.c: fix possible segfault in add_slash() Siddharth Asthana (4): revision: improve commit_rewrite_person() ident: move commit_rewrite_person() to ident.c ident: rename commit_rewrite_person() to apply_mailmap_to_header() cat-file: add mailmap support Tao Klerks (1): rev-parse: documentation adjustment - mention remote tracking with @{u} Taylor Blau (14): pack-objects.h: remove outdated pahole results commit-graph: pass repo_settings instead of repository t5318: demonstrate commit-graph generation v2 corruption commit-graph: introduce `repo_find_commit_pos_in_graph()` commit-graph: fix corrupt upgrade from generation v1 to v2 t1006: extract --batch-command inputs to variables builtin/cat-file.c: support NUL-delimited input with `-z` t5326: demonstrate potential bitmap corruption t/lib-bitmap.sh: avoid silencing stderr midx.c: extract `struct midx_fanout` midx.c: extract `midx_fanout_add_midx_fanout()` midx.c: extract `midx_fanout_add_pack_fanout()` midx.c: include preferred pack correctly with existing MIDX midx.c: avoid adding preferred objects twice Teng Long (8): pack-bitmap.c: fix formatting of error messages pack-bitmap.c: mark more strings for translations pack-bitmap.c: rename "idx_name" to "bitmap_name" pack-bitmap.c: do not ignore error when opening a bitmap file pack-bitmap.c: using error() instead of silently returning -1 pack-bitmap.c: continue looping when first MIDX bitmap is found api-trace2.txt: print config key-value pair tr2: shows scope unconditionally in addition to key-value pair Todd Zullinger (2): docs: fix a few recently broken links api docs: link to html version of api-trace2 Victoria Dye (37): scalar: reword command documentation to clarify purpose scalar: convert README.md into a technical design doc checkout: fix nested sparse directory diff in sparse index oneway_diff: handle removed sparse directories cache.h: create 'index_name_pos_sparse()' unpack-trees: unpack new trees as sparse directories scalar-diagnose: use "$GIT_UNZIP" in test scalar-diagnose: avoid 32-bit overflow of size_t scalar-diagnose: add directory to archiver more gently scalar-diagnose: move 'get_disk_info()' to 'compat/' scalar-diagnose: move functionality to common location diagnose.c: add option to configure archive contents builtin/diagnose.c: create 'git diagnose' builtin builtin/diagnose.c: add '--mode' option builtin/bugreport.c: create '--diagnose' option scalar-diagnose: use 'git diagnose --mode=all' scalar: update technical doc roadmap scalar: constrain enlistment search scalar-unregister: handle error codes greater than 0 scalar-[un]register: clearly indicate source of error scalar-delete: do not 'die()' in 'delete_enlistment()' scalar: move config setting logic into its own function scalar: update technical doc roadmap with FSMonitor support p0004: fix prereq declaration p0006: fix 'read-tree' argument ordering unpack-trees: fix sparse directory recursion check scalar: fix command documentation section header scalar: include in standard Git build & installation scalar: add to 'git help -a' command list scalar-clone: add test coverage t/perf: add Scalar performance tests t/perf: add 'GIT_PERF_USE_SCALAR' run option Documentation/technical: include Scalar technical doc diagnose.c: refactor to safely use 'd_type' Documentation: add ReviewingGuidelines diagnose: add to command-list.txt version: fix builtin linking & documentation ZheNing Hu (2): ls-files: introduce "--format" option ls-files: fix black space in error message brian m. carlson (2): sha256: add support for Nettle gc: use temporary file for editing crontab Ævar Arnfjörð Bjarmason (153): t0008: don't rely on default ".git/info/exclude" tests: don't depend on template-created .git/branches tests: don't assume a .git/info for .git/info/grafts tests: don't assume a .git/info for .git/info/attributes tests: don't assume a .git/info for .git/info/refs tests: don't assume a .git/info for .git/info/exclude tests: don't assume a .git/info for .git/info/sparse-checkout object-file.c: factor out deflate part of write_loose_object() core doc: modernize core.bigFileThreshold documentation git-submodule.sh: remove unused sanitize_submodule_env() git-submodule.sh: remove unused $prefix variable git-submodule.sh: make the "$cached" variable a boolean git-submodule.sh: remove unused top-level "--branch" argument submodule--helper: have --require-init imply --init submodule update: remove "-v" option submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" submodule--helper: report "submodule" as our name in some "-h" output submodule--helper: understand --checkout, --merge and --rebase synonyms git-submodule.sh: use "$quiet", not "$GIT_QUIET" git-sh-setup.sh: remove "say" function, change last users gitweb/Makefile: define all .PHONY prerequisites inline gitweb/Makefile: add a $(GITWEB_ALL) variable gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars gitweb/Makefile: prepare to merge into top-level Makefile gitweb: remove "test" and "test-installed" targets gitweb/Makefile: include in top-level Makefile gitweb/Makefile: add a "NO_GITWEB" parameter tests: add missing double quotes to included library paths test-lib.sh: fix prepend_var() quoting issue config tests: fix harmless but broken "rm -r" cleanup submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags check-ref-format: fix trivial memory leak clone: fix memory leak in wanted_peer_refs() submodule.c: free() memory from xgetcwd() revert: free "struct replay_opts" members cat-file: fix a memory leak in --batch-command mode merge-file: refactor for subsequent memory leak fix merge-file: fix memory leaks on error path checkout: avoid "struct unpack_trees_options" leak gc: fix a memory leak cat-file: fix a common "struct object_context" memory leak pull: fix a "struct oid_array" memory leak test-tool test-hash: fix a memory leak test-tool path-utils: fix a memory leak test-tool {dump,scrap}-cache-tree: fix memory leaks test-tool urlmatch-normalization: fix a memory leak test-tool regex: call regfree(), fix memory leaks test-tool json-writer: fix memory leaks test-tool bloom: fix memory leaks test-tool ref-store: fix a memory leak test-tool delta: fix a memory leak Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Makefile & .gitignore: ignore & clean "git.res", not "*.res" cocci: add a "coccicheck-test" target and test *.cocci rules cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" cocci: add and apply a rule to find "unused" strbufs cocci: generalize "unused" rule to cover more than "strbuf" trace2: only include "fsync" events if we git_fsync() test-lib: use $1, not $@ in test_known_broken_{ok,failure}_ test-lib: don't set GIT_EXIT_OK before calling test_atexit_handler test-lib: fix GIT_EXIT_OK logic errors, use BAIL_OUT test-lib: add a --invert-exit-code switch t/README: reword the "GIT_TEST_PASSING_SANITIZE_LEAK" description test-lib: add a SANITIZE=leak logging mode t/Makefile: don't remove test-results in "clean-except-prove-cache" tests: move copy/pasted PERL + Test::More checks to a lib-perl.sh test-lib: simplify by removing test_external test-lib: add a GIT_TEST_PASSING_SANITIZE_LEAK=check mode test-lib: have the "check" mode for SANITIZE=leak consider leak logs leak tests: don't skip some tests under SANITIZE=leak leak tests: mark passing SANITIZE=leak tests as leak-free upload-pack: fix a memory leak in create_pack_file() CI: use "GIT_TEST_SANITIZE_LEAK_LOG=true" in linux-leaks bisect.c: add missing "goto" for release_revisions() test-fast-rebase helper: use release_revisions() (again) log: fix a memory leak in "git show <revision>..." log: refactor "rev.pending" code in cmd_show() bisect.c: partially fix bisect_rev_setup() memory leak revisions API: don't leak memory on argv elements that need free()-ing help.c: refactor drop_prefix() to use a "switch" statement" help.c: remove common category behavior from drop_prefix() behavior git help doc: use "<doc>" instead of "<guide>" git docs: add a category for user-facing file, repo and command UX git docs: add a category for file formats, protocols and interfaces docs: move commit-graph format docs to man section 5 docs: move protocol-related docs to man section 5 docs: move index format docs to man section 5 docs: move signature docs to man section 5 docs: move pack format docs to man section 5 docs: move cruft pack docs to gitformat-pack docs: move http-protocol docs to man section 5 hook API: don't segfault on strbuf_addf() to NULL "out" Makefile + hash.h: remove PPC_SHA1 implementation Makefile: use $(OBJECTS) instead of $(C_OBJ) git-compat-util.h: use "UNUSED", not "UNUSED(var)" git-compat-util.h: use "deprecated" for UNUSED variables submodule tests: test usage behavior submodule tests: test for "add <repository> <abs-path>" submodule--helper: remove unused "name" helper submodule--helper: remove unused "list" helper test-tool submodule-config: remove unused "--url" handling submodule--helper: move "is-active" to a test-tool submodule--helper: move "check-name" to a test-tool submodule--helper: move "resolve-relative-url-test" to a test-tool submodule--helper style: don't separate declared variables with \n\n submodule--helper style: add \n\n after variable declarations submodule--helper: replace memset() with { 0 }-initialization submodule--helper: use xstrfmt() in clone_submodule() submodule--helper: move "sb" in clone_submodule() to its own scope submodule--helper: add "const" to passed "module_clone_data" submodule--helper: add "const" to passed "struct update_data" submodule--helper: don't redundantly check "else if (res)" submodule--helper: rename "int res" to "int ret" submodule--helper: return "ret", not "1" from update_submodule() submodule--helper: add missing braces to "else" arm submodule--helper: don't call submodule_strategy_to_string() in BUG() submodule API: don't handle SM_..{UNSPECIFIED,COMMAND} in to_string() submodule--helper: use "code" in run_update_command() submodule--helper: don't exit() on failure, return submodule--helper: libify determine_submodule_update_strategy() submodule--helper: libify "must_die_on_failure" code paths submodule--helper update: don't override 'checkout' exit code submodule--helper: libify "must_die_on_failure" code paths (for die) submodule--helper: check repo{_submodule,}_init() return values submodule--helper: libify more "die" paths for module_update() submodule--helper: libify even more "die" paths for module_update() submodule--helper: fix bad config API usage submodule--helper: fix a leak in "clone_submodule" submodule--helper: fix trivial get_default_remote_submodule() leak submodule--helper: fix most "struct pathspec" memory leaks submodule--helper: "struct pathspec" memory leak in module_update() submodule--helper: don't leak {run,capture}_command() cp.dir argument submodule--helper: add and use *_release() functions submodule--helper: fix "errmsg_str" memory leak submodule--helper: fix "sm_path" and other "module_cb_list" leaks submodule--helper: fix a leak with repo_clear() submodule--helper: fix a memory leak in get_default_remote_submodule() submodule--helper: fix "reference" leak submodule--helper: fix obscure leak in module_add() submodule--helper: fix a leak in module_add() submodule--helper: fix a memory leak in print_status() submodule--helper: free some "displaypath" in "struct update_data" submodule--helper: free rest of "displaypath" in "struct update_data" submodule--helper: fix a configure_added_submodule() leak docs: add and use include template for config/* includes grep docs: de-duplicate configuration sections send-email docs: de-duplicate configuration sections apply docs: de-duplicate configuration sections notes docs: de-duplicate and combine configuration sections difftool docs: de-duplicate configuration sections log docs: de-duplicate configuration sections docs: add CONFIGURATION sections that map to a built-in docs: add CONFIGURATION sections that fuzzy map to built-ins Øystein Walle (1): rev-parse --parseopt: detect missing opt-spec
An early preview release Git v2.38.0-rc0 is now available for testing at the usual places. It is comprised of 607 non-merge commits since v2.37.0, contributed by 75 people, 21 of which are new faces [*]. Since many contributors are travelling for Git Merge conference this week, I do not expect a lot of activities around this one. Just treat it as one of the normal updates to the tip of the 'master' branch. The real fun will begin with -rc1, where we enter feature freeze for the upcoming release, which is expected to happen mid next week. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/testing/ The following public repositories all have a copy of the 'v2.38.0-rc0' tag and the 'master' branch that the tag points at: url = https://git.kernel.org/pub/scm/git/git url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.37.0 are as follows. Welcome to the Git development community! Andrew Olsen, Anthony Delannoy, Carlos López, Celeste Liu, Cleber Rosa, David Plumpton, Eric DeCosta, Goss Geppert, Ilya K, Ingy dot Net, Jacob Stopak, Julien Rouhaud, Kilian Kilger, Lana Deere, Manuel Boni, Matthew Klein, Moritz Baumann, Pavel Rappo, Pierre Garnier, Richard Oliver, and Xavier Morel. Returning contributors who helped this release are as follows. Thanks for your continued support. Abhradeep Chakraborty, Ævar Arnfjörð Bjarmason, Arthur Milchior, brian m. carlson, Calvin Wan, Carlo Marcelo Arenas Belón, Christian Couder, Christoph Reiter, Derrick Stolee, Dimitriy Ryazantcev, Đoàn Trần Công Danh, Elijah Newren, Emily Shaffer, Eric Sunshine, Felipe Contreras, Fernando Ramos, Glen Choo, Han Xin, Hariom Verma, Jacob Keller, Jaydeep Das, Jeff King, Jiang Xin, Joey Hess, Johannes Schindelin, John Cai, Jonathan Tan, Josh Steadmon, Junio C Hamano, Justin Donnelly, Kyle Zhao, Lessley Dennington, Li Linchao, Linus Torvalds, Martin Ågren, Matheus Tavares, Matthew John Cheetham, Michael J Gruber, Øystein Walle, Philip Oakley, Philippe Blain, Phillip Wood, Randall S. Becker, Renato Botelho, René Scharfe, Shaoxuan Yuan, Siddharth Asthana, SZEDER Gábor, Tao Klerks, Taylor Blau, Teng Long, Torsten Bögershausen, Victoria Dye, and ZheNing Hu. [*] We are counting not just the authorship contribution but issue reporting, mentoring, helping and reviewing that are recorded in the commit trailers. ---------------------------------------------------------------- Git v2.38 Release Notes (draft) =============================== UI, Workflows & Features * "git remote show [-n] frotz" now pays attention to negative pathspec. * "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". * "git grep -m<max-hits>" is a way to limit the hits shown per file. * "git merge-tree" learned a new mode where it takes two commits and computes a tree that would result in the merge commit, if the histories leading to these two commits were to be merged. * "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. * Earlier, HTTP transport clients learned to tell the server side what locale they are in by sending Accept-Language HTTP header, but this was done only for some requests but not others. * Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. * Various messages that come from the pack-bitmap codepaths have been tweaked. * "git rebase -i" learns to update branches whose tip appear in the rebased range with "--update-refs" option. * "git ls-files" learns the "--format" option to tweak its output. * "git cat-file" learned an option to use the mailmap when showing commit and tag objects. * When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. * Operating modes like "--batch" of "git cat-file" command learned to take NUL-terminated input, instead of one-item-per-line. * "git rm" has become more aware of the sparse-index feature. * "git rev-list --disk-usage" learned to take an optional value "human" to show the reported value in human-readable format, like "3.40MiB". * The "diagnose" feature to create a zip archive for diagnostic material has been lifted from "scalar" and made into a feature of "git bugreport". * The namespaces used by "log --decorate" from "refs/" hierarchy by default has been tightened. * "git rev-list --ancestry-path=C A..B" is a natural extension of "git rev-list A..B"; instead of choosing a subset of A..B to those that have ancestry relationship with A, it lets a subset with ancestry relationship with C. * "scalar" now enables built-in fsmonitor on enlisted repositories, when able. * The bash prompt (in contrib/) learned to optionally indicate when the index is unmerged. * "git clone" command learned the "--bundle-uri" option to coordinate with hosting sites the use of pre-prepared bundle files. * "git range-diff" learned to honor pathspec argument if given. * "git format-patch --from=<ident>" can be told to add an in-body "From:" line even for commits that are authored by the given <ident> with "--force-in-body-from"option. * The built-in fsmonitor refuses to work on a network mounted repositories; a configuration knob for users to override this has been introduced. Performance, Internal Implementation, Development Support etc. * Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. * Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. * Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. * Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. * Further preparation to turn git-submodule.sh into a builtin continues. * Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. * Teach "make all" to build gitweb as well. * Tweak tests so that they still work when the "git init" template did not create .git/info directory. * Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused variable. * The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. * Support for libnettle as SHA256 implementation has been added. * The way "git multi-pack" uses parse-options API has been improved. * A coccinelle rule (in contrib/) to encourage use of COPY_ARRAY macro has been improved. * API tweak to make it easier to run fuzz testing on commit-graph parser. * Omit fsync-related trace2 entries when their values are all zero. * The codepath to write multi-pack index has been taught to release a large chunk of memory that holds an array of objects in the packs, as soon as it is done with the array, to reduce memory consumption. * Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. * "git fetch" client logs the partial clone filter used in the trace2 output. * The "bundle URI" design gets documented. * The common ancestor negotiation exchange during a "git fetch" session now leaves trace log. * Test portability improvements. (merge 4d1d843be7 mt/rot13-in-c later to maint). * The "subcommand" mode is introduced to parse-options API and update the command line parser of Git commands with subcommands. * The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. * The assembly version of SHA-1 implementation for PPC has been removed. * The server side that responds to "git fetch" and "git clone" request has been optimized by allowing it to send objects in its object store without recomputing and validating the object names. * Annotate function parameters that are not used (but cannot be removed for structural reasons), to prepare us to later compile with -Wunused warning turned on. * Share the text used to explain configuration variables used by "git <subcmd>" in "git help <subcmd>" with the text from "git help config". Fixes since v2.37 ----------------- * Rewrite of "git add -i" in C that appeared in Git 2.25 didn't correctly record a removed file to the index, which was fixed. * Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. * Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. * Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. * "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. * Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. * References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. * In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. * Recent update to vimdiff layout code has been made more robust against different end-user vim settings. * Plug various memory leaks, both in the main code and in test-tool commands. * Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. * The resolve-undo information in the index was not protected against GC, which has been corrected. * A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. * "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. * An earlier attempt to plug leaks placed a clean-up label to jump to at a bogus place, which as been corrected. * Variable quoting fix in the vimdiff driver of "git mergetool" * "git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. * A fix for a regression in test framework. * mkstemp() emulation on Windows has been improved. * Add missing documentation for "include" and "includeIf" features in "git config" file format, which incidentally teaches the command line completion to include them in its offerings. * Avoid "white/black-list" in documentation and code comments. * Workaround for a compiler warning against use of die() in osx-keychain (in contrib/). * Workaround for a false positive compiler warning. * "git p4" working on UTF-16 files on Windows did not implement CRLF-to-LF conversion correctly, which has been corrected. * "git p4" did not handle non-ASCII client name well, which has been corrected. * "rerere-train" script (in contrib/) used to honor commit.gpgSign while recreating the throw-away merges. * "git checkout" miscounted the paths it updated, which has been corrected. * Fix for a bug that makes write-tree to fail to write out a non-existent index as a tree, introduced in 2.37. * There was a bug in the codepath to upgrade generation information in commit-graph from v1 to v2 format, which has been corrected. * Gitweb had legacy URL shortener that is specific to the way projects hosted on kernel.org used to (but no longer) work, which has been removed. * Fix build procedure for Windows that uses CMake so that it can pick up the shell interpreter from local installation location. * Conditionally allow building Python interpreter on Windows * Fix to lstat() emulation on Windows. * Older gcc with -Wall complains about the universal zero initializer "struct s = { 0 };" idiom, which makes developers' lives inconvenient (as -Werror is enabled by DEVELOPER=YesPlease). The build procedure has been tweaked to help these compilers. * Plug memory leaks in the failure code path in the "merge-ort" merge strategy backend. * "git symbolic-ref symref non..sen..se" is now diagnosed as an error. * A follow-up fix to a fix for a regression in 2.36 around hooks. * Avoid repeatedly running getconf to ask libc version in the test suite, and instead just as it once per script. * Platform-specific code that determines if a directory is OK to use as a repository has been taught to report more details, especially on Windows. * "vimdiff3" regression fix. * "git fsck" reads mode from tree objects but canonicalizes the mode before passing it to the logic to check object sanity, which has hid broken tree objects from the checking logic. This has been corrected, but to help exiting projects with broken tree objects that they cannot fix retroactively, the severity of anomalies this code detects has been demoted to "info" for now. * Fixes to sparse index compatibility work for "reset" and "checkout" commands. * An earlier optimization discarded a tree-object buffer that is still in use, which has been corrected. (merge 1490d7d82d jk/is-promisor-object-keep-tree-in-use later to maint). * Fix deadlocks between main Git process and subprocess spawned via the pipe_command() API, that can kill "git add -p" that was reimplemented in C recently. (merge 716c1f649e jk/pipe-command-nonblock later to maint). * The sequencer machinery translated messages left in the reflog by mistake, which has been corrected. * xcalloc(), imitating calloc(), takes "number of elements of the array", and "size of a single element", in this order. A call that does not follow this ordering has been corrected. (merge c4bbd9bb8f sg/xcalloc-cocci-fix later to maint). * The preload-index codepath made copies of pathspec to give to multiple threads, which were left leaked. (merge 23578904da ad/preload-plug-memleak later to maint). * Update the version of Ubuntu used for GitHub Actions CI from 18.04 to 22.04. (merge ef46584831 ds/github-actions-use-newer-ubuntu later to maint). * The auto-stashed local changes created by "git merge --autostash" was mixed into a conflicted state left in the working tree, which has been corrected. (merge d3a9295ada en/merge-unstash-only-on-clean-merge later to maint). * Multi-pack index got corrupted when preferred pack changed from one pack to another in a certain way, which has been corrected. (merge 99e4d084ff tb/midx-with-changing-preferred-pack-fix later to maint). * The clean-up of temporary files created via mks_tempfile_dt() was racy and attempted to unlink() the leading directory when signals are involved, which has been corrected. (merge babe2e0559 rs/tempfile-cleanup-race-fix later to maint). * FreeBSD portability fix for "git maintenance" that spawns "crontab" to schedule tasks. (merge ee69e7884e bc/gc-crontab-fix later to maint). * Those who use diff-so-fancy as the diff-filter noticed a regression or two in the code that parses the diff output in the built-in version of "add -p", which has been corrected. (merge 0a101676e5 js/add-p-diff-parsing-fix later to maint). * Segfault fix-up to an earlier fix to the topic to teach "git reset" and "git checkout" work better in a sparse checkout. (merge 037f8ea6d9 vd/sparse-reset-checkout-fixes later to maint). * "git diff --no-index A B" managed its the pathnames of its two input files rather haphazardly, sometimes leaking them. The command line argument processing has been straightened out to clean it up. (merge 2b43dd0eb5 rs/diff-no-index-cleanup later to maint). * "git rev-list --verify-objects" ought to inspect the contents of objects and notice corrupted ones, but it didn't when the commit graph is in use, which has been corrected. (merge b27ccae34b jk/rev-list-verify-objects-fix later to maint). * More fixes to "add -p" (merge 64ec8efb83 js/builtin-add-p-portability-fix later to maint). * The parser in the script interface to parse-options in "git rev-parse" has been updated to diagnose a bogus input correctly. (merge f20b9c36d0 ow/rev-parse-parseopt-fix later to maint). * The code that manages list-object-filter structure, used in partial clones, leaked the instances, which has been plugged. (merge 66eede4a37 jk/plug-list-object-filter-leaks later to maint). * Fix another UI regression in the reimplemented "add -p". (merge f6f0ee247f rs/add-p-worktree-mode-prompt-fix later to maint). * "git fetch" over protocol v2 sent an incorrect ref prefix request to the server and made "git pull" with configured fetch refspec that does not cover the remote branch to merge with fail, which has been corrected. (merge 49ca2fba39 jk/proto-v2-ref-prefix-fix later to maint). * Other code cleanup, docfix, build fix, etc. (merge 77b9e85c0f vd/fix-perf-tests later to maint). (merge 0682bc43f5 jk/test-crontab-fixes later to maint). (merge b46dd1726c cc/doc-trailer-whitespace-rules later to maint). ---------------------------------------------------------------- Changes since v2.37.0 are as follows: Abhradeep Chakraborty (9): bitmap-format.txt: feed the file to asciidoc to generate html bitmap-format.txt: fix some formatting issues bitmap-format.txt: add information for trailing checksum Documentation/technical: describe bitmap lookup table extension bitmap: move `get commit positions` code to `bitmap_writer_finish` pack-bitmap-write.c: write lookup table extension pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests pack-bitmap: prepare to read lookup table extension bitmap-lookup-table: add performance tests for lookup table Anthony Delannoy (1): preload-index: fix memleak Calvin Wan (1): submodule merge: update conflict error message Carlo Marcelo Arenas Belón (2): setup: tighten ownership checks post CVE-2022-24765 cmake: support local installations of git Carlos López (1): grep: add --max-count command line option Celeste Liu (1): contrib/rerere-train: avoid useless gpg sign in training Christian Couder (1): Documentation: clarify whitespace rules for trailers Cleber Rosa (1): setup: fix function name in a BUG() message Derrick Stolee (50): branch: add branch_checked_out() helper branch: check for bisects and rebases fetch: use new branch_checked_out() and add tests branch: use branch_checked_out() when deleting refs branch: fix branch_checked_out() leaks t5510: replace 'origin' with URL more carefully vscode: improve tab size and wrapping git-rebase.txt: use back-ticks consistently pack-bitmap-write: use const for hashes midx: extract bitmap write setup midx: reduce memory pressure while writing bitmaps daemon: clarify directory arguments git-cvsserver: clarify directory list git.txt: remove redundant language t: avoid "whitelist" transport.c: avoid "whitelist" t2407: test bisect and rebase as black-boxes t2407: test branches currently using apply backend branch: consider refs under 'update-refs' rebase-interactive: update 'merge' description sequencer: define array with enum values sequencer: add update-ref command rebase: add --update-refs option rebase: update refs from 'update-ref' commands sequencer: rewrite update-refs as user edits todo list rebase: add rebase.updateRefs config option sequencer: ignore HEAD ref under --update-refs sequencer: notify user of --update-refs activity compat/win32: correct for incorrect compiler warning refs: allow "HEAD" as decoration filter t4207: modernize test t4207: test coloring of grafted decorations refs: add array of ref namespaces refs: use ref_namespaces for replace refs base log-tree: use ref_namespaces instead of if/else-if log: add default decoration filter log: add --clear-decorations option log: create log.initialDecorationSet=all maintenance: stop writing log.excludeDecoration fetch: use ref_namespaces during prefetch docs: document bundle URI standard bundle-uri: add example bundle organization remote-curl: add 'get' capability bundle-uri: create basic file-copy logic clone: add --bundle-uri option bundle-uri: add support for http(s):// and file:// clone: --bundle-uri cannot be combined with --depth t6019: modernize tests with helper clone: warn on failure to repo_init() ci: update 'static-analysis' to Ubuntu 22.04 Dimitriy Ryazantcev (1): i18n: mark message helpers prefix for translation Elijah Newren (43): merge-tree: rename merge_trees() to trivial_merge_trees() merge-tree: move logic for existing merge into new function merge-tree: add option parsing and initial shell for real merge function merge-tree: implement real merges merge-ort: split out a separate display_update_messages() function merge-tree: support including merge messages in output merge-ort: provide a merge_get_conflicted_files() helper function merge-ort: remove command-line-centric submodule message from merge-ort merge-tree: provide a list of which files have conflicts merge-tree: provide easy access to `ls-files -u` style info merge-ort: store more specific conflict information merge-ort: optionally produce machine-readable output merge-tree: allow `ls-files -u` style info to be NUL terminated merge-tree: add a --allow-unrelated-histories flag git-merge-tree.txt: add a section on potentional usage mistakes t6429: fix use of non-existent function t6423: add tests of dual directory rename plus add/add conflict merge-ort: small cleanups of check_for_directory_rename merge-ort: make a separate function for freeing struct collisions merge-ort: shuffle the computation and cleanup of potential collisions merge-ort: fix issue with dual rename and add/add conflict merge-ort-wrappers: make printed message match the one from recursive merge-resolve: abort if index does not match HEAD merge: abort if index does not match HEAD for trivial merges merge: do not abort early if one strategy fails to handle the merge merge: fix save_state() to work when there are stat-dirty files merge: make restore_state() restore staged state too merge: ensure we can actually restore pre-merge state merge: do not exit restore_state() prematurely merge-ort: remove translator lego in new "submodule conflict suggestion" merge-ort: avoid surprise with new sub_flag variable merge-ort: provide helpful submodule update message when possible merge-ort: remove code obsoleted by other changes rev-list-options.txt: fix simple typo revision: allow --ancestry-path to take an argument merge: only apply autostash when appropriate merge: cleanup confusing logic for handling successful merges merge: small code readability improvement t4301: add more interesting merge-tree testcases t64xx: convert 'test_create_repo' to 'git init' diff: have submodule_format logic avoid additional diff headers diff: fix filtering of additional headers under --remerge-diff diff: fix filtering of merge commits under --remerge-diff Eric DeCosta (1): fsmonitor: option to allow fsmonitor to run against network-mounted repos Eric Sunshine (6): t2407: fix broken &&-chains in compound statement t1092: fix buggy sparse "blame" test t: detect and signal failure within loop t4301: account for behavior differences between sed implementations t4301: fix broken &&-chains and add missing loop termination t4301: emit blank line in more idiomatic fashion Felipe Contreras (7): mergetools: vimdiff: fix comment mergetools: vimdiff: make vimdiff3 actually work mergetools: vimdiff: silence annoying messages mergetools: vimdiff: fix for diffopt mergetools: vimdiff: rework tab logic mergetools: vimdiff: fix single window layouts mergetools: vimdiff: simplify tabfirst Fernando Ramos (1): vimdiff: make layout engine more robust against user vim settings Glen Choo (16): submodule--helper: eliminate internal "--update" option submodule--helper tests: add missing "display path" coverage submodule--helper update: use display path helper submodule--helper: don't recreate recursive prefix submodule--helper: use correct display path helper submodule--helper update: use --super-prefix submodule--helper: remove display path helper Documentation/git-config.txt: add SCOPES section Documentation: define protected configuration config: learn `git_protected_config()` safe.directory: use git_protected_config() setup.c: create `safe.bareRepository` config.c: NULL check when reading protected config Documentation/git-reflog: remove unneeded \ from \{ submodule--helper: add "const" to copy of "update_data" submodule--helper: refactor "errmsg_str" to be a "struct strbuf" Goss Geppert (2): dir: traverse into repository dir: minor refactoring / clean-up Han Xin (6): unpack-objects: low memory footprint for get_data() in dry_run mode object-file.c: refactor write_loose_object() to several steps object-file.c: add "stream_loose_object()" to handle large object unpack-objects: use stream_loose_object() to unpack large objects commit-graph.c: no lazy fetch in lookup_commit_in_graph() t5330: remove run_with_limited_processses() Jacob Keller (1): remote: handle negative refspecs in git remote show Jacob Stopak (1): Documentation: fix various repeat word typos Jaydeep Das (1): gpg-interface: add function for converting trust level to string Jeff King (59): is_promisor_object(): walk promisor packs in pack-order fetch: stop passing around unused worktrees variable branch: drop unused worktrees variable revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis clone: drop extra newline from warning message clone: propagate empty remote HEAD even with other branches clone: use remote branch if it matches default HEAD clone: move unborn head creation to update_head() ref-filter: disable save_commit_buffer while traversing diff-files: move misplaced cleanup label write_midx_bitmap(): drop unused refs_snapshot parameter config.mak.dev: squelch -Wno-missing-braces for older gcc tree-walk: add a mechanism for getting non-canonicalized modes fsck: actually detect bad file modes in trees fsck: downgrade tree badFilemode to "info" is_promisor_object(): fix use-after-free of tree buffer compat: add function to enable nonblocking pipes git-compat-util: make MAX_IO_SIZE define globally available pipe_command(): avoid xwrite() for writing to pipe pipe_command(): handle ENOSPC when writing to a pipe pipe_command(): mark stdin descriptor as non-blocking git-compat-util: add UNUSED macro refs: mark unused each_ref_fn parameters refs: mark unused reflog callback parameters refs: mark unused virtual method parameters transport: mark bundle transport_options as unused streaming: mark unused virtual method parameters config: mark unused callback parameters hashmap: mark unused callback parameters mark unused read_tree_recursive() callback parameters run-command: mark unused async callback parameters is_path_owned_by_current_uid(): mark "report" parameter as unused xdiff: drop unused mmfile parameters from xdl_do_histogram_diff() log-tree: drop unused commit param in remerge_diff() match_pathname(): drop unused "flags" parameter verify_one_sparse(): drop unused parameters reftable: drop unused parameter from reader_seek_linear() reflog: assert PARSE_OPT_NONEG in parse-options callbacks xdiff: drop unused mmfile parameters from xdl_do_patience_diff() pass subcommand "prefix" arguments to parse_options() maintenance: add parse-options boilerplate for subcommands remote: run "remote rm" argv through parse_options() pack-bitmap-write: drop unused pack_idx_entry parameters tempfile: drop active flag tempfile: update comment describing state transitions test-crontab: minor memory and error handling fixes lookup_commit_in_graph(): use prepare_commit_graph() to check for graph rev-list: disable commit graph with --verify-objects parse_object(): allow skipping hash check upload-pack: skip parse-object re-hashing of "want" objects parse_object(): check commit-graph when skip_hash set t1060: check partial clone of misnamed blob list_objects_filter_copy(): deep-copy sparse_oid_name field transport: deep-copy object-filter struct for fetch-pack transport: free filter options in disconnect_git() list_objects_filter_options: plug leak of filter_spec strings prepare_repo_settings(): plug leak of config values fetch: stop checking for NULL transport->remote in do_fetch() fetch: add branch.*.merge to default ref-prefix extension Johannes Schindelin (36): merge-ort: store messages in a list, not in a single strbuf merge-ort: make `path_messages` a strmap to a string_list Git 2.30.5 Git 2.31.4 Git 2.32.3 Git 2.33.4 Git 2.34.4 Git 2.35.4 Git 2.36.2 add --interactive: allow `update` to stage deleted files tests: fix incorrect --write-junit-xml code mergetool(vimdiff): allow paths to contain spaces again shortlog: use a stable sort t5351: avoid relying on `core.fsyncMethod = batch` to be supported t5351: avoid using `test_cmp` for binary data windows: include the Python bits when building Git for Windows mingw: remove unneeded `NO_GETTEXT` directive mingw: remove unneeded `NO_CURL` directive lstat(mingw): correctly detect ENOTDIR scenarios merge-ort: clean up after failed merge merge-ort: do leave trace2 region even if checkout fails setup: fix some formatting setup: prepare for more detailed "dubious ownership" messages mingw: provide details about unsafe directories' ownership mingw: be more informative when ownership check fails on FAT32 mingw: handle a file owned by the Administrators group correctly scalar unregister: stop FSMonitor daemon range-diff: reorder argument handling range-diff: consistently validate the arguments range-diff: optionally accept pathspecs add -p: avoid ambiguous signed/unsigned comparison t3701: test the built-in `add -i` regardless of NO_PERL t6132(NO_PERL): do not run the scripted `add -p` add -p: detect more mismatches between plain vs colored diffs add -p: gracefully handle unparseable hunk headers in colored diffs add -p: ignore dirty submodules Jonathan Tan (1): fetch-pack: write effective filter to trace2 Josh Steadmon (1): fetch-pack: add tracing for negotiation rounds Julien Rouhaud (1): gitweb: remove title shortening heuristics Junio C Hamano (40): revision: mark blobs needed for resolve-undo as reachable A regression fix for 2.37 Git 2.37.1 builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() The first batch after Git 2.37 fsck: do not dereference NULL while checking resolve-undo data The second batch The third batch The fourth batch The fifth batch builtin/remote.c: use the right kind of STRING_LIST_INIT The sixth batch The seventh batch Downmerge a handful of fixes for 2.37.x maintenance track The eighth batch The ninth batch doc: consolidate --rerere-autoupdate description doc: clarify rerere-autoupdate Downmerge a bit more for 2.37.x The tenth batch The eleventh batch Git 2.37.2 The twelfth batch The thirteenth batch The fourteenth batch t5329: notice a failure within a loop The fifteenth batch A handful more topics from the 'master' front for 2.37.3 pretty: separate out the logic to decide the use of in-body from format-patch: allow forcing the use of in-body From: header format-patch: learn format.forceInBodyFrom configuration variable The sixteenth batch Git 2.37.3 The seventeenth batch The eighteenth batch The nineteenth batch The twentieth batch Merge a handful of topics from the 'master' front Prepare for 2.38-rc0 Git 2.38-rc0 Justin Donnelly (1): git-prompt: show presence of unresolved conflicts at command prompt Kilian Kilger (2): git-p4: fix bug with encoding of p4 client name git-p4: refactoring of p4CmdList() Kyle Zhao (1): send-pack.c: add config push.useBitmaps Lessley Dennington (1): osx-keychain: fix compiler warning Li Linchao (3): ls-files: update test style remote-curl: send Accept-Language header to server rev-list: support human-readable output for `--disk-usage` Linus Torvalds (1): symbolic-ref: refuse to set syntactically invalid target Manuel Boni (1): config.txt: document include, includeIf Martin Ågren (3): config/core.txt: fix minor issues for `core.sparseCheckoutCone` t4200: drop irrelevant code read-cache: make `do_read_index()` always set up `istate->repo` Matheus Tavares (7): checkout: document bug where delayed checkout counts entries twice checkout: show bug about failed entries being included in final report checkout: fix two bugs on the final count of updated entries pkt-line.h: move comment closer to the associated code t0021: avoid grepping for a Perl-specific string at filter output t0021: implementation the rot13-filter.pl script in C tests: use the new C rot13-filter helper to avoid PERL prereq Matthew John Cheetham (1): scalar: enable built-in FSMonitor on `register` Michael J Gruber (3): sequencer: do not translate reflog messages sequencer: do not translate parameters to error_resolve_conflict() sequencer: do not translate command names Moritz Baumann (3): git-p4: fix CR LF handling for utf16 files git-p4: fix typo in P4Submit.applyCommit() git-p4: fix error handling in P4Unshelve.renameBranch() Philip Oakley (1): doc add: renormalize is not idempotent for CRCRLF Philippe Blain (3): diff-format.txt: dst can be 0* SHA-1 when path is deleted, too diff-format.txt: correct misleading wording diff-index.txt: update raw output format in examples Phillip Wood (5): xdiff: introduce XDL_ALLOC_ARRAY() xdiff: introduce xdl_calloc xdiff: introduce XDL_CALLOC_ARRAY() xdiff: introduce XDL_ALLOC_GROW() tests: cache glibc version check René Scharfe (28): archive: update format documentation archive: rename archiver data field to filter_command archive-tar: factor out write_block() archive-tar: add internal gzip implementation archive-tar: use OS_CODE 3 (Unix) for internal gzip archive-tar: use internal gzip by default combine-diff: abort if --ignore-matching-lines is given combine-diff: abort if --output is given cocci: avoid normalization rules for memcpy mingw: avoid mktemp() in mkstemp() implementation mergesort: unify ranks loops mergesort: tighten merge loop mergesort: add macros for typed sort of linked lists test-mergesort: use DEFINE_LIST_SORT_DEBUG test-mergesort: use DEFINE_LIST_SORT blame: use DEFINE_LIST_SORT commit: use DEFINE_LIST_SORT fetch-pack: use DEFINE_LIST_SORT packfile: use DEFINE_LIST_SORT mergesort: remove llist_mergesort() nonblock: support Windows tempfile: avoid directory cleanup race test-mergesort: read sort input all at once test-mergesort: use mem_pool for sort input diff-no-index: release strbuf on queue error diff-no-index: release prefixed filenames diff-no-index: simplify argv index calculation add -p: fix worktree patch mode prompts Richard Oliver (1): mktree: do not check type of remote objects SZEDER Gábor (29): Makefile: build 'gitweb' in the default target multi-pack-index: simplify handling of unknown --options index-format.txt: remove outdated list of supported extensions git.c: update NO_PARSEOPT markings t3301-notes.sh: check that default operation mode doesn't take arguments t5505-remote.sh: check the behavior without a subcommand t0040-parse-options: test parse_options() with various 'parse_opt_flags' api-parse-options.txt: fix description of OPT_CMDMODE parse-options: PARSE_OPT_KEEP_UNKNOWN only applies to --options parse-options: clarify the limitations of PARSE_OPT_NODASH parse-options: drop leading space from '--git-completion-helper' output parse-options: add support for parsing subcommands builtin/bundle.c: let parse-options parse subcommands builtin/commit-graph.c: let parse-options parse subcommands builtin/gc.c: let parse-options parse 'git maintenance's subcommands builtin/hook.c: let parse-options parse subcommands builtin/multi-pack-index.c: let parse-options parse subcommands builtin/notes.c: let parse-options parse subcommands builtin/reflog.c: let parse-options parse subcommands builtin/remote.c: let parse-options parse subcommands builtin/sparse-checkout.c: let parse-options parse subcommands builtin/stash.c: let parse-options parse subcommands builtin/worktree.c: let parse-options parse subcommands promisor-remote: fix xcalloc() argument order t0040-parse-options: remove leftover debugging test-parse-options.c: don't use for loop initial declaration test-parse-options.c: fix style of comparison with zero notes: simplify default operation mode arguments check notes, remote: show unknown subcommands between `' Shaoxuan Yuan (12): t7002: add tests for moving out-of-cone file/directory t1092: mv directory from out-of-cone to in-cone mv: update sparsity after moving from out-of-cone to in-cone mv: decouple if/else-if checks using goto mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit mv: check if <destination> exists in index to handle overwriting mv: use flags mode for update_mode mv: add check_dir_in_index() and solve general dir check issue t1092: add tests for `git-rm` pathspec.h: move pathspec_needs_expanded_index() from reset.c to here rm: expand the index only when necessary rm: integrate with sparse-index Siddharth Asthana (4): revision: improve commit_rewrite_person() ident: move commit_rewrite_person() to ident.c ident: rename commit_rewrite_person() to apply_mailmap_to_header() cat-file: add mailmap support Tao Klerks (1): rev-parse: documentation adjustment - mention remote tracking with @{u} Taylor Blau (14): pack-objects.h: remove outdated pahole results commit-graph: pass repo_settings instead of repository t5318: demonstrate commit-graph generation v2 corruption commit-graph: introduce `repo_find_commit_pos_in_graph()` commit-graph: fix corrupt upgrade from generation v1 to v2 t1006: extract --batch-command inputs to variables builtin/cat-file.c: support NUL-delimited input with `-z` t5326: demonstrate potential bitmap corruption t/lib-bitmap.sh: avoid silencing stderr midx.c: extract `struct midx_fanout` midx.c: extract `midx_fanout_add_midx_fanout()` midx.c: extract `midx_fanout_add_pack_fanout()` midx.c: include preferred pack correctly with existing MIDX midx.c: avoid adding preferred objects twice Teng Long (8): pack-bitmap.c: fix formatting of error messages pack-bitmap.c: mark more strings for translations pack-bitmap.c: rename "idx_name" to "bitmap_name" pack-bitmap.c: do not ignore error when opening a bitmap file pack-bitmap.c: using error() instead of silently returning -1 pack-bitmap.c: continue looping when first MIDX bitmap is found api-trace2.txt: print config key-value pair tr2: shows scope unconditionally in addition to key-value pair Victoria Dye (26): scalar: reword command documentation to clarify purpose scalar: convert README.md into a technical design doc checkout: fix nested sparse directory diff in sparse index oneway_diff: handle removed sparse directories cache.h: create 'index_name_pos_sparse()' unpack-trees: unpack new trees as sparse directories scalar-diagnose: use "$GIT_UNZIP" in test scalar-diagnose: avoid 32-bit overflow of size_t scalar-diagnose: add directory to archiver more gently scalar-diagnose: move 'get_disk_info()' to 'compat/' scalar-diagnose: move functionality to common location diagnose.c: add option to configure archive contents builtin/diagnose.c: create 'git diagnose' builtin builtin/diagnose.c: add '--mode' option builtin/bugreport.c: create '--diagnose' option scalar-diagnose: use 'git diagnose --mode=all' scalar: update technical doc roadmap scalar: constrain enlistment search scalar-unregister: handle error codes greater than 0 scalar-[un]register: clearly indicate source of error scalar-delete: do not 'die()' in 'delete_enlistment()' scalar: move config setting logic into its own function scalar: update technical doc roadmap with FSMonitor support p0004: fix prereq declaration p0006: fix 'read-tree' argument ordering unpack-trees: fix sparse directory recursion check ZheNing Hu (1): ls-files: introduce "--format" option brian m. carlson (2): sha256: add support for Nettle gc: use temporary file for editing crontab Ævar Arnfjörð Bjarmason (153): t0008: don't rely on default ".git/info/exclude" tests: don't depend on template-created .git/branches tests: don't assume a .git/info for .git/info/grafts tests: don't assume a .git/info for .git/info/attributes tests: don't assume a .git/info for .git/info/refs tests: don't assume a .git/info for .git/info/exclude tests: don't assume a .git/info for .git/info/sparse-checkout object-file.c: factor out deflate part of write_loose_object() core doc: modernize core.bigFileThreshold documentation git-submodule.sh: remove unused sanitize_submodule_env() git-submodule.sh: remove unused $prefix variable git-submodule.sh: make the "$cached" variable a boolean git-submodule.sh: remove unused top-level "--branch" argument submodule--helper: have --require-init imply --init submodule update: remove "-v" option submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" submodule--helper: report "submodule" as our name in some "-h" output submodule--helper: understand --checkout, --merge and --rebase synonyms git-submodule.sh: use "$quiet", not "$GIT_QUIET" git-sh-setup.sh: remove "say" function, change last users gitweb/Makefile: define all .PHONY prerequisites inline gitweb/Makefile: add a $(GITWEB_ALL) variable gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars gitweb/Makefile: prepare to merge into top-level Makefile gitweb: remove "test" and "test-installed" targets gitweb/Makefile: include in top-level Makefile gitweb/Makefile: add a "NO_GITWEB" parameter tests: add missing double quotes to included library paths test-lib.sh: fix prepend_var() quoting issue config tests: fix harmless but broken "rm -r" cleanup submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags check-ref-format: fix trivial memory leak clone: fix memory leak in wanted_peer_refs() submodule.c: free() memory from xgetcwd() revert: free "struct replay_opts" members cat-file: fix a memory leak in --batch-command mode merge-file: refactor for subsequent memory leak fix merge-file: fix memory leaks on error path checkout: avoid "struct unpack_trees_options" leak gc: fix a memory leak cat-file: fix a common "struct object_context" memory leak pull: fix a "struct oid_array" memory leak test-tool test-hash: fix a memory leak test-tool path-utils: fix a memory leak test-tool {dump,scrap}-cache-tree: fix memory leaks test-tool urlmatch-normalization: fix a memory leak test-tool regex: call regfree(), fix memory leaks test-tool json-writer: fix memory leaks test-tool bloom: fix memory leaks test-tool ref-store: fix a memory leak test-tool delta: fix a memory leak Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Makefile & .gitignore: ignore & clean "git.res", not "*.res" cocci: add a "coccicheck-test" target and test *.cocci rules cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" cocci: add and apply a rule to find "unused" strbufs cocci: generalize "unused" rule to cover more than "strbuf" trace2: only include "fsync" events if we git_fsync() test-lib: use $1, not $@ in test_known_broken_{ok,failure}_ test-lib: don't set GIT_EXIT_OK before calling test_atexit_handler test-lib: fix GIT_EXIT_OK logic errors, use BAIL_OUT test-lib: add a --invert-exit-code switch t/README: reword the "GIT_TEST_PASSING_SANITIZE_LEAK" description test-lib: add a SANITIZE=leak logging mode t/Makefile: don't remove test-results in "clean-except-prove-cache" tests: move copy/pasted PERL + Test::More checks to a lib-perl.sh test-lib: simplify by removing test_external test-lib: add a GIT_TEST_PASSING_SANITIZE_LEAK=check mode test-lib: have the "check" mode for SANITIZE=leak consider leak logs leak tests: don't skip some tests under SANITIZE=leak leak tests: mark passing SANITIZE=leak tests as leak-free upload-pack: fix a memory leak in create_pack_file() CI: use "GIT_TEST_SANITIZE_LEAK_LOG=true" in linux-leaks bisect.c: add missing "goto" for release_revisions() test-fast-rebase helper: use release_revisions() (again) log: fix a memory leak in "git show <revision>..." log: refactor "rev.pending" code in cmd_show() bisect.c: partially fix bisect_rev_setup() memory leak revisions API: don't leak memory on argv elements that need free()-ing help.c: refactor drop_prefix() to use a "switch" statement" help.c: remove common category behavior from drop_prefix() behavior git help doc: use "<doc>" instead of "<guide>" git docs: add a category for user-facing file, repo and command UX git docs: add a category for file formats, protocols and interfaces docs: move commit-graph format docs to man section 5 docs: move protocol-related docs to man section 5 docs: move index format docs to man section 5 docs: move signature docs to man section 5 docs: move pack format docs to man section 5 docs: move cruft pack docs to gitformat-pack docs: move http-protocol docs to man section 5 hook API: don't segfault on strbuf_addf() to NULL "out" Makefile + hash.h: remove PPC_SHA1 implementation Makefile: use $(OBJECTS) instead of $(C_OBJ) git-compat-util.h: use "UNUSED", not "UNUSED(var)" git-compat-util.h: use "deprecated" for UNUSED variables submodule tests: test usage behavior submodule tests: test for "add <repository> <abs-path>" submodule--helper: remove unused "name" helper submodule--helper: remove unused "list" helper test-tool submodule-config: remove unused "--url" handling submodule--helper: move "is-active" to a test-tool submodule--helper: move "check-name" to a test-tool submodule--helper: move "resolve-relative-url-test" to a test-tool submodule--helper style: don't separate declared variables with \n\n submodule--helper style: add \n\n after variable declarations submodule--helper: replace memset() with { 0 }-initialization submodule--helper: use xstrfmt() in clone_submodule() submodule--helper: move "sb" in clone_submodule() to its own scope submodule--helper: add "const" to passed "module_clone_data" submodule--helper: add "const" to passed "struct update_data" submodule--helper: don't redundantly check "else if (res)" submodule--helper: rename "int res" to "int ret" submodule--helper: return "ret", not "1" from update_submodule() submodule--helper: add missing braces to "else" arm submodule--helper: don't call submodule_strategy_to_string() in BUG() submodule API: don't handle SM_..{UNSPECIFIED,COMMAND} in to_string() submodule--helper: use "code" in run_update_command() submodule--helper: don't exit() on failure, return submodule--helper: libify determine_submodule_update_strategy() submodule--helper: libify "must_die_on_failure" code paths submodule--helper update: don't override 'checkout' exit code submodule--helper: libify "must_die_on_failure" code paths (for die) submodule--helper: check repo{_submodule,}_init() return values submodule--helper: libify more "die" paths for module_update() submodule--helper: libify even more "die" paths for module_update() submodule--helper: fix bad config API usage submodule--helper: fix a leak in "clone_submodule" submodule--helper: fix trivial get_default_remote_submodule() leak submodule--helper: fix most "struct pathspec" memory leaks submodule--helper: "struct pathspec" memory leak in module_update() submodule--helper: don't leak {run,capture}_command() cp.dir argument submodule--helper: add and use *_release() functions submodule--helper: fix "errmsg_str" memory leak submodule--helper: fix "sm_path" and other "module_cb_list" leaks submodule--helper: fix a leak with repo_clear() submodule--helper: fix a memory leak in get_default_remote_submodule() submodule--helper: fix "reference" leak submodule--helper: fix obscure leak in module_add() submodule--helper: fix a leak in module_add() submodule--helper: fix a memory leak in print_status() submodule--helper: free some "displaypath" in "struct update_data" submodule--helper: free rest of "displaypath" in "struct update_data" submodule--helper: fix a configure_added_submodule() leak docs: add and use include template for config/* includes grep docs: de-duplicate configuration sections send-email docs: de-duplicate configuration sections apply docs: de-duplicate configuration sections notes docs: de-duplicate and combine configuration sections difftool docs: de-duplicate configuration sections log docs: de-duplicate configuration sections docs: add CONFIGURATION sections that map to a built-in docs: add CONFIGURATION sections that fuzzy map to built-ins Øystein Walle (1): rev-parse --parseopt: detect missing opt-spec
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [Graduated to 'master'] * ab/test-quoting-fix (2022-06-30) 3 commits (merged to 'next' on 2022-07-06 at 0aa78fd9db) + config tests: fix harmless but broken "rm -r" cleanup + test-lib.sh: fix prepend_var() quoting issue + tests: add missing double quotes to included library paths Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. source: <cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com> * cl/grep-max-count (2022-06-22) 1 commit (merged to 'next' on 2022-07-08 at 646199ab4c) + grep: add --max-count command line option "git grep -m<max-hits>" is a way to limit the hits shown per file. source: <pull.1278.v4.git.git.1655927252899.gitgitgadget@gmail.com> * dr/i18n-die-warn-error-usage (2022-06-21) 1 commit (merged to 'next' on 2022-07-08 at 6f639750a1) + i18n: mark message helpers prefix for translation Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com> * ds/git-rebase-doc-markup (2022-06-30) 1 commit (merged to 'next' on 2022-07-08 at 24a0b80b71) + git-rebase.txt: use back-ticks consistently References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. source: <pull.1270.v3.git.1656508868146.gitgitgadget@gmail.com> * ds/t5510-brokequote (2022-06-21) 1 commit (merged to 'next' on 2022-07-06 at 2776bed385) + t5510: replace 'origin' with URL more carefully Test fix. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * en/t6429-test-must-be-empty-fix (2022-06-30) 1 commit (merged to 'next' on 2022-07-06 at 627c51773c) + t6429: fix use of non-existent function A test fix. source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit (merged to 'next' on 2022-07-08 at d4e49ad22a) + remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspec. source: <20220617002036.1577-2-jacob.keller@gmail.com> * ll/ls-files-tests-update (2022-07-06) 1 commit (merged to 'next' on 2022-07-06 at 444d1eabd0) + ls-files: update test style Test update. source: <pull.1269.v6.git.1656863349926.gitgitgadget@gmail.com> * ro/mktree-allow-missing-fix (2022-06-21) 1 commit (merged to 'next' on 2022-07-08 at 599ed6fb84) + mktree: do not check type of remote objects "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com> * tb/pack-objects-remove-pahole-comment (2022-06-28) 1 commit (merged to 'next' on 2022-07-06 at d7494fbdef) + pack-objects.h: remove outdated pahole results Comment fix. source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com> * tk/rev-parse-doc-clarify-at-u (2022-06-23) 1 commit (merged to 'next' on 2022-07-08 at 1075452f32) + rev-parse: documentation adjustment - mention remote tracking with @{u} Doc update. source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit (merged to 'next' on 2022-07-08 at 8aa1f94fad) + send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> -------------------------------------------------- [New Topics] * jk/diff-files-cleanup-fix (2022-07-12) 1 commit (merged to 'next' on 2022-07-13 at 9db5235d01) + diff-files: move misplaced cleanup label An earlier attempt to plug leaks placed a clean-up label to jump to at a bogus place, which as been corrected. Will merge to 'master'. source: <Ys0c0ePxPOqZ/5ck@coredump.intra.peff.net> * cw/submodule-merge-messages (2022-07-13) 1 commit - submodule merge: update conflict error message Update the message given when "git merge" sees conflicts at a path with a submodule while merging a superproject. Needs review. source: <20220712231935.2979727-1-calvinwan@google.com> * ds/doc-allowlist (2022-07-13) 3 commits - *: use allowlist and denylist - t/*: use allowlist - Documentation: use allowlist and denylist Mechanical replacement of s/whitelist/allowlist/. Expecting a reroll. source: <pull.1274.git.1657718450.gitgitgadget@gmail.com> * js/vimdiff-quotepath-fix (2022-07-13) 2 commits - SQUASH??? - mergetool(vimdiff): allow paths to contain spaces again Variable quoting fix in the vimdiff driver of "git mergetool" Expecting a reroll. cf. <xmqqa69cabhq.fsf@gitster.g> source: <pull.1287.git.1657726969774.gitgitgadget@gmail.com> * mt/checkout-count-fix (2022-07-13) 3 commits - checkout: fix two bugs on the final count of updated entries - checkout: show bug about failed entries being included in final report - checkout: document bug where delayed checkout counts entries twice "git checkout" miscounted the paths it updated, which has been corrected. Will merge to 'next'? source: <cover.1657685948.git.matheus.bernardino@usp.br> * tb/commit-graph-genv2-upgrade-fix (2022-07-13) 3 commits - commit-graph: fix corrupt upgrade from generation v1 to v2 - commit-graph: introduce `repo_find_commit_pos_in_graph()` - t5318: demonstrate commit-graph generation v2 corruption There was a bug in the codepath to upgrade generation information in commit-graph from v1 to v2 format, which has been corrected. Needs review. source: <cover.1657667404.git.me@ttaylorr.com> * js/safe-directory-plus (2022-07-13) 3 commits - mingw: be more informative when ownership check fails on FAT32 - mingw: handle a file owned by the Administrators group correctly - Allow debugging unsafe directories' ownership Needs review. source: <pull.1286.git.1657700238.gitgitgadget@gmail.com> -------------------------------------------------- [Stalled] * ll/curl-accept-language (2022-07-11) 1 commit (merged to 'next' on 2022-07-13 at 076aba7421) + remote-curl: send Accept-Language header to server Earlier, HTTP transport clients learned to tell the server side what locale they are in by sending Accept-Language HTTP header, but this was done only for some requests but not others. Will merge to 'master'. source: <pull.1251.v4.git.1657519134336.gitgitgadget@gmail.com> * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * po/doc-add-renormalize (2022-07-09) 1 commit - doc add: renormalize is not idempotent for CRCRLF Documentation for "git add --renormalize" has been improved. Expecting a reroll. cf. <dfe0c1ab-33f8-f13e-71ce-1829bb0d2d7f@iee.email> source: <d3b8ed97a105ea1d7e656c964b7eee378e11ede6.1657385781.git.gitgitgadget@gmail.com> * po/glossary-around-traversal (2022-07-09) 3 commits - glossary: add reachability bitmap description - glossary: add commit graph description - glossary: add Object DataBase (ODB) abbreviation The glossary entries for "commit-graph file" and "reachability bitmap" have been added. Expecting a reroll. cf. <dfe0c1ab-33f8-f13e-71ce-1829bb0d2d7f@iee.email> source: <pull.1282.git.1657385781.gitgitgadget@gmail.com> * rs/cocci-array-copy (2022-07-10) 1 commit (merged to 'next' on 2022-07-13 at f21dec0f71) + cocci: avoid normalization rules for memcpy A coccinelle rule (in contrib/) to encourage use of COPY_ARRAY macro has been improved. Will merge to 'master'. source: <ded153d4-4aea-d4da-11cb-ec66d181e4c9@web.de> * sg/multi-pack-index-parse-options-fix (2022-07-10) 1 commit (merged to 'next' on 2022-07-11 at 1e14685680) + multi-pack-index: simplify handling of unknown --options The way "git multi-pack" uses parse-options API has been improved. Will merge to 'master'. source: <20220710151645.GA2038@szeder.dev> * jk/ref-filter-discard-commit-buffer (2022-07-11) 1 commit (merged to 'next' on 2022-07-13 at d1521724db) + ref-filter: disable save_commit_buffer while traversing Will merge to 'master'. source: <Ysw4JtoHW1vWmqhz@coredump.intra.peff.net> * ab/cocci-unused (2022-07-06) 6 commits (merged to 'next' on 2022-07-11 at 7fa60d2a5b) + cocci: generalize "unused" rule to cover more than "strbuf" + cocci: add and apply a rule to find "unused" strbufs + cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" + cocci: add a "coccicheck-test" target and test *.cocci rules + Makefile & .gitignore: ignore & clean "git.res", not "*.res" + Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused varilable. Will merge to 'master'. source: <cover-v4-0.6-00000000000-20220705T134033Z-avarab@gmail.com> * jk/clone-unborn-confusion (2022-07-11) 4 commits (merged to 'next' on 2022-07-13 at a7ae8cb4b5) + clone: move unborn head creation to update_head() + clone: use remote branch if it matches default HEAD + clone: propagate empty remote HEAD even with other branches + clone: drop extra newline from warning message "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. Will merge to 'master'. source: <YsdyLS4UFzj0j/wB@coredump.intra.peff.net> * ac/bitmap-lookup-table (2022-07-06) 6 commits - p5310-pack-bitmaps.sh: remove pack.writeReverseIndex - bitmap-lookup-table: add performance tests for lookup table - pack-bitmap: prepare to read lookup table extension - pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests - pack-bitmap-write.c: write lookup table extension - Documentation/technical: describe bitmap lookup table extension The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. Waiting for a more thorough review. cf. <Ys4DjW9JjQFx5Bhb@nand.local> source: <pull.1266.v3.git.1656924376.gitgitgadget@gmail.com> * bc/nettle-sha256 (2022-07-10) 1 commit (merged to 'next' on 2022-07-11 at cf9595d8ca) + sha256: add support for Nettle Support for libnettle as SHA256 implementation has been added. Will merge to 'master'. source: <20220710132907.1499365-1-sandals@crustytoothpaste.net> * jc/builtin-mv-move-array (2022-07-09) 1 commit (merged to 'next' on 2022-07-09 at 0d3b3f62e5) + builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. Will merge to 'master'. source: <xmqq4jzpu4xp.fsf_-_@gitster.g> * jd/gpg-interface-trust-level-string (2022-07-10) 1 commit (merged to 'next' on 2022-07-11 at 7b3cca73a8) + gpg-interface: add function for converting trust level to string The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. Will merge to 'master'. source: <pull.1281.v4.git.1657515650587.gitgitgadget@gmail.com> * kk/p4-client-name-encoding-fix (2022-07-08) 1 commit (merged to 'next' on 2022-07-11 at 9c18616f76) + git-p4: fix bug with encoding of p4 client name "git p4" did not handle non-ASCII client name well, which has been corrected. Will merge to 'master'. source: <pull.1285.git.git.1657267260405.gitgitgadget@gmail.com> * sa/cat-file-mailmap (2022-07-13) 4 commits - cat-file: add mailmap support - ident: rename commit_rewrite_person() to apply_mailmap_to_header() - ident: move commit_rewrite_person() to ident.c - revision: improve commit_rewrite_person() "git cat-file" learned an option to use the mailmap when showing commit and tag objects. Will merge to 'next'? source: <20220712160634.213956-1-siddharthasthana31@gmail.com> * fr/vimdiff-layout-fix (2022-07-08) 1 commit (merged to 'next' on 2022-07-09 at d8461bd236) + vimdiff: make layout engine more robust against user vim settings Recent update to vimdiff layout code has been made more robust against different end-user vim settings. Will merge to 'master'. source: <20220708181024.45839-1-greenfoo@u92.eu> * ds/rebase-update-ref (2022-07-12) 13 commits - sequencer: notify user of --update-refs activity - sequencer: ignore HEAD ref under --update-refs - rebase: add rebase.updateRefs config option - sequencer: rewrite update-refs as user edits todo list - rebase: update refs from 'update-ref' commands - rebase: add --update-refs option - sequencer: add update-ref command - sequencer: define array with enum values - rebase-interactive: update 'merge' description - branch: consider refs under 'update-refs' - t2407: test branches currently using apply backend - t2407: test bisect and rebase as black-boxes - Merge branch 'ds/branch-checked-out' into ds/rebase-update-ref "git rebase -i" learns to update branches whose tip appear in the rebased range. Expecting a reroll. cf. <15631ea2-6722-fd24-c8a6-0cee638b0602@github.com> source: <pull.1247.v4.git.1657631225.gitgitgadget@gmail.com> * ab/leakfix (2022-07-01) 11 commits (merged to 'next' on 2022-07-11 at 0b107fffcf) + pull: fix a "struct oid_array" memory leak + cat-file: fix a common "struct object_context" memory leak + gc: fix a memory leak + checkout: avoid "struct unpack_trees_options" leak + merge-file: fix memory leaks on error path + merge-file: refactor for subsequent memory leak fix + cat-file: fix a memory leak in --batch-command mode + revert: free "struct replay_opts" members + submodule.c: free() memory from xgetcwd() + clone: fix memory leak in wanted_peer_refs() + check-ref-format: fix trivial memory leak Plug various memory leaks. Will merge to 'master'. source: <cover-v2-00.11-00000000000-20220701T104017Z-avarab@gmail.com> * ab/test-tool-leakfix (2022-07-01) 9 commits (merged to 'next' on 2022-07-11 at db7a724694) + test-tool delta: fix a memory leak + test-tool ref-store: fix a memory leak + test-tool bloom: fix memory leaks + test-tool json-writer: fix memory leaks + test-tool regex: call regfree(), fix memory leaks + test-tool urlmatch-normalization: fix a memory leak + test-tool {dump,scrap}-cache-tree: fix memory leaks + test-tool path-utils: fix a memory leak + test-tool test-hash: fix a memory leak Plug various memory leaks in test-tool commands. Will merge to 'master'. source: <cover-v2-0.9-00000000000-20220701T103503Z-avarab@gmail.com> * gc/submodule-use-super-prefix (2022-06-30) 8 commits (merged to 'next' on 2022-07-11 at 0d9cf172f9) + submodule--helper: remove display path helper + submodule--helper update: use --super-prefix + submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags + submodule--helper: use correct display path helper + submodule--helper: don't recreate recursive prefix + submodule--helper update: use display path helper + submodule--helper tests: add missing "display path" coverage + Merge branch 'ab/submodule-cleanup' into gc/submodule-use-super-prefix (this branch uses ab/submodule-cleanup.) Another step to rewrite more parts of "git submodule" in C. Will merge to 'master'. source: <20220701021157.88858-1-chooglen@google.com> * hx/lookup-commit-in-graph-fix (2022-07-12) 2 commits (merged to 'next' on 2022-07-13 at 4489696814) + t5330: remove run_with_limited_processses() (merged to 'next' on 2022-07-08 at cef32db0b6) + commit-graph.c: no lazy fetch in lookup_commit_in_graph() A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. Will merge to 'master'. source: <cover.1656593279.git.hanxin.hx@bytedance.com> * pw/xdiff-alloc (2022-07-08) 4 commits - xdiff: introduce XDL_ALLOC_GROW() - xdiff: introduce XDL_CALLOC_ARRAY() - xdiff: introduce xdl_calloc - xdiff: introduce XDL_ALLOC_ARRAY() Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. Will merge to 'next'? source: <pull.1272.v2.git.1657297519.gitgitgadget@gmail.com> * sy/mv-out-of-cone (2022-07-01) 8 commits (merged to 'next' on 2022-07-08 at 654970fdb7) + mv: add check_dir_in_index() and solve general dir check issue + mv: use flags mode for update_mode + mv: check if <destination> exists in index to handle overwriting + mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit + mv: decouple if/else-if checks using goto + mv: update sparsity after moving from out-of-cone to in-cone + t1092: mv directory from out-of-cone to in-cone + t7002: add tests for moving out-of-cone file/directory "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. Will merge to 'master'. source: <20220630023737.473690-1-shaoxuan.yuan02@gmail.com> * ab/squelch-empty-fsync-traces (2022-06-30) 1 commit . trace2: don't include "fsync" events in all trace2 logs Omit fsync-related trace2 entries when their values are all zero. Breaks tests in hx/unpack-streaming with an interesting interaction. source: <patch-v2-1.1-a1fc37de947-20220630T084607Z-avarab@gmail.com> * en/merge-tree (2022-06-22) 17 commits (merged to 'next' on 2022-07-08 at a29b4896ab) + git-merge-tree.txt: add a section on potentional usage mistakes + merge-tree: add a --allow-unrelated-histories flag + merge-tree: allow `ls-files -u` style info to be NUL terminated + merge-ort: optionally produce machine-readable output + merge-ort: store more specific conflict information + merge-ort: make `path_messages` a strmap to a string_list + merge-ort: store messages in a list, not in a single strbuf + merge-tree: provide easy access to `ls-files -u` style info + merge-tree: provide a list of which files have conflicts + merge-ort: remove command-line-centric submodule message from merge-ort + merge-ort: provide a merge_get_conflicted_files() helper function + merge-tree: support including merge messages in output + merge-ort: split out a separate display_update_messages() function + merge-tree: implement real merges + merge-tree: add option parsing and initial shell for real merge function + merge-tree: move logic for existing merge into new function + merge-tree: rename merge_trees() to trivial_merge_trees() A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. Will merge to 'master'. source: <pull.1122.v7.git.1655511660.gitgitgadget@gmail.com> * en/merge-restore-to-pristine (2022-06-21) 6 commits - merge: do not exit restore_state() prematurely - merge: ensure we can actually restore pre-merge state - merge: make restore_state() restore staged state too - merge: fix save_state() to work when there are racy-dirty files - merge: remove unused variable - t6424: make sure a failed merge preserves local changes When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. Needs review. source: <pull.1231.v2.git.1655621424.gitgitgadget@gmail.com> * tk/apply-case-insensitive (2022-06-21) 3 commits - apply: support case-only renames in case-insensitive filesystems - reset: new failing test for reset of case-insensitive duplicate in index - t4141: test "git apply" with core.ignorecase "git apply" barfed on a patch that makes a case-only rename on a case-insensitive filesystem. Needs review. source: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com> * zh/ls-files-format (2022-07-13) 1 commit - ls-files: introduce "--format" option "git ls-files" learns the "--format" option to tweak its output. Will merge to 'next'? source: <pull.1262.v7.git.1657692472994.gitgitgadget@gmail.com> * en/merge-dual-dir-renames-fix (2022-07-06) 5 commits (merged to 'next' on 2022-07-11 at 5f8dadf87b) + merge-ort: fix issue with dual rename and add/add conflict + merge-ort: shuffle the computation and cleanup of potential collisions + merge-ort: make a separate function for freeing struct collisions + merge-ort: small cleanups of check_for_directory_rename + t6423: add tests of dual directory rename plus add/add conflict Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. Will merge to 'master'. source: <pull.1268.v4.git.1656984823.gitgitgadget@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings Expecting a reroll. source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * ab/submodule-cleanup (2022-06-28) 12 commits (merged to 'next' on 2022-07-08 at 6f3886aa03) + git-sh-setup.sh: remove "say" function, change last users + git-submodule.sh: use "$quiet", not "$GIT_QUIET" + submodule--helper: eliminate internal "--update" option + submodule--helper: understand --checkout, --merge and --rebase synonyms + submodule--helper: report "submodule" as our name in some "-h" output + submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" + submodule update: remove "-v" option + submodule--helper: have --require-init imply --init + git-submodule.sh: remove unused top-level "--branch" argument + git-submodule.sh: make the "$cached" variable a boolean + git-submodule.sh: remove unused $prefix variable + git-submodule.sh: remove unused sanitize_submodule_env() (this branch is used by gc/submodule-use-super-prefix.) Further preparation to turn git-submodule.sh into a builtin. Will merge to 'master'. source: <cover-v4-00.12-00000000000-20220628T095914Z-avarab@gmail.com> * jc/resolve-undo (2022-07-11) 2 commits (merged to 'next' on 2022-07-13 at b9ef9482e8) + fsck: do not dereference NULL while checking resolve-undo data (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will merge to 'master'. source: <xmqq35f7kzad.fsf@gitster.g> * ab/build-gitweb (2022-06-28) 8 commits (merged to 'next' on 2022-07-11 at 731e354ff0) + gitweb/Makefile: add a "NO_GITWEB" parameter + Makefile: build 'gitweb' in the default target + gitweb/Makefile: include in top-level Makefile + gitweb: remove "test" and "test-installed" targets + gitweb/Makefile: prepare to merge into top-level Makefile + gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars + gitweb/Makefile: add a $(GITWEB_ALL) variable + gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Will merge to 'master'. source: <cover-v3-0.8-00000000000-20220628T100936Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits (merged to 'next' on 2022-07-11 at afab6c1918) + tests: don't assume a .git/info for .git/info/sparse-checkout + tests: don't assume a .git/info for .git/info/exclude + tests: don't assume a .git/info for .git/info/refs + tests: don't assume a .git/info for .git/info/attributes + tests: don't assume a .git/info for .git/info/grafts + tests: don't depend on template-created .git/branches + t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'master'. source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits (merged to 'next' on 2022-07-08 at 4eb375ec2f) + unpack-objects: use stream_loose_object() to unpack large objects + core doc: modernize core.bigFileThreshold documentation + object-file.c: add "stream_loose_object()" to handle large object + object-file.c: factor out deflate part of write_loose_object() + object-file.c: refactor write_loose_object() to several steps + unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'master'. source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-06-27) 16 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: move even the command-line parsing to `bisect--helper` - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message - bisect: verify that a bogus option won't try to start a bisection Final bits of "git bisect.sh" have been rewritten in C. Expecting a (hopefully final) reroll. cf. <20627.86ilolhnnn.gmgdl@evledraar.gmail.com> source: <pull.1132.v4.git.1656354677.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-07-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: learn `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Expecting a reroll. cf. <kl6lpmia55ys.fsf@chooglen-macbookpro.roam.corp.google.com> source: <pull.1261.v7.git.git.1657234914.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-06-21) 2 commits (merged to 'next' on 2022-07-08 at fa0e71ba39) + dir: minor refactoring / clean-up + dir: traverse into repository In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. Will merge to 'master'. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> -------------------------------------------------- [Discarded] * ar/send-email-confirm-by-default (2022-04-22) 1 commit . send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Discarded. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. source: <20220422083629.1404989-1-hi@alyssa.is>
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Maintenance releases v2.37.1 and others have been tagged. They are to address CVE-2022-29187, a vulnerability related to CVE-2022-24765 that was fixed earlier. Big thanks to Carlo Arenas and Johannes Schindelin for fixing the issue and helping the releases out. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [Graduated to 'master'] * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * cr/setup-bug-typo (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 8834ffe0ab) + setup: fix function name in a BUG() message Typofix in a BUG() message. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * ds/branch-checked-out (2022-06-21) 7 commits (merged to 'next' on 2022-06-21 at e42bc4566f) + branch: drop unused worktrees variable + fetch: stop passing around unused worktrees variable (merged to 'next' on 2022-06-17 at c881874257) + branch: fix branch_checked_out() leaks + branch: use branch_checked_out() when deleting refs + fetch: use new branch_checked_out() and add tests + branch: check for bisects and rebases + branch: add branch_checked_out() helper (this branch is used by ds/rebase-update-ref.) Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * ds/vscode-settings (2022-06-27) 1 commit (merged to 'next' on 2022-07-02 at fcbd2e7aca) + vscode: improve tab size and wrapping Will merge to 'master'. source: <pull.1271.git.1656354587496.gitgitgadget@gmail.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * jk/revisions-doc-markup-fix (2022-06-22) 1 commit (merged to 'next' on 2022-07-02 at e25dbe8cfb) + revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis Documentation mark-up fix. source: <YrOmsA04FZae89be@coredump.intra.peff.net> * pb/diff-doc-raw-format (2022-06-13) 3 commits (merged to 'next' on 2022-07-02 at 198480cbc6) + diff-index.txt: update raw output format in examples + diff-format.txt: correct misleading wording + diff-format.txt: dst can be 0* SHA-1 when path is deleted, too Update "git diff/log --raw" format documentation. source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits (merged to 'next' on 2022-06-17 at ab5af6acd1) + archive-tar: use internal gzip by default + archive-tar: use OS_CODE 3 (Unix) for internal gzip + archive-tar: add internal gzip implementation + archive-tar: factor out write_block() + archive: rename archiver data field to filter_command + archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * rs/combine-diff-with-incompatible-options (2022-06-21) 2 commits (merged to 'next' on 2022-07-02 at 0fe8b80a3e) + combine-diff: abort if --output is given + combine-diff: abort if --ignore-matching-lines is given Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com> -------------------------------------------------- [New Topics] * po/doc-add-renormalize (2022-07-09) 1 commit - doc add: renormalize is not idempotent for CRCRLF Documentation for "git add --renormalize" has been improved. Will merge to 'next'? source: <d3b8ed97a105ea1d7e656c964b7eee378e11ede6.1657385781.git.gitgitgadget@gmail.com> * po/glossary-around-traversal (2022-07-09) 3 commits - glossary: add reachability bitmap description - glossary: add commit graph description - glossary: add Object DataBase (ODB) abbreviation The glossary entries for "commit-graph file" and "reachability bitmap" have been added. Will merge to 'next'? source: <pull.1282.git.1657385781.gitgitgadget@gmail.com> * rs/cocci-array-copy (2022-07-10) 1 commit - cocci: avoid normalization rules for memcpy A coccinelle rule (in contrib/) to encourage use of COPY_ARRAY macro has been improved. Will merge to 'next'. source: <ded153d4-4aea-d4da-11cb-ec66d181e4c9@web.de> * sg/multi-pack-index-parse-options-fix (2022-07-10) 1 commit (merged to 'next' on 2022-07-11 at 1e14685680) + multi-pack-index: simplify handling of unknown --options The way "git multi-pack" uses parse-options API has been improved. Will merge to 'master'. source: <20220710151645.GA2038@szeder.dev> * jk/ref-filter-discard-commit-buffer (2022-07-11) 1 commit - ref-filter: disable save_commit_buffer while traversing source: <Ysw4JtoHW1vWmqhz@coredump.intra.peff.net> -------------------------------------------------- [Stalled] * ll/curl-accept-language (2022-07-11) 1 commit - remote-curl: send Accept-Language header to server Earlier, HTTP transport clients learned to tell the server side what locale they are in by sending Accept-Language HTTP header, but this was done only for some requests but not others. Will merge to 'next'. source: <pull.1251.v4.git.1657519134336.gitgitgadget@gmail.com> * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * ab/cocci-unused (2022-07-06) 6 commits (merged to 'next' on 2022-07-11 at 7fa60d2a5b) + cocci: generalize "unused" rule to cover more than "strbuf" + cocci: add and apply a rule to find "unused" strbufs + cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" + cocci: add a "coccicheck-test" target and test *.cocci rules + Makefile & .gitignore: ignore & clean "git.res", not "*.res" + Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused varilable. Will merge to 'master'. source: <cover-v4-0.6-00000000000-20220705T134033Z-avarab@gmail.com> * jk/clone-unborn-confusion (2022-07-11) 4 commits - clone: move unborn head creation to update_head() - clone: use remote branch if it matches default HEAD - clone: propagate empty remote HEAD even with other branches - clone: drop extra newline from warning message "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. Will merge to 'next'. source: <YsdyLS4UFzj0j/wB@coredump.intra.peff.net> source: <YsvrsOH1jg559yVt@coredump.intra.peff.net> * ac/bitmap-lookup-table (2022-07-06) 6 commits - p5310-pack-bitmaps.sh: remove pack.writeReverseIndex - bitmap-lookup-table: add performance tests for lookup table - pack-bitmap: prepare to read lookup table extension - pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests - pack-bitmap-write.c: write lookup table extension - Documentation/technical: describe bitmap lookup table extension The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. Will merge to 'next'? source: <pull.1266.v3.git.1656924376.gitgitgadget@gmail.com> * bc/nettle-sha256 (2022-07-10) 1 commit (merged to 'next' on 2022-07-11 at cf9595d8ca) + sha256: add support for Nettle Support for libnettle as SHA256 implementation has been added. Will merge to 'master'. source: <20220710132907.1499365-1-sandals@crustytoothpaste.net> * jc/builtin-mv-move-array (2022-07-09) 1 commit (merged to 'next' on 2022-07-09 at 0d3b3f62e5) + builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. Will merge to 'master'. source: <xmqq4jzpu4xp.fsf_-_@gitster.g> * jd/gpg-interface-trust-level-string (2022-07-10) 1 commit (merged to 'next' on 2022-07-11 at 7b3cca73a8) + gpg-interface: add function for converting trust level to string The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. Will merge to 'master'. source: <pull.1281.v4.git.1657515650587.gitgitgadget@gmail.com> * kk/p4-client-name-encoding-fix (2022-07-08) 1 commit (merged to 'next' on 2022-07-11 at 9c18616f76) + git-p4: fix bug with encoding of p4 client name "git p4" did not handle non-ASCII client name well, which has been corrected. Will merge to 'master'. source: <pull.1285.git.git.1657267260405.gitgitgadget@gmail.com> * sa/cat-file-mailmap (2022-07-09) 4 commits - cat-file: add mailmap support - ident: rename commit_rewrite_person() to apply_mailmap_to_header() - ident: move commit_rewrite_person() to ident.c - revision: improve commit_rewrite_person() "git cat-file" learned an option to use the mailmap when showing commit and tag objects. source: <20220709154149.165524-1-siddharthasthana31@gmail.com> * fr/vimdiff-layout-fix (2022-07-08) 1 commit (merged to 'next' on 2022-07-09 at d8461bd236) + vimdiff: make layout engine more robust against user vim settings Recent update to vimdiff layout code has been made more robust against different end-user vim settings. Will merge to 'master'. source: <20220708181024.45839-1-greenfoo@u92.eu> * ds/git-rebase-doc-markup (2022-06-30) 1 commit (merged to 'next' on 2022-07-08 at 24a0b80b71) + git-rebase.txt: use back-ticks consistently References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. Will merge to 'master'. source: <pull.1270.v3.git.1656508868146.gitgitgadget@gmail.com> * ds/rebase-update-ref (2022-06-28) 8 commits - rebase: add rebase.updateRefs config option - rebase: update refs from 'update-ref' commands - rebase: add --update-refs option - sequencer: add update-ref command - sequencer: define array with enum values - rebase-interactive: update 'merge' description - branch: consider refs under 'update-refs' - t2407: test branches currently using apply backend "git rebase -i" learns to update branches whose tip appear in the rebased range. Expecting a reroll. cf. <15631ea2-6722-fd24-c8a6-0cee638b0602@github.com> source: <pull.1247.v3.git.1656422759.gitgitgadget@gmail.com> * tb/pack-objects-remove-pahole-comment (2022-06-28) 1 commit (merged to 'next' on 2022-07-06 at d7494fbdef) + pack-objects.h: remove outdated pahole results Comment fix. Will merge to 'master'. source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com> * ab/leakfix (2022-07-01) 11 commits (merged to 'next' on 2022-07-11 at 0b107fffcf) + pull: fix a "struct oid_array" memory leak + cat-file: fix a common "struct object_context" memory leak + gc: fix a memory leak + checkout: avoid "struct unpack_trees_options" leak + merge-file: fix memory leaks on error path + merge-file: refactor for subsequent memory leak fix + cat-file: fix a memory leak in --batch-command mode + revert: free "struct replay_opts" members + submodule.c: free() memory from xgetcwd() + clone: fix memory leak in wanted_peer_refs() + check-ref-format: fix trivial memory leak Plug various memory leaks. Will merge to 'master'. source: <cover-v2-00.11-00000000000-20220701T104017Z-avarab@gmail.com> * ab/test-tool-leakfix (2022-07-01) 9 commits (merged to 'next' on 2022-07-11 at db7a724694) + test-tool delta: fix a memory leak + test-tool ref-store: fix a memory leak + test-tool bloom: fix memory leaks + test-tool json-writer: fix memory leaks + test-tool regex: call regfree(), fix memory leaks + test-tool urlmatch-normalization: fix a memory leak + test-tool {dump,scrap}-cache-tree: fix memory leaks + test-tool path-utils: fix a memory leak + test-tool test-hash: fix a memory leak Plug various memory leaks in test-tool commands. Will merge to 'master'. source: <cover-v2-0.9-00000000000-20220701T103503Z-avarab@gmail.com> * en/t6429-test-must-be-empty-fix (2022-06-30) 1 commit (merged to 'next' on 2022-07-06 at 627c51773c) + t6429: fix use of non-existent function A test fix. Will merge to 'master'. source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com> * gc/submodule-use-super-prefix (2022-06-30) 8 commits (merged to 'next' on 2022-07-11 at 0d9cf172f9) + submodule--helper: remove display path helper + submodule--helper update: use --super-prefix + submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags + submodule--helper: use correct display path helper + submodule--helper: don't recreate recursive prefix + submodule--helper update: use display path helper + submodule--helper tests: add missing "display path" coverage + Merge branch 'ab/submodule-cleanup' into gc/submodule-use-super-prefix (this branch uses ab/submodule-cleanup.) Another step to rewrite more parts of "git submodule" in C. Will merge to 'master'. source: <20220701021157.88858-1-chooglen@google.com> * hx/lookup-commit-in-graph-fix (2022-06-30) 1 commit (merged to 'next' on 2022-07-08 at cef32db0b6) + commit-graph.c: no lazy fetch in lookup_commit_in_graph() A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. Will merge to 'master'. source: <96d4bb71505d87ed501c058bbd89bfc13d08b24a.1656593279.git.hanxin.hx@bytedance.com> * ll/ls-files-tests-update (2022-07-06) 1 commit (merged to 'next' on 2022-07-06 at 444d1eabd0) + ls-files: update test style Test update. Will merge to 'master'. source: <pull.1269.v6.git.1656863349926.gitgitgadget@gmail.com> * pw/xdiff-alloc (2022-07-08) 4 commits - xdiff: introduce XDL_ALLOC_GROW() - xdiff: introduce XDL_CALLOC_ARRAY() - xdiff: introduce xdl_calloc - xdiff: introduce XDL_ALLOC_ARRAY() Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. Will merge to 'next'? source: <pull.1272.v2.git.1657297519.gitgitgadget@gmail.com> * sy/mv-out-of-cone (2022-07-01) 8 commits (merged to 'next' on 2022-07-08 at 654970fdb7) + mv: add check_dir_in_index() and solve general dir check issue + mv: use flags mode for update_mode + mv: check if <destination> exists in index to handle overwriting + mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit + mv: decouple if/else-if checks using goto + mv: update sparsity after moving from out-of-cone to in-cone + t1092: mv directory from out-of-cone to in-cone + t7002: add tests for moving out-of-cone file/directory "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. Will merge to 'master'. source: <20220630023737.473690-1-shaoxuan.yuan02@gmail.com> * ab/squelch-empty-fsync-traces (2022-06-30) 1 commit . trace2: don't include "fsync" events in all trace2 logs Omit fsync-related trace2 entries when their values are all zero. Breaks tests in hx/unpack-streaming with an interesting interaction. source: <patch-v2-1.1-a1fc37de947-20220630T084607Z-avarab@gmail.com> * cl/grep-max-count (2022-06-22) 1 commit (merged to 'next' on 2022-07-08 at 646199ab4c) + grep: add --max-count command line option "git grep -m<max-hits>" is a way to limit the hits shown per file. Will merge to 'master'. source: <pull.1278.v4.git.git.1655927252899.gitgitgadget@gmail.com> * tk/rev-parse-doc-clarify-at-u (2022-06-23) 1 commit (merged to 'next' on 2022-07-08 at 1075452f32) + rev-parse: documentation adjustment - mention remote tracking with @{u} Doc update. Will merge to 'master'. source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com> * en/merge-tree (2022-06-22) 17 commits (merged to 'next' on 2022-07-08 at a29b4896ab) + git-merge-tree.txt: add a section on potentional usage mistakes + merge-tree: add a --allow-unrelated-histories flag + merge-tree: allow `ls-files -u` style info to be NUL terminated + merge-ort: optionally produce machine-readable output + merge-ort: store more specific conflict information + merge-ort: make `path_messages` a strmap to a string_list + merge-ort: store messages in a list, not in a single strbuf + merge-tree: provide easy access to `ls-files -u` style info + merge-tree: provide a list of which files have conflicts + merge-ort: remove command-line-centric submodule message from merge-ort + merge-ort: provide a merge_get_conflicted_files() helper function + merge-tree: support including merge messages in output + merge-ort: split out a separate display_update_messages() function + merge-tree: implement real merges + merge-tree: add option parsing and initial shell for real merge function + merge-tree: move logic for existing merge into new function + merge-tree: rename merge_trees() to trivial_merge_trees() A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. Will merge to 'master'. source: <pull.1122.v7.git.1655511660.gitgitgadget@gmail.com> * dr/i18n-die-warn-error-usage (2022-06-21) 1 commit (merged to 'next' on 2022-07-08 at 6f639750a1) + i18n: mark message helpers prefix for translation Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. Will merge to 'master'. source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com> * ds/t5510-brokequote (2022-06-21) 1 commit (merged to 'next' on 2022-07-06 at 2776bed385) + t5510: replace 'origin' with URL more carefully Test fix. Will merge to 'master'. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * en/merge-restore-to-pristine (2022-06-21) 6 commits - merge: do not exit restore_state() prematurely - merge: ensure we can actually restore pre-merge state - merge: make restore_state() restore staged state too - merge: fix save_state() to work when there are racy-dirty files - merge: remove unused variable - t6424: make sure a failed merge preserves local changes When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. Needs review. source: <pull.1231.v2.git.1655621424.gitgitgadget@gmail.com> * tk/apply-case-insensitive (2022-06-21) 3 commits - apply: support case-only renames in case-insensitive filesystems - reset: new failing test for reset of case-insensitive duplicate in index - t4141: test "git apply" with core.ignorecase "git apply" barfed on a patch that makes a case-only rename on a case-insensitive filesystem. Needs review. source: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com> * zh/ls-files-format (2022-07-11) 1 commit - ls-files: introduce "--format" option "git ls-files" learns the "--format" option to tweak its output. Getting closer to finish? cf. <xmqqleszl2p0.fsf@gitster.g> source: <pull.1262.v6.git.1657558435532.gitgitgadget@gmail.com> * ab/test-quoting-fix (2022-06-30) 3 commits (merged to 'next' on 2022-07-06 at 0aa78fd9db) + config tests: fix harmless but broken "rm -r" cleanup + test-lib.sh: fix prepend_var() quoting issue + tests: add missing double quotes to included library paths Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. Will merge to 'master'. source: <cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com> * en/merge-dual-dir-renames-fix (2022-07-06) 5 commits (merged to 'next' on 2022-07-11 at 5f8dadf87b) + merge-ort: fix issue with dual rename and add/add conflict + merge-ort: shuffle the computation and cleanup of potential collisions + merge-ort: make a separate function for freeing struct collisions + merge-ort: small cleanups of check_for_directory_rename + t6423: add tests of dual directory rename plus add/add conflict Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. Will merge to 'master'. source: <pull.1268.v4.git.1656984823.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit (merged to 'next' on 2022-07-08 at 8aa1f94fad) + send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". Will merge to 'master'. source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit (merged to 'next' on 2022-07-08 at d4e49ad22a) + remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspecs. Will merge to 'master'. source: <20220617002036.1577-2-jacob.keller@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings Expecting a reroll. source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * ro/mktree-allow-missing-fix (2022-06-21) 1 commit (merged to 'next' on 2022-07-08 at 599ed6fb84) + mktree: do not check type of remote objects "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. Will merge to 'master'. source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * ab/submodule-cleanup (2022-06-28) 12 commits (merged to 'next' on 2022-07-08 at 6f3886aa03) + git-sh-setup.sh: remove "say" function, change last users + git-submodule.sh: use "$quiet", not "$GIT_QUIET" + submodule--helper: eliminate internal "--update" option + submodule--helper: understand --checkout, --merge and --rebase synonyms + submodule--helper: report "submodule" as our name in some "-h" output + submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" + submodule update: remove "-v" option + submodule--helper: have --require-init imply --init + git-submodule.sh: remove unused top-level "--branch" argument + git-submodule.sh: make the "$cached" variable a boolean + git-submodule.sh: remove unused $prefix variable + git-submodule.sh: remove unused sanitize_submodule_env() (this branch is used by gc/submodule-use-super-prefix.) Further preparation to turn git-submodule.sh into a builtin. Will merge to 'master'. source: <cover-v4-00.12-00000000000-20220628T095914Z-avarab@gmail.com> * jc/resolve-undo (2022-07-11) 2 commits - fsck: do not dereference NULL while checking resolve-undo data (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will merge to 'next'. source: <xmqqfskdieqz.fsf@gitster.g> * ab/build-gitweb (2022-06-28) 8 commits (merged to 'next' on 2022-07-11 at 731e354ff0) + gitweb/Makefile: add a "NO_GITWEB" parameter + Makefile: build 'gitweb' in the default target + gitweb/Makefile: include in top-level Makefile + gitweb: remove "test" and "test-installed" targets + gitweb/Makefile: prepare to merge into top-level Makefile + gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars + gitweb/Makefile: add a $(GITWEB_ALL) variable + gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Will merge to 'master'. source: <cover-v3-0.8-00000000000-20220628T100936Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits (merged to 'next' on 2022-07-11 at afab6c1918) + tests: don't assume a .git/info for .git/info/sparse-checkout + tests: don't assume a .git/info for .git/info/exclude + tests: don't assume a .git/info for .git/info/refs + tests: don't assume a .git/info for .git/info/attributes + tests: don't assume a .git/info for .git/info/grafts + tests: don't depend on template-created .git/branches + t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'master'. source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits (merged to 'next' on 2022-07-08 at 4eb375ec2f) + unpack-objects: use stream_loose_object() to unpack large objects + core doc: modernize core.bigFileThreshold documentation + object-file.c: add "stream_loose_object()" to handle large object + object-file.c: factor out deflate part of write_loose_object() + object-file.c: refactor write_loose_object() to several steps + unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'master'. source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-06-27) 16 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: move even the command-line parsing to `bisect--helper` - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message - bisect: verify that a bogus option won't try to start a bisection Final bits of "git bisect.sh" have been rewritten in C. Expecting a (hopefully final) reroll. cf. <20627.86ilolhnnn.gmgdl@evledraar.gmail.com> source: <pull.1132.v4.git.1656354677.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-07-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: learn `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Will merge to 'next'? source: <pull.1261.v7.git.git.1657234914.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-06-21) 2 commits (merged to 'next' on 2022-07-08 at fa0e71ba39) + dir: minor refactoring / clean-up + dir: traverse into repository In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. Will merge to 'master'. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> -------------------------------------------------- [Discarded] * ar/send-email-confirm-by-default (2022-04-22) 1 commit . send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Discarded. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. source: <20220422083629.1404989-1-hi@alyssa.is>
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [New Topics] * ab/cocci-unused (2022-07-06) 6 commits - cocci: generalize "unused" rule to cover more than "strbuf" - cocci: add and apply a rule to find "unused" strbufs - cocci: have "coccicheck{,-pending}" depend on "coccicheck-test" - cocci: add a "coccicheck-test" target and test *.cocci rules - Makefile & .gitignore: ignore & clean "git.res", not "*.res" - Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS Add Coccinelle rules to detect the pattern of initializing and then finalizing a structure without using it in between at all, which happens after code restructuring and the compilers fail to recognize as an unused varilable. Will merge to 'next'. source: <cover-v4-0.6-00000000000-20220705T134033Z-avarab@gmail.com> * jk/clone-unborn-confusion (2022-07-07) 3 commits - clone: use remote branch if it matches default HEAD - clone: propagate empty remote HEAD even with other branches - clone: drop extra newline from warning message "git clone" from a repository with some ref whose HEAD is unborn did not set the HEAD in the resulting repository correctly, which has been corrected. Will merge to 'next'? source: <YsdyLS4UFzj0j/wB@coredump.intra.peff.net> * ac/bitmap-lookup-table (2022-07-06) 6 commits - p5310-pack-bitmaps.sh: remove pack.writeReverseIndex - bitmap-lookup-table: add performance tests for lookup table - pack-bitmap: prepare to read lookup table extension - pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests - pack-bitmap-write.c: write lookup table extension - Documentation/technical: describe bitmap lookup table extension The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. Will merge to 'next'? source: <pull.1266.v3.git.1656924376.gitgitgadget@gmail.com> * bc/nettle-sha256 (2022-07-07) 1 commit - sha256: add support for Nettle Support for libnettle as SHA256 implementation has been added. Expecting a reroll. cf. <YsTgmv+h2SFFFMga@tapette.crustytoothpaste.net> source: <20220705230518.713218-1-sandals@crustytoothpaste.net> * jc/builtin-mv-move-array (2022-07-06) 1 commit - builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove() Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp macro, which would improve maintainability and readability. Will merge to 'next'? source: <xmqqy1x531vp.fsf@gitster.g> * jd/gpg-interface-trust-level-string (2022-07-08) 1 commit - gpg-interface: add function for converting trust level to string The code to convert between GPG trust level strings and internal constants we use to represent them have been cleaned up. Will merge to 'next'. source: <pull.1281.v2.git.1657279447515.gitgitgadget@gmail.com> * kk/p4-client-name-encoding-fix (2022-07-08) 1 commit - git-p4: fix bug with encoding of p4 client name "git p4" did not handle non-ASCII client name well, which has been corrected. Will merge to 'next'. source: <pull.1285.git.git.1657267260405.gitgitgadget@gmail.com> * sa/cat-file-mailmap (2022-07-07) 5 commits - SQUASH??? - cat-file: add mailmap support - ident: rename commit_rewrite_person() to apply_mailmap_to_header() - ident: move commit_rewrite_person() to ident.c - revision: improve commit_rewrite_person() source: <20220707161554.6900-1-siddharthasthana31@gmail.com> * fr/vimdiff-layout-fix (2022-07-08) 1 commit - vimdiff: make layout engine more robust against user vim settings source: <20220708181024.45839-1-greenfoo@u92.eu> -------------------------------------------------- [Graduated to 'master'] * js/add-i-delete (2022-06-28) 1 commit (merged to 'next' on 2022-06-28 at 8ac04bfd24) + add --interactive: allow `update` to stage deleted files Rewrite of "git add -i" in C that appeared in Git 2.25 didn't correctly record a removed file to the index, which was fixed. source: <pull.1273.git.1656454964378.gitgitgadget@gmail.com> -------------------------------------------------- [Stalled] * ll/curl-accept-language (2022-06-13) 2 commits - PREP??? give initializer to rpc_state - remote-curl: send Accept-Language header to server source: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * ds/git-rebase-doc-markup (2022-06-30) 1 commit (merged to 'next' on 2022-07-08 at 24a0b80b71) + git-rebase.txt: use back-ticks consistently References to commands-to-be-typed-literally in "git rebase" documentation mark-up have been corrected. Will merge to 'master'. source: <pull.1270.v3.git.1656508868146.gitgitgadget@gmail.com> * ds/rebase-update-ref (2022-06-28) 8 commits - rebase: add rebase.updateRefs config option - rebase: update refs from 'update-ref' commands - rebase: add --update-refs option - sequencer: add update-ref command - sequencer: define array with enum values - rebase-interactive: update 'merge' description - branch: consider refs under 'update-refs' - t2407: test branches currently using apply backend (this branch uses ds/branch-checked-out.) "git rebase -i" learns to update branches whose tip appear in the rebased range. Expecting a reroll. cf. <15631ea2-6722-fd24-c8a6-0cee638b0602@github.com> source: <pull.1247.v3.git.1656422759.gitgitgadget@gmail.com> * ds/vscode-settings (2022-06-27) 1 commit (merged to 'next' on 2022-07-02 at fcbd2e7aca) + vscode: improve tab size and wrapping Will merge to 'master'. source: <pull.1271.git.1656354587496.gitgitgadget@gmail.com> * tb/pack-objects-remove-pahole-comment (2022-06-28) 1 commit (merged to 'next' on 2022-07-06 at d7494fbdef) + pack-objects.h: remove outdated pahole results Comment fix. Will merge to 'master'. source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com> * ab/leakfix (2022-07-01) 11 commits - pull: fix a "struct oid_array" memory leak - cat-file: fix a common "struct object_context" memory leak - gc: fix a memory leak - checkout: avoid "struct unpack_trees_options" leak - merge-file: fix memory leaks on error path - merge-file: refactor for subsequent memory leak fix - cat-file: fix a memory leak in --batch-command mode - revert: free "struct replay_opts" members - submodule.c: free() memory from xgetcwd() - clone: fix memory leak in wanted_peer_refs() - check-ref-format: fix trivial memory leak Plug various memory leaks. Will merge to 'next'. source: <cover-v2-00.11-00000000000-20220701T104017Z-avarab@gmail.com> * ab/test-tool-leakfix (2022-07-01) 9 commits - test-tool delta: fix a memory leak - test-tool ref-store: fix a memory leak - test-tool bloom: fix memory leaks - test-tool json-writer: fix memory leaks - test-tool regex: call regfree(), fix memory leaks - test-tool urlmatch-normalization: fix a memory leak - test-tool {dump,scrap}-cache-tree: fix memory leaks - test-tool path-utils: fix a memory leak - test-tool test-hash: fix a memory leak Plug various memory leaks in test-tool commands. Will merge to 'next'. source: <cover-v2-0.9-00000000000-20220701T103503Z-avarab@gmail.com> * en/t6429-test-must-be-empty-fix (2022-06-30) 1 commit (merged to 'next' on 2022-07-06 at 627c51773c) + t6429: fix use of non-existent function A test fix. Will merge to 'master'. source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com> * gc/submodule-use-super-prefix (2022-06-30) 8 commits - submodule--helper: remove display path helper - submodule--helper update: use --super-prefix - submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags - submodule--helper: use correct display path helper - submodule--helper: don't recreate recursive prefix - submodule--helper update: use display path helper - submodule--helper tests: add missing "display path" coverage - Merge branch 'ab/submodule-cleanup' into gc/submodule-use-super-prefix (this branch uses ab/submodule-cleanup.) Another step to rewrite more parts of "git submodule" in C. Will merge to 'next'. source: <20220701021157.88858-1-chooglen@google.com> * hx/lookup-commit-in-graph-fix (2022-06-30) 1 commit (merged to 'next' on 2022-07-08 at cef32db0b6) + commit-graph.c: no lazy fetch in lookup_commit_in_graph() A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. Will merge to 'master'. source: <96d4bb71505d87ed501c058bbd89bfc13d08b24a.1656593279.git.hanxin.hx@bytedance.com> * ll/ls-files-tests-update (2022-07-06) 1 commit (merged to 'next' on 2022-07-06 at 444d1eabd0) + ls-files: update test style Test update. Will merge to 'master'. source: <pull.1269.v6.git.1656863349926.gitgitgadget@gmail.com> * pw/xdiff-alloc (2022-07-08) 4 commits - xdiff: introduce XDL_ALLOC_GROW() - xdiff: introduce XDL_CALLOC_ARRAY() - xdiff: introduce xdl_calloc - xdiff: introduce XDL_ALLOC_ARRAY() Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. Will merge to 'next'? source: <pull.1272.v2.git.1657297519.gitgitgadget@gmail.com> * sy/mv-out-of-cone (2022-07-01) 8 commits (merged to 'next' on 2022-07-08 at 654970fdb7) + mv: add check_dir_in_index() and solve general dir check issue + mv: use flags mode for update_mode + mv: check if <destination> exists in index to handle overwriting + mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit + mv: decouple if/else-if checks using goto + mv: update sparsity after moving from out-of-cone to in-cone + t1092: mv directory from out-of-cone to in-cone + t7002: add tests for moving out-of-cone file/directory "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. Will merge to 'master'. source: <20220630023737.473690-1-shaoxuan.yuan02@gmail.com> * ab/squelch-empty-fsync-traces (2022-06-30) 1 commit . trace2: don't include "fsync" events in all trace2 logs Omit fsync-related trace2 entries when their values are all zero. Breaks tests in hx/unpack-streaming with an interesting interaction. source: <patch-v2-1.1-a1fc37de947-20220630T084607Z-avarab@gmail.com> * cl/grep-max-count (2022-06-22) 1 commit (merged to 'next' on 2022-07-08 at 646199ab4c) + grep: add --max-count command line option "git grep -m<max-hits>" is a way to limit the hits shown per file. Will merge to 'master'. source: <pull.1278.v4.git.git.1655927252899.gitgitgadget@gmail.com> * jk/revisions-doc-markup-fix (2022-06-22) 1 commit (merged to 'next' on 2022-07-02 at e25dbe8cfb) + revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis Documentation mark-up fix. Will merge to 'master'. source: <YrOmsA04FZae89be@coredump.intra.peff.net> * tk/rev-parse-doc-clarify-at-u (2022-06-23) 1 commit (merged to 'next' on 2022-07-08 at 1075452f32) + rev-parse: documentation adjustment - mention remote tracking with @{u} Doc update. Will merge to 'master'. source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com> * en/merge-tree (2022-06-22) 17 commits (merged to 'next' on 2022-07-08 at a29b4896ab) + git-merge-tree.txt: add a section on potentional usage mistakes + merge-tree: add a --allow-unrelated-histories flag + merge-tree: allow `ls-files -u` style info to be NUL terminated + merge-ort: optionally produce machine-readable output + merge-ort: store more specific conflict information + merge-ort: make `path_messages` a strmap to a string_list + merge-ort: store messages in a list, not in a single strbuf + merge-tree: provide easy access to `ls-files -u` style info + merge-tree: provide a list of which files have conflicts + merge-ort: remove command-line-centric submodule message from merge-ort + merge-ort: provide a merge_get_conflicted_files() helper function + merge-tree: support including merge messages in output + merge-ort: split out a separate display_update_messages() function + merge-tree: implement real merges + merge-tree: add option parsing and initial shell for real merge function + merge-tree: move logic for existing merge into new function + merge-tree: rename merge_trees() to trivial_merge_trees() A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. Will merge to 'master'. source: <pull.1122.v7.git.1655511660.gitgitgadget@gmail.com> * dr/i18n-die-warn-error-usage (2022-06-21) 1 commit (merged to 'next' on 2022-07-08 at 6f639750a1) + i18n: mark message helpers prefix for translation Give _() markings to fatal/warning/usage: labels that are shown in front of these messages. Will merge to 'master'. source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com> * ds/t5510-brokequote (2022-06-21) 1 commit (merged to 'next' on 2022-07-06 at 2776bed385) + t5510: replace 'origin' with URL more carefully Test fix. Will merge to 'master'. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * en/merge-restore-to-pristine (2022-06-21) 6 commits - merge: do not exit restore_state() prematurely - merge: ensure we can actually restore pre-merge state - merge: make restore_state() restore staged state too - merge: fix save_state() to work when there are racy-dirty files - merge: remove unused variable - t6424: make sure a failed merge preserves local changes When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. Needs review. source: <pull.1231.v2.git.1655621424.gitgitgadget@gmail.com> * rs/combine-diff-with-incompatible-options (2022-06-21) 2 commits (merged to 'next' on 2022-07-02 at 0fe8b80a3e) + combine-diff: abort if --output is given + combine-diff: abort if --ignore-matching-lines is given Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. Will merge to 'master'. source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com> * tk/apply-case-insensitive (2022-06-21) 3 commits - apply: support case-only renames in case-insensitive filesystems - reset: new failing test for reset of case-insensitive duplicate in index - t4141: test "git apply" with core.ignorecase "git apply" barfed on a patch that makes a case-only rename on a case-insensitive filesystem. Needs review. source: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com> * zh/ls-files-format (2022-07-06) 1 commit - ls-files: introduce "--format" option "git ls-files" learns the "--format" option to tweak its output. Getting closer to finish? cf. <220705.86sfng9c5a.gmgdl@evledraar.gmail.com> source: <pull.1262.v5.git.1657002760815.gitgitgadget@gmail.com> * ab/test-quoting-fix (2022-06-30) 3 commits (merged to 'next' on 2022-07-06 at 0aa78fd9db) + config tests: fix harmless but broken "rm -r" cleanup + test-lib.sh: fix prepend_var() quoting issue + tests: add missing double quotes to included library paths Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. Will merge to 'master'. source: <cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com> * en/merge-dual-dir-renames-fix (2022-07-06) 5 commits - merge-ort: fix issue with dual rename and add/add conflict - merge-ort: shuffle the computation and cleanup of potential collisions - merge-ort: make a separate function for freeing struct collisions - merge-ort: small cleanups of check_for_directory_rename - t6423: add tests of dual directory rename plus add/add conflict Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. Will merge to 'next'. source: <pull.1268.v4.git.1656984823.gitgitgadget@gmail.com> * cr/setup-bug-typo (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 8834ffe0ab) + setup: fix function name in a BUG() message Typofix in a BUG() message. Will cook in 'next'. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit (merged to 'next' on 2022-07-08 at 8aa1f94fad) + send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". Will merge to 'master'. source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit (merged to 'next' on 2022-07-08 at d4e49ad22a) + remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspecs. Will merge to 'master'. source: <20220617002036.1577-2-jacob.keller@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings Expecting a reroll. source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. Will cook in 'next'. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * ro/mktree-allow-missing-fix (2022-06-21) 1 commit (merged to 'next' on 2022-07-08 at 599ed6fb84) + mktree: do not check type of remote objects "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary for the purpose of creating the tree object(s) from its input. Will merge to 'master'. source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com> * pb/diff-doc-raw-format (2022-06-13) 3 commits (merged to 'next' on 2022-07-02 at 198480cbc6) + diff-index.txt: update raw output format in examples + diff-format.txt: correct misleading wording + diff-format.txt: dst can be 0* SHA-1 when path is deleted, too Update "git diff/log --raw" format documentation. Will merge to 'master'. source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits (merged to 'next' on 2022-06-17 at ab5af6acd1) + archive-tar: use internal gzip by default + archive-tar: use OS_CODE 3 (Unix) for internal gzip + archive-tar: add internal gzip implementation + archive-tar: factor out write_block() + archive: rename archiver data field to filter_command + archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. Will cook in 'next'. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * ds/branch-checked-out (2022-06-21) 7 commits (merged to 'next' on 2022-06-21 at e42bc4566f) + branch: drop unused worktrees variable + fetch: stop passing around unused worktrees variable (merged to 'next' on 2022-06-17 at c881874257) + branch: fix branch_checked_out() leaks + branch: use branch_checked_out() when deleting refs + fetch: use new branch_checked_out() and add tests + branch: check for bisects and rebases + branch: add branch_checked_out() helper (this branch is used by ds/rebase-update-ref.) Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. Will cook in 'next'. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * ab/submodule-cleanup (2022-06-28) 12 commits (merged to 'next' on 2022-07-08 at 6f3886aa03) + git-sh-setup.sh: remove "say" function, change last users + git-submodule.sh: use "$quiet", not "$GIT_QUIET" + submodule--helper: eliminate internal "--update" option + submodule--helper: understand --checkout, --merge and --rebase synonyms + submodule--helper: report "submodule" as our name in some "-h" output + submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" + submodule update: remove "-v" option + submodule--helper: have --require-init imply --init + git-submodule.sh: remove unused top-level "--branch" argument + git-submodule.sh: make the "$cached" variable a boolean + git-submodule.sh: remove unused $prefix variable + git-submodule.sh: remove unused sanitize_submodule_env() (this branch is used by gc/submodule-use-super-prefix.) Further preparation to turn git-submodule.sh into a builtin. Will merge to 'master'. source: <cover-v4-00.12-00000000000-20220628T095914Z-avarab@gmail.com> * jc/resolve-undo (2022-06-09) 1 commit (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will cook in 'next'. source: <xmqqfskdieqz.fsf@gitster.g> * ab/build-gitweb (2022-06-28) 8 commits - gitweb/Makefile: add a "NO_GITWEB" parameter - Makefile: build 'gitweb' in the default target - gitweb/Makefile: include in top-level Makefile - gitweb: remove "test" and "test-installed" targets - gitweb/Makefile: prepare to merge into top-level Makefile - gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars - gitweb/Makefile: add a $(GITWEB_ALL) variable - gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Will merge to 'next'? source: <cover-v3-0.8-00000000000-20220628T100936Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits - tests: don't assume a .git/info for .git/info/sparse-checkout - tests: don't assume a .git/info for .git/info/exclude - tests: don't assume a .git/info for .git/info/refs - tests: don't assume a .git/info for .git/info/attributes - tests: don't assume a .git/info for .git/info/grafts - tests: don't depend on template-created .git/branches - t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'next'? source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. Will cook in 'next'. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits (merged to 'next' on 2022-07-08 at 4eb375ec2f) + unpack-objects: use stream_loose_object() to unpack large objects + core doc: modernize core.bigFileThreshold documentation + object-file.c: add "stream_loose_object()" to handle large object + object-file.c: factor out deflate part of write_loose_object() + object-file.c: refactor write_loose_object() to several steps + unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'master'. source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-06-27) 16 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: move even the command-line parsing to `bisect--helper` - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message - bisect: verify that a bogus option won't try to start a bisection Final bits of "git bisect.sh" have been rewritten in C. Expecting a (hopefully final) reroll. cf. <20627.86ilolhnnn.gmgdl@evledraar.gmail.com> source: <pull.1132.v4.git.1656354677.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-07-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: learn `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. source: <pull.1261.v7.git.git.1657234914.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-06-21) 2 commits (merged to 'next' on 2022-07-08 at fa0e71ba39) + dir: minor refactoring / clean-up + dir: traverse into repository In a non-bare repository, the behavior of Git when the core.worktree configuration variable points at a directory that has a repository as its subdirectory, regressed in Git 2.27 days. Will merge to 'master'. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> -------------------------------------------------- [Discarded] * ar/send-email-confirm-by-default (2022-04-22) 1 commit . send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Discarded. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. source: <20220422083629.1404989-1-hi@alyssa.is>
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Git 2.37 final was released, many in the northan hemisphere are about to be in summer vacation week. We probably will have a small update 2.37.1 near mid July to deal with a small "regression" in 2.37 but otherwise things are expected to be slow, and slow is good ;-) Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [New Topics] * ds/git-rebase-doc-markup (2022-06-30) 1 commit - git-rebase.txt: use back-ticks consistently Correct "git rebase" documentation mark-up. Will merge to 'next'. source: <pull.1270.v3.git.1656508868146.gitgitgadget@gmail.com> * ds/rebase-update-ref (2022-06-28) 8 commits - rebase: add rebase.updateRefs config option - rebase: update refs from 'update-ref' commands - rebase: add --update-refs option - sequencer: add update-ref command - sequencer: define array with enum values - rebase-interactive: update 'merge' description - branch: consider refs under 'update-refs' - t2407: test branches currently using apply backend (this branch uses ds/branch-checked-out.) "git rebase -i" learns to update branches whose tip appear in the rebased range. Will merge to 'next'? source: <pull.1247.v3.git.1656422759.gitgitgadget@gmail.com> * ds/vscode-settings (2022-06-27) 1 commit - vscode: improve tab size and wrapping source: <pull.1271.git.1656354587496.gitgitgadget@gmail.com> * js/add-i-delete (2022-06-28) 1 commit (merged to 'next' on 2022-06-28 at 8ac04bfd24) + add --interactive: allow `update` to stage deleted files Rewrite of "git add -i" in C that appeared in Git 2.25 didn't correctly record a removed file to the index, which was fixed. Will merge to 'master'. source: <pull.1273.git.1656454964378.gitgitgadget@gmail.com> * tb/pack-objects-remove-pahole-comment (2022-06-28) 1 commit - pack-objects.h: remove outdated pahole results Comment fix. Will merge to 'next'. source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com> * ab/leakfix (2022-07-01) 11 commits - pull: fix a "struct oid_array" memory leak - cat-file: fix a common "struct object_context" memory leak - gc: fix a memory leak - checkout: avoid "struct unpack_trees_options" leak - merge-file: fix memory leaks on error path - merge-file: refactor for subsequent memory leak fix - cat-file: fix a memory leak in --batch-command mode - revert: free "struct replay_opts" members - submodule.c: free() memory from xgetcwd() - clone: fix memory leak in wanted_peer_refs() - check-ref-format: fix trivial memory leak Plug various memory leaks. source: <cover-v2-00.11-00000000000-20220701T104017Z-avarab@gmail.com> * ab/test-tool-leakfix (2022-07-01) 9 commits - test-tool delta: fix a memory leak - test-tool ref-store: fix a memory leak - test-tool bloom: fix memory leaks - test-tool json-writer: fix memory leaks - test-tool regex: call regfree(), fix memory leaks - test-tool urlmatch-normalization: fix a memory leak - test-tool {dump,scrap}-cache-tree: fix memory leaks - test-tool path-utils: fix a memory leak - test-tool test-hash: fix a memory leak Plug various memory leaks in test-tool commands. source: <cover-v2-0.9-00000000000-20220701T103503Z-avarab@gmail.com> * en/t6429-test-must-be-empty-fix (2022-06-30) 1 commit - t6429: fix use of non-existent function A test fix. Will merge to 'next'. source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com> * gc/submodule-use-super-prefix (2022-06-30) 8 commits - submodule--helper: remove display path helper - submodule--helper update: use --super-prefix - submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags - submodule--helper: use correct display path helper - submodule--helper: don't recreate recursive prefix - submodule--helper update: use display path helper - submodule--helper tests: add missing "display path" coverage - Merge branch 'ab/submodule-cleanup' into gc/submodule-use-super-prefix (this branch uses ab/submodule-cleanup.) Another step to rewrite more parts of "git submodule" in C. Will merge to 'next'? source: <20220701021157.88858-1-chooglen@google.com> * hx/lookup-commit-in-graph-fix (2022-06-30) 1 commit - commit-graph.c: no lazy fetch in lookup_commit_in_graph() A corner case bug where lazily fetching objects from a promisor remote resulted in infinite recursion has been corrected. Will merge to 'next'. source: <96d4bb71505d87ed501c058bbd89bfc13d08b24a.1656593279.git.hanxin.hx@bytedance.com> * ll/ls-files-tests-update (2022-07-01) 1 commit - ls-files: update test style Test update. Will merge to 'next'. source: <pull.1269.v5.git.1656673435357.gitgitgadget@gmail.com> * pw/xdiff-alloc (2022-06-30) 3 commits - xdiff: introduce XDL_ALLOC_GROW() - xdiff: introduce XDL_CALLOC_ARRAY() - xdiff: introduce XDL_ALLOC_ARRAY() Add a level of redirection to array allocation API in xdiff part, to make it easier to share with the libgit2 project. Waiting for review responses. source: <pull.1272.git.1656516334.gitgitgadget@gmail.com> * sy/mv-out-of-cone (2022-07-01) 8 commits - mv: add check_dir_in_index() and solve general dir check issue - mv: use flags mode for update_mode - mv: check if <destination> exists in index to handle overwriting - mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit - mv: decouple if/else-if checks using goto - mv: update sparsity after moving from out-of-cone to in-cone - t1092: mv directory from out-of-cone to in-cone - t7002: add tests for moving out-of-cone file/directory "git mv A B" in a sparsely populated working tree can be asked to move a path between directories that are "in cone" (i.e. expected to be materialized in the working tree) and "out of cone" (i.e. expected to be hidden). The handling of such cases has been improved. Will merge to 'next'. source: <20220630023737.473690-1-shaoxuan.yuan02@gmail.com> -------------------------------------------------- [Stalled] * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * ab/squelch-empty-fsync-traces (2022-06-30) 1 commit . trace2: don't include "fsync" events in all trace2 logs Omit fsync-related trace2 entries when their values are all zero. Breaks tests in hx/unpack-streaming with an interesting interaction. source: <patch-v2-1.1-a1fc37de947-20220630T084607Z-avarab@gmail.com> * cl/grep-max-count (2022-06-22) 1 commit - grep: add --max-count command line option "git grep -m<max-hits>" is a way to limit the hits shown per file. Will merge to 'next'. source: <pull.1278.v4.git.git.1655927252899.gitgitgadget@gmail.com> * jk/revisions-doc-markup-fix (2022-06-22) 1 commit - revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis Documentation mark-up fix. Will merge to 'next'. source: <YrOmsA04FZae89be@coredump.intra.peff.net> * tk/rev-parse-doc-clarify-at-u (2022-06-23) 1 commit - rev-parse: documentation adjustment - mention remote tracking with @{u} Doc update. Will merge to 'next'. source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com> * en/merge-tree (2022-06-22) 17 commits - git-merge-tree.txt: add a section on potentional usage mistakes - merge-tree: add a --allow-unrelated-histories flag - merge-tree: allow `ls-files -u` style info to be NUL terminated - merge-ort: optionally produce machine-readable output - merge-ort: store more specific conflict information - merge-ort: make `path_messages` a strmap to a string_list - merge-ort: store messages in a list, not in a single strbuf - merge-tree: provide easy access to `ls-files -u` style info - merge-tree: provide a list of which files have conflicts - merge-ort: remove command-line-centric submodule message from merge-ort - merge-ort: provide a merge_get_conflicted_files() helper function - merge-tree: support including merge messages in output - merge-ort: split out a separate display_update_messages() function - merge-tree: implement real merges - merge-tree: add option parsing and initial shell for real merge function - merge-tree: move logic for existing merge into new function - merge-tree: rename merge_trees() to trivial_merge_trees() A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. Will merge to 'next'. source: <pull.1122.v7.git.1655511660.gitgitgadget@gmail.com> * dr/i18n-die-warn-error-usage (2022-06-21) 1 commit - i18n: mark message helpers prefix for translation Give _() markings to fatal/warning/usage: that is shown in front of these messages. Will merge to 'next'. source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com> * ds/t5510-brokequote (2022-06-21) 1 commit - t5510: replace 'origin' with URL more carefully Test fix. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * en/merge-restore-to-pristine (2022-06-21) 6 commits - merge: do not exit restore_state() prematurely - merge: ensure we can actually restore pre-merge state - merge: make restore_state() restore staged state too - merge: fix save_state() to work when there are racy-dirty files - merge: remove unused variable - t6424: make sure a failed merge preserves local changes When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. Needs review. source: <pull.1231.v2.git.1655621424.gitgitgadget@gmail.com> * rs/combine-diff-with-incompatible-options (2022-06-21) 2 commits - combine-diff: abort if --output is given - combine-diff: abort if --ignore-matching-lines is given Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. Will merge to 'next'. source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com> * tk/apply-case-insensitive (2022-06-21) 3 commits - apply: support case-only renames in case-insensitive filesystems - reset: new failing test for reset of case-insensitive duplicate in index - t4141: test "git apply" with core.ignorecase "git apply" barfed on a patch that makes a case-only rename on a case-insensitive filesystem. Needs review. source: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com> * zh/ls-files-format (2022-06-27) 1 commit - ls-files: introduce "--format" option "git ls-files" learns the "--format" option to tweak its output. Expecting a reroll. cf. <CAOLTT8Tc95-aUE+uN2d8QjTJpGpGw6cBJfG+bpmyE55OcXTSRA@mail.gmail.com> source: <pull.1262.v4.git.1656257376109.gitgitgadget@gmail.com> * ab/test-quoting-fix (2022-06-30) 3 commits - config tests: fix harmless but broken "rm -r" cleanup - test-lib.sh: fix prepend_var() quoting issue - tests: add missing double quotes to included library paths Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. Will merge to 'next'. source: <cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com> * en/merge-dual-dir-renames-fix (2022-06-30) 5 commits - merge-ort: fix issue with dual rename and add/add conflict - merge-ort: shuffle the computation and cleanup of potential collisions - merge-ort: make a separate function for freeing struct collisions - merge-ort: small cleanups of check_for_directory_rename - t6423: add tests of dual directory rename plus add/add conflict Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. Will merge to 'next'? source: <pull.1268.v3.git.1656653000.gitgitgadget@gmail.com> * cr/setup-bug-typo (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 8834ffe0ab) + setup: fix function name in a BUG() message Typofix in a BUG() message. Will cook in 'next'. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit - send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". Will merge to 'next'. source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit - remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspecs. Will merge to 'next'. source: <20220617002036.1577-2-jacob.keller@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings Expecting a reroll. source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. Will cook in 'next'. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * ro/mktree-allow-missing-fix (2022-06-21) 1 commit - mktree: do not check type of remote objects "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary. Will merge to 'next'. source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com> * ll/curl-accept-language (2022-06-13) 2 commits - PREP??? give initializer to rpc_state - remote-curl: send Accept-Language header to server source: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> * pb/diff-doc-raw-format (2022-06-13) 3 commits - diff-index.txt: update raw output format in examples - diff-format.txt: correct misleading wording - diff-format.txt: dst can be 0* SHA-1 when path is deleted, too source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits (merged to 'next' on 2022-06-17 at ab5af6acd1) + archive-tar: use internal gzip by default + archive-tar: use OS_CODE 3 (Unix) for internal gzip + archive-tar: add internal gzip implementation + archive-tar: factor out write_block() + archive: rename archiver data field to filter_command + archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. Will cook in 'next'. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * ds/branch-checked-out (2022-06-21) 7 commits (merged to 'next' on 2022-06-21 at e42bc4566f) + branch: drop unused worktrees variable + fetch: stop passing around unused worktrees variable (merged to 'next' on 2022-06-17 at c881874257) + branch: fix branch_checked_out() leaks + branch: use branch_checked_out() when deleting refs + fetch: use new branch_checked_out() and add tests + branch: check for bisects and rebases + branch: add branch_checked_out() helper (this branch is used by ds/rebase-update-ref.) Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. Will cook in 'next'. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * ab/submodule-cleanup (2022-06-28) 12 commits - git-sh-setup.sh: remove "say" function, change last users - git-submodule.sh: use "$quiet", not "$GIT_QUIET" - submodule--helper: eliminate internal "--update" option - submodule--helper: understand --checkout, --merge and --rebase synonyms - submodule--helper: report "submodule" as our name in some "-h" output - submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" - submodule update: remove "-v" option - submodule--helper: have --require-init imply --init - git-submodule.sh: remove unused top-level "--branch" argument - git-submodule.sh: make the "$cached" variable a boolean - git-submodule.sh: remove unused $prefix variable - git-submodule.sh: remove unused sanitize_submodule_env() (this branch is used by gc/submodule-use-super-prefix.) Further preparation to turn git-submodule.sh into a builtin. Will merge to 'next'. source: <cover-v4-00.12-00000000000-20220628T095914Z-avarab@gmail.com> * jc/resolve-undo (2022-06-09) 1 commit (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will cook in 'next'. source: <xmqqfskdieqz.fsf@gitster.g> * ab/build-gitweb (2022-06-28) 8 commits - gitweb/Makefile: add a "NO_GITWEB" parameter - Makefile: build 'gitweb' in the default target - gitweb/Makefile: include in top-level Makefile - gitweb: remove "test" and "test-installed" targets - gitweb/Makefile: prepare to merge into top-level Makefile - gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars - gitweb/Makefile: add a $(GITWEB_ALL) variable - gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. source: <cover-v3-0.8-00000000000-20220628T100936Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits - tests: don't assume a .git/info for .git/info/sparse-checkout - tests: don't assume a .git/info for .git/info/exclude - tests: don't assume a .git/info for .git/info/refs - tests: don't assume a .git/info for .git/info/attributes - tests: don't assume a .git/info for .git/info/grafts - tests: don't depend on template-created .git/branches - t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'next'? source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. Will cook in 'next'. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits - unpack-objects: use stream_loose_object() to unpack large objects - core doc: modernize core.bigFileThreshold documentation - object-file.c: add "stream_loose_object()" to handle large object - object-file.c: factor out deflate part of write_loose_object() - object-file.c: refactor write_loose_object() to several steps - unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'next'. source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-06-27) 16 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: move even the command-line parsing to `bisect--helper` - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message - bisect: verify that a bogus option won't try to start a bisection Final bits of "git bisect.sh" have been rewritten in C. source: <pull.1132.v4.git.1656354677.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-06-30) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: learn `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Will merge to 'next'? source: <pull.1261.v6.git.git.1656612839.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-06-21) 2 commits - dir: minor refactoring / clean-up - dir: traverse into repository With a non-bare repository, with core.worktree pointing at a directory that has the repository as its subdirectory, regressed in Git 2.27 days. Will merge to 'next'. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> * ar/send-email-confirm-by-default (2022-04-22) 1 commit - send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Will discard. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. Thoughts? source: <20220422083629.1404989-1-hi@alyssa.is>
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Git 2.37 (final) has been tagged. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [Graduated to 'master'] * ab/credentials-in-url-more (2022-06-23) 1 commit (merged to 'next' on 2022-06-23 at 11d700111c) + Documentation/config/transfer.txt: fix typo Typofix. source: <68c1c3648c51f6298eea4d58286b20e0c770a270.1656010900.git.me@ttaylorr.com> * jc/revert-show-parent-info (2022-06-27) 1 commit (merged to 'next' on 2022-06-27 at 9a7cc59c69) + revert: config documentation fixes Typofix. source: <6727daf1-f077-7319-187e-ab4e55de3b2d@web.de> -------------------------------------------------- [New Topics] * ab/squelch-empty-fsync-traces (2022-06-23) 1 commit - trace2: don't include "fsync" events in all trace2 logs Omit fsync-related trace2 entries when their values are all zero. Expecting a reroll. cf. <xmqqh74byy19.fsf@gitster.g> source: <patch-1.1-df87e515efd-20220623T154943Z-avarab@gmail.com> * cl/grep-max-count (2022-06-22) 1 commit - grep: add --max-count command line option "git grep -m<max-hits>" is a way to limit the hits shown per file. Will merge to 'next'. source: <pull.1278.v4.git.git.1655927252899.gitgitgadget@gmail.com> * jk/revisions-doc-markup-fix (2022-06-22) 1 commit - revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis Documentation mark-up fix. Will merge to 'next'. source: <YrOmsA04FZae89be@coredump.intra.peff.net> * tk/rev-parse-doc-clarify-at-u (2022-06-23) 1 commit - rev-parse: documentation adjustment - mention remote tracking with @{u} Doc update. Will merge to 'next'. source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com> -------------------------------------------------- [Stalled] * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * en/merge-tree (2022-06-22) 17 commits - git-merge-tree.txt: add a section on potentional usage mistakes - merge-tree: add a --allow-unrelated-histories flag - merge-tree: allow `ls-files -u` style info to be NUL terminated - merge-ort: optionally produce machine-readable output - merge-ort: store more specific conflict information - merge-ort: make `path_messages` a strmap to a string_list - merge-ort: store messages in a list, not in a single strbuf - merge-tree: provide easy access to `ls-files -u` style info - merge-tree: provide a list of which files have conflicts - merge-ort: remove command-line-centric submodule message from merge-ort - merge-ort: provide a merge_get_conflicted_files() helper function - merge-tree: support including merge messages in output - merge-ort: split out a separate display_update_messages() function - merge-tree: implement real merges - merge-tree: add option parsing and initial shell for real merge function - merge-tree: move logic for existing merge into new function - merge-tree: rename merge_trees() to trivial_merge_trees() A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. Will merge to 'next'. source: <pull.1122.v7.git.1655511660.gitgitgadget@gmail.com> * dr/i18n-die-warn-error-usage (2022-06-21) 1 commit - i18n: mark message helpers prefix for translation Give _() markings to fatal/warning/usage: that is shown in front of these messages. Will merge to 'next'. source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com> * ds/t5510-brokequote (2022-06-21) 1 commit - t5510: replace 'origin' with URL more carefully Test fix. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * en/merge-restore-to-pristine (2022-06-21) 6 commits - merge: do not exit restore_state() prematurely - merge: ensure we can actually restore pre-merge state - merge: make restore_state() restore staged state too - merge: fix save_state() to work when there are racy-dirty files - merge: remove unused variable - t6424: make sure a failed merge preserves local changes When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. Needs review. source: <pull.1231.v2.git.1655621424.gitgitgadget@gmail.com> * rs/combine-diff-with-incompatible-options (2022-06-21) 2 commits - combine-diff: abort if --output is given - combine-diff: abort if --ignore-matching-lines is given Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. Will merge to 'next'. source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com> * tk/apply-case-insensitive (2022-06-21) 3 commits - apply: support case-only renames in case-insensitive filesystems - reset: new failing test for reset of case-insensitive duplicate in index - t4141: test "git apply" with core.ignorecase "git apply" barfed on a patch that makes a case-only rename on a case-insensitive filesystem. Needs review. source: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com> * zh/ls-files-format (2022-06-27) 1 commit - ls-files: introduce "--format" option "git ls-files" learns the "--format" option to tweak its output. Expecting a reroll. cf. <CAOLTT8Tc95-aUE+uN2d8QjTJpGpGw6cBJfG+bpmyE55OcXTSRA@mail.gmail.com> source: <pull.1262.v4.git.1656257376109.gitgitgadget@gmail.com> * ab/test-quoting-fix (2022-06-21) 3 commits - config tests: fix harmless but broken "rm -r" cleanup - test-lib.sh: fix prepend_var() quoting issue - tests: add missing double quotes to included library paths Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. Expecting a reroll. source: <cover-0.3-00000000000-20220621T221928Z-avarab@gmail.com> * en/merge-dual-dir-renames-fix (2022-06-21) 3 commits - merge-ort: fix issue with dual rename and add/add conflict - merge-ort: shuffle the computation and cleanup of potential collisions - t6423: add tests of dual directory rename plus add/add conflict Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. Needs review. source: <pull.1268.git.1655871651.gitgitgadget@gmail.com> * cr/setup-bug-typo (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 8834ffe0ab) + setup: fix function name in a BUG() message Typofix in a BUG() message. Will cook in 'next'. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit - send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". Will merge to 'next'. source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit - remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspecs. Will merge to 'next'. source: <20220617002036.1577-2-jacob.keller@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings Expecting a reroll. source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. Will cook in 'next'. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * ro/mktree-allow-missing-fix (2022-06-21) 1 commit - mktree: do not check type of remote objects "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary. Will merge to 'next'. source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com> * ll/curl-accept-language (2022-06-13) 2 commits - PREP??? give initializer to rpc_state - remote-curl: send Accept-Language header to server source: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> * pb/diff-doc-raw-format (2022-06-13) 3 commits - diff-index.txt: update raw output format in examples - diff-format.txt: correct misleading wording - diff-format.txt: dst can be 0* SHA-1 when path is deleted, too source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits (merged to 'next' on 2022-06-17 at ab5af6acd1) + archive-tar: use internal gzip by default + archive-tar: use OS_CODE 3 (Unix) for internal gzip + archive-tar: add internal gzip implementation + archive-tar: factor out write_block() + archive: rename archiver data field to filter_command + archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. Will cook in 'next'. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * ds/branch-checked-out (2022-06-21) 7 commits (merged to 'next' on 2022-06-21 at e42bc4566f) + branch: drop unused worktrees variable + fetch: stop passing around unused worktrees variable (merged to 'next' on 2022-06-17 at c881874257) + branch: fix branch_checked_out() leaks + branch: use branch_checked_out() when deleting refs + fetch: use new branch_checked_out() and add tests + branch: check for bisects and rebases + branch: add branch_checked_out() helper Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. Will cook in 'next'. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * ab/submodule-cleanup (2022-06-15) 12 commits - git-sh-setup.sh: remove "say" function, change last users - git-submodule.sh: use "$quiet", not "$GIT_QUIET" - submodule--helper: eliminate internal "--update" option - submodule--helper: understand --checkout, --merge and --rebase synonyms - submodule--helper: report "submodule" as our name in "-h" output - submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" - submodule update: remove "-v" option - submodule--helper: have --require-init imply --init - git-submodule.sh: remove unused top-level "--branch" argument - git-submodule.sh: make "$cached" variable a boolean - git-submodule.sh: remove unused $prefix var and --super-prefix - git-submodule.sh: remove unused sanitize_submodule_env() Further preparation to turn git-submodule.sh into a builtin. Will merge to 'next'? source: <cover-v2-00.12-00000000000-20220613T220150Z-avarab@gmail.com> * jc/resolve-undo (2022-06-09) 1 commit (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will cook in 'next'. source: <xmqqfskdieqz.fsf@gitster.g> * ab/build-gitweb (2022-06-02) 7 commits - Makefile: build 'gitweb' in the default target - gitweb/Makefile: include in top-level Makefile - gitweb: remove "test" and "test-installed" targets - gitweb/Makefile: prepare to merge into top-level Makefile - gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars - gitweb/Makefile: add a $(GITWEB_ALL) variable - gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Needs review. source: <cover-v2-0.7-00000000000-20220531T173805Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits - tests: don't assume a .git/info for .git/info/sparse-checkout - tests: don't assume a .git/info for .git/info/exclude - tests: don't assume a .git/info for .git/info/refs - tests: don't assume a .git/info for .git/info/attributes - tests: don't assume a .git/info for .git/info/grafts - tests: don't depend on template-created .git/branches - t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'next'? source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. Will cook in 'next'. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits - unpack-objects: use stream_loose_object() to unpack large objects - core doc: modernize core.bigFileThreshold documentation - object-file.c: add "stream_loose_object()" to handle large object - object-file.c: factor out deflate part of write_loose_object() - object-file.c: refactor write_loose_object() to several steps - unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'next'. source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-05-21) 15 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect: move even the command-line parsing to `bisect--helper` - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message Final bits of "git bisect.sh" have been rewritten in C. The command line parsing is reported to be still broken. cf. <220521.86zgjazuy4.gmgdl@evledraar.gmail.com> source: <pull.1132.v3.git.1653144546.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-06-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: read protected config with `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Expecting a reroll. cf. <xmqqbkv4t7gp.fsf@gitster.g> source: <29053d029f8ec61095a2ad557be38b1d485a158f.1654635432.git.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-06-21) 2 commits - dir: minor refactoring / clean-up - dir: traverse into repository With a non-bare repository, with core.worktree pointing at a directory that has the repository as its subdirectory, regressed in Git 2.27 days. Will merge to 'next'. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> * ar/send-email-confirm-by-default (2022-04-22) 1 commit - send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Will discard. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. Thoughts? source: <20220422083629.1404989-1-hi@alyssa.is>
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Git 2.37-rc2 has been tagged. Due to summer vacation season in the northern hemisphere, this cycle is shorter than usual. We expect to tag the final 2.37 release early next week. Hopefully we fixed all the known regressions in 2.36 without adding too many new ones. Some new topics are still marked for 'next', but the merges of them obviously will happen in the next cycle---they will not be in the upcoming release. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [New Topics] * dr/i18n-die-warn-error-usage (2022-06-21) 1 commit - i18n: mark message helpers prefix for translation Give _() markings to fatal/warning/usage: that is shown in front of these messages. Will merge to 'next'? source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com> * ds/t5510-brokequote (2022-06-21) 1 commit - t5510: replace 'origin' with URL more carefully Test fix. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * en/merge-restore-to-pristine (2022-06-21) 6 commits - merge: do not exit restore_state() prematurely - merge: ensure we can actually restore pre-merge state - merge: make restore_state() restore staged state too - merge: fix save_state() to work when there are racy-dirty files - merge: remove unused variable - t6424: make sure a failed merge preserves local changes When "git merge" finds that it cannot perform a merge, it should restore the working tree to the state before the command was initiated, but in some corner cases it didn't. Needs review. source: <pull.1231.v2.git.1655621424.gitgitgadget@gmail.com> * rs/combine-diff-with-incompatible-options (2022-06-21) 2 commits - combine-diff: abort if --output is given - combine-diff: abort if --ignore-matching-lines is given Certain diff options are currently ignored when combined-diff is shown; mark them as incompatible with the feature. Will merge to 'next'? source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com> * tk/apply-case-insensitive (2022-06-21) 3 commits - apply: support case-only renames in case-insensitive filesystems - reset: new failing test for reset of case-insensitive duplicate in index - t4141: test "git apply" with core.ignorecase "git apply" barfed on a patch that makes a case-only rename on a case-insensitive filesystem. Needs review. source: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com> * zh/ls-files-format (2022-06-21) 1 commit - ls-files: introduce "--format" option "git ls-files" learns the "--format" option to tweak its output. Needs review. source: <pull.1262.v3.git.1655777140231.gitgitgadget@gmail.com> * ab/test-quoting-fix (2022-06-21) 3 commits - config tests: fix harmless but broken "rm -r" cleanup - test-lib.sh: fix prepend_var() quoting issue - tests: add missing double quotes to included library paths Fixes for tests when the source directory has unusual characters in its path, e.g. whitespaces, double-quotes, etc. Expecting a reroll. source: <cover-0.3-00000000000-20220621T221928Z-avarab@gmail.com> * en/merge-dual-dir-renames-fix (2022-06-21) 3 commits - merge-ort: fix issue with dual rename and add/add conflict - merge-ort: shuffle the computation and cleanup of potential collisions - t6423: add tests of dual directory rename plus add/add conflict Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. Needs review. source: <pull.1268.git.1655871651.gitgitgadget@gmail.com> -------------------------------------------------- [Graduated to 'master'] * jp/prompt-clear-before-upstream-mark (2022-06-10) 2 commits (merged to 'next' on 2022-06-15 at e580db03e9) + git-prompt: fix expansion of branch colour codes (merged to 'next' on 2022-06-08 at 201a84ad63) + git-prompt: make colourization consistent Bash command line prompt (in contrib/) update. source: <20220607115024.64724-1-joak-pet@online.no> * tb/cruft-packs (2022-06-21) 1 commit (merged to 'next' on 2022-06-21 at 0703251124) + gc: simplify --cruft description Docfix. source: <157741e2-cd06-9304-bb21-c67c2cbd923e@web.de> -------------------------------------------------- [Stalled] * en/merge-tree (2022-02-23) 13 commits - git-merge-tree.txt: add a section on potentional usage mistakes - merge-tree: add a --allow-unrelated-histories flag - merge-tree: allow `ls-files -u` style info to be NUL terminated - merge-tree: provide easy access to `ls-files -u` style info - merge-tree: provide a list of which files have conflicts - merge-ort: provide a merge_get_conflicted_files() helper function - merge-tree: support including merge messages in output - merge-ort: split out a separate display_update_messages() function - merge-tree: implement real merges - merge-tree: add option parsing and initial shell for real merge function - merge-tree: move logic for existing merge into new function - merge-tree: rename merge_trees() to trivial_merge_trees() - Merge branch 'en/remerge-diff' into en/merge-trees A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. On hold. cf. <CABPp-BGZ7OAYRR5YKRsxJSo-C=ho+qcNAkqwkim8CkhCfCeHsA@mail.gmail.com> source: <pull.1122.v6.git.1645602413.gitgitgadget@gmail.com> * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * cr/setup-bug-typo (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 8834ffe0ab) + setup: fix function name in a BUG() message Typofix in a BUG() message. Will cook in 'next'. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit - send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". Will merge to 'next'? source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit - remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspecs. Will merge to 'next'? source: <20220617002036.1577-2-jacob.keller@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. Will cook in 'next'. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * ro/mktree-allow-missing-fix (2022-06-21) 1 commit - mktree: do not check type of remote objects "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary. Will merge to 'next'? source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com> * ll/curl-accept-language (2022-06-13) 2 commits - PREP??? give initializer to rpc_state - remote-curl: send Accept-Language header to server source: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> * pb/diff-doc-raw-format (2022-06-13) 3 commits - diff-index.txt: update raw output format in examples - diff-format.txt: correct misleading wording - diff-format.txt: dst can be 0* SHA-1 when path is deleted, too source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits (merged to 'next' on 2022-06-17 at ab5af6acd1) + archive-tar: use internal gzip by default + archive-tar: use OS_CODE 3 (Unix) for internal gzip + archive-tar: add internal gzip implementation + archive-tar: factor out write_block() + archive: rename archiver data field to filter_command + archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. Will cook in 'next'. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * ds/branch-checked-out (2022-06-21) 7 commits (merged to 'next' on 2022-06-21 at e42bc4566f) + branch: drop unused worktrees variable + fetch: stop passing around unused worktrees variable (merged to 'next' on 2022-06-17 at c881874257) + branch: fix branch_checked_out() leaks + branch: use branch_checked_out() when deleting refs + fetch: use new branch_checked_out() and add tests + branch: check for bisects and rebases + branch: add branch_checked_out() helper Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. Will cook in 'next'. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * gc/submodule-update (2022-06-15) 12 commits - git-sh-setup.sh: remove "say" function, change last users - git-submodule.sh: use "$quiet", not "$GIT_QUIET" - submodule--helper: eliminate internal "--update" option - submodule--helper: understand --checkout, --merge and --rebase synonyms - submodule--helper: report "submodule" as our name in "-h" output - submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" - submodule update: remove "-v" option - submodule--helper: have --require-init imply --init - git-submodule.sh: remove unused top-level "--branch" argument - git-submodule.sh: make "$cached" variable a boolean - git-submodule.sh: remove unused $prefix var and --super-prefix - git-submodule.sh: remove unused sanitize_submodule_env() More work on "git submodule update". Needs review. source: <cover-v2-00.12-00000000000-20220613T220150Z-avarab@gmail.com> * jc/resolve-undo (2022-06-09) 1 commit (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will cook in 'next'. source: <xmqqfskdieqz.fsf@gitster.g> * ab/build-gitweb (2022-06-02) 7 commits - Makefile: build 'gitweb' in the default target - gitweb/Makefile: include in top-level Makefile - gitweb: remove "test" and "test-installed" targets - gitweb/Makefile: prepare to merge into top-level Makefile - gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars - gitweb/Makefile: add a $(GITWEB_ALL) variable - gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Needs review. source: <cover-v2-0.7-00000000000-20220531T173805Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits - tests: don't assume a .git/info for .git/info/sparse-checkout - tests: don't assume a .git/info for .git/info/exclude - tests: don't assume a .git/info for .git/info/refs - tests: don't assume a .git/info for .git/info/attributes - tests: don't assume a .git/info for .git/info/grafts - tests: don't depend on template-created .git/branches - t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'next'? source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. Will cook in 'next'. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits - unpack-objects: use stream_loose_object() to unpack large objects - core doc: modernize core.bigFileThreshold documentation - object-file.c: add "stream_loose_object()" to handle large object - object-file.c: factor out deflate part of write_loose_object() - object-file.c: refactor write_loose_object() to several steps - unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'next'? source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-05-21) 15 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect: move even the command-line parsing to `bisect--helper` - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message Final bits of "git bisect.sh" have been rewritten in C. The command line parsing is reported to be still broken. cf. <220521.86zgjazuy4.gmgdl@evledraar.gmail.com> source: <pull.1132.v3.git.1653144546.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-06-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: read protected config with `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Expecting a reroll. cf. <xmqqbkv4t7gp.fsf@gitster.g> source: <29053d029f8ec61095a2ad557be38b1d485a158f.1654635432.git.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-06-21) 2 commits - dir: minor refactoring / clean-up - dir: traverse into repository With a non-bare repository, with core.worktree pointing at a directory that has the repository as its subdirectory, regressed in Git 2.27 days. Will merge to 'next'. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> * ar/send-email-confirm-by-default (2022-04-22) 1 commit - send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Will discard. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. Thoughts? source: <20220422083629.1404989-1-hi@alyssa.is> -------------------------------------------------- [Discarded] * jc/apply-icase-tests (2022-06-13) 1 commit . t4141: test "git apply" with core.ignorecase Now a part of tk/apply-case-insensitive topic. source: <xmqqo7yw77qo.fsf@gitster.g> * tl/pack-bitmap-trace (2022-06-21) 5 commits . bitmap: add trace2 outputs during open "bitmap" file . pack-bitmap.c: using error() instead of silently returning -1 . pack-bitmap.c: make warnings support i18N when opening bitmap . pack-bitmap.c: rename "idx_name" to "bitmap_name" . pack-bitmap.c: continue looping when first MIDX bitmap is found Add trace2 traces in code paths involving the pack bitmaps. source: <cover.1655817253.git.dyroneteng@gmail.com>
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. Git 2.37-rc1 has been tagged. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [New Topics] * cr/setup-bug-typo (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 8834ffe0ab) + setup: fix function name in a BUG() message Typofix in a BUG() message. Will cook in 'next'. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * zk/push-use-bitmaps (2022-06-17) 1 commit - send-pack.c: add config push.useBitmaps "git push" sometimes perform poorly when reachability bitmaps are used, even in a repository where other operations are helped by bitmaps. The push.useBitmaps configuration variable is introduced to allow disabling use of reachability bitmaps only for "git push". Will merge to 'next'? source: <pull.1263.v4.git.1655492779228.gitgitgadget@gmail.com> -------------------------------------------------- [Graduated to 'master'] * ab/credentials-in-url-more (2022-06-15) 2 commits (merged to 'next' on 2022-06-16 at de19b3b40c) + transfer doc: move fetch.credentialsInUrl to "transfer" config namespace + fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate Rename fetch.credentialsInUrl to transfer.credentialsInUrl as the single configuration variable should work both in pushing and fetching. source: <cover-0.2-00000000000-20220615T103852Z-avarab@gmail.com> * cb/path-owner-check-with-sudo-plus (2022-06-17) 1 commit (merged to 'next' on 2022-06-17 at 518afcbc48) + git-compat-util: allow root to access both SUDO_UID and root owned "sudo git foo" used to consider a repository owned by the original user a safe one to access; it now also considers a repository owned by root a safe one, too (after all, if an attacker can craft a malicious repository owned by root, the box is 0wned already). source: <20220617202338.27984-1-carenas@gmail.com> * ds/more-test-coverage (2022-06-16) 4 commits (merged to 'next' on 2022-06-16 at 3f0452418c) + cache-tree: remove cache_tree_find_path() + pack-write: drop always-NULL parameter + t5329: test 'git gc --cruft' without '--prune=now' + t2107: test 'git update-index --verbose' Improve test coverage with a handful of tests. source: <pull.1261.v2.git.1655385230.gitgitgadget@gmail.com> * jc/cocci-cleanup (2022-06-07) 1 commit (merged to 'next' on 2022-06-16 at 990576f5c5) + cocci: retire is_null_sha1() rule Remove a coccinelle rule that is no longer relevant. source: <xmqq7d5suoqt.fsf@gitster.g> * jk/bug-fl-va-list-fix (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at 8150aebb0f) + bug_fl(): correctly initialize trace2 va_list Fix buggy va_list usage in recent code. source: <YquMyakxYnU6mI5a@coredump.intra.peff.net> * jk/perf-lib-test-titles (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at 064d7efa99) + perf-lib: fix missing test titles in output Show test titles to the performance test output again. source: <YqrXLO5oMYeOr2PB@coredump.intra.peff.net> * js/ci-github-workflow-markup (2022-06-13) 3 commits (merged to 'next' on 2022-06-15 at 03eb5e68ed) + ci(github): also mark up compile errors + ci(github): use grouping also in the `win-build` job + ci(github): bring back the 'print test failures' step Recent CI update hides certain failures in test jobs, which has been corrected. source: <pull.1253.v2.git.1655125988.gitgitgadget@gmail.com> * js/misc-fixes (2022-06-16) 6 commits (merged to 'next' on 2022-06-16 at 2f1f98e403) + relative_url(): fix incorrect condition + pack-mtimes: avoid closing a bogus file descriptor + read_index_from(): avoid memory leak + submodule--helper: avoid memory leak when fetching submodules + submodule-config: avoid memory leak + fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()` Assorted fixes to problems found by Coverity. source: <pull.1264.git.1655336146.gitgitgadget@gmail.com> -------------------------------------------------- [Stalled] * en/merge-tree (2022-02-23) 13 commits - git-merge-tree.txt: add a section on potentional usage mistakes - merge-tree: add a --allow-unrelated-histories flag - merge-tree: allow `ls-files -u` style info to be NUL terminated - merge-tree: provide easy access to `ls-files -u` style info - merge-tree: provide a list of which files have conflicts - merge-ort: provide a merge_get_conflicted_files() helper function - merge-tree: support including merge messages in output - merge-ort: split out a separate display_update_messages() function - merge-tree: implement real merges - merge-tree: add option parsing and initial shell for real merge function - merge-tree: move logic for existing merge into new function - merge-tree: rename merge_trees() to trivial_merge_trees() - Merge branch 'en/remerge-diff' into en/merge-trees A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. On hold. cf. <CABPp-BGZ7OAYRR5YKRsxJSo-C=ho+qcNAkqwkim8CkhCfCeHsA@mail.gmail.com> source: <pull.1122.v6.git.1645602413.gitgitgadget@gmail.com> * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * jk/remote-show-with-negative-refspecs (2022-06-17) 1 commit - remote: handle negative refspecs in git remote show (this branch is used by jk/t5505-restructure.) "git remote show [-n] frotz" now pays attention to negative pathspecs. Will merge to 'next'? source: <20220617002036.1577-2-jacob.keller@gmail.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. Will cook in 'next'. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * ro/mktree-allow-missing-fix (2022-06-16) 1 commit - mktree: do not load objects under '--missing' "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary. Waiting for review response. source: <1566aed1-a38f-a9ca-241c-21b56d732328@roku.com> * jc/apply-icase-tests (2022-06-13) 1 commit - t4141: test "git apply" with core.ignorecase source: <xmqqo7yw77qo.fsf@gitster.g> * ll/curl-accept-language (2022-06-13) 2 commits - PREP??? give initializer to rpc_state - remote-curl: send Accept-Language header to server source: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> * pb/diff-doc-raw-format (2022-06-13) 3 commits - diff-index.txt: update raw output format in examples - diff-format.txt: correct misleading wording - diff-format.txt: dst can be 0* SHA-1 when path is deleted, too source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits (merged to 'next' on 2022-06-17 at ab5af6acd1) + archive-tar: use internal gzip by default + archive-tar: use OS_CODE 3 (Unix) for internal gzip + archive-tar: add internal gzip implementation + archive-tar: factor out write_block() + archive: rename archiver data field to filter_command + archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. Will cook in 'next'. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * tl/pack-bitmap-trace (2022-06-13) 5 commits - bitmap: add trace2 outputs during open "bitmap" file - pack-bitmap.c: using error() instead of silently returning -1 - pack-bitmap.c: make warnings support i18N when opening bitmap - pack-bitmap.c: rename "idx_name" to "bitmap_name" - pack-bitmap.c: continue looping when first MIDX bitmap is found Add trace2 traces in code paths involving the pack bitmaps. Needs review. source: <cover.1655018322.git.dyroneteng@gmail.com> * ds/branch-checked-out (2022-06-15) 5 commits (merged to 'next' on 2022-06-17 at c881874257) + branch: fix branch_checked_out() leaks + branch: use branch_checked_out() when deleting refs + fetch: use new branch_checked_out() and add tests + branch: check for bisects and rebases + branch: add branch_checked_out() helper Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. Will cook in 'next'. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * gc/submodule-update (2022-06-15) 12 commits - git-sh-setup.sh: remove "say" function, change last users - git-submodule.sh: use "$quiet", not "$GIT_QUIET" - submodule--helper: eliminate internal "--update" option - submodule--helper: understand --checkout, --merge and --rebase synonyms - submodule--helper: report "submodule" as our name in "-h" output - submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" - submodule update: remove "-v" option - submodule--helper: have --require-init imply --init - git-submodule.sh: remove unused top-level "--branch" argument - git-submodule.sh: make "$cached" variable a boolean - git-submodule.sh: remove unused $prefix var and --super-prefix - git-submodule.sh: remove unused sanitize_submodule_env() More work on "git submodule update". Needs review. source: <cover-v2-00.12-00000000000-20220613T220150Z-avarab@gmail.com> * jc/resolve-undo (2022-06-09) 1 commit (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will cook in 'next'. source: <xmqqfskdieqz.fsf@gitster.g> * jp/prompt-clear-before-upstream-mark (2022-06-10) 2 commits (merged to 'next' on 2022-06-15 at e580db03e9) + git-prompt: fix expansion of branch colour codes (merged to 'next' on 2022-06-08 at 201a84ad63) + git-prompt: make colourization consistent Bash command line prompt (in contrib/) update. Will merge to 'master'. source: <20220607115024.64724-1-joak-pet@online.no> * ab/build-gitweb (2022-06-02) 7 commits - Makefile: build 'gitweb' in the default target - gitweb/Makefile: include in top-level Makefile - gitweb: remove "test" and "test-installed" targets - gitweb/Makefile: prepare to merge into top-level Makefile - gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars - gitweb/Makefile: add a $(GITWEB_ALL) variable - gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Needs review. source: <cover-v2-0.7-00000000000-20220531T173805Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits - tests: don't assume a .git/info for .git/info/sparse-checkout - tests: don't assume a .git/info for .git/info/exclude - tests: don't assume a .git/info for .git/info/refs - tests: don't assume a .git/info for .git/info/attributes - tests: don't assume a .git/info for .git/info/grafts - tests: don't depend on template-created .git/branches - t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'next'? source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. Will cook in 'next'. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits - unpack-objects: use stream_loose_object() to unpack large objects - core doc: modernize core.bigFileThreshold documentation - object-file.c: add "stream_loose_object()" to handle large object - object-file.c: factor out deflate part of write_loose_object() - object-file.c: refactor write_loose_object() to several steps - unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'next'? source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-05-21) 15 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect: move even the command-line parsing to `bisect--helper` - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message Final bits of "git bisect.sh" have been rewritten in C. The command line parsing is reported to be still broken. cf. <220521.86zgjazuy4.gmgdl@evledraar.gmail.com> source: <pull.1132.v3.git.1653144546.gitgitgadget@gmail.com> * gc/bare-repo-discovery (2022-06-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: read protected config with `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Expecting a reroll. cf. <xmqqbkv4t7gp.fsf@gitster.g> source: <29053d029f8ec61095a2ad557be38b1d485a158f.1654635432.git.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-05-20) 3 commits - dir: minor refactoring / clean-up - dir: cache git_dir's realpath - dir: traverse into repository With a non-bare repository, with core.worktree pointing at a directory that has the repository as its subdirectory, regressed in Git 2.27 days. Needs review. source: <20220520192840.8942-1-ggossdev@gmail.com> * ar/send-email-confirm-by-default (2022-04-22) 1 commit - send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Will discard. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. Thoughts? source: <20220422083629.1404989-1-hi@alyssa.is>
From: Jacob Keller <jacob.e.keller@intel.com> The t5505-remote.sh function makes heavy use of git config, often leaving potentially stale configuration which may affect future tests. Fix this by using test_config instead, which ensures the configuration values get unset. The t5505-remote.sh script makes use of the --add option of git config. Teach this option to test_config, and then use test_config where appropriate. Some configuration values in the 'show' test are left alone. This is done because these values are actually relied upon by future tests, and clearing them breaks the expectations. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> --- t/t5505-remote.sh | 52 ++++++++++++++++++++--------------------- t/test-lib-functions.sh | 6 ++++- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 7914379ed253..8cad753023ef 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -95,7 +95,7 @@ test_expect_success 'filters for promisor remotes are listed by git remote -v' ' git -C pc remote -v >out && grep "srv.bare (fetch) \[blob:none\]" out && - git -C pc config remote.origin.partialCloneFilter object:type=commit && + test_config -C pc remote.origin.partialCloneFilter object:type=commit && git -C pc remote -v >out && grep "srv.bare (fetch) \[object:type=commit\]" out ' @@ -155,10 +155,10 @@ test_expect_success 'remove remote protects local branches' ' git branch -d main EOF git -C test tag footag && - git -C test config --add remote.oops.fetch "+refs/*:refs/*" && + test_config -C test --add remote.oops.fetch "+refs/*:refs/*" && git -C test remote remove oops 2>actual1 && git -C test branch foobranch && - git -C test config --add remote.oops.fetch "+refs/*:refs/*" && + test_config -C test --add remote.oops.fetch "+refs/*:refs/*" && git -C test remote rm oops 2>actual2 && git -C test branch -d foobranch && git -C test tag -d footag && @@ -183,7 +183,7 @@ test_expect_success 'remove remote with a branch without configured merge' ' git -C test remote add two ../two && git -C test fetch two && git -C test checkout -b second two/main^0 && - git -C test config branch.second.remote two && + test_config -C test branch.second.remote two && git -C test checkout main && git -C test remote rm two ' @@ -294,8 +294,7 @@ cat >expect <<EOF EOF test_expect_success 'show with negative refspecs' ' - test_when_finished "git -C test config --unset-all --fixed-value remote.origin.fetch ^refs/heads/main" && - git -C test config --add remote.origin.fetch ^refs/heads/main && + test_config -C test --add remote.origin.fetch ^refs/heads/main && git -C test remote show origin >output && test_cmp expect output ' @@ -317,8 +316,7 @@ cat >expect <<EOF EOF test_expect_failure 'show stale with negative refspecs' ' - test_when_finished "git -C test config --unset-all --fixed-value remote.origin.fetch ^refs/heads/side" && - git -C test config --add remote.origin.fetch ^refs/heads/side && + test_config -C test --add remote.origin.fetch ^refs/heads/side && git -C test remote show origin >output && test_cmp expect output ' @@ -488,8 +486,8 @@ test_expect_success 'add alt && prune' ' mkdir alttst && git -C alttst init && git -C alttst remote add -f origin ../one && - git -C alttst config remote.alt.url ../one && - git -C alttst config remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*" && + test_config -C alttst remote.alt.url ../one && + test_config -C alttst remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*" && git -C one branch -m side side2 && git -C alttst rev-parse --verify refs/remotes/origin/side && test_must_fail git -C alttst rev-parse --verify refs/remotes/origin/side2 && @@ -590,8 +588,8 @@ test_expect_success 'update with arguments' ' done && git -C one remote add manduca ../mirror && git -C one remote add megaloprepus ../mirror && - git -C one config remotes.phobaeticus "drosophila megaloprepus" && - git -C one config remotes.titanus manduca && + test_config -C one remotes.phobaeticus "drosophila megaloprepus" && + test_config -C one remotes.titanus manduca && git -C one remote update phobaeticus titanus && git -C one branch -r >output && test_cmp expect output @@ -619,7 +617,7 @@ test_expect_success 'update default' ' do git -C one branch -r -d $b || exit 1 done && - git -C one config remote.drosophila.skipDefaultUpdate true && + test_config -C one remote.drosophila.skipDefaultUpdate true && git -C one remote update default && git -C one branch -r >output && test_cmp expect output @@ -636,7 +634,7 @@ test_expect_success 'update default (overridden, with funny whitespace)' ' do git -C one branch -r -d $b || exit 1 done && - git -C one config remotes.default "$(printf "\t drosophila \n")" && + test_config -C one remotes.default "$(printf "\t drosophila \n")" && git -C one remote update default && git -C one branch -r >output && test_cmp expect output @@ -647,7 +645,7 @@ test_expect_success 'update (with remotes.default defined)' ' do git -C one branch -r -d $b || exit 1 done && - git -C one config remotes.default "drosophila" && + test_config -C one remotes.default "drosophila" && git -C one remote update && git -C one branch -r >output && test_cmp expect output @@ -670,7 +668,7 @@ test_expect_success 'reject adding remote with an invalid name' ' test_expect_success 'rename a remote' ' test_config --global remote.pushDefault origin && git clone one four && - git -C four config branch.main.pushRemote origin && + test_config -C four branch.main.pushRemote origin && GIT_TRACE2_EVENT=$(pwd)/trace \ git -C four remote rename --progress origin upstream && test_region progress "Renaming remote references" trace && @@ -686,7 +684,7 @@ test_expect_success 'rename a remote' ' test_expect_success 'rename a remote renames repo remote.pushDefault' ' git clone one four.1 && - git -C four.1 config remote.pushDefault origin && + test_config -C four.1 remote.pushDefault origin && git -C four.1 remote rename origin upstream && grep pushDefault four.1/.git/config && test "$(git -C four.1 config --local remote.pushDefault)" = "upstream" @@ -695,7 +693,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault' ' test_expect_success 'rename a remote renames repo remote.pushDefault but ignores global' ' test_config --global remote.pushDefault other && git clone one four.2 && - git -C four.2 config remote.pushDefault origin && + test_config -C four.2 remote.pushDefault origin && git -C four.2 remote rename origin upstream && test "$(git -C four.2 config --global remote.pushDefault)" = "other" && test "$(git -C four.2 config --local remote.pushDefault)" = "upstream" @@ -704,7 +702,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault but ignores test_expect_success 'rename a remote renames repo remote.pushDefault but keeps global' ' test_config --global remote.pushDefault origin && git clone one four.3 && - git -C four.3 config remote.pushDefault origin && + test_config -C four.3 remote.pushDefault origin && git -C four.3 remote rename origin upstream && test "$(git -C four.3 config --global remote.pushDefault)" = "origin" && test "$(git -C four.3 config --local remote.pushDefault)" = "upstream" @@ -712,7 +710,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault but keeps g test_expect_success 'rename does not update a non-default fetch refspec' ' git clone one four.one && - git -C four.one config remote.origin.fetch +refs/heads/*:refs/heads/origin/* && + test_config -C four.one remote.origin.fetch +refs/heads/*:refs/heads/origin/* && git -C four.one remote rename origin upstream && test "$(git -C four.one config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" && git -C four.one rev-parse -q origin/main @@ -742,7 +740,7 @@ test_expect_success 'rename succeeds with existing remote.<target>.prune' ' test_expect_success 'remove a remote' ' test_config --global remote.pushDefault origin && git clone one four.five && - git -C four.five config branch.main.pushRemote origin && + test_config -C four.five branch.main.pushRemote origin && git -C four.five remote remove origin && test -z "$(git -C four.five for-each-ref refs/remotes/origin)" && test_must_fail git -C four.five config branch.main.remote && @@ -752,7 +750,7 @@ test_expect_success 'remove a remote' ' test_expect_success 'remove a remote removes repo remote.pushDefault' ' git clone one four.five.1 && - git -C four.five.1 config remote.pushDefault origin && + test_config -C four.five.1 remote.pushDefault origin && git -C four.five.1 remote remove origin && test_must_fail git -C four.five.1 config --local remote.pushDefault ' @@ -760,7 +758,7 @@ test_expect_success 'remove a remote removes repo remote.pushDefault' ' test_expect_success 'remove a remote removes repo remote.pushDefault but ignores global' ' test_config --global remote.pushDefault other && git clone one four.five.2 && - git -C four.five.2 config remote.pushDefault origin && + test_config -C four.five.2 remote.pushDefault origin && git -C four.five.2 remote remove origin && test "$(git -C four.five.2 config --global remote.pushDefault)" = "other" && test_must_fail git -C four.five.2 config --local remote.pushDefault @@ -769,7 +767,7 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but ignores test_expect_success 'remove a remote removes repo remote.pushDefault but keeps global' ' test_config --global remote.pushDefault origin && git clone one four.five.3 && - git -C four.five.3 config remote.pushDefault origin && + test_config -C four.five.3 remote.pushDefault origin && git -C four.five.3 remote remove origin && test "$(git -C four.five.3 config --global remote.pushDefault)" = "origin" && test_must_fail git -C four.five.3 config --local remote.pushDefault @@ -1210,9 +1208,9 @@ test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and git -C two tag -a -m "Some tag" my-tag main && git -C two update-ref refs/trees/my-head-tree HEAD^{tree} && git -C two update-ref refs/blobs/my-file-blob HEAD:file && - git -C test config --add remote.two.fetch "+refs/tags/*:refs/remotes/tags-from-two/*" && - git -C test config --add remote.two.fetch "+refs/trees/*:refs/remotes/trees-from-two/*" && - git -C test config --add remote.two.fetch "+refs/blobs/*:refs/remotes/blobs-from-two/*" && + test_config -C test --add remote.two.fetch "+refs/tags/*:refs/remotes/tags-from-two/*" && + test_config -C test --add remote.two.fetch "+refs/trees/*:refs/remotes/trees-from-two/*" && + test_config -C test --add remote.two.fetch "+refs/blobs/*:refs/remotes/blobs-from-two/*" && git -C test fetch --no-tags two && test_must_fail git -C test push origin refs/remotes/two/another:dst 2>err && diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 9957eb2e6c30..7955ef03b8c4 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -574,6 +574,7 @@ test_unconfig () { # Set git config, automatically unsetting it after the test is over. test_config () { global= + add= config_dir= while test $# != 0 do @@ -585,6 +586,9 @@ test_config () { --global) global=--global ;; + --add) + add=--add + ;; -*) BUG "invalid test_config option: $1" ;; @@ -606,7 +610,7 @@ test_config () { esac test_when_finished "test_unconfig ${config_dir:+-C '$config_dir'} --fixed-value $global '$1' '$2'" && - git ${config_dir:+-C "$config_dir"} config $global "$1" "$2" + git ${config_dir:+-C "$config_dir"} config $global $add "$1" "$2" } write_script () { -- 2.36.1
git remote prune does not handle negative refspecs properly. If a negative refspec got added after a fetch, a user may expect that the resulting refs that were previously fetched would now be considered stale, and thus removed by git remote prune. Show that this isn't the case with a new test case. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> --- t/t5505-remote.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 8cad753023ef..0810e7d8d0b7 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -399,6 +399,19 @@ test_expect_success 'prune --dry-run' ' test_cmp expect output ' +cat >expect <<EOF +Pruning origin +URL: $(pwd)/one + * [would prune] origin/side2 +EOF + +test_expect_failure 'prune --dry-run negative refspec' ' + test_config -C test --add remote.origin.fetch ^refs/heads/side2 && + git -C test remote prune --dry-run origin >output && + git -C test rev-parse refs/remotes/origin/side2 && + test_cmp expect output +' + test_expect_success 'add --mirror && prune' ' mkdir mirror && git -C mirror init --bare && -- 2.36.1
From: Jacob Keller <jacob.e.keller@intel.com> The t5505-remote.sh test script makes liberal use of sub shells to move directories before executing a series of git commands. This is not the typical style of a more modern test script. Instead, newer tests favor the use of git's "-C" option to change directory before executing. Update this test script to drop the unnecessary sub shells. Where necessary, adjust the paths of various output files to account for this change. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> --- t/t5505-remote.sh | 1061 ++++++++++++++++++--------------------------- 1 file changed, 415 insertions(+), 646 deletions(-) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 0aad0eb4d26c..c4228a27a71f 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -28,14 +28,28 @@ tokens_match () { } check_remote_track () { - actual=$(git remote show "$1" | sed -ne 's|^ \(.*\) tracked$|\1|p') + local config_dir= + if test "$1" = -C + then + shift + config_dir=$1 + shift + fi + actual=$(git ${config_dir:+-C "$config_dir"} remote show "$1" | sed -ne 's|^ \(.*\) tracked$|\1|p') shift && tokens_match "$*" "$actual" } check_tracking_branch () { + local config_dir= + if test "$1" = -C + then + shift + config_dir=$1 + shift + fi f="" && - r=$(git for-each-ref "--format=%(refname)" | + r=$(git ${config_dir:+-C "$config_dir"} for-each-ref "--format=%(refname)" | sed -ne "s|^refs/remotes/$1/||p") && shift && tokens_match "$*" "$r" @@ -44,10 +58,7 @@ check_tracking_branch () { test_expect_success setup ' setup_repository one && setup_repository two && - ( - cd two && - git branch another - ) && + git -C two branch another && git clone one test ' @@ -57,25 +68,19 @@ test_expect_success 'add remote whose URL agrees with url.<...>.insteadOf' ' ' test_expect_success 'remote information for the origin' ' - ( - cd test && - tokens_match origin "$(git remote)" && - check_remote_track origin main side && - check_tracking_branch origin HEAD main side - ) + tokens_match origin "$(git -C test remote)" && + check_remote_track -C test origin main side && + check_tracking_branch -C test origin HEAD main side ' test_expect_success 'add another remote' ' - ( - cd test && - git remote add -f second ../two && - tokens_match "origin second" "$(git remote)" && - check_tracking_branch second main side another && - git for-each-ref "--format=%(refname)" refs/remotes | - sed -e "/^refs\/remotes\/origin\//d" \ - -e "/^refs\/remotes\/second\//d" >actual && - test_must_be_empty actual - ) + git -C test remote add -f second ../two && + tokens_match "origin second" "$(git -C test remote)" && + check_tracking_branch -C test second main side another && + git -C test for-each-ref "--format=%(refname)" refs/remotes | + sed -e "/^refs\/remotes\/origin\//d" \ + -e "/^refs\/remotes\/second\//d" >actual && + test_must_be_empty actual ' test_expect_success 'setup bare clone for server' ' @@ -113,76 +118,58 @@ test_expect_success 'filters are listed by git remote -v only' ' ' test_expect_success 'check remote-tracking' ' - ( - cd test && - check_remote_track origin main side && - check_remote_track second main side another - ) + check_remote_track -C test origin main side && + check_remote_track -C test second main side another ' test_expect_success 'remote forces tracking branches' ' - ( - cd test && - case $(git config remote.second.fetch) in - +*) true ;; - *) false ;; - esac - ) + case $(git -C test config remote.second.fetch) in + +*) true ;; + *) false ;; + esac ' test_expect_success 'remove remote' ' - ( - cd test && - git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main && - git remote rm second - ) + git -C test symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main && + git -C test remote rm second ' test_expect_success 'remove remote' ' - ( - cd test && - tokens_match origin "$(git remote)" && - check_remote_track origin main side && - git for-each-ref "--format=%(refname)" refs/remotes | - sed -e "/^refs\/remotes\/origin\//d" >actual && - test_must_be_empty actual - ) + tokens_match origin "$(git -C test remote)" && + check_remote_track -C test origin main side && + git -C test for-each-ref "--format=%(refname)" refs/remotes | + sed -e "/^refs\/remotes\/origin\//d" >actual && + test_must_be_empty actual ' test_expect_success 'remove remote protects local branches' ' - ( - cd test && - cat >expect1 <<-\EOF && - Note: A branch outside the refs/remotes/ hierarchy was not removed; - to delete it, use: - git branch -d main - EOF - cat >expect2 <<-\EOF && - Note: Some branches outside the refs/remotes/ hierarchy were not removed; - to delete them, use: - git branch -d foobranch - git branch -d main - EOF - git tag footag && - git config --add remote.oops.fetch "+refs/*:refs/*" && - git remote remove oops 2>actual1 && - git branch foobranch && - git config --add remote.oops.fetch "+refs/*:refs/*" && - git remote rm oops 2>actual2 && - git branch -d foobranch && - git tag -d footag && - test_cmp expect1 actual1 && - test_cmp expect2 actual2 - ) + cat >expect1 <<-\EOF && + Note: A branch outside the refs/remotes/ hierarchy was not removed; + to delete it, use: + git branch -d main + EOF + cat >expect2 <<-\EOF && + Note: Some branches outside the refs/remotes/ hierarchy were not removed; + to delete them, use: + git branch -d foobranch + git branch -d main + EOF + git -C test tag footag && + git -C test config --add remote.oops.fetch "+refs/*:refs/*" && + git -C test remote remove oops 2>actual1 && + git -C test branch foobranch && + git -C test config --add remote.oops.fetch "+refs/*:refs/*" && + git -C test remote rm oops 2>actual2 && + git -C test branch -d foobranch && + git -C test tag -d footag && + test_cmp expect1 actual1 && + test_cmp expect2 actual2 ' test_expect_success 'remove errors out early when deleting non-existent branch' ' - ( - cd test && - echo "error: No such remote: '\''foo'\''" >expect && - test_expect_code 2 git remote rm foo 2>actual && - test_cmp expect actual - ) + echo "error: No such remote: '\''foo'\''" >expect && + test_expect_code 2 git -C test remote rm foo 2>actual && + test_cmp expect actual ' test_expect_success 'remove remote with a branch without configured merge' ' @@ -193,24 +180,18 @@ test_expect_success 'remove remote with a branch without configured merge' ' git -C test config --remove-section branch.second; true )" && - ( - cd test && - git remote add two ../two && - git fetch two && - git checkout -b second two/main^0 && - git config branch.second.remote two && - git checkout main && - git remote rm two - ) + git -C test remote add two ../two && + git -C test fetch two && + git -C test checkout -b second two/main^0 && + git -C test config branch.second.remote two && + git -C test checkout main && + git -C test remote rm two ' test_expect_success 'rename errors out early when deleting non-existent branch' ' - ( - cd test && - echo "error: No such remote: '\''foo'\''" >expect && - test_expect_code 2 git remote rename foo bar 2>actual && - test_cmp expect actual - ) + echo "error: No such remote: '\''foo'\''" >expect && + test_expect_code 2 git -C test remote rename foo bar 2>actual && + test_cmp expect actual ' test_expect_success 'rename errors out early when new name is invalid' ' @@ -241,7 +222,7 @@ test_expect_success 'add invalid foreign_vcs remote' ' test_cmp expect actual ' -cat >test/expect <<EOF +cat >expect <<EOF * remote origin Fetch URL: $(pwd)/one Push URL: $(pwd)/one @@ -269,37 +250,31 @@ cat >test/expect <<EOF EOF test_expect_success 'show' ' - ( - cd test && - git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream && - git fetch && - git checkout -b ahead origin/main && - echo 1 >>file && - test_tick && - git commit -m update file && - git checkout main && - git branch --track octopus origin/main && - git branch --track rebase origin/main && - git branch -d -r origin/main && - git config --add remote.two.url ../two && - git config --add remote.two.pushurl ../three && - git config branch.rebase.rebase true && - git config branch.octopus.merge "topic-a topic-b topic-c" && - ( - cd ../one && - echo 1 >file && - test_tick && - git commit -m update file - ) && - git config --add remote.origin.push : && - git config --add remote.origin.push refs/heads/main:refs/heads/upstream && - git config --add remote.origin.push +refs/tags/lastbackup && - git config --add remote.two.push +refs/heads/ahead:refs/heads/main && - git config --add remote.two.push refs/heads/main:refs/heads/another && - git remote show origin two >output && - git branch -d rebase octopus && - test_cmp expect output - ) + git -C test config --add remote.origin.fetch refs/heads/main:refs/heads/upstream && + git -C test fetch && + git -C test checkout -b ahead origin/main && + echo 1 >>test/file && + test_tick && + git -C test commit -m update file && + git -C test checkout main && + git -C test branch --track octopus origin/main && + git -C test branch --track rebase origin/main && + git -C test branch -d -r origin/main && + git -C test config --add remote.two.url ../two && + git -C test config --add remote.two.pushurl ../three && + git -C test config branch.rebase.rebase true && + git -C test config branch.octopus.merge "topic-a topic-b topic-c" && + echo 1 >one/file && + test_tick && + git -C one commit -m update file && + git -C test config --add remote.origin.push : && + git -C test config --add remote.origin.push refs/heads/main:refs/heads/upstream && + git -C test config --add remote.origin.push +refs/tags/lastbackup && + git -C test config --add remote.two.push +refs/heads/ahead:refs/heads/main && + git -C test config --add remote.two.push refs/heads/main:refs/heads/another && + git -C test remote show origin two >output && + git -C test branch -d rebase octopus && + test_cmp expect output ' cat >expect <<EOF @@ -348,7 +323,7 @@ test_expect_failure 'show stale with negative refspecs' ' test_cmp expect output ' -cat >test/expect <<EOF +cat >expect <<EOF * remote origin Fetch URL: $(pwd)/one Push URL: $(pwd)/one @@ -367,72 +342,51 @@ EOF test_expect_success 'show -n' ' mv one one.unreachable && - ( - cd test && - git remote show -n origin >output && - mv ../one.unreachable ../one && - test_cmp expect output - ) + git -C test remote show -n origin >output && + mv one.unreachable one && + test_cmp expect output ' test_expect_success 'prune' ' - ( - cd one && - git branch -m side side2 - ) && - ( - cd test && - git fetch origin && - git remote prune origin && - git rev-parse refs/remotes/origin/side2 && - test_must_fail git rev-parse refs/remotes/origin/side - ) + git -C one branch -m side side2 && + git -C test fetch origin && + git -C test remote prune origin && + git -C test rev-parse refs/remotes/origin/side2 && + test_must_fail git -C test rev-parse refs/remotes/origin/side ' test_expect_success 'set-head --delete' ' - ( - cd test && - git symbolic-ref refs/remotes/origin/HEAD && - git remote set-head --delete origin && - test_must_fail git symbolic-ref refs/remotes/origin/HEAD - ) + git -C test symbolic-ref refs/remotes/origin/HEAD && + git -C test remote set-head --delete origin && + test_must_fail git -C test symbolic-ref refs/remotes/origin/HEAD ' test_expect_success 'set-head --auto' ' - ( - cd test && - git remote set-head --auto origin && - echo refs/remotes/origin/main >expect && - git symbolic-ref refs/remotes/origin/HEAD >output && - test_cmp expect output - ) + git -C test remote set-head --auto origin && + echo refs/remotes/origin/main >expect && + git -C test symbolic-ref refs/remotes/origin/HEAD >output && + test_cmp expect output ' test_expect_success 'set-head --auto has no problem w/multiple HEADs' ' - ( - cd test && - git fetch two "refs/heads/*:refs/remotes/two/*" && - git remote set-head --auto two >output 2>&1 && - echo "two/HEAD set to main" >expect && - test_cmp expect output - ) + git -C test fetch two "refs/heads/*:refs/remotes/two/*" && + git -C test remote set-head --auto two >output 2>&1 && + echo "two/HEAD set to main" >expect && + test_cmp expect output ' -cat >test/expect <<\EOF +cat >expect <<\EOF refs/remotes/origin/side2 EOF test_expect_success 'set-head explicit' ' - ( - cd test && - git remote set-head origin side2 && - git symbolic-ref refs/remotes/origin/HEAD >output && - git remote set-head origin main && - test_cmp expect output - ) + git -C test remote set-head origin side2 && + git -C test symbolic-ref refs/remotes/origin/HEAD >output && + git -C test remote set-head origin main && + test_cmp expect output ' -cat >test/expect <<EOF +cat >expect <<EOF Pruning origin URL: $(pwd)/one * [would prune] origin/side2 @@ -441,206 +395,131 @@ EOF test_expect_success 'prune --dry-run' ' git -C one branch -m side2 side && test_when_finished "git -C one branch -m side side2" && - ( - cd test && - git remote prune --dry-run origin >output && - git rev-parse refs/remotes/origin/side2 && - test_must_fail git rev-parse refs/remotes/origin/side && - test_cmp expect output - ) + git -C test remote prune --dry-run origin >output && + git -C test rev-parse refs/remotes/origin/side2 && + test_must_fail git -C test rev-parse refs/remotes/origin/side && + test_cmp expect output ' test_expect_success 'add --mirror && prune' ' mkdir mirror && - ( - cd mirror && - git init --bare && - git remote add --mirror -f origin ../one - ) && - ( - cd one && - git branch -m side2 side - ) && - ( - cd mirror && - git rev-parse --verify refs/heads/side2 && - test_must_fail git rev-parse --verify refs/heads/side && - git fetch origin && - git remote prune origin && - test_must_fail git rev-parse --verify refs/heads/side2 && - git rev-parse --verify refs/heads/side - ) + git -C mirror init --bare && + git -C mirror remote add --mirror -f origin ../one && + git -C one branch -m side2 side && + git -C mirror rev-parse --verify refs/heads/side2 && + test_must_fail git -C mirror rev-parse --verify refs/heads/side && + git -C mirror fetch origin && + git -C mirror remote prune origin && + test_must_fail git -C mirror rev-parse --verify refs/heads/side2 && + git -C mirror rev-parse --verify refs/heads/side ' test_expect_success 'add --mirror=fetch' ' mkdir mirror-fetch && git init -b main mirror-fetch/parent && - ( - cd mirror-fetch/parent && - test_commit one - ) && + test_commit -C mirror-fetch/parent one && git init --bare mirror-fetch/child && - ( - cd mirror-fetch/child && - git remote add --mirror=fetch -f parent ../parent - ) + git -C mirror-fetch/child remote add --mirror=fetch -f parent ../parent ' test_expect_success 'fetch mirrors act as mirrors during fetch' ' - ( - cd mirror-fetch/parent && - git branch new && - git branch -m main renamed - ) && - ( - cd mirror-fetch/child && - git fetch parent && - git rev-parse --verify refs/heads/new && - git rev-parse --verify refs/heads/renamed - ) + git -C mirror-fetch/parent branch new && + git -C mirror-fetch/parent branch -m main renamed && + git -C mirror-fetch/child fetch parent && + git -C mirror-fetch/child rev-parse --verify refs/heads/new && + git -C mirror-fetch/child rev-parse --verify refs/heads/renamed ' test_expect_success 'fetch mirrors can prune' ' - ( - cd mirror-fetch/child && - git remote prune parent && - test_must_fail git rev-parse --verify refs/heads/main - ) + git -C mirror-fetch/child remote prune parent && + test_must_fail git -C mirror-fetch/child rev-parse --verify refs/heads/main ' test_expect_success 'fetch mirrors do not act as mirrors during push' ' - ( - cd mirror-fetch/parent && - git checkout HEAD^0 - ) && - ( - cd mirror-fetch/child && - git branch -m renamed renamed2 && - git push parent : - ) && - ( - cd mirror-fetch/parent && - git rev-parse --verify renamed && - test_must_fail git rev-parse --verify refs/heads/renamed2 - ) + git -C mirror-fetch/parent checkout HEAD^0 && + git -C mirror-fetch/child branch -m renamed renamed2 && + git -C mirror-fetch/child push parent : && + git -C mirror-fetch/parent rev-parse --verify renamed && + test_must_fail git -C mirror-fetch/parent rev-parse --verify refs/heads/renamed2 ' test_expect_success 'add fetch mirror with specific branches' ' git init --bare mirror-fetch/track && - ( - cd mirror-fetch/track && - git remote add --mirror=fetch -t heads/new parent ../parent - ) + git -C mirror-fetch/track remote add --mirror=fetch -t heads/new parent ../parent ' test_expect_success 'fetch mirror respects specific branches' ' - ( - cd mirror-fetch/track && - git fetch parent && - git rev-parse --verify refs/heads/new && - test_must_fail git rev-parse --verify refs/heads/renamed - ) + git -C mirror-fetch/track fetch parent && + git -C mirror-fetch/track rev-parse --verify refs/heads/new && + test_must_fail git -C mirror-fetch/track rev-parse --verify refs/heads/renamed ' test_expect_success 'add --mirror=push' ' mkdir mirror-push && git init --bare mirror-push/public && git init -b main mirror-push/private && - ( - cd mirror-push/private && - test_commit one && - git remote add --mirror=push public ../public - ) + test_commit -C mirror-push/private one && + git -C mirror-push/private remote add --mirror=push public ../public ' test_expect_success 'push mirrors act as mirrors during push' ' - ( - cd mirror-push/private && - git branch new && - git branch -m main renamed && - git push public - ) && - ( - cd mirror-push/private && - git rev-parse --verify refs/heads/new && - git rev-parse --verify refs/heads/renamed && - test_must_fail git rev-parse --verify refs/heads/main - ) + git -C mirror-push/private branch new && + git -C mirror-push/private branch -m main renamed && + git -C mirror-push/private push public && + git -C mirror-push/private rev-parse --verify refs/heads/new && + git -C mirror-push/private rev-parse --verify refs/heads/renamed && + test_must_fail git -C mirror-push/private rev-parse --verify refs/heads/main ' test_expect_success 'push mirrors do not act as mirrors during fetch' ' - ( - cd mirror-push/public && - git branch -m renamed renamed2 && - git symbolic-ref HEAD refs/heads/renamed2 - ) && - ( - cd mirror-push/private && - git fetch public && - git rev-parse --verify refs/heads/renamed && - test_must_fail git rev-parse --verify refs/heads/renamed2 - ) + git -C mirror-push/public branch -m renamed renamed2 && + git -C mirror-push/public symbolic-ref HEAD refs/heads/renamed2 && + git -C mirror-push/private fetch public && + git -C mirror-push/private rev-parse --verify refs/heads/renamed && + test_must_fail git -C mirror-push/private rev-parse --verify refs/heads/renamed2 ' test_expect_success 'push mirrors do not allow you to specify refs' ' git init mirror-push/track && - ( - cd mirror-push/track && - test_must_fail git remote add --mirror=push -t new public ../public - ) + test_must_fail git -C mirror-push/track remote add --mirror=push -t new public ../public ' test_expect_success 'add alt && prune' ' mkdir alttst && - ( - cd alttst && - git init && - git remote add -f origin ../one && - git config remote.alt.url ../one && - git config remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*" - ) && - ( - cd one && - git branch -m side side2 - ) && - ( - cd alttst && - git rev-parse --verify refs/remotes/origin/side && - test_must_fail git rev-parse --verify refs/remotes/origin/side2 && - git fetch alt && - git remote prune alt && - test_must_fail git rev-parse --verify refs/remotes/origin/side && - git rev-parse --verify refs/remotes/origin/side2 - ) + git -C alttst init && + git -C alttst remote add -f origin ../one && + git -C alttst config remote.alt.url ../one && + git -C alttst config remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*" && + git -C one branch -m side side2 && + git -C alttst rev-parse --verify refs/remotes/origin/side && + test_must_fail git -C alttst rev-parse --verify refs/remotes/origin/side2 && + git -C alttst fetch alt && + git -C alttst remote prune alt && + test_must_fail git -C alttst rev-parse --verify refs/remotes/origin/side && + git -C alttst rev-parse --verify refs/remotes/origin/side2 ' -cat >test/expect <<\EOF +cat >expect <<\EOF some-tag EOF test_expect_success 'add with reachable tags (default)' ' - ( - cd one && - >foobar && - git add foobar && - git commit -m "Foobar" && - git tag -a -m "Foobar tag" foobar-tag && - git reset --hard HEAD~1 && - git tag -a -m "Some tag" some-tag - ) && + >one/foobar && + git -C one add foobar && + git -C one commit -m "Foobar" && + git -C one tag -a -m "Foobar tag" foobar-tag && + git -C one reset --hard HEAD~1 && + git -C one tag -a -m "Some tag" some-tag && mkdir add-tags && - ( - cd add-tags && - git init && - git remote add -f origin ../one && - git tag -l some-tag >../test/output && - git tag -l foobar-tag >>../test/output && - test_must_fail git config remote.origin.tagopt - ) && - test_cmp test/expect test/output + git -C add-tags init && + git -C add-tags remote add -f origin ../one && + git -C add-tags tag -l some-tag >output && + git -C add-tags tag -l foobar-tag >>output && + test_must_fail git -C add-tags config remote.origin.tagopt && + test_cmp expect output ' -cat >test/expect <<\EOF +cat >expect <<\EOF some-tag foobar-tag --tags @@ -648,49 +527,37 @@ EOF test_expect_success 'add --tags' ' rm -rf add-tags && - ( - mkdir add-tags && - cd add-tags && - git init && - git remote add -f --tags origin ../one && - git tag -l some-tag >../test/output && - git tag -l foobar-tag >>../test/output && - git config remote.origin.tagopt >>../test/output - ) && - test_cmp test/expect test/output + mkdir add-tags && + git -C add-tags init && + git -C add-tags remote add -f --tags origin ../one && + git -C add-tags tag -l some-tag >output && + git -C add-tags tag -l foobar-tag >>output && + git -C add-tags config remote.origin.tagopt >>output && + test_cmp expect output ' -cat >test/expect <<\EOF +cat >expect <<\EOF --no-tags EOF test_expect_success 'add --no-tags' ' rm -rf add-tags && - ( - mkdir add-no-tags && - cd add-no-tags && - git init && - git remote add -f --no-tags origin ../one && - grep tagOpt .git/config && - git tag -l some-tag >../test/output && - git tag -l foobar-tag >../test/output && - git config remote.origin.tagopt >>../test/output - ) && - ( - cd one && - git tag -d some-tag foobar-tag - ) && - test_cmp test/expect test/output + mkdir add-no-tags && + git -C add-no-tags init && + git -C add-no-tags remote add -f --no-tags origin ../one && + grep tagOpt add-no-tags/.git/config && + git -C add-no-tags tag -l some-tag >output && + git -C add-no-tags tag -l foobar-tag >output && + git -C add-no-tags config remote.origin.tagopt >>output && + git -C one tag -d some-tag foobar-tag && + test_cmp expect output ' test_expect_success 'reject --no-no-tags' ' - ( - cd add-no-tags && - test_must_fail git remote add -f --no-no-tags neworigin ../one - ) + test_must_fail git -C add-no-tags remote add -f --no-no-tags neworigin ../one ' -cat >one/expect <<\EOF +cat >expect <<\EOF apis/main apis/side drosophila/another @@ -699,17 +566,14 @@ cat >one/expect <<\EOF EOF test_expect_success 'update' ' - ( - cd one && - git remote add drosophila ../two && - git remote add apis ../mirror && - git remote update && - git branch -r >output && - test_cmp expect output - ) + git -C one remote add drosophila ../two && + git -C one remote add apis ../mirror && + git -C one remote update && + git -C one branch -r >output && + test_cmp expect output ' -cat >one/expect <<\EOF +cat >expect <<\EOF drosophila/another drosophila/main drosophila/side @@ -720,40 +584,28 @@ cat >one/expect <<\EOF EOF test_expect_success 'update with arguments' ' - ( - cd one && - for b in $(git branch -r) - do - git branch -r -d $b || exit 1 - done && - git remote add manduca ../mirror && - git remote add megaloprepus ../mirror && - git config remotes.phobaeticus "drosophila megaloprepus" && - git config remotes.titanus manduca && - git remote update phobaeticus titanus && - git branch -r >output && - test_cmp expect output - ) + for b in $(git -C one branch -r) + do + git -C one branch -r -d $b || exit 1 + done && + git -C one remote add manduca ../mirror && + git -C one remote add megaloprepus ../mirror && + git -C one config remotes.phobaeticus "drosophila megaloprepus" && + git -C one config remotes.titanus manduca && + git -C one remote update phobaeticus titanus && + git -C one branch -r >output && + test_cmp expect output ' test_expect_success 'update --prune' ' - ( - cd one && - git branch -m side2 side3 - ) && - ( - cd test && - git remote update --prune && - ( - cd ../one && - git branch -m side3 side2 - ) && - git rev-parse refs/remotes/origin/side3 && - test_must_fail git rev-parse refs/remotes/origin/side2 - ) + git -C one branch -m side2 side3 && + git -C test remote update --prune && + git -C one branch -m side3 side2 && + git -C test rev-parse refs/remotes/origin/side3 && + test_must_fail git -C test rev-parse refs/remotes/origin/side2 ' -cat >one/expect <<-\EOF +cat >expect <<-\EOF apis/main apis/side manduca/main @@ -763,61 +615,49 @@ cat >one/expect <<-\EOF EOF test_expect_success 'update default' ' - ( - cd one && - for b in $(git branch -r) - do - git branch -r -d $b || exit 1 - done && - git config remote.drosophila.skipDefaultUpdate true && - git remote update default && - git branch -r >output && - test_cmp expect output - ) + for b in $(git -C one branch -r) + do + git -C one branch -r -d $b || exit 1 + done && + git -C one config remote.drosophila.skipDefaultUpdate true && + git -C one remote update default && + git -C one branch -r >output && + test_cmp expect output ' -cat >one/expect <<\EOF +cat >expect <<\EOF drosophila/another drosophila/main drosophila/side EOF test_expect_success 'update default (overridden, with funny whitespace)' ' - ( - cd one && - for b in $(git branch -r) - do - git branch -r -d $b || exit 1 - done && - git config remotes.default "$(printf "\t drosophila \n")" && - git remote update default && - git branch -r >output && - test_cmp expect output - ) + for b in $(git -C one branch -r) + do + git -C one branch -r -d $b || exit 1 + done && + git -C one config remotes.default "$(printf "\t drosophila \n")" && + git -C one remote update default && + git -C one branch -r >output && + test_cmp expect output ' test_expect_success 'update (with remotes.default defined)' ' - ( - cd one && - for b in $(git branch -r) - do - git branch -r -d $b || exit 1 - done && - git config remotes.default "drosophila" && - git remote update && - git branch -r >output && - test_cmp expect output - ) + for b in $(git -C one branch -r) + do + git -C one branch -r -d $b || exit 1 + done && + git -C one config remotes.default "drosophila" && + git -C one remote update && + git -C one branch -r >output && + test_cmp expect output ' test_expect_success '"remote show" does not show symbolic refs' ' git clone one three && - ( - cd three && - git remote show origin >output && - ! grep "^ *HEAD$" < output && - ! grep -i stale < output - ) + git -C three remote show origin >output && + ! grep "^ *HEAD$" < output && + ! grep -i stale < output ' test_expect_success 'reject adding remote with an invalid name' ' @@ -830,87 +670,66 @@ test_expect_success 'reject adding remote with an invalid name' ' test_expect_success 'rename a remote' ' test_config_global remote.pushDefault origin && git clone one four && - ( - cd four && - git config branch.main.pushRemote origin && - GIT_TRACE2_EVENT=$(pwd)/trace \ - git remote rename --progress origin upstream && - test_region progress "Renaming remote references" trace && - grep "pushRemote" .git/config && - test -z "$(git for-each-ref refs/remotes/origin)" && - test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" && - test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" && - test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" && - test "$(git config branch.main.remote)" = "upstream" && - test "$(git config branch.main.pushRemote)" = "upstream" && - test "$(git config --global remote.pushDefault)" = "origin" - ) + git -C four config branch.main.pushRemote origin && + GIT_TRACE2_EVENT=$(pwd)/trace \ + git -C four remote rename --progress origin upstream && + test_region progress "Renaming remote references" trace && + grep "pushRemote" four/.git/config && + test -z "$(git -C four for-each-ref refs/remotes/origin)" && + test "$(git -C four symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" && + test "$(git -C four rev-parse upstream/main)" = "$(git -C four rev-parse main)" && + test "$(git -C four config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" && + test "$(git -C four config branch.main.remote)" = "upstream" && + test "$(git -C four config branch.main.pushRemote)" = "upstream" && + test "$(git -C four config --global remote.pushDefault)" = "origin" ' test_expect_success 'rename a remote renames repo remote.pushDefault' ' git clone one four.1 && - ( - cd four.1 && - git config remote.pushDefault origin && - git remote rename origin upstream && - grep pushDefault .git/config && - test "$(git config --local remote.pushDefault)" = "upstream" - ) + git -C four.1 config remote.pushDefault origin && + git -C four.1 remote rename origin upstream && + grep pushDefault four.1/.git/config && + test "$(git -C four.1 config --local remote.pushDefault)" = "upstream" ' test_expect_success 'rename a remote renames repo remote.pushDefault but ignores global' ' test_config_global remote.pushDefault other && git clone one four.2 && - ( - cd four.2 && - git config remote.pushDefault origin && - git remote rename origin upstream && - test "$(git config --global remote.pushDefault)" = "other" && - test "$(git config --local remote.pushDefault)" = "upstream" - ) + git -C four.2 config remote.pushDefault origin && + git -C four.2 remote rename origin upstream && + test "$(git -C four.2 config --global remote.pushDefault)" = "other" && + test "$(git -C four.2 config --local remote.pushDefault)" = "upstream" ' test_expect_success 'rename a remote renames repo remote.pushDefault but keeps global' ' test_config_global remote.pushDefault origin && git clone one four.3 && - ( - cd four.3 && - git config remote.pushDefault origin && - git remote rename origin upstream && - test "$(git config --global remote.pushDefault)" = "origin" && - test "$(git config --local remote.pushDefault)" = "upstream" - ) + git -C four.3 config remote.pushDefault origin && + git -C four.3 remote rename origin upstream && + test "$(git -C four.3 config --global remote.pushDefault)" = "origin" && + test "$(git -C four.3 config --local remote.pushDefault)" = "upstream" ' test_expect_success 'rename does not update a non-default fetch refspec' ' git clone one four.one && - ( - cd four.one && - git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* && - git remote rename origin upstream && - test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" && - git rev-parse -q origin/main - ) + git -C four.one config remote.origin.fetch +refs/heads/*:refs/heads/origin/* && + git -C four.one remote rename origin upstream && + test "$(git -C four.one config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" && + git -C four.one rev-parse -q origin/main ' test_expect_success 'rename a remote with name part of fetch spec' ' git clone one four.two && - ( - cd four.two && - git remote rename origin remote && - git remote rename remote upstream && - test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" - ) + git -C four.two remote rename origin remote && + git -C four.two remote rename remote upstream && + test "$(git -C four.two config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" ' test_expect_success 'rename a remote with name prefix of other remote' ' git clone one four.three && - ( - cd four.three && - git remote add o git://example.com/repo.git && - git remote rename o upstream && - test "$(git rev-parse origin/main)" = "$(git rev-parse main)" - ) + git -C four.three remote add o git://example.com/repo.git && + git -C four.three remote rename o upstream && + test "$(git -C four.three rev-parse origin/main)" = "$(git -C four.three rev-parse main)" ' test_expect_success 'rename succeeds with existing remote.<target>.prune' ' @@ -923,49 +742,37 @@ test_expect_success 'rename succeeds with existing remote.<target>.prune' ' test_expect_success 'remove a remote' ' test_config_global remote.pushDefault origin && git clone one four.five && - ( - cd four.five && - git config branch.main.pushRemote origin && - git remote remove origin && - test -z "$(git for-each-ref refs/remotes/origin)" && - test_must_fail git config branch.main.remote && - test_must_fail git config branch.main.pushRemote && - test "$(git config --global remote.pushDefault)" = "origin" - ) + git -C four.five config branch.main.pushRemote origin && + git -C four.five remote remove origin && + test -z "$(git -C four.five for-each-ref refs/remotes/origin)" && + test_must_fail git -C four.five config branch.main.remote && + test_must_fail git -C four.five config branch.main.pushRemote && + test "$(git -C four.five config --global remote.pushDefault)" = "origin" ' test_expect_success 'remove a remote removes repo remote.pushDefault' ' git clone one four.five.1 && - ( - cd four.five.1 && - git config remote.pushDefault origin && - git remote remove origin && - test_must_fail git config --local remote.pushDefault - ) + git -C four.five.1 config remote.pushDefault origin && + git -C four.five.1 remote remove origin && + test_must_fail git -C four.five.1 config --local remote.pushDefault ' test_expect_success 'remove a remote removes repo remote.pushDefault but ignores global' ' test_config_global remote.pushDefault other && git clone one four.five.2 && - ( - cd four.five.2 && - git config remote.pushDefault origin && - git remote remove origin && - test "$(git config --global remote.pushDefault)" = "other" && - test_must_fail git config --local remote.pushDefault - ) + git -C four.five.2 config remote.pushDefault origin && + git -C four.five.2 remote remove origin && + test "$(git -C four.five.2 config --global remote.pushDefault)" = "other" && + test_must_fail git -C four.five.2 config --local remote.pushDefault ' test_expect_success 'remove a remote removes repo remote.pushDefault but keeps global' ' test_config_global remote.pushDefault origin && git clone one four.five.3 && - ( - cd four.five.3 && - git config remote.pushDefault origin && - git remote remove origin && - test "$(git config --global remote.pushDefault)" = "origin" && - test_must_fail git config --local remote.pushDefault - ) + git -C four.five.3 config remote.pushDefault origin && + git -C four.five.3 remote remove origin && + test "$(git -C four.five.3 config --global remote.pushDefault)" = "origin" && + test_must_fail git -C four.five.3 config --local remote.pushDefault ' cat >remotes_origin <<EOF @@ -979,91 +786,67 @@ EOF test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' ' git clone one five && origin_url=$(pwd)/one && - ( - cd five && - git remote remove origin && - mkdir -p .git/remotes && - cat ../remotes_origin >.git/remotes/origin && - git remote rename origin origin && - test_path_is_missing .git/remotes/origin && - test "$(git config remote.origin.url)" = "$origin_url" && - cat >push_expected <<-\EOF && - refs/heads/main:refs/heads/upstream - refs/heads/next:refs/heads/upstream2 - EOF - cat >fetch_expected <<-\EOF && - refs/heads/main:refs/heads/origin - refs/heads/next:refs/heads/origin2 - EOF - git config --get-all remote.origin.push >push_actual && - git config --get-all remote.origin.fetch >fetch_actual && - test_cmp push_expected push_actual && - test_cmp fetch_expected fetch_actual - ) + git -C five remote remove origin && + mkdir -p five/.git/remotes && + cat remotes_origin >five/.git/remotes/origin && + git -C five remote rename origin origin && + test_path_is_missing .git/remotes/origin && + test "$(git -C five config remote.origin.url)" = "$origin_url" && + cat >push_expected <<-\EOF && + refs/heads/main:refs/heads/upstream + refs/heads/next:refs/heads/upstream2 + EOF + cat >fetch_expected <<-\EOF && + refs/heads/main:refs/heads/origin + refs/heads/next:refs/heads/origin2 + EOF + git -C five config --get-all remote.origin.push >push_actual && + git -C five config --get-all remote.origin.fetch >fetch_actual && + test_cmp push_expected push_actual && + test_cmp fetch_expected fetch_actual ' test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' ' git clone one six && origin_url=$(pwd)/one && - ( - cd six && - git remote rm origin && - echo "$origin_url#main" >.git/branches/origin && - git remote rename origin origin && - test_path_is_missing .git/branches/origin && - test "$(git config remote.origin.url)" = "$origin_url" && - test "$(git config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" && - test "$(git config remote.origin.push)" = "HEAD:refs/heads/main" - ) + git -C six remote rm origin && + echo "$origin_url#main" >six/.git/branches/origin && + git -C six remote rename origin origin && + test_path_is_missing .git/branches/origin && + test "$(git -C six config remote.origin.url)" = "$origin_url" && + test "$(git -C six config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" && + test "$(git -C six config remote.origin.push)" = "HEAD:refs/heads/main" ' test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' ' git clone one seven && - ( - cd seven && - git remote rm origin && - echo "quux#foom" > .git/branches/origin && - git remote rename origin origin && - test_path_is_missing .git/branches/origin && - test "$(git config remote.origin.url)" = "quux" && - test "$(git config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin" && - test "$(git config remote.origin.push)" = "HEAD:refs/heads/foom" - ) + git -C seven remote rm origin && + echo "quux#foom" >seven/.git/branches/origin && + git -C seven remote rename origin origin && + test_path_is_missing .git/branches/origin && + test "$(git -C seven config remote.origin.url)" = "quux" && + test "$(git -C seven config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin" && + test "$(git -C seven config remote.origin.push)" = "HEAD:refs/heads/foom" ' test_expect_success 'remote prune to cause a dangling symref' ' git clone one eight && - ( - cd one && - git checkout side2 && - git branch -D main - ) && - ( - cd eight && - git remote prune origin - ) >err 2>&1 && + git -C one checkout side2 && + git -C one branch -D main && + git -C eight remote prune origin >err 2>&1 && test_i18ngrep "has become dangling" err && : And the dangling symref will not cause other annoying errors && - ( - cd eight && - git branch -a - ) 2>err && + git -C eight branch -a 2>err && ! grep "points nowhere" err && - ( - cd eight && - test_must_fail git branch nomore origin - ) 2>err && + test_must_fail git -C eight branch nomore origin 2>err && test_i18ngrep "dangling symref" err ' test_expect_success 'show empty remote' ' test_create_repo empty && git clone empty empty-clone && - ( - cd empty-clone && - git remote show origin - ) + git -C empty-clone remote show origin ' test_expect_success 'remote set-branches requires a remote' ' @@ -1100,36 +883,34 @@ test_expect_success 'remote set-branches' ' EOF git clone .git/ setbranches && - ( - cd setbranches && - git remote rename origin scratch && - git config --get-all remote.scratch.fetch >config-result && - sort <config-result >../actual.initial && + git -C setbranches remote rename origin scratch && + git -C setbranches config --get-all remote.scratch.fetch >config-result && + sort <config-result >actual.initial && - git remote set-branches scratch --add other && - git config --get-all remote.scratch.fetch >config-result && - sort <config-result >../actual.add && + git -C setbranches remote set-branches scratch --add other && + git -C setbranches config --get-all remote.scratch.fetch >config-result && + sort <config-result >actual.add && - git remote set-branches scratch maint main next && - git config --get-all remote.scratch.fetch >config-result && - sort <config-result >../actual.replace && + git -C setbranches remote set-branches scratch maint main next && + git -C setbranches config --get-all remote.scratch.fetch >config-result && + sort <config-result >actual.replace && - git remote set-branches --add scratch seen t/topic && - git config --get-all remote.scratch.fetch >config-result && - sort <config-result >../actual.add-two && + git -C setbranches remote set-branches --add scratch seen t/topic && + git -C setbranches config --get-all remote.scratch.fetch >config-result && + sort <config-result >actual.add-two && - git config --unset-all remote.scratch.fetch && - git config remote.scratch.fetch \ - refs/heads/main:refs/remotes/scratch/main && - git config --add remote.scratch.fetch \ - +refs/heads/next:refs/remotes/scratch/next && - git config --get-all remote.scratch.fetch >config-result && - sort <config-result >../actual.setup-ffonly && + git -C setbranches config --unset-all remote.scratch.fetch && + git -C setbranches config remote.scratch.fetch \ + refs/heads/main:refs/remotes/scratch/main && + git -C setbranches config --add remote.scratch.fetch \ + +refs/heads/next:refs/remotes/scratch/next && + git -C setbranches config --get-all remote.scratch.fetch >config-result && + sort <config-result >actual.setup-ffonly && + + git -C setbranches remote set-branches --add scratch seen && + git -C setbranches config --get-all remote.scratch.fetch >config-result && + sort <config-result >actual.respect-ffonly && - git remote set-branches --add scratch seen && - git config --get-all remote.scratch.fetch >config-result && - sort <config-result >../actual.respect-ffonly - ) && test_cmp expect.initial actual.initial && test_cmp expect.add actual.add && test_cmp expect.replace actual.replace && @@ -1142,14 +923,11 @@ test_expect_success 'remote set-branches with --mirror' ' echo "+refs/*:refs/*" >expect.initial && echo "+refs/heads/main:refs/heads/main" >expect.replace && git clone --mirror .git/ setbranches-mirror && - ( - cd setbranches-mirror && - git remote rename origin scratch && - git config --get-all remote.scratch.fetch >../actual.initial && + git -C setbranches-mirror remote rename origin scratch && + git -C setbranches-mirror config --get-all remote.scratch.fetch >actual.initial && - git remote set-branches scratch heads/main && - git config --get-all remote.scratch.fetch >../actual.replace - ) && + git -C setbranches-mirror remote set-branches scratch heads/main && + git -C setbranches-mirror config --get-all remote.scratch.fetch >actual.replace && test_cmp expect.initial actual.initial && test_cmp expect.replace actual.replace ' @@ -1407,56 +1185,47 @@ test_expect_success 'add remote matching the "insteadOf" URL' ' ' test_expect_success 'unqualified <dst> refspec DWIM and advice' ' - test_when_finished "(cd test && git tag -d some-tag)" && - ( - cd test && - git tag -a -m "Some tag" some-tag main && - for type in commit tag tree blob - do - if test "$type" = "blob" - then - oid=$(git rev-parse some-tag:file) - else - oid=$(git rev-parse some-tag^{$type}) - fi && - test_must_fail git push origin $oid:dst 2>err && - test_i18ngrep "error: The destination you" err && - test_i18ngrep "hint: Did you mean" err && - test_must_fail git -c advice.pushUnqualifiedRefName=false \ - push origin $oid:dst 2>err && - test_i18ngrep "error: The destination you" err && - test_i18ngrep ! "hint: Did you mean" err || - exit 1 - done - ) + test_when_finished "git -C test tag -d some-tag" && + git -C test tag -a -m "Some tag" some-tag main && + for type in commit tag tree blob + do + if test "$type" = "blob" + then + oid=$(git -C test rev-parse some-tag:file) + else + oid=$(git -C test rev-parse some-tag^{$type}) + fi && + test_must_fail git -C test push origin $oid:dst 2>err && + test_i18ngrep "error: The destination you" err && + test_i18ngrep "hint: Did you mean" err && + test_must_fail git -C test -c advice.pushUnqualifiedRefName=false \ + push origin $oid:dst 2>err && + test_i18ngrep "error: The destination you" err && + test_i18ngrep ! "hint: Did you mean" err || + exit 1 + done ' test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' ' - ( - cd two && - git tag -a -m "Some tag" my-tag main && - git update-ref refs/trees/my-head-tree HEAD^{tree} && - git update-ref refs/blobs/my-file-blob HEAD:file - ) && - ( - cd test && - git config --add remote.two.fetch "+refs/tags/*:refs/remotes/tags-from-two/*" && - git config --add remote.two.fetch "+refs/trees/*:refs/remotes/trees-from-two/*" && - git config --add remote.two.fetch "+refs/blobs/*:refs/remotes/blobs-from-two/*" && - git fetch --no-tags two && + git -C two tag -a -m "Some tag" my-tag main && + git -C two update-ref refs/trees/my-head-tree HEAD^{tree} && + git -C two update-ref refs/blobs/my-file-blob HEAD:file && + git -C test config --add remote.two.fetch "+refs/tags/*:refs/remotes/tags-from-two/*" && + git -C test config --add remote.two.fetch "+refs/trees/*:refs/remotes/trees-from-two/*" && + git -C test config --add remote.two.fetch "+refs/blobs/*:refs/remotes/blobs-from-two/*" && + git -C test fetch --no-tags two && - test_must_fail git push origin refs/remotes/two/another:dst 2>err && - test_i18ngrep "error: The destination you" err && + test_must_fail git -C test push origin refs/remotes/two/another:dst 2>err && + test_i18ngrep "error: The destination you" err && - test_must_fail git push origin refs/remotes/tags-from-two/my-tag:dst-tag 2>err && - test_i18ngrep "error: The destination you" err && + test_must_fail git -C test push origin refs/remotes/tags-from-two/my-tag:dst-tag 2>err && + test_i18ngrep "error: The destination you" err && - test_must_fail git push origin refs/remotes/trees-from-two/my-head-tree:dst-tree 2>err && - test_i18ngrep "error: The destination you" err && + test_must_fail git -C test push origin refs/remotes/trees-from-two/my-head-tree:dst-tree 2>err && + test_i18ngrep "error: The destination you" err && - test_must_fail git push origin refs/remotes/blobs-from-two/my-file-blob:dst-blob 2>err && - test_i18ngrep "error: The destination you" err - ) + test_must_fail git -C test push origin refs/remotes/blobs-from-two/my-file-blob:dst-blob 2>err && + test_i18ngrep "error: The destination you" err ' test_done -- 2.36.1
From: Jacob Keller <jacob.e.keller@intel.com> By default, the git remote show command will query data from remotes to show data about what might be done on a future git fetch. This process currently does not handle negative refspecs. This can be confusing, because the show command will list refs as if they would be fetched. For example if the fetch refspec "^refs/heads/pr/*", it still displays the following: * remote jdk19 Fetch URL: git@github.com:openjdk/jdk19.git Push URL: git@github.com:openjdk/jdk19.git HEAD branch: master Remote branches: master tracked pr/1 new (next fetch will store in remotes/jdk19) pr/2 new (next fetch will store in remotes/jdk19) pr/3 new (next fetch will store in remotes/jdk19) Local ref configured for 'git push': master pushes to master (fast-forwardable) Fix this by adding an additional check inside of get_ref_states. If a ref matches one of the negative refspecs, mark it as skipped instead of marking it as new or tracked. With this change, we now report remote branches that are skipped due to negative refspecs properly: * remote jdk19 Fetch URL: git@github.com:openjdk/jdk19.git Push URL: git@github.com:openjdk/jdk19.git HEAD branch: master Remote branches: master tracked pr/1 skipped pr/2 skipped pr/3 skipped Local ref configured for 'git push': master pushes to master (fast-forwardable) By showing the refs as skipped, it helps clarify that these references won't actually be fetched. This does not properly handle refs going stale due to a newly added negative refspec. In addition, git remote prune doesn't handle that negative refspec case either. Fixing that requires digging into get_stale_heads and handling the case of a ref which exists on the remote but is omitted due to a negative refspec locally. Add a new test case which covers the functionality above, as well as a new expected failure indicating the poor overlap with stale refs. Reported-by: Pavel Rappo <pavel.rappo@gmail.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> --- builtin/remote.c | 12 ++++++++++-- remote.c | 2 +- remote.h | 6 ++++++ t/t5505-remote.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index d4b69fe77898..d9b8746cb3cb 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -344,12 +344,13 @@ static void read_branches(void) struct ref_states { struct remote *remote; - struct string_list new_refs, stale, tracked, heads, push; + struct string_list new_refs, skipped, stale, tracked, heads, push; int queried; }; #define REF_STATES_INIT { \ .new_refs = STRING_LIST_INIT_DUP, \ + .skipped = STRING_LIST_INIT_DUP, \ .stale = STRING_LIST_INIT_DUP, \ .tracked = STRING_LIST_INIT_DUP, \ .heads = STRING_LIST_INIT_DUP, \ @@ -368,7 +369,9 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat states->remote->fetch.raw[i]); for (ref = fetch_map; ref; ref = ref->next) { - if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) + string_list_append(&states->skipped, abbrev_branch(ref->name)); + else if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) string_list_append(&states->new_refs, abbrev_branch(ref->name)); else string_list_append(&states->tracked, abbrev_branch(ref->name)); @@ -383,6 +386,7 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat free_refs(fetch_map); string_list_sort(&states->new_refs); + string_list_sort(&states->skipped); string_list_sort(&states->tracked); string_list_sort(&states->stale); @@ -941,6 +945,7 @@ static void clear_push_info(void *util, const char *string) static void free_remote_ref_states(struct ref_states *states) { string_list_clear(&states->new_refs, 0); + string_list_clear(&states->skipped, 0); string_list_clear(&states->stale, 1); string_list_clear(&states->tracked, 0); string_list_clear(&states->heads, 0); @@ -1035,6 +1040,8 @@ static int show_remote_info_item(struct string_list_item *item, void *cb_data) arg = states->remote->name; } else if (string_list_has_string(&states->tracked, name)) arg = _(" tracked"); + else if (string_list_has_string(&states->skipped, name)) + arg = _(" skipped"); else if (string_list_has_string(&states->stale, name)) arg = _(" stale (use 'git remote prune' to remove)"); else @@ -1308,6 +1315,7 @@ static int show(int argc, const char **argv) /* remote branch info */ info.width = 0; for_each_string_list(&info.states.new_refs, add_remote_to_show_info, &info); + for_each_string_list(&info.states.skipped, add_remote_to_show_info, &info); for_each_string_list(&info.states.tracked, add_remote_to_show_info, &info); for_each_string_list(&info.states.stale, add_remote_to_show_info, &info); if (info.list.nr) diff --git a/remote.c b/remote.c index 404e1e0a0ddb..7d68b5632bb5 100644 --- a/remote.c +++ b/remote.c @@ -804,7 +804,7 @@ static int refspec_match(const struct refspec_item *refspec, return !strcmp(refspec->src, name); } -static int omit_name_by_refspec(const char *name, struct refspec *rs) +int omit_name_by_refspec(const char *name, struct refspec *rs) { int i; diff --git a/remote.h b/remote.h index dd4402436f1f..448675e11259 100644 --- a/remote.h +++ b/remote.h @@ -247,6 +247,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Check whether a name matches any negative refspec in rs. Returns 1 if the + * name matches at least one negative refspec, and 0 otherwise. + */ +int omit_name_by_refspec(const char *name, struct refspec *rs); + /* * Remove all entries in the input list which match any negative refspec in * the refspec list. diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index fff14e13ed43..0aad0eb4d26c 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -302,6 +302,52 @@ test_expect_success 'show' ' ) ' +cat >expect <<EOF +* remote origin + Fetch URL: $(pwd)/one + Push URL: $(pwd)/one + HEAD branch: main + Remote branches: + main skipped + side tracked + Local branches configured for 'git pull': + ahead merges with remote main + main merges with remote main + Local refs configured for 'git push': + main pushes to main (local out of date) + main pushes to upstream (create) +EOF + +test_expect_success 'show with negative refspecs' ' + test_when_finished "git -C test config --unset-all --fixed-value remote.origin.fetch ^refs/heads/main" && + git -C test config --add remote.origin.fetch ^refs/heads/main && + git -C test remote show origin >output && + test_cmp expect output +' + +cat >expect <<EOF +* remote origin + Fetch URL: $(pwd)/one + Push URL: $(pwd)/one + HEAD branch: main + Remote branches: + main new (next fetch will store in remotes/origin) + side stale (use 'git remote prune' to remove) + Local branches configured for 'git pull': + ahead merges with remote main + main merges with remote main + Local refs configured for 'git push': + main pushes to main (local out of date) + main pushes to upstream (create) +EOF + +test_expect_failure 'show stale with negative refspecs' ' + test_when_finished "git -C test config --unset-all --fixed-value remote.origin.fetch ^refs/heads/side" && + git -C test config --add remote.origin.fetch ^refs/heads/side && + git -C test remote show origin >output && + test_cmp expect output +' + cat >test/expect <<EOF * remote origin Fetch URL: $(pwd)/one -- 2.36.1
The git remote show command does not handle negative refspecs. In fact, the function will happily show that the refs will be fetched, even though they won't be. The first patch in this series fixes the show issue for new refs that should be marked as skipped. The later patches do some cleanup on the t5505-remote.sh script, improving the test file, along with some improved test infrastructure. Finally, I also noticed that git remote prune doesn't interact as expected with negative refspecs either, so there is a patch to add an expected failure for this as well. I suspect we need to dig into get_stale_heads and make that handle negative refspecs properly, but I wasn't able to figure that out in the time I have today. Changes since v2: * re-ordered so that the fix is first * cleaned up helper functions to honor -C instead of hard coding 'test' * added expected failures for the short comings of this fix Jacob Keller (6): remote: handle negative refspecs in git remote show t5505: remove sub shell use in favor of git -C tests: handle --global directly in test_config/test_unconfig tests: only automatically unset matching values from test_config t5505: use test_config where appropriate remote: add test for negative refspec with prune builtin/remote.c | 12 +- remote.c | 2 +- remote.h | 6 + t/lib-parallel-checkout.sh | 4 +- t/lib-proto-disable.sh | 12 +- t/lib-submodule-update.sh | 2 +- t/t0001-init.sh | 14 +- t/t0021-conversion.sh | 58 +- t/t0210-trace2-normal.sh | 10 +- t/t0211-trace2-perf.sh | 4 +- t/t0212-trace2-event.sh | 2 +- t/t1309-early-config.sh | 2 +- t/t2081-parallel-checkout-collisions.sh | 2 +- t/t2082-parallel-checkout-attributes.sh | 4 +- t/t3431-rebase-fork-point.sh | 2 +- t/t5505-remote.sh | 1132 ++++++++++------------- t/t5544-pack-objects-hook.sh | 6 +- t/t5550-http-fetch-dumb.sh | 8 +- t/t5573-pull-verify-signatures.sh | 6 +- t/t5606-clone-options.sh | 10 +- t/t5617-clone-submodules-remote.sh | 4 +- t/t5702-protocol-v2.sh | 2 +- t/t7814-grep-recurse-submodules.sh | 16 +- t/test-lib-functions.sh | 104 ++- 24 files changed, 667 insertions(+), 757 deletions(-) -- 2.36.1
Here are the topics that have been cooking in my tree. Commits prefixed with '+' are in 'next' (being in 'next' is a sign that a topic is stable enough to be used and are candidate to be in a future release). Commits prefixed with '-' are only in 'seen', and aren't considered "accepted" at all. The first -rc for this cycle is expected to be tagged tomorrow. Copies of the source code to Git live in many repositories, and the following is a list of the ones I push into or their mirrors. Some repositories have only a subset of branches. With maint, master, next, seen, todo: git://git.kernel.org/pub/scm/git/git.git/ git://repo.or.cz/alt-git.git/ https://kernel.googlesource.com/pub/scm/git/git/ https://github.com/git/git/ https://gitlab.com/git-vcs/git/ With all the integration branches and topics broken out: https://github.com/gitster/git/ Even though the preformatted documentation in HTML and man format are not sources, they are published in these repositories for convenience (replace "htmldocs" with "manpages" for the manual pages): git://git.kernel.org/pub/scm/git/git-htmldocs.git/ https://github.com/gitster/git-htmldocs.git/ Release tarballs are available at: https://www.kernel.org/pub/software/scm/git/ -------------------------------------------------- [Graduated to 'master'] * fs/ssh-default-key-command-doc (2022-06-08) 1 commit (merged to 'next' on 2022-06-10 at b5cc5b6619) + gpg docs: explain better use of ssh.defaultKeyCommand Doc update. source: <20220608152437.126276-1-fs@gigacodes.de> * jc/revert-show-parent-info (2022-05-31) 2 commits (merged to 'next' on 2022-06-07 at e405211ff4) + revert: --reference should apply only to 'revert', not 'cherry-pick' (merged to 'next' on 2022-05-30 at b5da52dc14) + revert: optionally refer to commit in the "reference" format "git revert" learns "--reference" option to use more human-readable reference to the commit it reverts in the message template it prepares for the user. source: <xmqq8rqn7buk.fsf_-_@gitster.g> * po/rebase-preserve-merges (2022-06-06) 4 commits (merged to 'next' on 2022-06-10 at 471f67aebc) + rebase: translate a die(preserve-merges) message + rebase: note `preserve` merges may be a pull config option + rebase: help users when dying with `preserve-merges` + rebase.c: state preserve-merges has been removed Various error messages that talk about the removal of "--preserve-merges" in "rebase" have been strengthened, and "rebase --abort" learned to get out of a state that was left by an earlier use of the option. source: <pull.1242.v2.git.1654341469.gitgitgadget@gmail.com> -------------------------------------------------- [New Topics] * ab/credentials-in-url-more (2022-06-15) 2 commits (merged to 'next' on 2022-06-16 at de19b3b40c) + transfer doc: move fetch.credentialsInUrl to "transfer" config namespace + fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate Rename fetch.credentialsInUrl to transfer.credentialsInUrl as the single configuration variable should work both in pushing and fetching. Will merge to 'master'. source: <cover-0.2-00000000000-20220615T103852Z-avarab@gmail.com> * ds/more-test-coverage (2022-06-16) 4 commits (merged to 'next' on 2022-06-16 at 3f0452418c) + cache-tree: remove cache_tree_find_path() + pack-write: drop always-NULL parameter + t5329: test 'git gc --cruft' without '--prune=now' + t2107: test 'git update-index --verbose' Improve test coverage with a handful of tests. Will merge to 'master'. source: <pull.1261.v2.git.1655385230.gitgitgadget@gmail.com> * jk/remote-show-with-negative-refspecs (2022-06-15) 1 commit - remote: handle negative refspecs in git remote show "git remote show [-n] frotz" now pays attention to negative pathspecs. source: <20220614003251.16765-1-jacob.e.keller@intel.com> * js/commit-graph-parsing-without-repo-settings (2022-06-15) 1 commit - commit-graph: refactor to avoid prepare_repo_settings source: <9b56496b0809cc8a25af877ea97042e2cb7f2af6.1655246092.git.steadmon@google.com> * jk/optim-promisor-object-enumeration (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at ce0712a74c) + is_promisor_object(): walk promisor packs in pack-order Collection of what is referenced by objects in promisor packs have been optimized to inspect these objects in the in-pack order. Will cook in 'next'. source: <YqrTsbXbEjx0Pabn@coredump.intra.peff.net> * jk/perf-lib-test-titles (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at 064d7efa99) + perf-lib: fix missing test titles in output Show test titles to the performance test output again. Will merge to 'master'. source: <YqrXLO5oMYeOr2PB@coredump.intra.peff.net> * js/misc-fixes (2022-06-16) 6 commits (merged to 'next' on 2022-06-16 at 2f1f98e403) + relative_url(): fix incorrect condition + pack-mtimes: avoid closing a bogus file descriptor + read_index_from(): avoid memory leak + submodule--helper: avoid memory leak when fetching submodules + submodule-config: avoid memory leak + fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()` Assorted fixes to problems found by Coverity. Will merge to 'master'. source: <pull.1264.git.1655336146.gitgitgadget@gmail.com> * ro/mktree-allow-missing-fix (2022-06-16) 1 commit - mktree: do not load objects under '--missing' "git mktree --missing" lazily fetched objects that are missing from the local object store, which was totally unnecessary. Waiting for review response. source: <1566aed1-a38f-a9ca-241c-21b56d732328@roku.com> * jk/bug-fl-va-list-fix (2022-06-16) 1 commit (merged to 'next' on 2022-06-16 at 8150aebb0f) + bug_fl(): correctly initialize trace2 va_list Fix buggy va_list usage in recent code. Will merge to 'master'. source: <YquMyakxYnU6mI5a@coredump.intra.peff.net> -------------------------------------------------- [Stalled] * en/merge-tree (2022-02-23) 13 commits - git-merge-tree.txt: add a section on potentional usage mistakes - merge-tree: add a --allow-unrelated-histories flag - merge-tree: allow `ls-files -u` style info to be NUL terminated - merge-tree: provide easy access to `ls-files -u` style info - merge-tree: provide a list of which files have conflicts - merge-ort: provide a merge_get_conflicted_files() helper function - merge-tree: support including merge messages in output - merge-ort: split out a separate display_update_messages() function - merge-tree: implement real merges - merge-tree: add option parsing and initial shell for real merge function - merge-tree: move logic for existing merge into new function - merge-tree: rename merge_trees() to trivial_merge_trees() - Merge branch 'en/remerge-diff' into en/merge-trees A new command is introduced that takes two commits and computes a tree that would be contained in the resulting merge commit, if the histories leading to these two commits were to be merged, and is added as a new mode of "git merge-tree" subcommand. On hold. cf. <CABPp-BGZ7OAYRR5YKRsxJSo-C=ho+qcNAkqwkim8CkhCfCeHsA@mail.gmail.com> source: <pull.1122.v6.git.1645602413.gitgitgadget@gmail.com> * bc/stash-export (2022-04-08) 4 commits - builtin/stash: provide a way to import stashes from a ref - builtin/stash: provide a way to export stashes to a ref - builtin/stash: factor out revision parsing into a function - object-name: make get_oid quietly return an error A mechanism to export and import stash entries to and from a normal commit to transfer it across repositories has been introduced. Expecting a reroll. cf. <YnL2d4Vr9Vr7W4Hj@camp.crustytoothpaste.net> source: <20220407215352.3491567-1-sandals@crustytoothpaste.net> * cw/remote-object-info (2022-05-06) 11 commits - SQUASH??? coccicheck - SQUASH??? ensure that coccicheck is happy - SQUASH??? compilation fix - cat-file: add --batch-command remote-object-info command - cat-file: move parse_cmd and DEFAULT_FORMAT up - transport: add object-info fallback to fetch - transport: add client side capability to request object-info - object-info: send attribute packet regardless of object ids - object-store: add function to free object_info contents - fetch-pack: move fetch default settings - fetch-pack: refactor packet writing A client component to talk with the object-info endpoint. Expecting a reroll. source: <20220502170904.2770649-1-calvinwan@google.com> -------------------------------------------------- [Cooking] * jc/apply-icase-tests (2022-06-13) 1 commit - t4141: test "git apply" with core.ignorecase source: <xmqqo7yw77qo.fsf@gitster.g> * ll/curl-accept-language (2022-06-13) 2 commits - PREP??? give initializer to rpc_state - remote-curl: send Accept-Language header to server source: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> * pb/diff-doc-raw-format (2022-06-13) 3 commits - diff-index.txt: update raw output format in examples - diff-format.txt: correct misleading wording - diff-format.txt: dst can be 0* SHA-1 when path is deleted, too source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * rs/archive-with-internal-gzip (2022-06-15) 6 commits - archive-tar: use internal gzip by default - archive-tar: use OS_CODE 3 (Unix) for internal gzip - archive-tar: add internal gzip implementation - archive-tar: factor out write_block() - archive: rename archiver data field to filter_command - archive: update format documentation Teach "git archive" to (optionally and then by default) avoid spawning an external "gzip" process when creating ".tar.gz" (and ".tgz") archives. Will merge to 'next'. source: <9df761c3-355a-ede9-7971-b32687fe9abb@web.de> * tl/pack-bitmap-trace (2022-06-13) 5 commits - bitmap: add trace2 outputs during open "bitmap" file - pack-bitmap.c: using error() instead of silently returning -1 - pack-bitmap.c: make warnings support i18N when opening bitmap - pack-bitmap.c: rename "idx_name" to "bitmap_name" - pack-bitmap.c: continue looping when first MIDX bitmap is found Add trace2 traces in code paths involving the pack bitmaps. Needs review. source: <cover.1655018322.git.dyroneteng@gmail.com> * ds/branch-checked-out (2022-06-15) 5 commits - branch: fix branch_checked_out() leaks - branch: use branch_checked_out() when deleting refs - fetch: use new branch_checked_out() and add tests - branch: check for bisects and rebases - branch: add branch_checked_out() helper Introduce a helper to see if a branch is already being worked on (hence should not be newly checked out in a working tree), which performs much better than the existing find_shared_symref() to replace many uses of the latter. Will merge to 'next'. source: <pull.1254.v2.git.1655234853.gitgitgadget@gmail.com> * js/ci-github-workflow-markup (2022-06-13) 3 commits (merged to 'next' on 2022-06-15 at 03eb5e68ed) + ci(github): also mark up compile errors + ci(github): use grouping also in the `win-build` job + ci(github): bring back the 'print test failures' step Recent CI update hides certain failures in test jobs, which has been corrected. Will merge to 'master'? source: <pull.1253.v2.git.1655125988.gitgitgadget@gmail.com> * jt/connected-show-missing-from-which-side (2022-06-10) 1 commit - fetch,fetch-pack: clarify connectivity check error We may find an object missing after a "git fetch" stores the objects it obtained from the other side, but it is not necessarily because the remote failed to send necessary objects. Reword the messages in an attempt to help users explore other possibilities when they hit this error. Expecting a reroll. source: <20220610195247.1177549-1-jonathantanmy@google.com> * gc/submodule-update (2022-06-15) 12 commits - git-sh-setup.sh: remove "say" function, change last users - git-submodule.sh: use "$quiet", not "$GIT_QUIET" - submodule--helper: eliminate internal "--update" option - submodule--helper: understand --checkout, --merge and --rebase synonyms - submodule--helper: report "submodule" as our name in "-h" output - submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs" - submodule update: remove "-v" option - submodule--helper: have --require-init imply --init - git-submodule.sh: remove unused top-level "--branch" argument - git-submodule.sh: make "$cached" variable a boolean - git-submodule.sh: remove unused $prefix var and --super-prefix - git-submodule.sh: remove unused sanitize_submodule_env() More work on "git submodule update". Needs review. source: <cover-v2-00.12-00000000000-20220613T220150Z-avarab@gmail.com> * jc/resolve-undo (2022-06-09) 1 commit (merged to 'next' on 2022-06-15 at c195e5a2d9) + revision: mark blobs needed for resolve-undo as reachable The resolve-undo information in the index was not protected against GC, which has been corrected. Will merge to 'master'? source: <xmqqfskdieqz.fsf@gitster.g> * jp/prompt-clear-before-upstream-mark (2022-06-10) 2 commits (merged to 'next' on 2022-06-15 at e580db03e9) + git-prompt: fix expansion of branch colour codes (merged to 'next' on 2022-06-08 at 201a84ad63) + git-prompt: make colourization consistent Bash command line prompt (in contrib/) update. Will merge to 'master'? source: <20220607115024.64724-1-joak-pet@online.no> * ab/build-gitweb (2022-06-02) 7 commits - Makefile: build 'gitweb' in the default target - gitweb/Makefile: include in top-level Makefile - gitweb: remove "test" and "test-installed" targets - gitweb/Makefile: prepare to merge into top-level Makefile - gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars - gitweb/Makefile: add a $(GITWEB_ALL) variable - gitweb/Makefile: define all .PHONY prerequisites inline Teach "make all" to build gitweb as well. Needs review. source: <cover-v2-0.7-00000000000-20220531T173805Z-avarab@gmail.com> * ab/test-without-templates (2022-06-06) 7 commits - tests: don't assume a .git/info for .git/info/sparse-checkout - tests: don't assume a .git/info for .git/info/exclude - tests: don't assume a .git/info for .git/info/refs - tests: don't assume a .git/info for .git/info/attributes - tests: don't assume a .git/info for .git/info/grafts - tests: don't depend on template-created .git/branches - t0008: don't rely on default ".git/info/exclude" Tweak tests so that they still work when the "git init" template did not create .git/info directory. Will merge to 'next'? source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com> * ac/bitmap-format-doc (2022-06-16) 3 commits (merged to 'next' on 2022-06-16 at 5591d11601) + bitmap-format.txt: add information for trailing checksum + bitmap-format.txt: fix some formatting issues + bitmap-format.txt: feed the file to asciidoc to generate html Adjust technical/bitmap-format to be formatted by AsciiDoc, and add some missing information to the documentation. Will cook in 'next'. source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com> * hx/unpack-streaming (2022-06-13) 6 commits - unpack-objects: use stream_loose_object() to unpack large objects - core doc: modernize core.bigFileThreshold documentation - object-file.c: add "stream_loose_object()" to handle large object - object-file.c: factor out deflate part of write_loose_object() - object-file.c: refactor write_loose_object() to several steps - unpack-objects: low memory footprint for get_data() in dry_run mode Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. Will merge to 'next'? source: <cover.1654914555.git.chiyutianyi@gmail.com> * tb/show-ref-count (2022-06-06) 2 commits - builtin/show-ref.c: limit output with `--count` - builtin/show-ref.c: rename `found_match` to `matches_nr` "git show-ref" learned to stop after emitting N refs with the new "--count=N" option. Expecting a reroll. cf. <xmqqczfl4ce1.fsf@gitster.g> source: <cover.1654552560.git.me@ttaylorr.com> * jc/cocci-cleanup (2022-06-07) 1 commit (merged to 'next' on 2022-06-16 at 990576f5c5) + cocci: retire is_null_sha1() rule Remove a coccinelle rule that is no longer relevant. Will merge to 'master'. source: <xmqq7d5suoqt.fsf@gitster.g> * ds/bundle-uri-more (2022-06-06) 6 commits - fetch: add 'refs/bundle/' to log.excludeDecoration - bundle-uri: add support for http(s):// and file:// - fetch: add --bundle-uri option - bundle-uri: create basic file-copy logic - remote-curl: add 'get' capability - docs: document bundle URI standard The "bundle URI" topic. Needs review. source: <pull.1248.git.1654545325.gitgitgadget@gmail.com> * js/bisect-in-c (2022-05-21) 15 commits - bisect: no longer try to clean up left-over `.git/head-name` files - bisect: remove Cogito-related code - Turn `git bisect` into a full built-in - bisect: teach the `bisect--helper` command to show the correct usage strings - bisect: move even the command-line parsing to `bisect--helper` - bisect--helper: return only correct exit codes in `cmd_*()` - bisect--helper: move the `BISECT_STATE` case to the end - bisect--helper: make `--bisect-state` optional - bisect--helper: align the sub-command order with git-bisect.sh - bisect--helper: using `--bisect-state` without an argument is a bug - bisect--helper: really retire `--bisect-autostart` - bisect--helper: really retire --bisect-next-check - bisect--helper: retire the --no-log option - bisect: avoid double-quoting when printing the failed command - bisect run: fix the error message Final bits of "git bisect.sh" have been rewritten in C. The command line parsing is reported to be still broken. cf. <220521.86zgjazuy4.gmgdl@evledraar.gmail.com> source: <pull.1132.v3.git.1653144546.gitgitgadget@gmail.com> * cb/path-owner-check-with-sudo-plus (2022-05-12) 1 commit - git-compat-util: allow root to access both SUDO_UID and root owned "sudo git foo" used to consider a repository owned by the original user a safe one to access; it now also considers a repository owned by root a safe one, too (after all, if an attacker can craft a malicious repository owned by root, the box is 0wned already). Will merge to 'next'? cf. <20220519152344.ktrifm3pc42bjruh@Carlos-MacBook-Pro-2.local> source: <20220513010020.55361-5-carenas@gmail.com> * gc/bare-repo-discovery (2022-06-07) 5 commits - setup.c: create `discovery.bare` - safe.directory: use git_protected_config() - config: read protected config with `git_protected_config()` - Documentation: define protected configuration - Documentation/git-config.txt: add SCOPES section Introduce a discovery.barerepository configuration variable that allows users to forbid discovery of bare repositories. Expecting a reroll. cf. <xmqqbkv4t7gp.fsf@gitster.g> source: <29053d029f8ec61095a2ad557be38b1d485a158f.1654635432.git.gitgitgadget@gmail.com> * gg/worktree-from-the-above (2022-05-20) 3 commits - dir: minor refactoring / clean-up - dir: cache git_dir's realpath - dir: traverse into repository With a non-bare repository, with core.worktree pointing at a directory that has the repository as its subdirectory, regressed in Git 2.27 days. Needs review. source: <20220520192840.8942-1-ggossdev@gmail.com> * ar/send-email-confirm-by-default (2022-04-22) 1 commit - send-email: always confirm by default "git send-email" is changed so that by default it asks for confirmation before sending each message out. Will discard. I wanted to like this, and had it in the version of Git I use myself for daily work, but the prompting turned out to be somewhat distracting. Thoughts? source: <20220422083629.1404989-1-hi@alyssa.is>
On Thu, Jun 16, 2022 at 3:09 PM Jacob Keller <jacob.keller@gmail.com> wrote: > > On Thu, Jun 16, 2022 at 2:52 PM Junio C Hamano <gitster@pobox.com> wrote: > > > > Jacob Keller <jacob.keller@gmail.com> writes: > > > > >> This is somewhat curious. Do we really need to destroy the > > >> fetch_map like the above? I know by removing skipped items from the > > >> list, the existing loop (below) can stop having to worry about them, > > >> but the caller of get_ref_states() may later want to iterate over > > >> the full fetch_map for other reasons (even if the current one does > > >> not, a future version of the caller may have a reason to do so that > > >> we do not know right now yet). > > >> > > > > > > Good point. I'll fix this. I think we can just move the > > > omit_name_by_refspec into the other loop. > > > > > >> > + > > >> > for (ref = fetch_map; ref; ref = ref->next) { > > >> > if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) > > >> > string_list_append(&states->new_refs, abbrev_branch(ref->name)); > > >> > > >> IOW, is adding a new condition to this existing loop insufficient? > > >> > > > > > > The tricky part here is that we don't have a simple check, and we're > > > currently iterating over all of the refspecs each time. But we have to > > > do that regardless so I think this makes sense. Will fix. > > > > Another thing that worries me is that get_stale_heads() will not see > > the filtered refs with your original implementation, because you cull > > them from the fetch_map in the extra loop upfront. > > > > I think the new implementation fixed this, but I'll see about adding a test! > > > I do not know offhand what its effect would be, but it probably is > > worth testing. In your original scenario, if we locally have > > refs/remotes/jdk19/old and refs/remotes/jdk19/pr/1 (perhaps obtained > > before we configured ^refs/pr/* negative refspec), we'd want to see > > that pr/1 exists here but will not be updated. > > > > Yea, I will see if I can check that. > Ok so this raises another issue: get_stale_heads currently never treats a refname as stale if it matches a negative refspec. The function first queries the name against all refspecs via query_refspecs_mutiple. It only considers a ref stale if it matches at least one refspec but no longer exists in the remote. The problem is that query_refspecs_multple returns no matches if the refname matches any negative refspec. Thus, all refs matching a negative refspec will be ignored by get_stale_heads. The query_refspecs_multiple is only used by get_stale_heads_cb, so we could change its implementation possibly, but that would make it not quite match the name. I'll try to think of a better solution. Thanks, Jake > > * remote jdk19 > > Fetch URL: git@github.com:openjdk/jdk19.git > > Push URL: git@github.com:openjdk/jdk19.git > > HEAD branch: master > > Remote branches: > > master tracked > > old stale > > pr/1 stale > > pr/2 skipped > > pr/3 skipped > > Local ref configured for 'git push': > > master pushes to master (fast-forwardable)
On Thu, Jun 16, 2022 at 2:52 PM Junio C Hamano <gitster@pobox.com> wrote: > > Jacob Keller <jacob.keller@gmail.com> writes: > > >> This is somewhat curious. Do we really need to destroy the > >> fetch_map like the above? I know by removing skipped items from the > >> list, the existing loop (below) can stop having to worry about them, > >> but the caller of get_ref_states() may later want to iterate over > >> the full fetch_map for other reasons (even if the current one does > >> not, a future version of the caller may have a reason to do so that > >> we do not know right now yet). > >> > > > > Good point. I'll fix this. I think we can just move the > > omit_name_by_refspec into the other loop. > > > >> > + > >> > for (ref = fetch_map; ref; ref = ref->next) { > >> > if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) > >> > string_list_append(&states->new_refs, abbrev_branch(ref->name)); > >> > >> IOW, is adding a new condition to this existing loop insufficient? > >> > > > > The tricky part here is that we don't have a simple check, and we're > > currently iterating over all of the refspecs each time. But we have to > > do that regardless so I think this makes sense. Will fix. > > Another thing that worries me is that get_stale_heads() will not see > the filtered refs with your original implementation, because you cull > them from the fetch_map in the extra loop upfront. > I think the new implementation fixed this, but I'll see about adding a test! > I do not know offhand what its effect would be, but it probably is > worth testing. In your original scenario, if we locally have > refs/remotes/jdk19/old and refs/remotes/jdk19/pr/1 (perhaps obtained > before we configured ^refs/pr/* negative refspec), we'd want to see > that pr/1 exists here but will not be updated. > Yea, I will see if I can check that. > * remote jdk19 > Fetch URL: git@github.com:openjdk/jdk19.git > Push URL: git@github.com:openjdk/jdk19.git > HEAD branch: master > Remote branches: > master tracked > old stale > pr/1 stale > pr/2 skipped > pr/3 skipped > Local ref configured for 'git push': > master pushes to master (fast-forwardable)
On Thu, Jun 16, 2022 at 2:31 PM Junio C Hamano <gitster@pobox.com> wrote: > > Jacob Keller <jacob.keller@gmail.com> writes: > > > This series adds support for negative refspecs to git remote show, fixing an > > issue reported by Pavel Rappo. > > > > In addition, it includes some cleanup of the t5505-remote.sh test script, > > focusing on removing subshells and using test_config more. > > > > To support this, test_config and test_unconfig are extended to take and > > handle more options. The test_config_global is removed in favor of just > > using test_config --global. > > > > In addition, test_config now passes the value and --fixed-value into > > test_unconfig so that only the specific value is removed (rather than all > > keys of the name). > > > > The original v1 can be found here: > > https://lore.kernel.org/git/20220614003251.16765-1-jacob.e.keller@intel.com/ > > > > If the config changes are too controversial, I'm happy to split them out > > into a separate series for further discussion, or drop them if they aren't > > desirable. > > I did not see anything in 5/5 that substantially depends on all the > code churn done in 1/5-4/5. Am I mistaken? > > It would have been much nicer to organize the patch series so that > the first one is the [v2 5/5]. It may not be able to use the > improved test_config, but writing test_when_finished instead would > not be the end of the world. The three-line test body will still be > three lines. Then test_when_finished will have to be updated in > follow-up patches that corresponds to [v2 1/5]-[v2 4/5], but that is > the cost of "clean up". The main "fix" patch shouldn't be the one > that is paying the price for it. > Yea, I can re-order this. I generally opted to put it last since it added code which would get modified. But yes, I agree it makes more sense to be first. > The clean-up offered by [v2 1/5] is a worthwhile thing to do. It's > just that I do not think it is wise to make the fix in [v2 5/5] wait > for the 1.4k lines patch to be adequately reviewed. > > Retiring "test_config_global" in [v2 2/5] is probably a good change, > especially when we are to add more featurs to test_config. Again, > [v2 5/5] shouldn't have to be made waiting on an extra 800-line patch > to be reviewed. Yep, I'll re-order it.
Jacob Keller <jacob.keller@gmail.com> writes:
>> This is somewhat curious. Do we really need to destroy the
>> fetch_map like the above? I know by removing skipped items from the
>> list, the existing loop (below) can stop having to worry about them,
>> but the caller of get_ref_states() may later want to iterate over
>> the full fetch_map for other reasons (even if the current one does
>> not, a future version of the caller may have a reason to do so that
>> we do not know right now yet).
>>
>
> Good point. I'll fix this. I think we can just move the
> omit_name_by_refspec into the other loop.
>
>> > +
>> > for (ref = fetch_map; ref; ref = ref->next) {
>> > if (!ref->peer_ref || !ref_exists(ref->peer_ref->name))
>> > string_list_append(&states->new_refs, abbrev_branch(ref->name));
>>
>> IOW, is adding a new condition to this existing loop insufficient?
>>
>
> The tricky part here is that we don't have a simple check, and we're
> currently iterating over all of the refspecs each time. But we have to
> do that regardless so I think this makes sense. Will fix.
Another thing that worries me is that get_stale_heads() will not see
the filtered refs with your original implementation, because you cull
them from the fetch_map in the extra loop upfront.
I do not know offhand what its effect would be, but it probably is
worth testing. In your original scenario, if we locally have
refs/remotes/jdk19/old and refs/remotes/jdk19/pr/1 (perhaps obtained
before we configured ^refs/pr/* negative refspec), we'd want to see
that pr/1 exists here but will not be updated.
* remote jdk19
Fetch URL: git@github.com:openjdk/jdk19.git
Push URL: git@github.com:openjdk/jdk19.git
HEAD branch: master
Remote branches:
master tracked
old stale
pr/1 stale
pr/2 skipped
pr/3 skipped
Local ref configured for 'git push':
master pushes to master (fast-forwardable)
Jacob Keller <jacob.keller@gmail.com> writes:
> This series adds support for negative refspecs to git remote show, fixing an
> issue reported by Pavel Rappo.
>
> In addition, it includes some cleanup of the t5505-remote.sh test script,
> focusing on removing subshells and using test_config more.
>
> To support this, test_config and test_unconfig are extended to take and
> handle more options. The test_config_global is removed in favor of just
> using test_config --global.
>
> In addition, test_config now passes the value and --fixed-value into
> test_unconfig so that only the specific value is removed (rather than all
> keys of the name).
>
> The original v1 can be found here:
> https://lore.kernel.org/git/20220614003251.16765-1-jacob.e.keller@intel.com/
>
> If the config changes are too controversial, I'm happy to split them out
> into a separate series for further discussion, or drop them if they aren't
> desirable.
I did not see anything in 5/5 that substantially depends on all the
code churn done in 1/5-4/5. Am I mistaken?
It would have been much nicer to organize the patch series so that
the first one is the [v2 5/5]. It may not be able to use the
improved test_config, but writing test_when_finished instead would
not be the end of the world. The three-line test body will still be
three lines. Then test_when_finished will have to be updated in
follow-up patches that corresponds to [v2 1/5]-[v2 4/5], but that is
the cost of "clean up". The main "fix" patch shouldn't be the one
that is paying the price for it.
The clean-up offered by [v2 1/5] is a worthwhile thing to do. It's
just that I do not think it is wise to make the fix in [v2 5/5] wait
for the 1.4k lines patch to be adequately reviewed.
Retiring "test_config_global" in [v2 2/5] is probably a good change,
especially when we are to add more featurs to test_config. Again,
[v2 5/5] shouldn't have to be made waiting on an extra 800-line patch
to be reviewed.
By default, the git remote show command will query data from remotes to show data about what might be done on a future git fetch. This process currently does not handle negative refspecs. This can be confusing, because the show command will list refs as if they would be fetched. For example if the fetch refspec "^refs/heads/pr/*", it still displays the following: * remote jdk19 Fetch URL: git@github.com:openjdk/jdk19.git Push URL: git@github.com:openjdk/jdk19.git HEAD branch: master Remote branches: master tracked pr/1 new (next fetch will store in remotes/jdk19) pr/2 new (next fetch will store in remotes/jdk19) pr/3 new (next fetch will store in remotes/jdk19) Local ref configured for 'git push': master pushes to master (fast-forwardable) Fix this by adding an additional check inside of get_ref_states. Before adding the ref name to the new_refs list, use omit_name_by_refspec to see if the ref matches any negative refspecs. This change results in the following output for git remote show: * remote jdk19 Fetch URL: git@github.com:openjdk/jdk19.git Push URL: git@github.com:openjdk/jdk19.git HEAD branch: master Remote branches: master tracked pr/1 skipped pr/2 skipped pr/3 skipped Local ref configured for 'git push': master pushes to master (fast-forwardable) By showing the refs as skipped, it helps clarify that these references won't actually be fetched. Alternatively, we could simply remove them entirely. Add a new test case to cover this functionality. Reported-by: Pavel Rappo <pavel.rappo@gmail.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> --- builtin/remote.c | 17 +++++++++++++---- remote.c | 2 +- remote.h | 6 ++++++ t/t5505-remote.sh | 22 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index d4b69fe77898..8d88c21e2e95 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -344,12 +344,13 @@ static void read_branches(void) struct ref_states { struct remote *remote; - struct string_list new_refs, stale, tracked, heads, push; + struct string_list new_refs, skipped, stale, tracked, heads, push; int queried; }; #define REF_STATES_INIT { \ .new_refs = STRING_LIST_INIT_DUP, \ + .skipped = STRING_LIST_INIT_DUP, \ .stale = STRING_LIST_INIT_DUP, \ .tracked = STRING_LIST_INIT_DUP, \ .heads = STRING_LIST_INIT_DUP, \ @@ -368,10 +369,13 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat states->remote->fetch.raw[i]); for (ref = fetch_map; ref; ref = ref->next) { - if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { + string_list_append(&states->skipped, abbrev_branch(ref->name)); + } else if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) { string_list_append(&states->new_refs, abbrev_branch(ref->name)); - else + } else { string_list_append(&states->tracked, abbrev_branch(ref->name)); + } } stale_refs = get_stale_heads(&states->remote->fetch, fetch_map); for (ref = stale_refs; ref; ref = ref->next) { @@ -383,6 +387,7 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat free_refs(fetch_map); string_list_sort(&states->new_refs); + string_list_sort(&states->skipped); string_list_sort(&states->tracked); string_list_sort(&states->stale); @@ -941,6 +946,7 @@ static void clear_push_info(void *util, const char *string) static void free_remote_ref_states(struct ref_states *states) { string_list_clear(&states->new_refs, 0); + string_list_clear(&states->skipped, 0); string_list_clear(&states->stale, 1); string_list_clear(&states->tracked, 0); string_list_clear(&states->heads, 0); @@ -1033,7 +1039,9 @@ static int show_remote_info_item(struct string_list_item *item, void *cb_data) if (string_list_has_string(&states->new_refs, name)) { fmt = _(" new (next fetch will store in remotes/%s)"); arg = states->remote->name; - } else if (string_list_has_string(&states->tracked, name)) + } else if (string_list_has_string(&states->skipped, name)) + arg = _(" skipped"); + else if (string_list_has_string(&states->tracked, name)) arg = _(" tracked"); else if (string_list_has_string(&states->stale, name)) arg = _(" stale (use 'git remote prune' to remove)"); @@ -1308,6 +1316,7 @@ static int show(int argc, const char **argv) /* remote branch info */ info.width = 0; for_each_string_list(&info.states.new_refs, add_remote_to_show_info, &info); + for_each_string_list(&info.states.skipped, add_remote_to_show_info, &info); for_each_string_list(&info.states.tracked, add_remote_to_show_info, &info); for_each_string_list(&info.states.stale, add_remote_to_show_info, &info); if (info.list.nr) diff --git a/remote.c b/remote.c index 404e1e0a0ddb..7d68b5632bb5 100644 --- a/remote.c +++ b/remote.c @@ -804,7 +804,7 @@ static int refspec_match(const struct refspec_item *refspec, return !strcmp(refspec->src, name); } -static int omit_name_by_refspec(const char *name, struct refspec *rs) +int omit_name_by_refspec(const char *name, struct refspec *rs) { int i; diff --git a/remote.h b/remote.h index dd4402436f1f..448675e11259 100644 --- a/remote.h +++ b/remote.h @@ -247,6 +247,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Check whether a name matches any negative refspec in rs. Returns 1 if the + * name matches at least one negative refspec, and 0 otherwise. + */ +int omit_name_by_refspec(const char *name, struct refspec *rs); + /* * Remove all entries in the input list which match any negative refspec in * the refspec list. diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index ac5198141e79..06e5cef325c2 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -263,6 +263,28 @@ test_expect_success 'show' ' test_cmp expect output ' +cat >expect <<EOF +* remote origin + Fetch URL: $(pwd)/one + Push URL: $(pwd)/one + HEAD branch: main + Remote branches: + main skipped + side tracked + Local branches configured for 'git pull': + ahead merges with remote main + main merges with remote main + Local refs configured for 'git push': + main pushes to main (local out of date) + main pushes to upstream (create) +EOF + +test_expect_success 'show with negative refspecs' ' + test_config -C test --add remote.origin.fetch ^refs/heads/main && + git -C test remote show origin >output && + test_cmp expect output +' + cat >expect <<EOF * remote origin Fetch URL: $(pwd)/one -- 2.36.1
This series adds support for negative refspecs to git remote show, fixing an issue reported by Pavel Rappo. In addition, it includes some cleanup of the t5505-remote.sh test script, focusing on removing subshells and using test_config more. To support this, test_config and test_unconfig are extended to take and handle more options. The test_config_global is removed in favor of just using test_config --global. In addition, test_config now passes the value and --fixed-value into test_unconfig so that only the specific value is removed (rather than all keys of the name). The original v1 can be found here: https://lore.kernel.org/git/20220614003251.16765-1-jacob.e.keller@intel.com/ If the config changes are too controversial, I'm happy to split them out into a separate series for further discussion, or drop them if they aren't desirable. Changes since v1: * cleanup t5505 subshells * modify test_config and test_unconfig to handle additional options including --add, --global, and --fixed-value * make test_config only cleanup keys with exact matching values. * use test_config more in t5505 to avoid lingering configuration in future tests * Moved the omit_name_by_refspec call into the already existing fetch_map, rather than using two loops. We don't really need to remove these values from the fetch_map and it significantly simplifies the code. Thanks Junio! Jacob Keller (5): t5505: remove sub shell use in favor of git -C tests: handle --global directly in test_config/test_unconfig tests: only automatically unset matching values from test_config t5505: use test_config where appropriate remote: handle negative refspecs in git remote show builtin/remote.c | 17 +- remote.c | 2 +- remote.h | 6 + t/lib-parallel-checkout.sh | 4 +- t/lib-proto-disable.sh | 12 +- t/lib-submodule-update.sh | 2 +- t/t0001-init.sh | 14 +- t/t0021-conversion.sh | 58 +- t/t0210-trace2-normal.sh | 10 +- t/t0211-trace2-perf.sh | 4 +- t/t0212-trace2-event.sh | 2 +- t/t1309-early-config.sh | 2 +- t/t2081-parallel-checkout-collisions.sh | 2 +- t/t2082-parallel-checkout-attributes.sh | 4 +- t/t3431-rebase-fork-point.sh | 2 +- t/t5505-remote.sh | 1083 +++++++++-------------- t/t5544-pack-objects-hook.sh | 6 +- t/t5550-http-fetch-dumb.sh | 8 +- t/t5573-pull-verify-signatures.sh | 6 +- t/t5606-clone-options.sh | 10 +- t/t5617-clone-submodules-remote.sh | 4 +- t/t5702-protocol-v2.sh | 2 +- t/t7814-grep-recurse-submodules.sh | 16 +- t/test-lib-functions.sh | 85 +- 24 files changed, 602 insertions(+), 759 deletions(-) -- 2.36.1
On Mon, Jun 13, 2022 at 7:26 PM Taylor Blau <me@ttaylorr.com> wrote:
>
> On Mon, Jun 13, 2022 at 06:56:55PM -0700, Jacob Keller wrote:
> > > > +test_expect_success 'show with negative refspecs' '
> > > > + test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" &&
> > > > + (
> > > > + cd test &&
> > > > + git config --add remote.origin.fetch ^refs/heads/main &&
> > >
> > > Doing "git config --unset" outside of the subshell could be avoided by
> > > ditching the subshell altogether, perhaps with something like:
> > >
> > > test_config -C test remote.origin.fetch ^refs/heads/main &&
> >
> > We need "--add" semantics here which test_config doesn't seem to
> > support at the moment.
>
> Makes sense, thanks for explaining. This patch looks good to me.
>
> Thanks,
> Taylor
I ended up digging into this, and have now additionally added some
patches to clean these tests up:
1) drop all the subshells in t5505 where possible
2) modify test_config and test_unconfig to handle options, including
--global, --add, and --fixed-value
3) make test_config use --fixed-value with test_unconfig so that only
the keys with the exact value are removed
4) use test_config more so that we don't have config values from
previous tests kept around
On Wed, Jun 15, 2022 at 2:45 PM Junio C Hamano <gitster@pobox.com> wrote: > > Jacob Keller <jacob.keller@gmail.com> writes: > > > Fix this by checking negative refspecs inside of get_ref_states. For > > each ref which matches a negative refspec, copy it into a "skipped" list > > and remove it from the fetch map. This allows us to show the following > > output instead: > > > > * remote jdk19 > > Fetch URL: git@github.com:openjdk/jdk19.git > > Push URL: git@github.com:openjdk/jdk19.git > > HEAD branch: master > > Remote branches: > > master tracked > > pr/1 skipped > > pr/2 skipped > > pr/3 skipped > > Local ref configured for 'git push': > > master pushes to master (fast-forwardable) > > > > By showing the refs as skipped, it helps clarify that these references > > won't actually be fetched. Alternatively, we could simply remove them > > entirely. > > Very sensible. > > > @@ -367,6 +368,24 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat > > die(_("Could not get fetch map for refspec %s"), > > states->remote->fetch.raw[i]); > > > > + /* handle negative refspecs first */ > > + for (tail = &fetch_map; *tail; ) { > > + ref = *tail; > > + > > + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { > > + string_list_append(&states->skipped, abbrev_branch(ref->name)); > > + > > + /* Matched a negative refspec, so remove this ref from > > + * consideration for being a new or tracked ref. > > + */ > > + *tail = ref->next; > > + free(ref->peer_ref); > > + free(ref); > > + } else { > > + tail = &ref->next; > > + } > > + } > > > This is somewhat curious. Do we really need to destroy the > fetch_map like the above? I know by removing skipped items from the > list, the existing loop (below) can stop having to worry about them, > but the caller of get_ref_states() may later want to iterate over > the full fetch_map for other reasons (even if the current one does > not, a future version of the caller may have a reason to do so that > we do not know right now yet). > Good point. I'll fix this. I think we can just move the omit_name_by_refspec into the other loop. > > + > > for (ref = fetch_map; ref; ref = ref->next) { > > if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) > > string_list_append(&states->new_refs, abbrev_branch(ref->name)); > > IOW, is adding a new condition to this existing loop insufficient? > The tricky part here is that we don't have a simple check, and we're currently iterating over all of the refspecs each time. But we have to do that regardless so I think this makes sense. Will fix. > for (ref = fetch_map; ref; ref = ref->next) { > - if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) > + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) > + string_list_append(&states->skipped, abbrev_branch(ref->name)); > + else if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) > string_list_append(&states->new_refs, abbrev_branch(ref->name)); > else > string_list_append(&states->tracked, abbrev_branch(ref->name)); > } > > > Thanks.
Jacob Keller <jacob.keller@gmail.com> writes: > Fix this by checking negative refspecs inside of get_ref_states. For > each ref which matches a negative refspec, copy it into a "skipped" list > and remove it from the fetch map. This allows us to show the following > output instead: > > * remote jdk19 > Fetch URL: git@github.com:openjdk/jdk19.git > Push URL: git@github.com:openjdk/jdk19.git > HEAD branch: master > Remote branches: > master tracked > pr/1 skipped > pr/2 skipped > pr/3 skipped > Local ref configured for 'git push': > master pushes to master (fast-forwardable) > > By showing the refs as skipped, it helps clarify that these references > won't actually be fetched. Alternatively, we could simply remove them > entirely. Very sensible. > @@ -367,6 +368,24 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat > die(_("Could not get fetch map for refspec %s"), > states->remote->fetch.raw[i]); > > + /* handle negative refspecs first */ > + for (tail = &fetch_map; *tail; ) { > + ref = *tail; > + > + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { > + string_list_append(&states->skipped, abbrev_branch(ref->name)); > + > + /* Matched a negative refspec, so remove this ref from > + * consideration for being a new or tracked ref. > + */ > + *tail = ref->next; > + free(ref->peer_ref); > + free(ref); > + } else { > + tail = &ref->next; > + } > + } This is somewhat curious. Do we really need to destroy the fetch_map like the above? I know by removing skipped items from the list, the existing loop (below) can stop having to worry about them, but the caller of get_ref_states() may later want to iterate over the full fetch_map for other reasons (even if the current one does not, a future version of the caller may have a reason to do so that we do not know right now yet). > + > for (ref = fetch_map; ref; ref = ref->next) { > if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) > string_list_append(&states->new_refs, abbrev_branch(ref->name)); IOW, is adding a new condition to this existing loop insufficient? for (ref = fetch_map; ref; ref = ref->next) { - if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) + string_list_append(&states->skipped, abbrev_branch(ref->name)); + else if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) string_list_append(&states->new_refs, abbrev_branch(ref->name)); else string_list_append(&states->tracked, abbrev_branch(ref->name)); } Thanks.
On Mon, Jun 13, 2022 at 6:03 PM Taylor Blau <me@ttaylorr.com> wrote: > > On Mon, Jun 13, 2022 at 05:32:51PM -0700, Jacob Keller wrote: > > Fix this by checking negative refspecs inside of get_ref_states. For > > each ref which matches a negative refspec, copy it into a "skipped" list > > and remove it from the fetch map. This allows us to show the following > > output instead: > > Seems sensible. > > > + /* handle negative refspecs first */ > > + for (tail = &fetch_map; *tail; ) { > > + ref = *tail; > > + > > + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { > > + string_list_append(&states->skipped, abbrev_branch(ref->name)); > > + > > + /* Matched a negative refspec, so remove this ref from > > + * consideration for being a new or tracked ref. > > + */ > > + *tail = ref->next; > > + free(ref->peer_ref); > > + free(ref); > > + } else { > > + tail = &ref->next; > > + } > > + } > > + > > Not being overly familiar with the "git remote show" code, this > implementation looks very reasonable to me. If we see a negative > refspec, we remove it from the fetch_map list and append it to the > skipped list. Otherwise, we increment our pointer, and continue along > until we reach the end of the list. > The specific way the loop works is similar to other ref looping code but it feels a little odd to me. Still, it seems to be the right approach overall. > > +test_expect_success 'show with negative refspecs' ' > > + test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" && > > + ( > > + cd test && > > + git config --add remote.origin.fetch ^refs/heads/main && > > Doing "git config --unset" outside of the subshell could be avoided by > ditching the subshell altogether, perhaps with something like: > > test_config -C test remote.origin.fetch ^refs/heads/main && > git -C test remote show origin >actual && > test_cmp test/expect actual > I still think that removing the subshell is a good idea here. I'll investigate this. I also wonder if it would be difficult to enable "--add" semantics for test_config. > Thanks, > Taylor
On Mon, Jun 13, 2022 at 06:56:55PM -0700, Jacob Keller wrote:
> > > +test_expect_success 'show with negative refspecs' '
> > > + test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" &&
> > > + (
> > > + cd test &&
> > > + git config --add remote.origin.fetch ^refs/heads/main &&
> >
> > Doing "git config --unset" outside of the subshell could be avoided by
> > ditching the subshell altogether, perhaps with something like:
> >
> > test_config -C test remote.origin.fetch ^refs/heads/main &&
>
> We need "--add" semantics here which test_config doesn't seem to
> support at the moment.
Makes sense, thanks for explaining. This patch looks good to me.
Thanks,
Taylor
On Mon, Jun 13, 2022 at 6:03 PM Taylor Blau <me@ttaylorr.com> wrote: > > On Mon, Jun 13, 2022 at 05:32:51PM -0700, Jacob Keller wrote: > > Fix this by checking negative refspecs inside of get_ref_states. For > > each ref which matches a negative refspec, copy it into a "skipped" list > > and remove it from the fetch map. This allows us to show the following > > output instead: > > Seems sensible. > > > + /* handle negative refspecs first */ > > + for (tail = &fetch_map; *tail; ) { > > + ref = *tail; > > + > > + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { > > + string_list_append(&states->skipped, abbrev_branch(ref->name)); > > + > > + /* Matched a negative refspec, so remove this ref from > > + * consideration for being a new or tracked ref. > > + */ > > + *tail = ref->next; > > + free(ref->peer_ref); > > + free(ref); > > + } else { > > + tail = &ref->next; > > + } > > + } > > + > > Not being overly familiar with the "git remote show" code, this > implementation looks very reasonable to me. If we see a negative > refspec, we remove it from the fetch_map list and append it to the > skipped list. Otherwise, we increment our pointer, and continue along > until we reach the end of the list. > > > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh > > index fff14e13ed43..e19b8d666c73 100755 > > --- a/t/t5505-remote.sh > > +++ b/t/t5505-remote.sh > > @@ -302,6 +302,33 @@ test_expect_success 'show' ' > > ) > > ' > > > > +cat >test/expect <<EOF > > +* remote origin > > + Fetch URL: $(pwd)/one > > + Push URL: $(pwd)/one > > + HEAD branch: main > > + Remote branches: > > + main skipped > > + side tracked > > + upstream stale (use 'git remote prune' to remove) > > + Local branches configured for 'git pull': > > + ahead merges with remote main > > + main merges with remote main > > + Local refs configured for 'git push': > > + main pushes to main (local out of date) > > + main pushes to upstream (create) > > +EOF > > + > > +test_expect_success 'show with negative refspecs' ' > > + test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" && > > + ( > > + cd test && > > + git config --add remote.origin.fetch ^refs/heads/main && > > Doing "git config --unset" outside of the subshell could be avoided by > ditching the subshell altogether, perhaps with something like: > > test_config -C test remote.origin.fetch ^refs/heads/main && We need "--add" semantics here which test_config doesn't seem to support at the moment. > git -C test remote show origin >actual && > test_cmp test/expect actual > > Thanks, > Taylor
On Mon, Jun 13, 2022 at 05:32:51PM -0700, Jacob Keller wrote: > Fix this by checking negative refspecs inside of get_ref_states. For > each ref which matches a negative refspec, copy it into a "skipped" list > and remove it from the fetch map. This allows us to show the following > output instead: Seems sensible. > + /* handle negative refspecs first */ > + for (tail = &fetch_map; *tail; ) { > + ref = *tail; > + > + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { > + string_list_append(&states->skipped, abbrev_branch(ref->name)); > + > + /* Matched a negative refspec, so remove this ref from > + * consideration for being a new or tracked ref. > + */ > + *tail = ref->next; > + free(ref->peer_ref); > + free(ref); > + } else { > + tail = &ref->next; > + } > + } > + Not being overly familiar with the "git remote show" code, this implementation looks very reasonable to me. If we see a negative refspec, we remove it from the fetch_map list and append it to the skipped list. Otherwise, we increment our pointer, and continue along until we reach the end of the list. > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh > index fff14e13ed43..e19b8d666c73 100755 > --- a/t/t5505-remote.sh > +++ b/t/t5505-remote.sh > @@ -302,6 +302,33 @@ test_expect_success 'show' ' > ) > ' > > +cat >test/expect <<EOF > +* remote origin > + Fetch URL: $(pwd)/one > + Push URL: $(pwd)/one > + HEAD branch: main > + Remote branches: > + main skipped > + side tracked > + upstream stale (use 'git remote prune' to remove) > + Local branches configured for 'git pull': > + ahead merges with remote main > + main merges with remote main > + Local refs configured for 'git push': > + main pushes to main (local out of date) > + main pushes to upstream (create) > +EOF > + > +test_expect_success 'show with negative refspecs' ' > + test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" && > + ( > + cd test && > + git config --add remote.origin.fetch ^refs/heads/main && Doing "git config --unset" outside of the subshell could be avoided by ditching the subshell altogether, perhaps with something like: test_config -C test remote.origin.fetch ^refs/heads/main && git -C test remote show origin >actual && test_cmp test/expect actual Thanks, Taylor
On Mon, Jun 13, 2022 at 4:20 PM Jacob Keller <jacob.keller@gmail.com> wrote:
>
> On Fri, Jun 10, 2022 at 10:08 AM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > Pavel Rappo <pavel.rappo@gmail.com> writes:
> >
> > > Here's a console session:
> > >
> > > % git config --get-all remote.jdk19.fetch
> > > +refs/heads/*:refs/remotes/jdk19/*
> > > ^refs/heads/pr/*
> >
> > Thanks
> >
> > "Negative refspecs" is relatively new feature introduced in c0192df6
> > (refspec: add support for negative refspecs, 2020-09-30), so it
> > would not be so surprising if it still had some surprising behaviour
> > ;-)
> >
> > Jacob, care to take a look?
> >
>
> Ok, so this looks like its caused by the fact that get_fetch_map in
> builtin/remote.c ignores all negative refspecs. I think what we really
> want to do is check if a given ref matches any negative ref and then
> maybe move it from the new listing into a separate skipped listing.
>
> Figuring out the best way to do this is a little bit of a challenge.
> It looks like maybe we need to use one of the functions in remote.c
> just after the get_fetch_map call in get_ref_states. But exactly what
> has so far eluded me after a bit of digging.
>
> I'm still looking at this, but help would be appreciated if anyone
> else has a suggestion.
>
> Thanks,
> Jake
>
> > > % git remote show jdk19
> > >
> > > * remote jdk19
> > > Fetch URL: git@github.com:openjdk/jdk19.git
> > > Push URL: git@github.com:openjdk/jdk19.git
> > > HEAD branch: master
> > > Remote branches:
> > > master tracked
> > > pr/1 new (next fetch will store in remotes/jdk19)
> > > pr/2 new (next fetch will store in remotes/jdk19)
> > > pr/3 new (next fetch will store in remotes/jdk19)
> > > Local ref configured for 'git push':
> > > master pushes to master (fast-forwardable)
> > >
> > > I would naively expect the pr/1, pr/2, and pr/3 branches to be either:
> > >
> > > - not displayed, or better
> > > - displayed with a hint that they won't be fetched (since they match a
> > > _negative_ refspec, which is the second line in the `git config`
> > > output above)
> > >
> > > Thanks,
> > > -Pavel
I found a working solution, but I don't really like the
implementation, so perhaps someone with more knowledge of the struct
refspec, struct refspec_item, etc would help me figure out if I am
doing it in a good way. I just posted it.
Thanks,
Jake
By default, the git remote show command will query data from remotes to show data about what might be done on a future git fetch. This process currently does not handle negative refspecs. This can be confusing, because the show command will list refs as if they would be fetched. For example if the fetch refspec "^refs/heads/pr/*", it still displays the following: * remote jdk19 Fetch URL: git@github.com:openjdk/jdk19.git Push URL: git@github.com:openjdk/jdk19.git HEAD branch: master Remote branches: master tracked pr/1 new (next fetch will store in remotes/jdk19) pr/2 new (next fetch will store in remotes/jdk19) pr/3 new (next fetch will store in remotes/jdk19) Local ref configured for 'git push': master pushes to master (fast-forwardable) Fix this by checking negative refspecs inside of get_ref_states. For each ref which matches a negative refspec, copy it into a "skipped" list and remove it from the fetch map. This allows us to show the following output instead: * remote jdk19 Fetch URL: git@github.com:openjdk/jdk19.git Push URL: git@github.com:openjdk/jdk19.git HEAD branch: master Remote branches: master tracked pr/1 skipped pr/2 skipped pr/3 skipped Local ref configured for 'git push': master pushes to master (fast-forwardable) By showing the refs as skipped, it helps clarify that these references won't actually be fetched. Alternatively, we could simply remove them entirely. Add a new test case to cover this functionality. Reported-by: Pavel Rappo <pavel.rappo@gmail.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> --- builtin/remote.c | 28 ++++++++++++++++++++++++++-- remote.c | 2 +- remote.h | 6 ++++++ t/t5505-remote.sh | 27 +++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index d4b69fe77898..243e60e19bdb 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -344,12 +344,13 @@ static void read_branches(void) struct ref_states { struct remote *remote; - struct string_list new_refs, stale, tracked, heads, push; + struct string_list new_refs, skipped, stale, tracked, heads, push; int queried; }; #define REF_STATES_INIT { \ .new_refs = STRING_LIST_INIT_DUP, \ + .skipped = STRING_LIST_INIT_DUP, \ .stale = STRING_LIST_INIT_DUP, \ .tracked = STRING_LIST_INIT_DUP, \ .heads = STRING_LIST_INIT_DUP, \ @@ -367,6 +368,24 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat die(_("Could not get fetch map for refspec %s"), states->remote->fetch.raw[i]); + /* handle negative refspecs first */ + for (tail = &fetch_map; *tail; ) { + ref = *tail; + + if (omit_name_by_refspec(ref->name, &states->remote->fetch)) { + string_list_append(&states->skipped, abbrev_branch(ref->name)); + + /* Matched a negative refspec, so remove this ref from + * consideration for being a new or tracked ref. + */ + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else { + tail = &ref->next; + } + } + for (ref = fetch_map; ref; ref = ref->next) { if (!ref->peer_ref || !ref_exists(ref->peer_ref->name)) string_list_append(&states->new_refs, abbrev_branch(ref->name)); @@ -383,6 +402,7 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat free_refs(fetch_map); string_list_sort(&states->new_refs); + string_list_sort(&states->skipped); string_list_sort(&states->tracked); string_list_sort(&states->stale); @@ -941,6 +961,7 @@ static void clear_push_info(void *util, const char *string) static void free_remote_ref_states(struct ref_states *states) { string_list_clear(&states->new_refs, 0); + string_list_clear(&states->skipped, 0); string_list_clear(&states->stale, 1); string_list_clear(&states->tracked, 0); string_list_clear(&states->heads, 0); @@ -1033,7 +1054,9 @@ static int show_remote_info_item(struct string_list_item *item, void *cb_data) if (string_list_has_string(&states->new_refs, name)) { fmt = _(" new (next fetch will store in remotes/%s)"); arg = states->remote->name; - } else if (string_list_has_string(&states->tracked, name)) + } else if (string_list_has_string(&states->skipped, name)) + arg = _(" skipped"); + else if (string_list_has_string(&states->tracked, name)) arg = _(" tracked"); else if (string_list_has_string(&states->stale, name)) arg = _(" stale (use 'git remote prune' to remove)"); @@ -1308,6 +1331,7 @@ static int show(int argc, const char **argv) /* remote branch info */ info.width = 0; for_each_string_list(&info.states.new_refs, add_remote_to_show_info, &info); + for_each_string_list(&info.states.skipped, add_remote_to_show_info, &info); for_each_string_list(&info.states.tracked, add_remote_to_show_info, &info); for_each_string_list(&info.states.stale, add_remote_to_show_info, &info); if (info.list.nr) diff --git a/remote.c b/remote.c index 404e1e0a0ddb..7d68b5632bb5 100644 --- a/remote.c +++ b/remote.c @@ -804,7 +804,7 @@ static int refspec_match(const struct refspec_item *refspec, return !strcmp(refspec->src, name); } -static int omit_name_by_refspec(const char *name, struct refspec *rs) +int omit_name_by_refspec(const char *name, struct refspec *rs) { int i; diff --git a/remote.h b/remote.h index dd4402436f1f..448675e11259 100644 --- a/remote.h +++ b/remote.h @@ -247,6 +247,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Check whether a name matches any negative refspec in rs. Returns 1 if the + * name matches at least one negative refspec, and 0 otherwise. + */ +int omit_name_by_refspec(const char *name, struct refspec *rs); + /* * Remove all entries in the input list which match any negative refspec in * the refspec list. diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index fff14e13ed43..e19b8d666c73 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -302,6 +302,33 @@ test_expect_success 'show' ' ) ' +cat >test/expect <<EOF +* remote origin + Fetch URL: $(pwd)/one + Push URL: $(pwd)/one + HEAD branch: main + Remote branches: + main skipped + side tracked + upstream stale (use 'git remote prune' to remove) + Local branches configured for 'git pull': + ahead merges with remote main + main merges with remote main + Local refs configured for 'git push': + main pushes to main (local out of date) + main pushes to upstream (create) +EOF + +test_expect_success 'show with negative refspecs' ' + test_when_finished "git -C test config --fixed-value --unset remote.origin.fetch ^refs/heads/main" && + ( + cd test && + git config --add remote.origin.fetch ^refs/heads/main && + git remote show origin >output && + test_cmp expect output + ) +' + cat >test/expect <<EOF * remote origin Fetch URL: $(pwd)/one -- 2.36.1
On Fri, Jun 10, 2022 at 10:08 AM Junio C Hamano <gitster@pobox.com> wrote: > > Pavel Rappo <pavel.rappo@gmail.com> writes: > > > Here's a console session: > > > > % git config --get-all remote.jdk19.fetch > > +refs/heads/*:refs/remotes/jdk19/* > > ^refs/heads/pr/* > > Thanks > > "Negative refspecs" is relatively new feature introduced in c0192df6 > (refspec: add support for negative refspecs, 2020-09-30), so it > would not be so surprising if it still had some surprising behaviour > ;-) > > Jacob, care to take a look? > Ok, so this looks like its caused by the fact that get_fetch_map in builtin/remote.c ignores all negative refspecs. I think what we really want to do is check if a given ref matches any negative ref and then maybe move it from the new listing into a separate skipped listing. Figuring out the best way to do this is a little bit of a challenge. It looks like maybe we need to use one of the functions in remote.c just after the get_fetch_map call in get_ref_states. But exactly what has so far eluded me after a bit of digging. I'm still looking at this, but help would be appreciated if anyone else has a suggestion. Thanks, Jake > > % git remote show jdk19 > > > > * remote jdk19 > > Fetch URL: git@github.com:openjdk/jdk19.git > > Push URL: git@github.com:openjdk/jdk19.git > > HEAD branch: master > > Remote branches: > > master tracked > > pr/1 new (next fetch will store in remotes/jdk19) > > pr/2 new (next fetch will store in remotes/jdk19) > > pr/3 new (next fetch will store in remotes/jdk19) > > Local ref configured for 'git push': > > master pushes to master (fast-forwardable) > > > > I would naively expect the pr/1, pr/2, and pr/3 branches to be either: > > > > - not displayed, or better > > - displayed with a hint that they won't be fetched (since they match a > > _negative_ refspec, which is the second line in the `git config` > > output above) > > > > Thanks, > > -Pavel
On Fri, Jun 10, 2022 at 10:08 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Pavel Rappo <pavel.rappo@gmail.com> writes:
>
> > Here's a console session:
> >
> > % git config --get-all remote.jdk19.fetch
> > +refs/heads/*:refs/remotes/jdk19/*
> > ^refs/heads/pr/*
>
> Thanks
>
> "Negative refspecs" is relatively new feature introduced in c0192df6
> (refspec: add support for negative refspecs, 2020-09-30), so it
> would not be so surprising if it still had some surprising behaviour
> ;-)
>
> Jacob, care to take a look?
>
> > % git remote show jdk19
> >
> > * remote jdk19
> > Fetch URL: git@github.com:openjdk/jdk19.git
> > Push URL: git@github.com:openjdk/jdk19.git
> > HEAD branch: master
> > Remote branches:
> > master tracked
> > pr/1 new (next fetch will store in remotes/jdk19)
> > pr/2 new (next fetch will store in remotes/jdk19)
> > pr/3 new (next fetch will store in remotes/jdk19)
> > Local ref configured for 'git push':
> > master pushes to master (fast-forwardable)
> >
> > I would naively expect the pr/1, pr/2, and pr/3 branches to be either:
> >
> > - not displayed, or better
> > - displayed with a hint that they won't be fetched (since they match a
> > _negative_ refspec, which is the second line in the `git config`
> > output above)
> >
> > Thanks,
> > -Pavel
This is almost certainly an oversight in that the particular code path
does not process negative refspecs. I can hopefully take a closer look
at this next week.
Pavel Rappo <pavel.rappo@gmail.com> writes: > Here's a console session: > > % git config --get-all remote.jdk19.fetch > +refs/heads/*:refs/remotes/jdk19/* > ^refs/heads/pr/* Thanks "Negative refspecs" is relatively new feature introduced in c0192df6 (refspec: add support for negative refspecs, 2020-09-30), so it would not be so surprising if it still had some surprising behaviour ;-) Jacob, care to take a look? > % git remote show jdk19 > > * remote jdk19 > Fetch URL: git@github.com:openjdk/jdk19.git > Push URL: git@github.com:openjdk/jdk19.git > HEAD branch: master > Remote branches: > master tracked > pr/1 new (next fetch will store in remotes/jdk19) > pr/2 new (next fetch will store in remotes/jdk19) > pr/3 new (next fetch will store in remotes/jdk19) > Local ref configured for 'git push': > master pushes to master (fast-forwardable) > > I would naively expect the pr/1, pr/2, and pr/3 branches to be either: > > - not displayed, or better > - displayed with a hint that they won't be fetched (since they match a > _negative_ refspec, which is the second line in the `git config` > output above) > > Thanks, > -Pavel
SZEDER Gábor <szeder.dev@gmail.com> writes:
> On Mon, Aug 23, 2021 at 04:32:39PM -0700, Junio C Hamano wrote:
>> Mickey Endito <mickey.endito.2323@protonmail.com> writes:
>>
>> > The variable D is never defined in test t5582, more severely the test
>> > fails if D is defined by something outside the test suite, so remove
>> > this spurious line.
>>
>> Wow. Well spotted.
>>
>> When D is left unset, we end up executing
>>
>> cd "" && ...
>>
>> and it explains why nobody noticed the breakage for nearly a year
>> since c0192df6 (refspec: add support for negative refspecs,
>> 2020-09-30) was written.
>>
>>
>> Unlike the apparent
>> copy-and-paste source, this is a more modern script that limits the
>> chdir inside subshells to avoid moving around in the main flow of
>> the test, and the fix proposed here looks the most sensible.
>
> 'grep " cd $" test-results/*.out' shows that there is a similar case
> in 't5323-pack-redundant.sh' as well, in test 'master: pack-redundant
> works with no packfile'.
OK. A candidate for a separate patch, which would be a low-hanging
fruit, I guess.
On Mon, Aug 23, 2021 at 04:32:39PM -0700, Junio C Hamano wrote: > Mickey Endito <mickey.endito.2323@protonmail.com> writes: > > > The variable D is never defined in test t5582, more severely the test > > fails if D is defined by something outside the test suite, so remove > > this spurious line. > > Wow. Well spotted. > > When D is left unset, we end up executing > > cd "" && ... > > and it explains why nobody noticed the breakage for nearly a year > since c0192df6 (refspec: add support for negative refspecs, > 2020-09-30) was written. > > > Unlike the apparent > copy-and-paste source, this is a more modern script that limits the > chdir inside subshells to avoid moving around in the main flow of > the test, and the fix proposed here looks the most sensible. 'grep " cd $" test-results/*.out' shows that there is a similar case in 't5323-pack-redundant.sh' as well, in test 'master: pack-redundant works with no packfile'. > > Signed-off-by: Mickey Endito <mickey.endito.2323@protonmail.com> > > --- > > To reproduce a failure do > > D=/some/path/which/does/not/exist t/t5582-fetch-negative-refspec.sh > > > > Note: The variable D seems to be a reminiscent similar to t/t5510-fetch.sh, > > which defines "D=$(pwd)". If you want to adopt that way, then you have > > to code a fix yourself. ;-) > > > > t/t5582-fetch-negative-refspec.sh | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > > index e5d2e79ad3..7a80e47c2b 100755 > > --- a/t/t5582-fetch-negative-refspec.sh > > +++ b/t/t5582-fetch-negative-refspec.sh > > @@ -105,7 +105,6 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix" > > ' > > > > test_expect_success "fetch with negative refspec avoids duplicate conflict" ' > > - cd "$D" && > > ( > > cd one && > > git branch dups/a && > > -- > > 2.30.2
Mickey Endito <mickey.endito.2323@protonmail.com> writes: > The variable D is never defined in test t5582, more severely the test > fails if D is defined by something outside the test suite, so remove > this spurious line. Wow. Well spotted. When D is left unset, we end up executing cd "" && ... and it explains why nobody noticed the breakage for nearly a year since c0192df6 (refspec: add support for negative refspecs, 2020-09-30) was written. Unlike the apparent copy-and-paste source, this is a more modern script that limits the chdir inside subshells to avoid moving around in the main flow of the test, and the fix proposed here looks the most sensible. > Signed-off-by: Mickey Endito <mickey.endito.2323@protonmail.com> > --- > To reproduce a failure do > D=/some/path/which/does/not/exist t/t5582-fetch-negative-refspec.sh > > Note: The variable D seems to be a reminiscent similar to t/t5510-fetch.sh, > which defines "D=$(pwd)". If you want to adopt that way, then you have > to code a fix yourself. ;-) > > t/t5582-fetch-negative-refspec.sh | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > index e5d2e79ad3..7a80e47c2b 100755 > --- a/t/t5582-fetch-negative-refspec.sh > +++ b/t/t5582-fetch-negative-refspec.sh > @@ -105,7 +105,6 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix" > ' > > test_expect_success "fetch with negative refspec avoids duplicate conflict" ' > - cd "$D" && > ( > cd one && > git branch dups/a && > -- > 2.30.2
Split out the discussion bout "object prerequisites" into its own section, and add some more examples of the common cases. See 2e0afafebd (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being changed here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/git-bundle.txt | 37 +++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 339c5b47276..f1f84ce2c42 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -44,6 +44,7 @@ header indicating what references are contained within the bundle. Like the the packed archive format itself bundles can either be self-contained, or be created using exclusions. +See the "OBJECT PREREQUISITES" section below. Bundles created using revision exclusions are "thin packs" created using the `--thin` option to linkgit:git-pack-objects[1], and @@ -152,19 +153,49 @@ contained in the union of the given bases. Each basis can be specified explicitly (e.g. `^master~10`), or implicitly (e.g. `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. +OBJECT PREREQUISITES +-------------------- + +When creating bundles it is possible to create a self-contained bundle +that can be unbundled in a repository with no common history, as well +as providing negative revisions to exclude objects needed in the +earlier parts of the history. + +Feeding a revision such as `new` to `git bundle create` will create a +bundle file that contains all the objects reachable from the revision +`new`. That bundle can be unbundled in any repository to obtain a full +history that leads to the revision `new`: + +---------------- +$ git bundle create full.bundle new +---------------- + +A revision range such as `old..new` will produce a bundle file that +will require the revision `old` (and any objects reachable from it) +to exist for the bundle to be "unbundle"-able: + +---------------- +$ git bundle create full.bundle old..new +---------------- + +A self-contained bundle without any prerequisites can be extracted +into anywhere, even into an empty repository, or be cloned from +(i.e., `new`, but not `old..new`). + It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. -`git clone` can use any bundle created without negative refspecs -(e.g., `new`, but not `old..new`). If you want to match `git clone --mirror`, which would include your refs such as `refs/remotes/*`, use `--all`. If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. +The 'git bundle verify' command can be used to check whether your +recipient repository has the required prerequisite commits for a +bundle. + EXAMPLES -------- -- 2.32.0.1069.g545f0888808
Split out the discussion bout "object prerequisites" into its own section, and add some more examples of the common cases. See 2e0afafebd (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being changed here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/git-bundle.txt | 37 +++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 339c5b4727..f1f84ce2c4 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -44,6 +44,7 @@ header indicating what references are contained within the bundle. Like the the packed archive format itself bundles can either be self-contained, or be created using exclusions. +See the "OBJECT PREREQUISITES" section below. Bundles created using revision exclusions are "thin packs" created using the `--thin` option to linkgit:git-pack-objects[1], and @@ -152,19 +153,49 @@ contained in the union of the given bases. Each basis can be specified explicitly (e.g. `^master~10`), or implicitly (e.g. `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. +OBJECT PREREQUISITES +-------------------- + +When creating bundles it is possible to create a self-contained bundle +that can be unbundled in a repository with no common history, as well +as providing negative revisions to exclude objects needed in the +earlier parts of the history. + +Feeding a revision such as `new` to `git bundle create` will create a +bundle file that contains all the objects reachable from the revision +`new`. That bundle can be unbundled in any repository to obtain a full +history that leads to the revision `new`: + +---------------- +$ git bundle create full.bundle new +---------------- + +A revision range such as `old..new` will produce a bundle file that +will require the revision `old` (and any objects reachable from it) +to exist for the bundle to be "unbundle"-able: + +---------------- +$ git bundle create full.bundle old..new +---------------- + +A self-contained bundle without any prerequisites can be extracted +into anywhere, even into an empty repository, or be cloned from +(i.e., `new`, but not `old..new`). + It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. -`git clone` can use any bundle created without negative refspecs -(e.g., `new`, but not `old..new`). If you want to match `git clone --mirror`, which would include your refs such as `refs/remotes/*`, use `--all`. If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. +The 'git bundle verify' command can be used to check whether your +recipient repository has the required prerequisite commits for a +bundle. + EXAMPLES -------- -- 2.32.0.988.g1a6a4b2c5f
Split out the discussion bout "object prerequisites" into its own section, and add some more examples of the common cases. See 2e0afafebd (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being changed here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/git-bundle.txt | 37 +++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 9c743aed49f..d5627b8cc51 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -45,6 +45,7 @@ header is (mostly) in the format emitted by linkgit:git-show-ref[1]. Like the the packed archive format itself bundles can either be self-contained, or be created using exclusions. +See the "OBJECT PREREQUISITES" section below. Bundles created using revision exclusions are "thin packs" created using the `--thin` option to linkgit:git-pack-objects[1], and @@ -153,19 +154,49 @@ contained in the union of the given bases. Each basis can be specified explicitly (e.g. `^master~10`), or implicitly (e.g. `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. +OBJECT PREREQUISITES +-------------------- + +When creating bundles it is possible to create a self-contained bundle +that can be unbundled in a repository with no common history, as well +as providing negative revisions to exclude objects needed in the +earlier parts of the history. + +Feeding a revision such as `new` to `git bundle create` will create a +bundle file that contains all the objects reachable from the revision +`new`. That bundle can be unbundled in any repository to obtain a full +history that leads to the revision `new`: + +---------------- +$ git bundle create full.bundle new +---------------- + +A revision range such as `old..new` will produce a bundle tip that'll +that'll require the revision `old` (and any objects reachable from it) +to exist for the bundle to be "unbundle"-able: + +---------------- +$ git bundle create full.bundle old..new +---------------- + +A self-contained bundle without any prerequisites can be extracted +into anywhere, even into an empty repository, or be cloned from +(i.e., `new`, but not `old..new`). + It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. -`git clone` can use any bundle created without negative refspecs -(e.g., `new`, but not `old..new`). If you want to match `git clone --mirror`, which would include your refs such as `refs/remotes/*`, use `--all`. If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. +The 'git bundle verify' command can be used to check whether your +recipient repository has the required prerequisite commits for a +bundle. + EXAMPLES -------- -- 2.32.0.874.ge7a9d58bfcf
Split out the discussion bout "object prerequisites" into its own section, and add some more examples of the common cases. See 2e0afafebd (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being changed here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/git-bundle.txt | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 9c743aed49f..f5430029b8c 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -45,6 +45,7 @@ header is (mostly) in the format emitted by linkgit:git-show-ref[1]. Like the the packed archive format itself bundles can either be self-contained, or be created using exclusions. +See the "OBJECT PREREQUISITES" section below. Bundles created using revision exclusions are "thin packs" created using the `--thin` option to linkgit:git-pack-objects[1], and @@ -153,19 +154,38 @@ contained in the union of the given bases. Each basis can be specified explicitly (e.g. `^master~10`), or implicitly (e.g. `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. +OBJECT PREREQUISITES +-------------------- + +When creating bundles it is possible to create a fully self-contained +bundle with all the prerequisite objects, as well as providing +negative revisions to exclude prerequisite objects. + +A revision such as `new` will produce a tip with all the prerequisite +objects needed for the `new` reference. + +A revision range such as `old..new` will produce a bundle tip that'll +require any objects existing before `new` to already be present in the +repository performing the 'git bundle unbundle' operation. + +A self-contained bundle without any prerequisites can be extracted +into anywhere, even into an empty repository, or be cloned from +(i.e., `new`, but not `old..new`). + It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. -`git clone` can use any bundle created without negative refspecs -(e.g., `new`, but not `old..new`). If you want to match `git clone --mirror`, which would include your refs such as `refs/remotes/*`, use `--all`. If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. +The 'git bundle verify' command can be used to check whether your +recipient repository has the required prerequisite commits for a +bundle. + EXAMPLES -------- -- 2.32.0.632.g49a94b9226d
A v5 of improvements to the "git bundle" documentation. See http://lore.kernel.org/git/cover-0.3-00000000000-20210630T091548Z-avarab@gmail.com for v4. This hopefully addresses Junio's concern in https://lore.kernel.org/git/xmqqk0mbt5rj.fsf@gitster.g/ I didn't remove the discussion of "thin packs" entirely, but now the whole section about "open" v.s. "closed" doesn't use that wording at all, we now talk only about whether a bundle includes prerequisite commits, and use the same language as git-rev-list does when referring to "exclusions'. The mention of "think pack" is left in the "BUNDLE FORMAT" section. It's made clear that it doesn't matter to the end result, but that it's noted as a reference to other docs. We then go on to link to the bundle & pack technical format docs for the overly curious. Ævar Arnfjörð Bjarmason (3): bundle doc: rewrite the "DESCRIPTION" section bundle doc: elaborate on object prerequisites bundle doc: elaborate on rev<->ref restriction Documentation/git-bundle.txt | 130 ++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 26 deletions(-) Range-diff against v4: 1: d10060a237e ! 1: 3b447500da9 bundle doc: rewrite the "DESCRIPTION" section @@ Commit message technical/bundle-format.txt documentation. The "the user must specify a basis" part of this is discussed below in - "SPECIFYING REFERENCES", so I'm removing that part and letting the - brief mention of "thin" suffice. + "SPECIFYING REFERENCES", and will be further elaborated on in a + subsequent commit. So I'm removing that part and letting the mention + of "revision exclusions" suffice. - To the extent that we should say more on the topic that documentation - will be improved by subsequent commits. + There was a discussion about whether to say anything at all about + "thin packs" here[1]. I think it's good to mention it for the curious + reader willing to read the technical docs, but let's explicitly say + that there's no "thick pack", and that the difference shouldn't + matter. + + 1. http://lore.kernel.org/git/xmqqk0mbt5rj.fsf@gitster.g Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> @@ Documentation/git-bundle.txt: SYNOPSIS +header is (mostly) in the format emitted by linkgit:git-show-ref[1]. + +Like the the packed archive format itself bundles can either be -+self-contained or thin (see "--thin" in linkgit:git-pack-objects[1]). ++self-contained, or be created using exclusions. ++ ++Bundles created using revision exclusions are "thin packs" created ++using the `--thin` option to linkgit:git-pack-objects[1], and ++unbundled using the `--fix-thin` option to linkgit:git-index-pack[1]. ++ ++There is no option to create a "thick pack" when using revision ++exclusions, users should not be concerned about the difference. By ++using "thin packs" bundles created using exclusions are smaller in ++size. That they're "thin" under the hood is merely noted here as a ++curiosity, and as a reference to other documentation + +See link:technical/bundle-format.html[the `bundle-format` -+documentation] for more details. ++documentation] for more details and the discussion of "thin pack" in ++link:technical/pack-format.html[the pack format documentation] for ++further details. OPTIONS ------- 2: 6a312fbdb01 ! 2: 444b06740bc bundle doc: split out open v.s. closed discussion from <rev-arg> @@ Metadata Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com> ## Commit message ## - bundle doc: split out open v.s. closed discussion from <rev-arg> + bundle doc: elaborate on object prerequisites - Split out the discussion of why you should or should not create "open - bundles" into a new section, away from the discussion of our handling - of the rev-args syntax. + Split out the discussion bout "object prerequisites" into its own + section, and add some more examples of the common cases. See 2e0afafebd (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being @@ Commit message Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> ## Documentation/git-bundle.txt ## -@@ Documentation/git-bundle.txt: header indicating what references are contained within the bundle. The - header is (mostly) in the format emitted by linkgit:git-show-ref[1]. +@@ Documentation/git-bundle.txt: header is (mostly) in the format emitted by linkgit:git-show-ref[1]. Like the the packed archive format itself bundles can either be --self-contained or thin (see "--thin" in linkgit:git-pack-objects[1]). -+self-contained or thin, see the "OPEN (THIN) AND CLOSED BUNDLES" -+section below. + self-contained, or be created using exclusions. ++See the "OBJECT PREREQUISITES" section below. - See link:technical/bundle-format.html[the `bundle-format` - documentation] for more details. + Bundles created using revision exclusions are "thin packs" created + using the `--thin` option to linkgit:git-pack-objects[1], and @@ Documentation/git-bundle.txt: contained in the union of the given bases. Each basis can be specified explicitly (e.g. `^master~10`), or implicitly (e.g. `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. --It is okay to err on the side of caution, causing the bundle file --to contain objects already in the destination, as these are ignored --when unpacking at the destination. -+OPEN AND CLOSED BUNDLES -+----------------------- ++OBJECT PREREQUISITES ++-------------------- + -+When creating bundles it is possible to create bundle tips that are -+either closed or open under reachability, i.e. those that contain all -+the history needed to get to a given point (closed), and those that do -+not (open). A revision such as "master" will produce a closed tip, a -+range such as "master~2..master" will not (unless the full history is -+contained within that range). ++When creating bundles it is possible to create a fully self-contained ++bundle with all the prerequisite objects, as well as providing ++negative revisions to exclude prerequisite objects. + -+When creating "open" bundles it is very important that the basis used -+be held by the destination. It is okay to err on the side of caution, -+causing the bundle file to contain objects already in the destination, -+as these are ignored when unpacking at the destination. ++A revision such as `new` will produce a tip with all the prerequisite ++objects needed for the `new` reference. ++ ++A revision range such as `old..new` will produce a bundle tip that'll ++require any objects existing before `new` to already be present in the ++repository performing the 'git bundle unbundle' operation. ++ ++A self-contained bundle without any prerequisites can be extracted ++into anywhere, even into an empty repository, or be cloned from ++(i.e., `new`, but not `old..new`). ++ + It is okay to err on the side of caution, causing the bundle file + to contain objects already in the destination, as these are ignored + when unpacking at the destination. - `git clone` can use any bundle created without negative refspecs - (e.g., `new`, but not `old..new`). -@@ Documentation/git-bundle.txt: If you want to provide the same set of refs that a clone directly +-`git clone` can use any bundle created without negative refspecs +-(e.g., `new`, but not `old..new`). + If you want to match `git clone --mirror`, which would include your + refs such as `refs/remotes/*`, use `--all`. + If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. -+THIN BUNDLES -+------------ -+ -+Bundles that are "open" (see above) are created "thin" by using the -+`--thin` option to linkgit:git-pack-objects[1]. Whether a bundle (or -+packfile) is "thin" is a subset of whether it's "open". What "thin" -+means is that such a packfile can store an object in a deltified form -+against a base object that is not in the same packfile. -+ -+To put it another way, when creating "open" bundles we assume that the -+objects leading up to the starting range(s) already exist in the -+recipient repository, which allows us to save space. When we run 'git -+bundle unbundle' we invoke linkgit:git-index-pack[1] with the -+`--fix-thin` option. -+ -+See the discussion of "thin pack" in -+link:technical/pack-format.html[the pack format documentation] for -+further details. ++The 'git bundle verify' command can be used to check whether your ++recipient repository has the required prerequisite commits for a ++bundle. + EXAMPLES -------- 3: 47b8dacb4aa ! 3: 6d8f2f27088 bundle doc: elaborate on rev<->ref restriction @@ Documentation/git-bundle.txt: unbundle <file>:: +fatal: Refusing to create empty bundle. +---------------- - OPEN AND CLOSED BUNDLES - ----------------------- + OBJECT PREREQUISITES + -------------------- -- 2.32.0.632.g49a94b9226d
Split out the discussion of why you should or should not create "open bundles" into a new section, away from the discussion of our handling of the rev-args syntax. See 2e0afafebd (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being changed here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/git-bundle.txt | 40 +++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index e19c2b83c91..3bb3b71526c 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -44,7 +44,8 @@ header indicating what references are contained within the bundle. The header is (mostly) in the format emitted by linkgit:git-show-ref[1]. Like the the packed archive format itself bundles can either be -self-contained or thin (see "--thin" in linkgit:git-pack-objects[1]). +self-contained or thin, see the "OPEN (THIN) AND CLOSED BUNDLES" +section below. See link:technical/bundle-format.html[the `bundle-format` documentation] for more details. @@ -141,10 +142,20 @@ contained in the union of the given bases. Each basis can be specified explicitly (e.g. `^master~10`), or implicitly (e.g. `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. -It is okay to err on the side of caution, causing the bundle file -to contain objects already in the destination, as these are ignored -when unpacking at the destination. +OPEN AND CLOSED BUNDLES +----------------------- + +When creating bundles it is possible to create bundle tips that are +either closed or open under reachability, i.e. those that contain all +the history needed to get to a given point (closed), and those that do +not (open). A revision such as "master" will produce a closed tip, a +range such as "master~2..master" will not (unless the full history is +contained within that range). + +When creating "open" bundles it is very important that the basis used +be held by the destination. It is okay to err on the side of caution, +causing the bundle file to contain objects already in the destination, +as these are ignored when unpacking at the destination. `git clone` can use any bundle created without negative refspecs (e.g., `new`, but not `old..new`). @@ -154,6 +165,25 @@ If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. +THIN BUNDLES +------------ + +Bundles that are "open" (see above) are created "thin" by using the +`--thin` option to linkgit:git-pack-objects[1]. Whether a bundle (or +packfile) is "thin" is a subset of whether it's "open". What "thin" +means is that such a packfile can store an object in a deltified form +against a base object that is not in the same packfile. + +To put it another way, when creating "open" bundles we assume that the +objects leading up to the starting range(s) already exist in the +recipient repository, which allows us to save space. When we run 'git +bundle unbundle' we invoke linkgit:git-index-pack[1] with the +`--fix-thin` option. + +See the discussion of "thin pack" in +link:technical/pack-format.html[the pack format documentation] for +further details. + EXAMPLES -------- -- 2.32.0.613.g8e17abc2eb
A re-roll of v3: http://lore.kernel.org/git/cover-0.3-00000000000-20210624T193730Z-avarab@gmail.com Junio had comments to the effect that we should mention that we can't push into bundles, and that I was confusing "thin" v.s. "open" packs. Both ahve been cleared up in this version. I added a new "THIN BUNDLES" section after the "OPEN AND CLOSED BUNDLES" section. Ævar Arnfjörð Bjarmason (3): bundle doc: rewrite the "DESCRIPTION" section bundle doc: split out open v.s. closed discussion from <rev-arg> bundle doc: elaborate on rev<->ref restriction Documentation/git-bundle.txt | 130 +++++++++++++++++++++++++++-------- 1 file changed, 103 insertions(+), 27 deletions(-) Range-diff against v3: 1: 2824133f423 ! 1: e32e7b3322d bundle doc: rewrite the "DESCRIPTION" section @@ Documentation/git-bundle.txt: SYNOPSIS +repository, and to relay the state of the references in one repository +to another. + -+Other git commands that understand protocols such as `ssh://` and -+`https://` can also operate on bundle files. It is possible -+linkgit:git-clone[1] a new repository from a bundle, to use ++Git commands that fetch or otherwise "read" via protocols such as ++`ssh://` and `https://` can also operate on bundle files. It is ++possible linkgit:git-clone[1] a new repository from a bundle, to use +linkgit:git-fetch[1] to fetch from one, and to list the references -+contained within it with linkgit:git-ls-remote[1]. ++contained within it with linkgit:git-ls-remote[1]. There's no ++corresponding "write" support, i.e.a 'git push' into a bundle is not ++supported. + +See the "EXAMPLES" section below for examples of how to use bundles. + 2: 63f871a0c72 ! 2: fe61f20f19f bundle doc: split out thin v.s. not discussion from <rev-arg> @@ Metadata Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com> ## Commit message ## - bundle doc: split out thin v.s. not discussion from <rev-arg> + bundle doc: split out open v.s. closed discussion from <rev-arg> - Split out the discussion of why you should or should not create "thin + Split out the discussion of why you should or should not create "open bundles" into a new section, away from the discussion of our handling of the rev-args syntax. @@ Documentation/git-bundle.txt: contained in the union of the given bases. Each b `master~10..master`, `--since=10.days.ago master`). -It is very important that the basis used be held by the destination. -+OPEN (THIN) AND CLOSED BUNDLES -+------------------------------ +-It is okay to err on the side of caution, causing the bundle file +-to contain objects already in the destination, as these are ignored +-when unpacking at the destination. ++OPEN AND CLOSED BUNDLES ++----------------------- + +When creating bundles it is possible to create bundle tips that are +either closed or open under reachability, i.e. those that contain all @@ Documentation/git-bundle.txt: contained in the union of the given bases. Each b +range such as "master~2..master" will not (unless the full history is +contained within that range). + -+Another name for "open" bundles might be "thin bundles", as in the -+`--thin` option to linkgit:git-pack-objects[1]. Under the hood that's -+what `git bundle create` uses to write bundles. When thin bundles -+it is very important that the basis used be held by the destination. - It is okay to err on the side of caution, causing the bundle file - to contain objects already in the destination, as these are ignored - when unpacking at the destination. ++When creating "open" bundles it is very important that the basis used ++be held by the destination. It is okay to err on the side of caution, ++causing the bundle file to contain objects already in the destination, ++as these are ignored when unpacking at the destination. + + `git clone` can use any bundle created without negative refspecs + (e.g., `new`, but not `old..new`). @@ Documentation/git-bundle.txt: If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags` for the `<git-rev-list-args>`. -+See the the `--thin` option to linkgit:git-pack-objects[1] noted -+above, and the discussion of "thin pack" in ++THIN BUNDLES ++------------ ++ ++Bundles that are "open" (see above) are created "thin" by using the ++`--thin` option to linkgit:git-pack-objects[1]. Whether a bundle (or ++packfile) is "thin" is a subset of whether it's "open". What "thin" ++means is that such a packfile can store an object in a deltified form ++against a base object that is not in the same packfile. ++ ++To put it another way, when creating "open" bundles we assume that the ++objects leading up to the starting range(s) already exist in the ++recipient repository, which allows us to save space. When we run 'git ++bundle unbundle' we invoke linkgit:git-index-pack[1] with the ++`--fix-thin` option. ++ ++See the discussion of "thin pack" in +link:technical/pack-format.html[the pack format documentation] for +further details. + 3: 14e4a724fb2 ! 3: 9a1c33cb853 bundle doc: elaborate on rev<->ref restriction @@ Documentation/git-bundle.txt: unbundle <file>:: +fatal: Refusing to create empty bundle. +---------------- - OPEN (THIN) AND CLOSED BUNDLES - ------------------------------ + OPEN AND CLOSED BUNDLES + ----------------------- -- 2.32.0.613.g8e17abc2eb
On Fri, Apr 16, 2021 at 12:52:21PM -0500, Tom Saeger wrote: > On Fri, Apr 16, 2021 at 12:49:57PM +0000, Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee <dstolee@microsoft.com> > > > > The --prefetch option will be used by the 'prefetch' maintenance task > > instead of sending refspecs explicitly across the command-line. The > > intention is to modify the refspec to place all results in > > refs/prefetch/ instead of anywhere else. > > > > Create helper method filter_prefetch_refspec() to modify a given refspec > > to fit the rules expected of the prefetch task: > > > > * Negative refspecs are preserved. > > * Refspecs without a destination are removed. > > * Refspecs whose source starts with "refs/tags/" are removed. > > * Other refspecs are placed within "refs/prefetch/". > > > > Finally, we add the 'force' option to ensure that prefetch refs are > > replaced as necessary. > > > > There are some interesting cases that are worth testing. > > > > An earlier version of this change dropped the "i--" from the loop that > > deletes a refspec item and shifts the remaining entries down. This > > allowed some refspecs to not be modified. The subtle part about the > > first --prefetch test is that the "refs/tags/*" refspec appears directly > > before the "refs/heads/bogus/*" refspec. Without that "i--", this > > ordering would remove the "refs/tags/*" refspec and leave the last one > > unmodified, placing the result in "refs/heads/*". > > > > It is possible to have an empty refspec. This is typically the case for > > remotes other than the origin, where users want to fetch a specific tag > > or branch. To correctly test this case, we need to further remove the > > upstream remote for the local branch. Thus, we are testing a refspec > > that will be deleted, leaving nothing to fetch. > > > > Helped-by: Tom Saeger <tom.saeger@oracle.com> > > Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> > > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > > --- > > Documentation/fetch-options.txt | 5 +++ > > builtin/fetch.c | 59 ++++++++++++++++++++++++++++++- > > t/t5582-fetch-negative-refspec.sh | 43 ++++++++++++++++++++++ > > 3 files changed, 106 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt > > index 07783deee309..9e7b4e189ce0 100644 > > --- a/Documentation/fetch-options.txt > > +++ b/Documentation/fetch-options.txt > > @@ -110,6 +110,11 @@ ifndef::git-pull[] > > setting `fetch.writeCommitGraph`. > > endif::git-pull[] > > > > +--prefetch:: > > + Modify the configured refspec to place all refs into the > > + `refs/prefetch/` namespace. See the `prefetch` task in > > + linkgit:git-maintenance[1]. > > + > > -p:: > > --prune:: > > Before fetching, remove any remote-tracking references that no > > diff --git a/builtin/fetch.c b/builtin/fetch.c > > index 0b90de87c7a2..97c4fe6e6d66 100644 > > --- a/builtin/fetch.c > > +++ b/builtin/fetch.c > > @@ -48,6 +48,7 @@ enum { > > static int fetch_prune_config = -1; /* unspecified */ > > static int fetch_show_forced_updates = 1; > > static uint64_t forced_updates_ms = 0; > > +static int prefetch = 0; > > static int prune = -1; /* unspecified */ > > #define PRUNE_BY_DEFAULT 0 /* do we prune by default? */ > > > > @@ -158,6 +159,8 @@ static struct option builtin_fetch_options[] = { > > N_("do not fetch all tags (--no-tags)"), TAGS_UNSET), > > OPT_INTEGER('j', "jobs", &max_jobs, > > N_("number of submodules fetched in parallel")), > > + OPT_BOOL(0, "prefetch", &prefetch, > > + N_("modify the refspec to place all refs within refs/prefetch/")), > > OPT_BOOL('p', "prune", &prune, > > N_("prune remote-tracking branches no longer on remote")), > > OPT_BOOL('P', "prune-tags", &prune_tags, > > @@ -436,6 +439,56 @@ static void find_non_local_tags(const struct ref *refs, > > oidset_clear(&fetch_oids); > > } > > > > +static void filter_prefetch_refspec(struct refspec *rs) > > +{ > > + int i; > > + > > + if (!prefetch) > > + return; > > + > > + for (i = 0; i < rs->nr; i++) { > > + struct strbuf new_dst = STRBUF_INIT; > > + char *old_dst; > > + const char *sub = NULL; > > + > > + if (rs->items[i].negative) > > + continue; > > + if (!rs->items[i].dst || > > + (rs->items[i].src && > > + !strncmp(rs->items[i].src, "refs/tags/", 10))) { > > + int j; > > + > > + free(rs->items[i].src); > > + free(rs->items[i].dst); > > + > > + for (j = i + 1; j < rs->nr; j++) { > > + rs->items[j - 1] = rs->items[j]; > > + rs->raw[j - 1] = rs->raw[j]; > > + } > > + rs->nr--; > > + i--; > > + continue; > > + } > > + > > + old_dst = rs->items[i].dst; > > + strbuf_addstr(&new_dst, "refs/prefetch/"); > > + > > + /* > > + * If old_dst starts with "refs/", then place > > + * sub after that prefix. Otherwise, start at > > + * the beginning of the string. > > + */ > > + if (!skip_prefix(old_dst, "refs/", &sub)) > > + sub = old_dst; > > + strbuf_addstr(&new_dst, sub); > > + > > + rs->items[i].dst = strbuf_detach(&new_dst, NULL); > > + rs->items[i].force = 1; > > + > > + free(old_dst); > > + } > > +} > > + > > static struct ref *get_ref_map(struct remote *remote, > > const struct ref *remote_refs, > > struct refspec *rs, > > @@ -452,6 +505,10 @@ static struct ref *get_ref_map(struct remote *remote, > > struct hashmap existing_refs; > > int existing_refs_populated = 0; > > > > + filter_prefetch_refspec(rs); > > + if (remote) > > + filter_prefetch_refspec(&remote->fetch); > > + > > if (rs->nr) { > > struct refspec *fetch_refspec; > > > > @@ -520,7 +577,7 @@ static struct ref *get_ref_map(struct remote *remote, > > if (has_merge && > > !strcmp(branch->remote_name, remote->name)) > > add_merge_config(&ref_map, remote_refs, branch, &tail); > > - } else { > > + } else if (!prefetch) { > > That works for me. > > > ref_map = get_remote_ref(remote_refs, "HEAD"); > > if (!ref_map) > > die(_("Couldn't find remote ref HEAD")); > > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > > index f34509727702..e5d2e79ad382 100755 > > --- a/t/t5582-fetch-negative-refspec.sh > > +++ b/t/t5582-fetch-negative-refspec.sh > > @@ -240,4 +240,47 @@ test_expect_success "push with matching +: and negative refspec" ' > > git -C two push -v one > > ' > > > > +test_expect_success '--prefetch correctly modifies refspecs' ' > > + git -C one config --unset-all remote.origin.fetch && > > + git -C one config --add remote.origin.fetch ^refs/heads/bogus/ignore && > > + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && > > + git -C one config --add remote.origin.fetch "refs/heads/bogus/*:bogus/*" && > > + > > + git tag -a -m never never-fetch-tag HEAD && > > + > > + git branch bogus/fetched HEAD~1 && > > + git branch bogus/ignore HEAD && > > + > > + git -C one fetch --prefetch --no-tags && > > + test_must_fail git -C one rev-parse never-fetch-tag && > > + git -C one rev-parse refs/prefetch/bogus/fetched && > > + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore && > > + > > + # correctly handle when refspec set becomes empty > > + # after removing the refs/tags/* refspec. > > + git -C one config --unset-all remote.origin.fetch && > > + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && > > + > > + git -C one fetch --prefetch --no-tags && > > + test_must_fail git -C one rev-parse never-fetch-tag && > > + > > + # The refspec for refs that are not fully qualified > > + # are filtered multiple times. > > + git -C one rev-parse refs/prefetch/bogus/fetched && > > + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore > > +' > > + > > +test_expect_success '--prefetch succeeds when refspec becomes empty' ' > > technically this will get skipped based only on "skipfetchall" right? > > The remote could have an empty-set of refspecs or multiple > valid refspecs post filter_prefetch_refspec, but the remote gets skipped altogether. > > perhaps '--prefetch succeeds when remote.skipfetchall is true' ' Forget what I said here. Now seeing this is using 'git fetch --prefetch' directly and not using `mainenance --task=prefetch` > > anyway this is looking pretty solid > > Reviewed-by: Tom Saeger <tom.saeger@oracle.com> > > > + git checkout bogus/fetched && > > + test_commit extra && > > + > > + git -C one config --unset-all remote.origin.fetch && > > + git -C one config --unset branch.main.remote && > > + git -C one config remote.origin.fetch "+refs/tags/extra" && > > + git -C one config remote.origin.skipfetchall true && > > + git -C one config remote.origin.tagopt "--no-tags" && > > + > > + git -C one fetch --prefetch > > +' > > + > > test_done > > -- > > gitgitgadget > >
On Fri, Apr 16, 2021 at 12:49:57PM +0000, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee <dstolee@microsoft.com> > > The --prefetch option will be used by the 'prefetch' maintenance task > instead of sending refspecs explicitly across the command-line. The > intention is to modify the refspec to place all results in > refs/prefetch/ instead of anywhere else. > > Create helper method filter_prefetch_refspec() to modify a given refspec > to fit the rules expected of the prefetch task: > > * Negative refspecs are preserved. > * Refspecs without a destination are removed. > * Refspecs whose source starts with "refs/tags/" are removed. > * Other refspecs are placed within "refs/prefetch/". > > Finally, we add the 'force' option to ensure that prefetch refs are > replaced as necessary. > > There are some interesting cases that are worth testing. > > An earlier version of this change dropped the "i--" from the loop that > deletes a refspec item and shifts the remaining entries down. This > allowed some refspecs to not be modified. The subtle part about the > first --prefetch test is that the "refs/tags/*" refspec appears directly > before the "refs/heads/bogus/*" refspec. Without that "i--", this > ordering would remove the "refs/tags/*" refspec and leave the last one > unmodified, placing the result in "refs/heads/*". > > It is possible to have an empty refspec. This is typically the case for > remotes other than the origin, where users want to fetch a specific tag > or branch. To correctly test this case, we need to further remove the > upstream remote for the local branch. Thus, we are testing a refspec > that will be deleted, leaving nothing to fetch. > > Helped-by: Tom Saeger <tom.saeger@oracle.com> > Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > Documentation/fetch-options.txt | 5 +++ > builtin/fetch.c | 59 ++++++++++++++++++++++++++++++- > t/t5582-fetch-negative-refspec.sh | 43 ++++++++++++++++++++++ > 3 files changed, 106 insertions(+), 1 deletion(-) > > diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt > index 07783deee309..9e7b4e189ce0 100644 > --- a/Documentation/fetch-options.txt > +++ b/Documentation/fetch-options.txt > @@ -110,6 +110,11 @@ ifndef::git-pull[] > setting `fetch.writeCommitGraph`. > endif::git-pull[] > > +--prefetch:: > + Modify the configured refspec to place all refs into the > + `refs/prefetch/` namespace. See the `prefetch` task in > + linkgit:git-maintenance[1]. > + > -p:: > --prune:: > Before fetching, remove any remote-tracking references that no > diff --git a/builtin/fetch.c b/builtin/fetch.c > index 0b90de87c7a2..97c4fe6e6d66 100644 > --- a/builtin/fetch.c > +++ b/builtin/fetch.c > @@ -48,6 +48,7 @@ enum { > static int fetch_prune_config = -1; /* unspecified */ > static int fetch_show_forced_updates = 1; > static uint64_t forced_updates_ms = 0; > +static int prefetch = 0; > static int prune = -1; /* unspecified */ > #define PRUNE_BY_DEFAULT 0 /* do we prune by default? */ > > @@ -158,6 +159,8 @@ static struct option builtin_fetch_options[] = { > N_("do not fetch all tags (--no-tags)"), TAGS_UNSET), > OPT_INTEGER('j', "jobs", &max_jobs, > N_("number of submodules fetched in parallel")), > + OPT_BOOL(0, "prefetch", &prefetch, > + N_("modify the refspec to place all refs within refs/prefetch/")), > OPT_BOOL('p', "prune", &prune, > N_("prune remote-tracking branches no longer on remote")), > OPT_BOOL('P', "prune-tags", &prune_tags, > @@ -436,6 +439,56 @@ static void find_non_local_tags(const struct ref *refs, > oidset_clear(&fetch_oids); > } > > +static void filter_prefetch_refspec(struct refspec *rs) > +{ > + int i; > + > + if (!prefetch) > + return; > + > + for (i = 0; i < rs->nr; i++) { > + struct strbuf new_dst = STRBUF_INIT; > + char *old_dst; > + const char *sub = NULL; > + > + if (rs->items[i].negative) > + continue; > + if (!rs->items[i].dst || > + (rs->items[i].src && > + !strncmp(rs->items[i].src, "refs/tags/", 10))) { > + int j; > + > + free(rs->items[i].src); > + free(rs->items[i].dst); > + > + for (j = i + 1; j < rs->nr; j++) { > + rs->items[j - 1] = rs->items[j]; > + rs->raw[j - 1] = rs->raw[j]; > + } > + rs->nr--; > + i--; > + continue; > + } > + > + old_dst = rs->items[i].dst; > + strbuf_addstr(&new_dst, "refs/prefetch/"); > + > + /* > + * If old_dst starts with "refs/", then place > + * sub after that prefix. Otherwise, start at > + * the beginning of the string. > + */ > + if (!skip_prefix(old_dst, "refs/", &sub)) > + sub = old_dst; > + strbuf_addstr(&new_dst, sub); > + > + rs->items[i].dst = strbuf_detach(&new_dst, NULL); > + rs->items[i].force = 1; > + > + free(old_dst); > + } > +} > + > static struct ref *get_ref_map(struct remote *remote, > const struct ref *remote_refs, > struct refspec *rs, > @@ -452,6 +505,10 @@ static struct ref *get_ref_map(struct remote *remote, > struct hashmap existing_refs; > int existing_refs_populated = 0; > > + filter_prefetch_refspec(rs); > + if (remote) > + filter_prefetch_refspec(&remote->fetch); > + > if (rs->nr) { > struct refspec *fetch_refspec; > > @@ -520,7 +577,7 @@ static struct ref *get_ref_map(struct remote *remote, > if (has_merge && > !strcmp(branch->remote_name, remote->name)) > add_merge_config(&ref_map, remote_refs, branch, &tail); > - } else { > + } else if (!prefetch) { That works for me. > ref_map = get_remote_ref(remote_refs, "HEAD"); > if (!ref_map) > die(_("Couldn't find remote ref HEAD")); > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > index f34509727702..e5d2e79ad382 100755 > --- a/t/t5582-fetch-negative-refspec.sh > +++ b/t/t5582-fetch-negative-refspec.sh > @@ -240,4 +240,47 @@ test_expect_success "push with matching +: and negative refspec" ' > git -C two push -v one > ' > > +test_expect_success '--prefetch correctly modifies refspecs' ' > + git -C one config --unset-all remote.origin.fetch && > + git -C one config --add remote.origin.fetch ^refs/heads/bogus/ignore && > + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && > + git -C one config --add remote.origin.fetch "refs/heads/bogus/*:bogus/*" && > + > + git tag -a -m never never-fetch-tag HEAD && > + > + git branch bogus/fetched HEAD~1 && > + git branch bogus/ignore HEAD && > + > + git -C one fetch --prefetch --no-tags && > + test_must_fail git -C one rev-parse never-fetch-tag && > + git -C one rev-parse refs/prefetch/bogus/fetched && > + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore && > + > + # correctly handle when refspec set becomes empty > + # after removing the refs/tags/* refspec. > + git -C one config --unset-all remote.origin.fetch && > + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && > + > + git -C one fetch --prefetch --no-tags && > + test_must_fail git -C one rev-parse never-fetch-tag && > + > + # The refspec for refs that are not fully qualified > + # are filtered multiple times. > + git -C one rev-parse refs/prefetch/bogus/fetched && > + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore > +' > + > +test_expect_success '--prefetch succeeds when refspec becomes empty' ' technically this will get skipped based only on "skipfetchall" right? The remote could have an empty-set of refspecs or multiple valid refspecs post filter_prefetch_refspec, but the remote gets skipped altogether. perhaps '--prefetch succeeds when remote.skipfetchall is true' ' anyway this is looking pretty solid Reviewed-by: Tom Saeger <tom.saeger@oracle.com> > + git checkout bogus/fetched && > + test_commit extra && > + > + git -C one config --unset-all remote.origin.fetch && > + git -C one config --unset branch.main.remote && > + git -C one config remote.origin.fetch "+refs/tags/extra" && > + git -C one config remote.origin.skipfetchall true && > + git -C one config remote.origin.tagopt "--no-tags" && > + > + git -C one fetch --prefetch > +' > + > test_done > -- > gitgitgadget >
From: Derrick Stolee <dstolee@microsoft.com> The --prefetch option will be used by the 'prefetch' maintenance task instead of sending refspecs explicitly across the command-line. The intention is to modify the refspec to place all results in refs/prefetch/ instead of anywhere else. Create helper method filter_prefetch_refspec() to modify a given refspec to fit the rules expected of the prefetch task: * Negative refspecs are preserved. * Refspecs without a destination are removed. * Refspecs whose source starts with "refs/tags/" are removed. * Other refspecs are placed within "refs/prefetch/". Finally, we add the 'force' option to ensure that prefetch refs are replaced as necessary. There are some interesting cases that are worth testing. An earlier version of this change dropped the "i--" from the loop that deletes a refspec item and shifts the remaining entries down. This allowed some refspecs to not be modified. The subtle part about the first --prefetch test is that the "refs/tags/*" refspec appears directly before the "refs/heads/bogus/*" refspec. Without that "i--", this ordering would remove the "refs/tags/*" refspec and leave the last one unmodified, placing the result in "refs/heads/*". It is possible to have an empty refspec. This is typically the case for remotes other than the origin, where users want to fetch a specific tag or branch. To correctly test this case, we need to further remove the upstream remote for the local branch. Thus, we are testing a refspec that will be deleted, leaving nothing to fetch. Helped-by: Tom Saeger <tom.saeger@oracle.com> Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- Documentation/fetch-options.txt | 5 +++ builtin/fetch.c | 59 ++++++++++++++++++++++++++++++- t/t5582-fetch-negative-refspec.sh | 43 ++++++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 07783deee309..9e7b4e189ce0 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -110,6 +110,11 @@ ifndef::git-pull[] setting `fetch.writeCommitGraph`. endif::git-pull[] +--prefetch:: + Modify the configured refspec to place all refs into the + `refs/prefetch/` namespace. See the `prefetch` task in + linkgit:git-maintenance[1]. + -p:: --prune:: Before fetching, remove any remote-tracking references that no diff --git a/builtin/fetch.c b/builtin/fetch.c index 0b90de87c7a2..97c4fe6e6d66 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -48,6 +48,7 @@ enum { static int fetch_prune_config = -1; /* unspecified */ static int fetch_show_forced_updates = 1; static uint64_t forced_updates_ms = 0; +static int prefetch = 0; static int prune = -1; /* unspecified */ #define PRUNE_BY_DEFAULT 0 /* do we prune by default? */ @@ -158,6 +159,8 @@ static struct option builtin_fetch_options[] = { N_("do not fetch all tags (--no-tags)"), TAGS_UNSET), OPT_INTEGER('j', "jobs", &max_jobs, N_("number of submodules fetched in parallel")), + OPT_BOOL(0, "prefetch", &prefetch, + N_("modify the refspec to place all refs within refs/prefetch/")), OPT_BOOL('p', "prune", &prune, N_("prune remote-tracking branches no longer on remote")), OPT_BOOL('P', "prune-tags", &prune_tags, @@ -436,6 +439,56 @@ static void find_non_local_tags(const struct ref *refs, oidset_clear(&fetch_oids); } +static void filter_prefetch_refspec(struct refspec *rs) +{ + int i; + + if (!prefetch) + return; + + for (i = 0; i < rs->nr; i++) { + struct strbuf new_dst = STRBUF_INIT; + char *old_dst; + const char *sub = NULL; + + if (rs->items[i].negative) + continue; + if (!rs->items[i].dst || + (rs->items[i].src && + !strncmp(rs->items[i].src, "refs/tags/", 10))) { + int j; + + free(rs->items[i].src); + free(rs->items[i].dst); + + for (j = i + 1; j < rs->nr; j++) { + rs->items[j - 1] = rs->items[j]; + rs->raw[j - 1] = rs->raw[j]; + } + rs->nr--; + i--; + continue; + } + + old_dst = rs->items[i].dst; + strbuf_addstr(&new_dst, "refs/prefetch/"); + + /* + * If old_dst starts with "refs/", then place + * sub after that prefix. Otherwise, start at + * the beginning of the string. + */ + if (!skip_prefix(old_dst, "refs/", &sub)) + sub = old_dst; + strbuf_addstr(&new_dst, sub); + + rs->items[i].dst = strbuf_detach(&new_dst, NULL); + rs->items[i].force = 1; + + free(old_dst); + } +} + static struct ref *get_ref_map(struct remote *remote, const struct ref *remote_refs, struct refspec *rs, @@ -452,6 +505,10 @@ static struct ref *get_ref_map(struct remote *remote, struct hashmap existing_refs; int existing_refs_populated = 0; + filter_prefetch_refspec(rs); + if (remote) + filter_prefetch_refspec(&remote->fetch); + if (rs->nr) { struct refspec *fetch_refspec; @@ -520,7 +577,7 @@ static struct ref *get_ref_map(struct remote *remote, if (has_merge && !strcmp(branch->remote_name, remote->name)) add_merge_config(&ref_map, remote_refs, branch, &tail); - } else { + } else if (!prefetch) { ref_map = get_remote_ref(remote_refs, "HEAD"); if (!ref_map) die(_("Couldn't find remote ref HEAD")); diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index f34509727702..e5d2e79ad382 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -240,4 +240,47 @@ test_expect_success "push with matching +: and negative refspec" ' git -C two push -v one ' +test_expect_success '--prefetch correctly modifies refspecs' ' + git -C one config --unset-all remote.origin.fetch && + git -C one config --add remote.origin.fetch ^refs/heads/bogus/ignore && + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && + git -C one config --add remote.origin.fetch "refs/heads/bogus/*:bogus/*" && + + git tag -a -m never never-fetch-tag HEAD && + + git branch bogus/fetched HEAD~1 && + git branch bogus/ignore HEAD && + + git -C one fetch --prefetch --no-tags && + test_must_fail git -C one rev-parse never-fetch-tag && + git -C one rev-parse refs/prefetch/bogus/fetched && + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore && + + # correctly handle when refspec set becomes empty + # after removing the refs/tags/* refspec. + git -C one config --unset-all remote.origin.fetch && + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && + + git -C one fetch --prefetch --no-tags && + test_must_fail git -C one rev-parse never-fetch-tag && + + # The refspec for refs that are not fully qualified + # are filtered multiple times. + git -C one rev-parse refs/prefetch/bogus/fetched && + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore +' + +test_expect_success '--prefetch succeeds when refspec becomes empty' ' + git checkout bogus/fetched && + test_commit extra && + + git -C one config --unset-all remote.origin.fetch && + git -C one config --unset branch.main.remote && + git -C one config remote.origin.fetch "+refs/tags/extra" && + git -C one config remote.origin.skipfetchall true && + git -C one config remote.origin.tagopt "--no-tags" && + + git -C one fetch --prefetch +' + test_done -- gitgitgadget
On 10/04/2021 03:03, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee <dstolee@microsoft.com> > > The --prefetch option will be used by the 'prefetch' maintenance task > instead of sending refspecs explicitly across the command-line. The > intention is to modify the refspec to place all results in > refs/prefetch/ instead of anywhere else. > > Create helper method filter_prefetch_refspec() to modify a given refspec > to fit the rules expected of the prefetch task: > > * Negative refspecs are preserved. > * Refspecs without a destination are removed. > * Refspecs whose source starts with "refs/tags/" are removed. > * Other refspecs are placed within "refs/prefetch/". > > Finally, we add the 'force' option to ensure that prefetch refs are > replaced as necessary. > > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > Documentation/fetch-options.txt | 5 +++ > builtin/fetch.c | 56 +++++++++++++++++++++++++++++++ > t/t5582-fetch-negative-refspec.sh | 30 +++++++++++++++++ > 3 files changed, 91 insertions(+) > > diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt > index 07783deee309..9e7b4e189ce0 100644 > --- a/Documentation/fetch-options.txt > +++ b/Documentation/fetch-options.txt > @@ -110,6 +110,11 @@ ifndef::git-pull[] > setting `fetch.writeCommitGraph`. > endif::git-pull[] > > +--prefetch:: > + Modify the configured refspec to place all refs into the > + `refs/prefetch/` namespace. See the `prefetch` task in > + linkgit:git-maintenance[1]. > + > -p:: > --prune:: > Before fetching, remove any remote-tracking references that no > diff --git a/builtin/fetch.c b/builtin/fetch.c > index 0b90de87c7a2..30856b442b79 100644 > --- a/builtin/fetch.c > +++ b/builtin/fetch.c > @@ -48,6 +48,7 @@ enum { > static int fetch_prune_config = -1; /* unspecified */ > static int fetch_show_forced_updates = 1; > static uint64_t forced_updates_ms = 0; > +static int prefetch = 0; > static int prune = -1; /* unspecified */ > #define PRUNE_BY_DEFAULT 0 /* do we prune by default? */ > > @@ -158,6 +159,8 @@ static struct option builtin_fetch_options[] = { > N_("do not fetch all tags (--no-tags)"), TAGS_UNSET), > OPT_INTEGER('j', "jobs", &max_jobs, > N_("number of submodules fetched in parallel")), > + OPT_BOOL(0, "prefetch", &prefetch, > + N_("modify the refspec to place all refs within refs/prefetch/")), > OPT_BOOL('p', "prune", &prune, > N_("prune remote-tracking branches no longer on remote")), > OPT_BOOL('P', "prune-tags", &prune_tags, > @@ -436,6 +439,55 @@ static void find_non_local_tags(const struct ref *refs, > oidset_clear(&fetch_oids); > } > > +static void filter_prefetch_refspec(struct refspec *rs) > +{ > + int i; > + > + if (!prefetch) > + return; > + > + for (i = 0; i < rs->nr; i++) { > + struct strbuf new_dst = STRBUF_INIT; > + char *old_dst; > + const char *sub = NULL; > + > + if (rs->items[i].negative) > + continue; > + if (!rs->items[i].dst || > + (rs->items[i].src && > + !strncmp(rs->items[i].src, "refs/tags/", 10))) { > + int j; > + > + free(rs->items[i].src); > + free(rs->items[i].dst); > + > + for (j = i + 1; j < rs->nr; j++) { > + rs->items[j - 1] = rs->items[j]; > + rs->raw[j - 1] = rs->raw[j]; > + } > + rs->nr--; Hmm, don't you need to do 'i--;' here? (Sorry in advance if this is nonsense, I am just skimming the patches without reading the whole series carefully). Maybe try a test which has an entry, which requires the 'prefetch' modification, that immediately follows a 'tag' or 'empty dst' entry. (I can't quite tell, just reading the email, whether that is covered by the tests below - so please just ignore me if it already works ;) ATB, Ramsay Jones > + continue; > + } > + > + old_dst = rs->items[i].dst; > + strbuf_addstr(&new_dst, "refs/prefetch/"); > + > + /* > + * If old_dst starts with "refs/", then place > + * sub after that prefix. Otherwise, start at > + * the beginning of the string. > + */ > + if (!skip_prefix(old_dst, "refs/", &sub)) > + sub = old_dst; > + strbuf_addstr(&new_dst, sub); > + > + rs->items[i].dst = strbuf_detach(&new_dst, NULL); > + rs->items[i].force = 1; > + > + free(old_dst); > + } > +} > + > static struct ref *get_ref_map(struct remote *remote, > const struct ref *remote_refs, > struct refspec *rs, > @@ -452,6 +504,10 @@ static struct ref *get_ref_map(struct remote *remote, > struct hashmap existing_refs; > int existing_refs_populated = 0; > > + filter_prefetch_refspec(rs); > + if (remote) > + filter_prefetch_refspec(&remote->fetch); > + > if (rs->nr) { > struct refspec *fetch_refspec; > > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > index f34509727702..030e6f978c4e 100755 > --- a/t/t5582-fetch-negative-refspec.sh > +++ b/t/t5582-fetch-negative-refspec.sh > @@ -240,4 +240,34 @@ test_expect_success "push with matching +: and negative refspec" ' > git -C two push -v one > ' > > +test_expect_success '--prefetch correctly modifies refspecs' ' > + git -C one config --unset-all remote.origin.fetch && > + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && > + git -C one config --add remote.origin.fetch ^refs/heads/bogus/ignore && > + git -C one config --add remote.origin.fetch "refs/heads/bogus/*:bogus/*" && > + > + git tag -a -m never never-fetch-tag HEAD && > + > + git branch bogus/fetched HEAD~1 && > + git branch bogus/ignore HEAD && > + > + git -C one fetch --prefetch --no-tags && > + test_must_fail git -C one rev-parse never-fetch-tag && > + git -C one rev-parse refs/prefetch/bogus/fetched && > + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore && > + > + # correctly handle when refspec set becomes empty > + # after removing the refs/tags/* refspec. > + git -C one config --unset-all remote.origin.fetch && > + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && > + > + git -C one fetch --prefetch --no-tags && > + test_must_fail git -C one rev-parse never-fetch-tag && > + > + # The refspec for refs that are not fully qualified > + # are filtered multiple times. > + git -C one rev-parse refs/prefetch/bogus/fetched && > + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore > +' > + > test_done >
From: Derrick Stolee <dstolee@microsoft.com> The --prefetch option will be used by the 'prefetch' maintenance task instead of sending refspecs explicitly across the command-line. The intention is to modify the refspec to place all results in refs/prefetch/ instead of anywhere else. Create helper method filter_prefetch_refspec() to modify a given refspec to fit the rules expected of the prefetch task: * Negative refspecs are preserved. * Refspecs without a destination are removed. * Refspecs whose source starts with "refs/tags/" are removed. * Other refspecs are placed within "refs/prefetch/". Finally, we add the 'force' option to ensure that prefetch refs are replaced as necessary. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- Documentation/fetch-options.txt | 5 +++ builtin/fetch.c | 56 +++++++++++++++++++++++++++++++ t/t5582-fetch-negative-refspec.sh | 30 +++++++++++++++++ 3 files changed, 91 insertions(+) diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 07783deee309..9e7b4e189ce0 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -110,6 +110,11 @@ ifndef::git-pull[] setting `fetch.writeCommitGraph`. endif::git-pull[] +--prefetch:: + Modify the configured refspec to place all refs into the + `refs/prefetch/` namespace. See the `prefetch` task in + linkgit:git-maintenance[1]. + -p:: --prune:: Before fetching, remove any remote-tracking references that no diff --git a/builtin/fetch.c b/builtin/fetch.c index 0b90de87c7a2..30856b442b79 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -48,6 +48,7 @@ enum { static int fetch_prune_config = -1; /* unspecified */ static int fetch_show_forced_updates = 1; static uint64_t forced_updates_ms = 0; +static int prefetch = 0; static int prune = -1; /* unspecified */ #define PRUNE_BY_DEFAULT 0 /* do we prune by default? */ @@ -158,6 +159,8 @@ static struct option builtin_fetch_options[] = { N_("do not fetch all tags (--no-tags)"), TAGS_UNSET), OPT_INTEGER('j', "jobs", &max_jobs, N_("number of submodules fetched in parallel")), + OPT_BOOL(0, "prefetch", &prefetch, + N_("modify the refspec to place all refs within refs/prefetch/")), OPT_BOOL('p', "prune", &prune, N_("prune remote-tracking branches no longer on remote")), OPT_BOOL('P', "prune-tags", &prune_tags, @@ -436,6 +439,55 @@ static void find_non_local_tags(const struct ref *refs, oidset_clear(&fetch_oids); } +static void filter_prefetch_refspec(struct refspec *rs) +{ + int i; + + if (!prefetch) + return; + + for (i = 0; i < rs->nr; i++) { + struct strbuf new_dst = STRBUF_INIT; + char *old_dst; + const char *sub = NULL; + + if (rs->items[i].negative) + continue; + if (!rs->items[i].dst || + (rs->items[i].src && + !strncmp(rs->items[i].src, "refs/tags/", 10))) { + int j; + + free(rs->items[i].src); + free(rs->items[i].dst); + + for (j = i + 1; j < rs->nr; j++) { + rs->items[j - 1] = rs->items[j]; + rs->raw[j - 1] = rs->raw[j]; + } + rs->nr--; + continue; + } + + old_dst = rs->items[i].dst; + strbuf_addstr(&new_dst, "refs/prefetch/"); + + /* + * If old_dst starts with "refs/", then place + * sub after that prefix. Otherwise, start at + * the beginning of the string. + */ + if (!skip_prefix(old_dst, "refs/", &sub)) + sub = old_dst; + strbuf_addstr(&new_dst, sub); + + rs->items[i].dst = strbuf_detach(&new_dst, NULL); + rs->items[i].force = 1; + + free(old_dst); + } +} + static struct ref *get_ref_map(struct remote *remote, const struct ref *remote_refs, struct refspec *rs, @@ -452,6 +504,10 @@ static struct ref *get_ref_map(struct remote *remote, struct hashmap existing_refs; int existing_refs_populated = 0; + filter_prefetch_refspec(rs); + if (remote) + filter_prefetch_refspec(&remote->fetch); + if (rs->nr) { struct refspec *fetch_refspec; diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index f34509727702..030e6f978c4e 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -240,4 +240,34 @@ test_expect_success "push with matching +: and negative refspec" ' git -C two push -v one ' +test_expect_success '--prefetch correctly modifies refspecs' ' + git -C one config --unset-all remote.origin.fetch && + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && + git -C one config --add remote.origin.fetch ^refs/heads/bogus/ignore && + git -C one config --add remote.origin.fetch "refs/heads/bogus/*:bogus/*" && + + git tag -a -m never never-fetch-tag HEAD && + + git branch bogus/fetched HEAD~1 && + git branch bogus/ignore HEAD && + + git -C one fetch --prefetch --no-tags && + test_must_fail git -C one rev-parse never-fetch-tag && + git -C one rev-parse refs/prefetch/bogus/fetched && + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore && + + # correctly handle when refspec set becomes empty + # after removing the refs/tags/* refspec. + git -C one config --unset-all remote.origin.fetch && + git -C one config --add remote.origin.fetch "refs/tags/*:refs/tags/*" && + + git -C one fetch --prefetch --no-tags && + test_must_fail git -C one rev-parse never-fetch-tag && + + # The refspec for refs that are not fully qualified + # are filtered multiple times. + git -C one rev-parse refs/prefetch/bogus/fetched && + test_must_fail git -C one rev-parse refs/prefetch/bogus/ignore +' + test_done -- gitgitgadget
Tom Saeger rightly pointed out [1] that the prefetch task ignores custom refspecs. This can lead to downloading more data than requested, and it doesn't even help the future foreground fetches that use that custom refspec. [1] https://lore.kernel.org/git/20210401184914.qmr7jhjbhp2mt3h6@dhcp-10-154-148-175.vpn.oracle.com/ This series fixes this problem by carefully replacing the start of each refspec's destination with "refs/prefetch/". If the destination already starts with "refs/", then that is replaced. Otherwise "refs/prefetch/" is just prepended. This happens inside of git fetch when a --prefetch option is given. This allows us to maniuplate a struct refspec_item instead of a full refspec string. It also simplifies our logic in testing the prefetch task. Update in V3 ============ * The fix is almost completely rewritten as an update to 'git fetch'. See the new PATCH 2 for this update. * There was some discussion of rewriting test_subcommand, but that can be delayed until a proper solution is found to complications around softer matches. Updates in V2 ============= Thanks for the close eye on this series. I appreciate the recommendations, which I believe I have responded to them all: * Fixed typos. * Made refspec_item_format() re-entrant. Consumers must free the buffer. * Cleaned up style (quoting and tabbing). Thanks, -Stolee Derrick Stolee (3): maintenance: simplify prefetch logic fetch: add --prefetch option maintenance: use 'git fetch --prefetch' Documentation/fetch-options.txt | 5 +++ Documentation/git-maintenance.txt | 6 ++-- builtin/fetch.c | 56 +++++++++++++++++++++++++++++++ builtin/gc.c | 36 +++++--------------- t/t5582-fetch-negative-refspec.sh | 30 +++++++++++++++++ t/t7900-maintenance.sh | 14 ++++---- 6 files changed, 109 insertions(+), 38 deletions(-) base-commit: 89b43f80a514aee58b662ad606e6352e03eaeee4 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-924%2Fderrickstolee%2Fmaintenance%2Frefspec-v3 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-924/derrickstolee/maintenance/refspec-v3 Pull-Request: https://github.com/gitgitgadget/git/pull/924 Range-diff vs v2: 1: 5aa0cb06c3f2 = 1: 4c0e983ba56f maintenance: simplify prefetch logic 2: d58a3e042ee8 < -: ------------ test-lib: use exact match for test_subcommand 3: 96388d949b98 < -: ------------ refspec: output a refspec item 4: bf296282323a < -: ------------ test-tool: test refspec input/output -: ------------ > 2: 7f488eea6dbd fetch: add --prefetch option 5: 9592224e3d42 ! 3: ed055d772452 maintenance: allow custom refspecs during prefetch @@ Metadata Author: Derrick Stolee <dstolee@microsoft.com> ## Commit message ## - maintenance: allow custom refspecs during prefetch + maintenance: use 'git fetch --prefetch' - The prefetch task previously used the default refspec source plus a - custom refspec destination to avoid colliding with remote refs: + The 'prefetch' maintenance task previously forced the following refspec + for each remote: +refs/heads/*:refs/prefetch/<remote>/* - However, some users customize their refspec to reduce how much data they - download from specific remotes. This can involve restrictive patterns - for fetching or negative patterns to avoid downloading some refs. + If a user has specified a more strict refspec for the remote, then this + prefetch task downloads more objects than necessary. - Modify fetch_remote() to iterate over the remote's refspec list and - translate that into the appropriate prefetch scenario. Specifically, - re-parse the raw form of the refspec into a new 'struct refspec' and - modify the 'dst' member to replace a leading "refs/" substring with - "refs/prefetch/", or prepend "refs/prefetch/" to 'dst' otherwise. - Negative refspecs do not have a 'dst' so they can be transferred to the - 'git fetch' command unmodified. - - This prefix change provides the benefit of keeping whatever collisions - may exist in the custom refspecs, if that is a desirable outcome. - - This changes the names of the refs that would be fetched by the default - refspec. Instead of "refs/prefetch/<remote>/<branch>" they will now go - to "refs/prefetch/remotes/<remote>/<branch>". While this is a change, it - is not a seriously breaking one: these refs are intended to be hidden - and not used. + The previous change introduced the '--prefetch' option to 'git fetch' + which manipulates the remote's refspec to place all resulting refs into + refs/prefetch/, with further partitioning based on the destinations of + those refspecs. Update the documentation to be more generic about the destination refs. - Do not mention custom refpecs explicitly, as that does not need to be + Do not mention custom refspecs explicitly, as that does not need to be highlighted in this documentation. The important part of placing refs in - refs/prefetch remains. + refs/prefetch/ remains. Reported-by: Tom Saeger <tom.saeger@oracle.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> ## Documentation/git-maintenance.txt ## -@@ Documentation/git-maintenance.txt: prefetch:: +@@ Documentation/git-maintenance.txt: commit-graph:: + prefetch:: + The `prefetch` task updates the object directory with the latest objects from all registered remotes. For each remote, a `git fetch` - command is run. The refmap is custom to avoid updating local or remote - branches (those in `refs/heads` or `refs/remotes`). Instead, the +- command is run. The refmap is custom to avoid updating local or remote +- branches (those in `refs/heads` or `refs/remotes`). Instead, the - remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are - not updated. -+ refs are stored in `refs/prefetch/`. Also, tags are not updated. ++ command is run. The configured refspec is modified to place all ++ requested refs within `refs/prefetch/`. Also, tags are not updated. + This is done to avoid disrupting the remote-tracking branches. The end users expect these refs to stay unmoved unless they initiate a fetch. With prefetch ## builtin/gc.c ## -@@ - #include "remote.h" - #include "object-store.h" - #include "exec-cmd.h" -+#include "refspec.h" - - #define FAILED_RUN "failed to run %s" - @@ builtin/gc.c: static int fetch_remote(struct remote *remote, void *cbdata) - { - struct maintenance_run_opts *opts = cbdata; struct child_process child = CHILD_PROCESS_INIT; -+ int i; child.git_cmd = 1; - strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", -@@ builtin/gc.c: static int fetch_remote(struct remote *remote, void *cbdata) +- strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", ++ strvec_pushl(&child.args, "fetch", remote->name, ++ "--prefetch", "--prune", "--no-tags", + "--no-write-fetch-head", "--recurse-submodules=no", +- "--refmap=", NULL); ++ NULL); + if (opts->quiet) strvec_push(&child.args, "--quiet"); - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); -+ for (i = 0; i < remote->fetch.nr; i++) { -+ struct refspec_item replace; -+ struct refspec_item *rsi = &remote->fetch.items[i]; -+ struct strbuf new_dst = STRBUF_INIT; -+ size_t ignore_len = 0; -+ char *replace_string; -+ -+ if (rsi->negative) { -+ strvec_push(&child.args, remote->fetch.raw[i]); -+ continue; -+ } -+ -+ refspec_item_init(&replace, remote->fetch.raw[i], 1); -+ -+ /* -+ * If a refspec dst starts with "refs/" at the start, -+ * then we will replace "refs/" with "refs/prefetch/". -+ * Otherwise, we will prepend the dst string with -+ * "refs/prefetch/". -+ */ -+ if (!strncmp(replace.dst, "refs/", 5)) -+ ignore_len = 5; -+ -+ strbuf_addstr(&new_dst, "refs/prefetch/"); -+ strbuf_addstr(&new_dst, replace.dst + ignore_len); -+ free(replace.dst); -+ replace.dst = strbuf_detach(&new_dst, NULL); -+ -+ replace_string = refspec_item_format(&replace); -+ strvec_push(&child.args, replace_string); -+ free(replace_string); -+ -+ refspec_item_clear(&replace); -+ } - +- return !!run_command(&child); } + ## t/t7900-maintenance.sh ## @@ t/t7900-maintenance.sh: test_expect_success 'prefetch multiple remotes' ' + test_commit -C clone1 one && test_commit -C clone2 two && GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && - fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && -- test_subcommand git fetch remote1 $fetchargs "+refs/heads/*:refs/prefetch/remote1/*" <run-prefetch.txt && -- test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remote2/*" <run-prefetch.txt && -+ test_subcommand git fetch remote1 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote1/*" <run-prefetch.txt && -+ test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <run-prefetch.txt && +- fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && +- test_subcommand git fetch remote1 $fetchargs +refs/heads/\\*:refs/prefetch/remote1/\\* <run-prefetch.txt && +- test_subcommand git fetch remote2 $fetchargs +refs/heads/\\*:refs/prefetch/remote2/\\* <run-prefetch.txt && ++ fetchargs="--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet" && ++ test_subcommand git fetch remote1 $fetchargs <run-prefetch.txt && ++ test_subcommand git fetch remote2 $fetchargs <run-prefetch.txt && test_path_is_missing .git/refs/remotes && - git log prefetch/remote1/one && - git log prefetch/remote2/two && @@ t/t7900-maintenance.sh: test_expect_success 'prefetch multiple remotes' ' test_cmp_config refs/prefetch/ log.excludedecoration && git log --oneline --decorate --all >log && - ! grep "prefetch" log - ' - -+test_expect_success 'prefetch custom refspecs' ' -+ git -C clone1 branch -f special/fetched HEAD && -+ git -C clone1 branch -f special/secret/not-fetched HEAD && -+ -+ # create multiple refspecs for remote1 -+ git config --add remote.remote1.fetch "+refs/heads/special/fetched:refs/heads/fetched" && -+ git config --add remote.remote1.fetch "^refs/heads/special/secret/not-fetched" && -+ -+ GIT_TRACE2_EVENT="$(pwd)/prefetch-refspec.txt" git maintenance run --task=prefetch 2>/dev/null && -+ -+ fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && -+ -+ # skips second refspec because it is not a pattern type -+ rs1="+refs/heads/*:refs/prefetch/remotes/remote1/*" && -+ rs2="+refs/heads/special/fetched:refs/prefetch/heads/fetched" && -+ rs3="^refs/heads/special/secret/not-fetched" && -+ -+ test_subcommand git fetch remote1 $fetchargs "$rs1" "$rs2" "$rs3" <prefetch-refspec.txt && -+ test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <prefetch-refspec.txt && -+ -+ # first refspec is overridden by second -+ test_must_fail git rev-parse refs/prefetch/special/fetched && -+ git rev-parse refs/prefetch/heads/fetched && -+ -+ # possible incorrect places for the non-fetched ref -+ test_must_fail git rev-parse refs/prefetch/remotes/remote1/secret/not-fetched && -+ test_must_fail git rev-parse refs/prefetch/remotes/remote1/not-fetched && -+ test_must_fail git rev-parse refs/heads/secret/not-fetched && -+ test_must_fail git rev-parse refs/heads/not-fetched -+' -+ - test_expect_success 'prefetch and existing log.excludeDecoration values' ' - git config --unset-all log.excludeDecoration && - git config log.excludeDecoration refs/remotes/remote1/ && -- gitgitgadget
On 2021.04.06 18:47, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee <dstolee@microsoft.com> > > The prefetch task previously used the default refspec source plus a > custom refspec destination to avoid colliding with remote refs: > > +refs/heads/*:refs/prefetch/<remote>/* > > However, some users customize their refspec to reduce how much data they > download from specific remotes. This can involve restrictive patterns > for fetching or negative patterns to avoid downloading some refs. > > Modify fetch_remote() to iterate over the remote's refspec list and > translate that into the appropriate prefetch scenario. Specifically, > re-parse the raw form of the refspec into a new 'struct refspec' and > modify the 'dst' member to replace a leading "refs/" substring with > "refs/prefetch/", or prepend "refs/prefetch/" to 'dst' otherwise. > Negative refspecs do not have a 'dst' so they can be transferred to the > 'git fetch' command unmodified. > > This prefix change provides the benefit of keeping whatever collisions > may exist in the custom refspecs, if that is a desirable outcome. > > This changes the names of the refs that would be fetched by the default > refspec. Instead of "refs/prefetch/<remote>/<branch>" they will now go > to "refs/prefetch/remotes/<remote>/<branch>". While this is a change, it > is not a seriously breaking one: these refs are intended to be hidden > and not used. > > Update the documentation to be more generic about the destination refs. > Do not mention custom refpecs explicitly, as that does not need to be Typo here: s/refpecs/refspecs/ > highlighted in this documentation. The important part of placing refs in > refs/prefetch remains. > > Reported-by: Tom Saeger <tom.saeger@oracle.com> > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > Documentation/git-maintenance.txt | 3 +-- > builtin/gc.c | 37 +++++++++++++++++++++++++- > t/t7900-maintenance.sh | 43 ++++++++++++++++++++++++++----- > 3 files changed, 74 insertions(+), 9 deletions(-) > > diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt > index 80ddd33ceba0..95a24264eb10 100644 > --- a/Documentation/git-maintenance.txt > +++ b/Documentation/git-maintenance.txt > @@ -94,8 +94,7 @@ prefetch:: > objects from all registered remotes. For each remote, a `git fetch` > command is run. The refmap is custom to avoid updating local or remote > branches (those in `refs/heads` or `refs/remotes`). Instead, the > - remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are > - not updated. > + refs are stored in `refs/prefetch/`. Also, tags are not updated. > + > This is done to avoid disrupting the remote-tracking branches. The end users > expect these refs to stay unmoved unless they initiate a fetch. With prefetch > diff --git a/builtin/gc.c b/builtin/gc.c > index fa8128de9ae1..76f347dd6b11 100644 > --- a/builtin/gc.c > +++ b/builtin/gc.c > @@ -32,6 +32,7 @@ > #include "remote.h" > #include "object-store.h" > #include "exec-cmd.h" > +#include "refspec.h" > > #define FAILED_RUN "failed to run %s" > > @@ -877,6 +878,7 @@ static int fetch_remote(struct remote *remote, void *cbdata) > { > struct maintenance_run_opts *opts = cbdata; > struct child_process child = CHILD_PROCESS_INIT; > + int i; > > child.git_cmd = 1; > strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", > @@ -886,7 +888,40 @@ static int fetch_remote(struct remote *remote, void *cbdata) > if (opts->quiet) > strvec_push(&child.args, "--quiet"); > > - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); > + for (i = 0; i < remote->fetch.nr; i++) { > + struct refspec_item replace; > + struct refspec_item *rsi = &remote->fetch.items[i]; > + struct strbuf new_dst = STRBUF_INIT; > + size_t ignore_len = 0; > + char *replace_string; > + > + if (rsi->negative) { > + strvec_push(&child.args, remote->fetch.raw[i]); > + continue; > + } > + > + refspec_item_init(&replace, remote->fetch.raw[i], 1); > + > + /* > + * If a refspec dst starts with "refs/" at the start, > + * then we will replace "refs/" with "refs/prefetch/". > + * Otherwise, we will prepend the dst string with > + * "refs/prefetch/". > + */ > + if (!strncmp(replace.dst, "refs/", 5)) > + ignore_len = 5; > + > + strbuf_addstr(&new_dst, "refs/prefetch/"); > + strbuf_addstr(&new_dst, replace.dst + ignore_len); > + free(replace.dst); > + replace.dst = strbuf_detach(&new_dst, NULL); > + > + replace_string = refspec_item_format(&replace); > + strvec_push(&child.args, replace_string); > + free(replace_string); > + > + refspec_item_clear(&replace); > + } > > return !!run_command(&child); > } > diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh > index 37eed6ed3aa3..03487be3af38 100755 > --- a/t/t7900-maintenance.sh > +++ b/t/t7900-maintenance.sh > @@ -142,20 +142,51 @@ test_expect_success 'prefetch multiple remotes' ' > test_commit -C clone2 two && > GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && > fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && > - test_subcommand git fetch remote1 $fetchargs "+refs/heads/*:refs/prefetch/remote1/*" <run-prefetch.txt && > - test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remote2/*" <run-prefetch.txt && > + test_subcommand git fetch remote1 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote1/*" <run-prefetch.txt && > + test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <run-prefetch.txt && > test_path_is_missing .git/refs/remotes && > - git log prefetch/remote1/one && > - git log prefetch/remote2/two && > + git log prefetch/remotes/remote1/one && > + git log prefetch/remotes/remote2/two && > git fetch --all && > - test_cmp_rev refs/remotes/remote1/one refs/prefetch/remote1/one && > - test_cmp_rev refs/remotes/remote2/two refs/prefetch/remote2/two && > + test_cmp_rev refs/remotes/remote1/one refs/prefetch/remotes/remote1/one && > + test_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two && > > test_cmp_config refs/prefetch/ log.excludedecoration && > git log --oneline --decorate --all >log && > ! grep "prefetch" log > ' > > +test_expect_success 'prefetch custom refspecs' ' > + git -C clone1 branch -f special/fetched HEAD && > + git -C clone1 branch -f special/secret/not-fetched HEAD && > + > + # create multiple refspecs for remote1 > + git config --add remote.remote1.fetch "+refs/heads/special/fetched:refs/heads/fetched" && > + git config --add remote.remote1.fetch "^refs/heads/special/secret/not-fetched" && > + > + GIT_TRACE2_EVENT="$(pwd)/prefetch-refspec.txt" git maintenance run --task=prefetch 2>/dev/null && > + > + fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && > + > + # skips second refspec because it is not a pattern type > + rs1="+refs/heads/*:refs/prefetch/remotes/remote1/*" && > + rs2="+refs/heads/special/fetched:refs/prefetch/heads/fetched" && > + rs3="^refs/heads/special/secret/not-fetched" && > + > + test_subcommand git fetch remote1 $fetchargs "$rs1" "$rs2" "$rs3" <prefetch-refspec.txt && > + test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <prefetch-refspec.txt && > + > + # first refspec is overridden by second > + test_must_fail git rev-parse refs/prefetch/special/fetched && > + git rev-parse refs/prefetch/heads/fetched && > + > + # possible incorrect places for the non-fetched ref > + test_must_fail git rev-parse refs/prefetch/remotes/remote1/secret/not-fetched && > + test_must_fail git rev-parse refs/prefetch/remotes/remote1/not-fetched && > + test_must_fail git rev-parse refs/heads/secret/not-fetched && > + test_must_fail git rev-parse refs/heads/not-fetched > +' > + > test_expect_success 'prefetch and existing log.excludeDecoration values' ' > git config --unset-all log.excludeDecoration && > git config log.excludeDecoration refs/remotes/remote1/ && > -- > gitgitgadget
On Tue, Apr 06, 2021 at 06:47:50PM +0000, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee <dstolee@microsoft.com> > > The prefetch task previously used the default refspec source plus a > custom refspec destination to avoid colliding with remote refs: > > +refs/heads/*:refs/prefetch/<remote>/* > > However, some users customize their refspec to reduce how much data they > download from specific remotes. This can involve restrictive patterns > for fetching or negative patterns to avoid downloading some refs. > > Modify fetch_remote() to iterate over the remote's refspec list and > translate that into the appropriate prefetch scenario. Specifically, > re-parse the raw form of the refspec into a new 'struct refspec' and > modify the 'dst' member to replace a leading "refs/" substring with > "refs/prefetch/", or prepend "refs/prefetch/" to 'dst' otherwise. > Negative refspecs do not have a 'dst' so they can be transferred to the > 'git fetch' command unmodified. > > This prefix change provides the benefit of keeping whatever collisions > may exist in the custom refspecs, if that is a desirable outcome. > > This changes the names of the refs that would be fetched by the default > refspec. Instead of "refs/prefetch/<remote>/<branch>" they will now go > to "refs/prefetch/remotes/<remote>/<branch>". While this is a change, it > is not a seriously breaking one: these refs are intended to be hidden > and not used. > > Update the documentation to be more generic about the destination refs. > Do not mention custom refpecs explicitly, as that does not need to be > highlighted in this documentation. The important part of placing refs in > refs/prefetch remains. > > Reported-by: Tom Saeger <tom.saeger@oracle.com> > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > Documentation/git-maintenance.txt | 3 +-- > builtin/gc.c | 37 +++++++++++++++++++++++++- > t/t7900-maintenance.sh | 43 ++++++++++++++++++++++++++----- > 3 files changed, 74 insertions(+), 9 deletions(-) > > diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt > index 80ddd33ceba0..95a24264eb10 100644 > --- a/Documentation/git-maintenance.txt > +++ b/Documentation/git-maintenance.txt > @@ -94,8 +94,7 @@ prefetch:: > objects from all registered remotes. For each remote, a `git fetch` > command is run. The refmap is custom to avoid updating local or remote > branches (those in `refs/heads` or `refs/remotes`). Instead, the > - remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are > - not updated. > + refs are stored in `refs/prefetch/`. Also, tags are not updated. > + > This is done to avoid disrupting the remote-tracking branches. The end users > expect these refs to stay unmoved unless they initiate a fetch. With prefetch > diff --git a/builtin/gc.c b/builtin/gc.c > index fa8128de9ae1..76f347dd6b11 100644 > --- a/builtin/gc.c > +++ b/builtin/gc.c > @@ -32,6 +32,7 @@ > #include "remote.h" > #include "object-store.h" > #include "exec-cmd.h" > +#include "refspec.h" > > #define FAILED_RUN "failed to run %s" > > @@ -877,6 +878,7 @@ static int fetch_remote(struct remote *remote, void *cbdata) > { > struct maintenance_run_opts *opts = cbdata; > struct child_process child = CHILD_PROCESS_INIT; > + int i; > > child.git_cmd = 1; > strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", > @@ -886,7 +888,40 @@ static int fetch_remote(struct remote *remote, void *cbdata) > if (opts->quiet) > strvec_push(&child.args, "--quiet"); > > - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); > + for (i = 0; i < remote->fetch.nr; i++) { > + struct refspec_item replace; > + struct refspec_item *rsi = &remote->fetch.items[i]; > + struct strbuf new_dst = STRBUF_INIT; > + size_t ignore_len = 0; > + char *replace_string; > + > + if (rsi->negative) { > + strvec_push(&child.args, remote->fetch.raw[i]); > + continue; > + } > + > + refspec_item_init(&replace, remote->fetch.raw[i], 1); > + > + /* > + * If a refspec dst starts with "refs/" at the start, > + * then we will replace "refs/" with "refs/prefetch/". > + * Otherwise, we will prepend the dst string with > + * "refs/prefetch/". > + */ > + if (!strncmp(replace.dst, "refs/", 5)) > + ignore_len = 5; > + > + strbuf_addstr(&new_dst, "refs/prefetch/"); > + strbuf_addstr(&new_dst, replace.dst + ignore_len); > + free(replace.dst); > + replace.dst = strbuf_detach(&new_dst, NULL); > + > + replace_string = refspec_item_format(&replace); > + strvec_push(&child.args, replace_string); > + free(replace_string); > + > + refspec_item_clear(&replace); > + } > > return !!run_command(&child); > } Junio brought up the point about configs which 'fetch' have no dst https://lore.kernel.org/git/c06a198a-2043-27a2-cab3-3471190754cc@gmail.com/ [remote "submaintainer1"] url = ... repository of submaintainer #1 ... fetch = master tagopt = --no-tags This patch fixes segfault for config like above. You might have ideas on a cleaner way to do this. I did add `child_process_clear`. --Tom diff --git a/builtin/gc.c b/builtin/gc.c index 76f347dd6b11..921266ee30a5 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -879,6 +879,7 @@ static int fetch_remote(struct remote *remote, void *cbdata) struct maintenance_run_opts *opts = cbdata; struct child_process child = CHILD_PROCESS_INIT; int i; + int nargs; child.git_cmd = 1; strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", @@ -888,6 +889,8 @@ static int fetch_remote(struct remote *remote, void *cbdata) if (opts->quiet) strvec_push(&child.args, "--quiet"); + nargs = child.args.nr; + for (i = 0; i < remote->fetch.nr; i++) { struct refspec_item replace; struct refspec_item *rsi = &remote->fetch.items[i]; @@ -900,6 +903,10 @@ static int fetch_remote(struct remote *remote, void *cbdata) continue; } + if (!rsi->dst) { + continue; + } + refspec_item_init(&replace, remote->fetch.raw[i], 1); /* @@ -923,6 +930,12 @@ static int fetch_remote(struct remote *remote, void *cbdata) refspec_item_clear(&replace); } + /* skip remote if no refspecs to fetch */ + if (child.args.nr - nargs <= 0) { + child_process_clear(&child); + return 0; + }
From: Derrick Stolee <dstolee@microsoft.com> The prefetch task previously used the default refspec source plus a custom refspec destination to avoid colliding with remote refs: +refs/heads/*:refs/prefetch/<remote>/* However, some users customize their refspec to reduce how much data they download from specific remotes. This can involve restrictive patterns for fetching or negative patterns to avoid downloading some refs. Modify fetch_remote() to iterate over the remote's refspec list and translate that into the appropriate prefetch scenario. Specifically, re-parse the raw form of the refspec into a new 'struct refspec' and modify the 'dst' member to replace a leading "refs/" substring with "refs/prefetch/", or prepend "refs/prefetch/" to 'dst' otherwise. Negative refspecs do not have a 'dst' so they can be transferred to the 'git fetch' command unmodified. This prefix change provides the benefit of keeping whatever collisions may exist in the custom refspecs, if that is a desirable outcome. This changes the names of the refs that would be fetched by the default refspec. Instead of "refs/prefetch/<remote>/<branch>" they will now go to "refs/prefetch/remotes/<remote>/<branch>". While this is a change, it is not a seriously breaking one: these refs are intended to be hidden and not used. Update the documentation to be more generic about the destination refs. Do not mention custom refpecs explicitly, as that does not need to be highlighted in this documentation. The important part of placing refs in refs/prefetch remains. Reported-by: Tom Saeger <tom.saeger@oracle.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- Documentation/git-maintenance.txt | 3 +-- builtin/gc.c | 37 +++++++++++++++++++++++++- t/t7900-maintenance.sh | 43 ++++++++++++++++++++++++++----- 3 files changed, 74 insertions(+), 9 deletions(-) diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt index 80ddd33ceba0..95a24264eb10 100644 --- a/Documentation/git-maintenance.txt +++ b/Documentation/git-maintenance.txt @@ -94,8 +94,7 @@ prefetch:: objects from all registered remotes. For each remote, a `git fetch` command is run. The refmap is custom to avoid updating local or remote branches (those in `refs/heads` or `refs/remotes`). Instead, the - remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are - not updated. + refs are stored in `refs/prefetch/`. Also, tags are not updated. + This is done to avoid disrupting the remote-tracking branches. The end users expect these refs to stay unmoved unless they initiate a fetch. With prefetch diff --git a/builtin/gc.c b/builtin/gc.c index fa8128de9ae1..76f347dd6b11 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -32,6 +32,7 @@ #include "remote.h" #include "object-store.h" #include "exec-cmd.h" +#include "refspec.h" #define FAILED_RUN "failed to run %s" @@ -877,6 +878,7 @@ static int fetch_remote(struct remote *remote, void *cbdata) { struct maintenance_run_opts *opts = cbdata; struct child_process child = CHILD_PROCESS_INIT; + int i; child.git_cmd = 1; strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", @@ -886,7 +888,40 @@ static int fetch_remote(struct remote *remote, void *cbdata) if (opts->quiet) strvec_push(&child.args, "--quiet"); - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); + for (i = 0; i < remote->fetch.nr; i++) { + struct refspec_item replace; + struct refspec_item *rsi = &remote->fetch.items[i]; + struct strbuf new_dst = STRBUF_INIT; + size_t ignore_len = 0; + char *replace_string; + + if (rsi->negative) { + strvec_push(&child.args, remote->fetch.raw[i]); + continue; + } + + refspec_item_init(&replace, remote->fetch.raw[i], 1); + + /* + * If a refspec dst starts with "refs/" at the start, + * then we will replace "refs/" with "refs/prefetch/". + * Otherwise, we will prepend the dst string with + * "refs/prefetch/". + */ + if (!strncmp(replace.dst, "refs/", 5)) + ignore_len = 5; + + strbuf_addstr(&new_dst, "refs/prefetch/"); + strbuf_addstr(&new_dst, replace.dst + ignore_len); + free(replace.dst); + replace.dst = strbuf_detach(&new_dst, NULL); + + replace_string = refspec_item_format(&replace); + strvec_push(&child.args, replace_string); + free(replace_string); + + refspec_item_clear(&replace); + } return !!run_command(&child); } diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index 37eed6ed3aa3..03487be3af38 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -142,20 +142,51 @@ test_expect_success 'prefetch multiple remotes' ' test_commit -C clone2 two && GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && - test_subcommand git fetch remote1 $fetchargs "+refs/heads/*:refs/prefetch/remote1/*" <run-prefetch.txt && - test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remote2/*" <run-prefetch.txt && + test_subcommand git fetch remote1 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote1/*" <run-prefetch.txt && + test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <run-prefetch.txt && test_path_is_missing .git/refs/remotes && - git log prefetch/remote1/one && - git log prefetch/remote2/two && + git log prefetch/remotes/remote1/one && + git log prefetch/remotes/remote2/two && git fetch --all && - test_cmp_rev refs/remotes/remote1/one refs/prefetch/remote1/one && - test_cmp_rev refs/remotes/remote2/two refs/prefetch/remote2/two && + test_cmp_rev refs/remotes/remote1/one refs/prefetch/remotes/remote1/one && + test_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two && test_cmp_config refs/prefetch/ log.excludedecoration && git log --oneline --decorate --all >log && ! grep "prefetch" log ' +test_expect_success 'prefetch custom refspecs' ' + git -C clone1 branch -f special/fetched HEAD && + git -C clone1 branch -f special/secret/not-fetched HEAD && + + # create multiple refspecs for remote1 + git config --add remote.remote1.fetch "+refs/heads/special/fetched:refs/heads/fetched" && + git config --add remote.remote1.fetch "^refs/heads/special/secret/not-fetched" && + + GIT_TRACE2_EVENT="$(pwd)/prefetch-refspec.txt" git maintenance run --task=prefetch 2>/dev/null && + + fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && + + # skips second refspec because it is not a pattern type + rs1="+refs/heads/*:refs/prefetch/remotes/remote1/*" && + rs2="+refs/heads/special/fetched:refs/prefetch/heads/fetched" && + rs3="^refs/heads/special/secret/not-fetched" && + + test_subcommand git fetch remote1 $fetchargs "$rs1" "$rs2" "$rs3" <prefetch-refspec.txt && + test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <prefetch-refspec.txt && + + # first refspec is overridden by second + test_must_fail git rev-parse refs/prefetch/special/fetched && + git rev-parse refs/prefetch/heads/fetched && + + # possible incorrect places for the non-fetched ref + test_must_fail git rev-parse refs/prefetch/remotes/remote1/secret/not-fetched && + test_must_fail git rev-parse refs/prefetch/remotes/remote1/not-fetched && + test_must_fail git rev-parse refs/heads/secret/not-fetched && + test_must_fail git rev-parse refs/heads/not-fetched +' + test_expect_success 'prefetch and existing log.excludeDecoration values' ' git config --unset-all log.excludeDecoration && git config log.excludeDecoration refs/remotes/remote1/ && -- gitgitgadget
On Mon, Apr 05, 2021 at 01:04:15PM +0000, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee <dstolee@microsoft.com> > > The prefetch task previously used the default refspec source plus a > custom refspec destination to avoid colliding with remote refs: > > +refs/heads/*:refs/prefetch/<remote>/* > > However, some users customize their refspec to reduce how much data they > download from specific remotes. This can involve restrictive patterns > for fetching or negative patterns to avoid downloading some refs. > > Modify fetch_remote() to iterate over the remote's refspec list and > translate that into the appropriate prefetch scenario. Specifically, > re-parse the raw form of the refspec into a new 'struct refspec' and > modify the 'dst' member to replace a leading "refs/" substring with > "refs/prefetch/", or prepend "refs/prefetch/" to 'dst' otherwise. > Negative refspecs do not have a 'dst' so they can be transferred to the > 'git fetch' command unmodified. > > This prefix change provides the benefit of keeping whatever collisions > may exist in the custom refspecs, if that is a desirable outcome. > > This changes the names of the refs that would be fetched by the default > refspec. Instead of "refs/prefetch/<remote>/<branch>" they will now go > to "refs/prefetch/remotes/<remote>/<branch>". While this is a change, it > is not a seriously breaking one: these refs are intended to be hidden > and not used. > > Update the documentation to be more generic about the destination refs. > Do not mention custom refpecs explicitly, as that does not need to be > highlighted in this documentation. The important part of placing refs in > refs/prefetch remains. > > Reported-by: Tom Saeger <tom.saeger@oracle.com> > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > Documentation/git-maintenance.txt | 3 +-- > builtin/gc.c | 34 +++++++++++++++++++++++- > t/t7900-maintenance.sh | 43 ++++++++++++++++++++++++++----- > 3 files changed, 71 insertions(+), 9 deletions(-) > > diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt > index 80ddd33ceba0..95a24264eb10 100644 > --- a/Documentation/git-maintenance.txt > +++ b/Documentation/git-maintenance.txt > @@ -94,8 +94,7 @@ prefetch:: > objects from all registered remotes. For each remote, a `git fetch` > command is run. The refmap is custom to avoid updating local or remote > branches (those in `refs/heads` or `refs/remotes`). Instead, the > - remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are > - not updated. > + refs are stored in `refs/prefetch/`. Also, tags are not updated. > + > This is done to avoid disrupting the remote-tracking branches. The end users > expect these refs to stay unmoved unless they initiate a fetch. With prefetch > diff --git a/builtin/gc.c b/builtin/gc.c > index fa8128de9ae1..92cb8b4e0bfa 100644 > --- a/builtin/gc.c > +++ b/builtin/gc.c > @@ -32,6 +32,7 @@ > #include "remote.h" > #include "object-store.h" > #include "exec-cmd.h" > +#include "refspec.h" > > #define FAILED_RUN "failed to run %s" > > @@ -877,6 +878,7 @@ static int fetch_remote(struct remote *remote, void *cbdata) > { > struct maintenance_run_opts *opts = cbdata; > struct child_process child = CHILD_PROCESS_INIT; > + int i; > > child.git_cmd = 1; > strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", > @@ -886,7 +888,37 @@ static int fetch_remote(struct remote *remote, void *cbdata) > if (opts->quiet) > strvec_push(&child.args, "--quiet"); > > - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); > + for (i = 0; i < remote->fetch.nr; i++) { > + struct refspec_item replace; > + struct refspec_item *rsi = &remote->fetch.items[i]; > + struct strbuf new_dst = STRBUF_INIT; > + size_t ignore_len = 0; > + > + if (rsi->negative) { > + strvec_push(&child.args, remote->fetch.raw[i]); > + continue; > + } > + > + refspec_item_init(&replace, remote->fetch.raw[i], 1); > + > + /* > + * If a refspec dst starts with "refs/" at the start, > + * then we will replace "refs/" with "refs/prefetch/". > + * Otherwise, we will prepend the dst string with > + * "refs/prefetch/". > + */ > + if (!strncmp(replace.dst, "refs/", 5)) > + ignore_len = 5; > + > + strbuf_addstr(&new_dst, "refs/prefetch/"); > + strbuf_addstr(&new_dst, replace.dst + ignore_len); > + free(replace.dst); > + replace.dst = strbuf_detach(&new_dst, NULL); > + > + strvec_push(&child.args, refspec_item_format(&replace)); see comment on 3/5, think refspec_item_format is leaking here. this code looks fine though. > + > + refspec_item_clear(&replace); > + } > > return !!run_command(&child); > } > diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh > index fc2315edec11..3366ea188782 100755 > --- a/t/t7900-maintenance.sh > +++ b/t/t7900-maintenance.sh > @@ -142,20 +142,51 @@ test_expect_success 'prefetch multiple remotes' ' > test_commit -C clone2 two && > GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && > fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && > - test_subcommand git fetch remote1 $fetchargs +refs/heads/*:refs/prefetch/remote1/* <run-prefetch.txt && > - test_subcommand git fetch remote2 $fetchargs +refs/heads/*:refs/prefetch/remote2/* <run-prefetch.txt && > + test_subcommand git fetch remote1 $fetchargs +refs/heads/*:refs/prefetch/remotes/remote1/* <run-prefetch.txt && > + test_subcommand git fetch remote2 $fetchargs +refs/heads/*:refs/prefetch/remotes/remote2/* <run-prefetch.txt && > test_path_is_missing .git/refs/remotes && > - git log prefetch/remote1/one && > - git log prefetch/remote2/two && > + git log prefetch/remotes/remote1/one && > + git log prefetch/remotes/remote2/two && > git fetch --all && > - test_cmp_rev refs/remotes/remote1/one refs/prefetch/remote1/one && > - test_cmp_rev refs/remotes/remote2/two refs/prefetch/remote2/two && > + test_cmp_rev refs/remotes/remote1/one refs/prefetch/remotes/remote1/one && > + test_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two && > > test_cmp_config refs/prefetch/ log.excludedecoration && > git log --oneline --decorate --all >log && > ! grep "prefetch" log > ' > > +test_expect_success 'prefetch custom refspecs' ' > + git -C clone1 branch -f special/fetched HEAD && > + git -C clone1 branch -f special/secret/not-fetched HEAD && > + > + # create multiple refspecs for remote1 > + git config --add remote.remote1.fetch +refs/heads/special/fetched:refs/heads/fetched && > + git config --add remote.remote1.fetch ^refs/heads/special/secret/not-fetched && > + > + GIT_TRACE2_EVENT="$(pwd)/prefetch-refspec.txt" git maintenance run --task=prefetch 2>/dev/null && > + > + fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && > + > + # skips second refspec because it is not a pattern type > + rs1="+refs/heads/*:refs/prefetch/remotes/remote1/*" && > + rs2="+refs/heads/special/fetched:refs/prefetch/heads/fetched" && > + rs3="^refs/heads/special/secret/not-fetched" && > + > + test_subcommand git fetch remote1 $fetchargs $rs1 $rs2 $rs3 <prefetch-refspec.txt && > + test_subcommand git fetch remote2 $fetchargs +refs/heads/*:refs/prefetch/remotes/remote2/* <prefetch-refspec.txt && > + > + # first refspec is overridden by second > + test_must_fail git rev-parse refs/prefetch/special/fetched && > + git rev-parse refs/prefetch/heads/fetched && > + > + # possible incorrect places for the non-fetched ref > + test_must_fail git rev-parse refs/prefetch/remotes/remote1/secret/not-fetched && > + test_must_fail git rev-parse refs/prefetch/remotes/remote1/not-fetched && > + test_must_fail git rev-parse refs/heads/secret/not-fetched && > + test_must_fail git rev-parse refs/heads/not-fetched > +' > + > test_expect_success 'prefetch and existing log.excludeDecoration values' ' > git config --unset-all log.excludeDecoration && > git config log.excludeDecoration refs/remotes/remote1/ && > -- > gitgitgadget
From: Derrick Stolee <dstolee@microsoft.com> The prefetch task previously used the default refspec source plus a custom refspec destination to avoid colliding with remote refs: +refs/heads/*:refs/prefetch/<remote>/* However, some users customize their refspec to reduce how much data they download from specific remotes. This can involve restrictive patterns for fetching or negative patterns to avoid downloading some refs. Modify fetch_remote() to iterate over the remote's refspec list and translate that into the appropriate prefetch scenario. Specifically, re-parse the raw form of the refspec into a new 'struct refspec' and modify the 'dst' member to replace a leading "refs/" substring with "refs/prefetch/", or prepend "refs/prefetch/" to 'dst' otherwise. Negative refspecs do not have a 'dst' so they can be transferred to the 'git fetch' command unmodified. This prefix change provides the benefit of keeping whatever collisions may exist in the custom refspecs, if that is a desirable outcome. This changes the names of the refs that would be fetched by the default refspec. Instead of "refs/prefetch/<remote>/<branch>" they will now go to "refs/prefetch/remotes/<remote>/<branch>". While this is a change, it is not a seriously breaking one: these refs are intended to be hidden and not used. Update the documentation to be more generic about the destination refs. Do not mention custom refpecs explicitly, as that does not need to be highlighted in this documentation. The important part of placing refs in refs/prefetch remains. Reported-by: Tom Saeger <tom.saeger@oracle.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- Documentation/git-maintenance.txt | 3 +-- builtin/gc.c | 34 +++++++++++++++++++++++- t/t7900-maintenance.sh | 43 ++++++++++++++++++++++++++----- 3 files changed, 71 insertions(+), 9 deletions(-) diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt index 80ddd33ceba0..95a24264eb10 100644 --- a/Documentation/git-maintenance.txt +++ b/Documentation/git-maintenance.txt @@ -94,8 +94,7 @@ prefetch:: objects from all registered remotes. For each remote, a `git fetch` command is run. The refmap is custom to avoid updating local or remote branches (those in `refs/heads` or `refs/remotes`). Instead, the - remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are - not updated. + refs are stored in `refs/prefetch/`. Also, tags are not updated. + This is done to avoid disrupting the remote-tracking branches. The end users expect these refs to stay unmoved unless they initiate a fetch. With prefetch diff --git a/builtin/gc.c b/builtin/gc.c index fa8128de9ae1..92cb8b4e0bfa 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -32,6 +32,7 @@ #include "remote.h" #include "object-store.h" #include "exec-cmd.h" +#include "refspec.h" #define FAILED_RUN "failed to run %s" @@ -877,6 +878,7 @@ static int fetch_remote(struct remote *remote, void *cbdata) { struct maintenance_run_opts *opts = cbdata; struct child_process child = CHILD_PROCESS_INIT; + int i; child.git_cmd = 1; strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", @@ -886,7 +888,37 @@ static int fetch_remote(struct remote *remote, void *cbdata) if (opts->quiet) strvec_push(&child.args, "--quiet"); - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); + for (i = 0; i < remote->fetch.nr; i++) { + struct refspec_item replace; + struct refspec_item *rsi = &remote->fetch.items[i]; + struct strbuf new_dst = STRBUF_INIT; + size_t ignore_len = 0; + + if (rsi->negative) { + strvec_push(&child.args, remote->fetch.raw[i]); + continue; + } + + refspec_item_init(&replace, remote->fetch.raw[i], 1); + + /* + * If a refspec dst starts with "refs/" at the start, + * then we will replace "refs/" with "refs/prefetch/". + * Otherwise, we will prepend the dst string with + * "refs/prefetch/". + */ + if (!strncmp(replace.dst, "refs/", 5)) + ignore_len = 5; + + strbuf_addstr(&new_dst, "refs/prefetch/"); + strbuf_addstr(&new_dst, replace.dst + ignore_len); + free(replace.dst); + replace.dst = strbuf_detach(&new_dst, NULL); + + strvec_push(&child.args, refspec_item_format(&replace)); + + refspec_item_clear(&replace); + } return !!run_command(&child); } diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index fc2315edec11..3366ea188782 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -142,20 +142,51 @@ test_expect_success 'prefetch multiple remotes' ' test_commit -C clone2 two && GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && - test_subcommand git fetch remote1 $fetchargs +refs/heads/*:refs/prefetch/remote1/* <run-prefetch.txt && - test_subcommand git fetch remote2 $fetchargs +refs/heads/*:refs/prefetch/remote2/* <run-prefetch.txt && + test_subcommand git fetch remote1 $fetchargs +refs/heads/*:refs/prefetch/remotes/remote1/* <run-prefetch.txt && + test_subcommand git fetch remote2 $fetchargs +refs/heads/*:refs/prefetch/remotes/remote2/* <run-prefetch.txt && test_path_is_missing .git/refs/remotes && - git log prefetch/remote1/one && - git log prefetch/remote2/two && + git log prefetch/remotes/remote1/one && + git log prefetch/remotes/remote2/two && git fetch --all && - test_cmp_rev refs/remotes/remote1/one refs/prefetch/remote1/one && - test_cmp_rev refs/remotes/remote2/two refs/prefetch/remote2/two && + test_cmp_rev refs/remotes/remote1/one refs/prefetch/remotes/remote1/one && + test_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two && test_cmp_config refs/prefetch/ log.excludedecoration && git log --oneline --decorate --all >log && ! grep "prefetch" log ' +test_expect_success 'prefetch custom refspecs' ' + git -C clone1 branch -f special/fetched HEAD && + git -C clone1 branch -f special/secret/not-fetched HEAD && + + # create multiple refspecs for remote1 + git config --add remote.remote1.fetch +refs/heads/special/fetched:refs/heads/fetched && + git config --add remote.remote1.fetch ^refs/heads/special/secret/not-fetched && + + GIT_TRACE2_EVENT="$(pwd)/prefetch-refspec.txt" git maintenance run --task=prefetch 2>/dev/null && + + fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && + + # skips second refspec because it is not a pattern type + rs1="+refs/heads/*:refs/prefetch/remotes/remote1/*" && + rs2="+refs/heads/special/fetched:refs/prefetch/heads/fetched" && + rs3="^refs/heads/special/secret/not-fetched" && + + test_subcommand git fetch remote1 $fetchargs $rs1 $rs2 $rs3 <prefetch-refspec.txt && + test_subcommand git fetch remote2 $fetchargs +refs/heads/*:refs/prefetch/remotes/remote2/* <prefetch-refspec.txt && + + # first refspec is overridden by second + test_must_fail git rev-parse refs/prefetch/special/fetched && + git rev-parse refs/prefetch/heads/fetched && + + # possible incorrect places for the non-fetched ref + test_must_fail git rev-parse refs/prefetch/remotes/remote1/secret/not-fetched && + test_must_fail git rev-parse refs/prefetch/remotes/remote1/not-fetched && + test_must_fail git rev-parse refs/heads/secret/not-fetched && + test_must_fail git rev-parse refs/heads/not-fetched +' + test_expect_success 'prefetch and existing log.excludeDecoration values' ' git config --unset-all log.excludeDecoration && git config log.excludeDecoration refs/remotes/remote1/ && -- gitgitgadget
On Fri, Apr 02, 2021 at 04:43:16PM -0400, Derrick Stolee wrote: > On 4/2/2021 2:27 PM, Tom Saeger wrote: > > On Thu, Apr 01, 2021 at 06:25:36PM -0400, Derrick Stolee wrote: > >> On 4/1/2021 4:14 PM, Junio C Hamano wrote: > >>> Derrick Stolee <stolee@gmail.com> writes: > >>> > >>>> On 4/1/2021 2:49 PM, Tom Saeger wrote: > >>> > >>> So, redirecting the right-hand of configured refspec is a good idea; > >>> not copying the left-hand of configured refspec, and unconditionally > >>> using "refs/heads/*" is not. > >> > >> This makes sense as a way to augment the feature. It doesn't seem > >> like a common scenario, but it would be good for users to have > >> that flexibility. > > > > It's common for me, especially on repos requiring 'maintenance'. > > I'm sure that once this is a tool in your belt, then it becomes > common. The number of users who think about refspecs is likely a > small proportion. But features should work as well as they can > for as many users as possible. There's a way forward here, it > just is a little tricky due to the generality of refspecs. > > >> Upon initial inspection, it shouldn't be too much work. However, > >> there is some generality to the refspec that might not be wholly > >> appropriate for prefetch (such as the exact_sha1 option). I'm > >> unfamiliar with the advanced forms of the refspec, so it'll take > >> some time to have confidence in this approach. > > > > Didn't know about exact_sha1. prefetch probably wouldn't do > > anything in that case? > > My guess is that those should be dropped and ignored. But > maybe the approach below will still work? > > > 'negative' refspecs - hmm haven't tried those. I see how that might > > complicate things or maybe not. > > > > generally isn't it still changing the right-hand side of refspec? > > > > replacing ":refs/" with ":refs/prefetch/" > > Right, this substring replacement might be easiest to achieve. The > 'struct refspec' doesn't make it incredibly easy. Perhaps skipping > the refspec parsing and just doing that substring swap directly from > the config value might be the best approach. > > > This would still work for refspecs with negative patterns right? > > One of the issues is that negative patterns have no ":refs/" > substring. > > The other issue is that exact matches (no "*") have an exact > string in the destination, too, so replacing the _entire_ > destination with "refs/prefetch/<remote>/*" breaks the refspec. > I think the substring approach will still work here. > > > I'm willing to help with/test/review this, thanks for investigating. > I have a branch available [1], but I'm seeing some failures only > on FreeBSD [2] and I can't understand why that platform is failing > this test. The current version (as of this writing) does not do > the substring replacement technique, and hence it just gives up > on exact matches. I will try the substring approach as an > alternative and see where that gets me. I also worked up a patch, not nearly as elegant as yours, but it did work. I didn't think about changing fetch_remote to take struct remote like what you've done. Thanks - I'll give this a try. --Tom > > [1] https://github.com/gitgitgadget/git/pull/924 > [2] https://github.com/gitgitgadget/git/pull/924/checks?check_run_id=2256079534 > > Thanks, > -Stolee
On 4/2/2021 2:27 PM, Tom Saeger wrote: > On Thu, Apr 01, 2021 at 06:25:36PM -0400, Derrick Stolee wrote: >> On 4/1/2021 4:14 PM, Junio C Hamano wrote: >>> Derrick Stolee <stolee@gmail.com> writes: >>> >>>> On 4/1/2021 2:49 PM, Tom Saeger wrote: >>> >>> So, redirecting the right-hand of configured refspec is a good idea; >>> not copying the left-hand of configured refspec, and unconditionally >>> using "refs/heads/*" is not. >> >> This makes sense as a way to augment the feature. It doesn't seem >> like a common scenario, but it would be good for users to have >> that flexibility. > > It's common for me, especially on repos requiring 'maintenance'. I'm sure that once this is a tool in your belt, then it becomes common. The number of users who think about refspecs is likely a small proportion. But features should work as well as they can for as many users as possible. There's a way forward here, it just is a little tricky due to the generality of refspecs. >> Upon initial inspection, it shouldn't be too much work. However, >> there is some generality to the refspec that might not be wholly >> appropriate for prefetch (such as the exact_sha1 option). I'm >> unfamiliar with the advanced forms of the refspec, so it'll take >> some time to have confidence in this approach. > > Didn't know about exact_sha1. prefetch probably wouldn't do > anything in that case? My guess is that those should be dropped and ignored. But maybe the approach below will still work? > 'negative' refspecs - hmm haven't tried those. I see how that might > complicate things or maybe not. > > generally isn't it still changing the right-hand side of refspec? > > replacing ":refs/" with ":refs/prefetch/" Right, this substring replacement might be easiest to achieve. The 'struct refspec' doesn't make it incredibly easy. Perhaps skipping the refspec parsing and just doing that substring swap directly from the config value might be the best approach. > This would still work for refspecs with negative patterns right? One of the issues is that negative patterns have no ":refs/" substring. The other issue is that exact matches (no "*") have an exact string in the destination, too, so replacing the _entire_ destination with "refs/prefetch/<remote>/*" breaks the refspec. I think the substring approach will still work here. > I'm willing to help with/test/review this, thanks for investigating. I have a branch available [1], but I'm seeing some failures only on FreeBSD [2] and I can't understand why that platform is failing this test. The current version (as of this writing) does not do the substring replacement technique, and hence it just gives up on exact matches. I will try the substring approach as an alternative and see where that gets me. [1] https://github.com/gitgitgadget/git/pull/924 [2] https://github.com/gitgitgadget/git/pull/924/checks?check_run_id=2256079534 Thanks, -Stolee
On Thu, Apr 01, 2021 at 06:25:36PM -0400, Derrick Stolee wrote: > On 4/1/2021 4:14 PM, Junio C Hamano wrote: > > Derrick Stolee <stolee@gmail.com> writes: > > > >> On 4/1/2021 2:49 PM, Tom Saeger wrote: > >>> I've recently setup git maintenance and noticed prefetch task > >>> fetches ALL remote refs (well not tags) and does not honor > >>> remote fetch config settings. > >> > >> This is intentional. The point is to get the latest objects > >> without modifying any local copies of refs. You still need > >> to run "git fetch" manually to update the refs, but that > >> should be faster because you have most of the objects already > >> in your copy of the repository. > > > > You answered only half of the question, I think. > > You are right. Thanks, both, for pointing that out. > > > The plain vanilla refspec after you clone would be > > > > [remote "origin"] > > fetch = +refs/heads/*:refs/remotes/origin/* > > > > and "maintenance prefetch" intentionally redirect the destination > > part away from refs/remotes/origin/ to avoid disrupting the > > reference to @{upstream} etc. that are used locally. And > > intentionally doing so is good. > > > > But imagine you are tracking my 'todo' branch which has nothing > > common with the history of Git. You'd have > > > > [remote "origin"] > > url = git://git.kernel.org/pub/scm/git/git.git > > fetch = +refs/heads/todo:refs/remotes/origin/todo > > > > If "maintenance prefetch" does "+refs/heads/*:refs/prefetch/origin/*", > > you'd end up the history of Git, which is not interesting for you who > > are only interested in the 'todo' branch (to be checked out in the > > Meta subdirectory to use Meta/cook script or read Meta/whats-cooking.txt > > file). > > > > So, redirecting the right-hand of configured refspec is a good idea; > > not copying the left-hand of configured refspec, and unconditionally > > using "refs/heads/*" is not. > > This makes sense as a way to augment the feature. It doesn't seem > like a common scenario, but it would be good for users to have > that flexibility. It's common for me, especially on repos requiring 'maintenance'. > > Upon initial inspection, it shouldn't be too much work. However, > there is some generality to the refspec that might not be wholly > appropriate for prefetch (such as the exact_sha1 option). I'm > unfamiliar with the advanced forms of the refspec, so it'll take > some time to have confidence in this approach. Didn't know about exact_sha1. prefetch probably wouldn't do anything in that case? 'negative' refspecs - hmm haven't tried those. I see how that might complicate things or maybe not. generally isn't it still changing the right-hand side of refspec? replacing ":refs/" with ":refs/prefetch/" This would still work for refspecs with negative patterns right? I'm willing to help with/test/review this, thanks for investigating. > > Thanks, > -Stolee
On Tue, Feb 23, 2021 at 03:13:32PM -0800, Junio C Hamano wrote: > When we added a syntax sugar "git push remote --delete <ref>" to > "git push" as a synonym to the canonical "git push remote :<ref>" > syntax at f517f1f2 (builtin-push: add --delete as syntactic sugar > for :foo, 2009-12-30), we weren't careful enough to make sure that > <ref> is not empty. > > Blindly rewriting "--delete <ref>" to ":<ref>" means that an empty > string <ref> results in refspec ":", which is the syntax to ask for > "matching" push that does not delete anything. > > Worse yet, if there were matching refs that can be fast-forwarded, > they would have been published prematurely, even if the user feels > that they are not ready yet to be pushed out, which would be a real > disaster. > > Noticed-by: Tilman Vogel <tilman.vogel@web.de> > Signed-off-by: Junio C Hamano <gitster@pobox.com> > --- > > * So this time with an obvious test. It is somewhat surprising > that this has been left unnoticed for the past 10 years. Thanks, this looks like the obviously correct fix. I'm not too surprised that nobody noticed. You have to add quoting to get an empty-string argument in shell, and the non-delete case does notice and complain. I did wonder if this was related to recent refactoring around the refspec code (like negative refspecs), but I think this function is independent of that anyway. Thanks for tracking down the original culprit. > diff --git a/builtin/push.c b/builtin/push.c > index 03adb58602..194967ed79 100644 > --- a/builtin/push.c > +++ b/builtin/push.c > @@ -115,7 +115,7 @@ static void set_refspecs(const char **refs, int nr, const char *repo) > else > refspec_appendf(&rs, "refs/tags/%s", ref); > } else if (deleterefs) { > - if (strchr(ref, ':')) > + if (strchr(ref, ':') || !*ref) > die(_("--delete only accepts plain target ref names")); > refspec_appendf(&rs, ":%s", ref); > } else if (!strchr(ref, ':')) { Just wondering if there are other similar bugs lurking: - could we see other strings that aren't empty, but also aren't plain target ref names? E.g., other punctuation like a "^" negative refspec? I guess that would produce ":^", which the refspec code will catch. - likewise, do any of these other else clauses blindly pass around an empty string? Yes, the final one does, but we catch it later in the refspec code. So I think it really is this "blindly prepend a colon" part that is the real bug. Anything else would create a nonsense refspec that will be caught by the refspec code. -Peff
On Mon, Dec 21, 2020 at 8:01 PM Nipunn Koorapati via GitGitGadget <gitgitgadget@gmail.com> wrote: > > From: Nipunn Koorapati <nipunn@dropbox.com> > > The logic added to check for negative pathspec match by c0192df630 > (refspec: add support for negative refspecs, 2020-09-30) looks at > refspec->src assuming it is never NULL, however when > remote.origin.push is set to ":", then refspec->src is NULL, > causing a segfault within strcmp. > > Tell git to handle matching refspec by adding the needle to the > set of positively matched refspecs, since matching ":" refspecs > match anything as src. > This seems like the right approach to me. Thanks for the fix, and the tests so we don't break it on accident again in the future. belated, but.... Reviewed-by: Jacob Keller <jacob.keller@gmail.com> > Add test for matching refspec pushes fetch-negative-refspec > both individually and in combination with a negative refspec. > > Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> > --- > remote.c | 10 ++++-- > t/t5582-fetch-negative-refspec.sh | 51 +++++++++++++++++++++++++++++++ > 2 files changed, 58 insertions(+), 3 deletions(-) > > diff --git a/remote.c b/remote.c > index 8be67f0892b..4f1a4099f1a 100644 > --- a/remote.c > +++ b/remote.c > @@ -751,9 +751,13 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite > > if (match_name_with_pattern(key, needle, value, &expn_name)) > string_list_append_nodup(&reversed, expn_name); > - } else { > - if (!strcmp(needle, refspec->src)) > - string_list_append(&reversed, refspec->src); > + } else if (refspec->matching) { > + /* For the special matching refspec, any query should match */ > + string_list_append(&reversed, needle); Right, so we explicitly handle matching first... > + } else if (!refspec->src) { > + BUG("refspec->src should not be null here"); and then carefully check to make sure we don't end up with a NULL src for some other reason, and at least BUG() instead of just crashing. This shouldn't be possible because when we build the refspec, src is always not NULL unless in the case of matching. Ok. > + } else if (!strcmp(needle, refspec->src)) { > + string_list_append(&reversed, refspec->src); > } > } Yep, this looks like the best approach to solving this. > > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > index 8c61e28fec8..2f3b064d0e7 100755 > --- a/t/t5582-fetch-negative-refspec.sh > +++ b/t/t5582-fetch-negative-refspec.sh > @@ -186,4 +186,55 @@ test_expect_success "fetch --prune with negative refspec" ' > ) > ' > > +test_expect_success "push with matching : and negative refspec" ' > + # Manually handle cleanup, since test_config is not > + # prepared to take arbitrary options like --add > + test_when_finished "test_unconfig -C two remote.one.push" && > + > + # For convenience, we use "master" to refer to the name of > + # the branch created by default in the following. > + # > + # Repositories two and one have branches other than "master" > + # but they have no overlap---"master" is the only one that > + # is shared between them. And the master branch at two is > + # behind the master branch at one by one commit. > + git -C two config --add remote.one.push : && > + > + # A matching push tries to update master, fails due to non-ff > + test_must_fail git -C two push one && > + > + # "master" may actually not be "master"---find it out. > + current=$(git symbolic-ref HEAD) && > + > + # If master is in negative refspec, then the command will not attempt > + # to push and succeed. > + git -C two config --add remote.one.push "^$current" && > + > + # With "master" excluded, this push is a no-op. Nothing gets > + # pushed and it succeeds. > + git -C two push -v one > +' > + > +test_expect_success "push with matching +: and negative refspec" ' > + test_when_finished "test_unconfig -C two remote.one.push" && > + > + # The same set-up as above, whose side-effect was a no-op. > + git -C two config --add remote.one.push +: && > + > + # The push refuses to update the "master" branch that is checked > + # out in the "one" repository, even when it is forced with +: > + test_must_fail git -C two push one && > + > + # "master" may actually not be "master"---find it out. > + current=$(git symbolic-ref HEAD) && > + > + # If master is in negative refspec, then the command will not attempt > + # to push and succeed > + git -C two config --add remote.one.push "^$current" && > + > + # With "master" excluded, this push is a no-op. Nothing gets > + # pushed and it succeeds. > + git -C two push -v one > +' > + > test_done > -- > gitgitgadget >
Hello, I found an issue with git and wanted to report this. Here is the filled result from `git bugreport` (sorry for the intermixed German, but I think the English statements should suffice to understand the issue). Vielen Dank für das Ausfüllen eines Git-Fehlerberichts! Bitte antworten Sie auf die folgenden Fragen, um uns dabei zu helfen, Ihr Problem zu verstehen. Was haben Sie gemacht, bevor der Fehler auftrat? (Schritte, um Ihr Fehler zu reproduzieren) 1. I have configured a remote `upstream` with a refspec like `+refs/heads/ *:refs/upstream/heads/*`. 2. I have fetched remote `upstream` fetching two branches `foo` and `bar`. 3. I add another line to `.git/config` with a negative refspec ``` fetch = ^refs/heads/bar ``` 4. I called `git fetch upstream` and `git remote prune upstream`. 5. Remove the refspec from step 2 in `.git/config` with some arbitrary names (e.g. `+refs/heads/baz:refs/upstream/heads/baz`), keep the negative refspec as it is 6. Fetch and prune (see step 4) 7. Undo step 5 and restore the original state as after step 3 8. Fetch and prune (see step 4) Was haben Sie erwartet, was passieren soll? (Erwartetes Verhalten) Expected behavior: After the fetch in step 2 both branches are mirrored locally. After the prune in line 4 the branch `bar` is dropped from the remotely fetched branches. After step 6 both both remote branches `foo` and `bar` are no longer visible. A possible error about unmatching branch `baz`. After step 8 again a remote branch `foo` is existing. Was ist stattdessen passiert? (Wirkliches Verhalten) Real behavior: After step 2: As intended After step 4: Both remote branches are still visible. Nothing is pruned. After step 6: Both remote branches are gone. After step 8: Only `foo` is existing/fetched as remote branch. Was ist der Unterschied zwischen dem, was Sie erwartet haben und was wirklich passiert ist? The difference of real and ideal behavior: The difference is that after step 4 the remote branch `bar` is not pruned. Sonstige Anmerkungen, die Sie hinzufügen möchten: The steps 5~8 are there to verify the negative pathspec is working in general. Fetching freshly takes the negativbe pathspec into account. So the problem is within the pruning code. [System Info] git Version: git version 2.30.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.10.10-arch1-1 #1 SMP PREEMPT Sat, 23 Jan 2021 23:59:48 +0000 x86_64 Compiler Info: gnuc: 10.2 libc Info: glibc: 2.33 $SHELL (typically, interactive shell): /bin/bash [Aktivierte Hooks] Thank you for looking into this. Christian
From: Nipunn Koorapati <nipunn@dropbox.com> Comment did not adequately explain how the two loops work together to achieve the goal of querying for matching of any negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remote.c b/remote.c index 4f1a4099f1a..4d150a316ed 100644 --- a/remote.c +++ b/remote.c @@ -736,6 +736,12 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite * item uses the destination. To handle this, we apply pattern * refspecs in reverse to figure out if the query source matches any * of the negative refspecs. + * + * The first loop finds and expands all positive refspecs + * matched by the queried ref. + * + * The second loop checks if any of the results of the first loop + * match any negative refspec. */ for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; -- gitgitgadget
From: Nipunn Koorapati <nipunn@dropbox.com> The logic added to check for negative pathspec match by c0192df630 (refspec: add support for negative refspecs, 2020-09-30) looks at refspec->src assuming it is never NULL, however when remote.origin.push is set to ":", then refspec->src is NULL, causing a segfault within strcmp. Tell git to handle matching refspec by adding the needle to the set of positively matched refspecs, since matching ":" refspecs match anything as src. Add test for matching refspec pushes fetch-negative-refspec both individually and in combination with a negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 10 ++++-- t/t5582-fetch-negative-refspec.sh | 51 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/remote.c b/remote.c index 8be67f0892b..4f1a4099f1a 100644 --- a/remote.c +++ b/remote.c @@ -751,9 +751,13 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite if (match_name_with_pattern(key, needle, value, &expn_name)) string_list_append_nodup(&reversed, expn_name); - } else { - if (!strcmp(needle, refspec->src)) - string_list_append(&reversed, refspec->src); + } else if (refspec->matching) { + /* For the special matching refspec, any query should match */ + string_list_append(&reversed, needle); + } else if (!refspec->src) { + BUG("refspec->src should not be null here"); + } else if (!strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); } } diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 8c61e28fec8..2f3b064d0e7 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -186,4 +186,55 @@ test_expect_success "fetch --prune with negative refspec" ' ) ' +test_expect_success "push with matching : and negative refspec" ' + # Manually handle cleanup, since test_config is not + # prepared to take arbitrary options like --add + test_when_finished "test_unconfig -C two remote.one.push" && + + # For convenience, we use "master" to refer to the name of + # the branch created by default in the following. + # + # Repositories two and one have branches other than "master" + # but they have no overlap---"master" is the only one that + # is shared between them. And the master branch at two is + # behind the master branch at one by one commit. + git -C two config --add remote.one.push : && + + # A matching push tries to update master, fails due to non-ff + test_must_fail git -C two push one && + + # "master" may actually not be "master"---find it out. + current=$(git symbolic-ref HEAD) && + + # If master is in negative refspec, then the command will not attempt + # to push and succeed. + git -C two config --add remote.one.push "^$current" && + + # With "master" excluded, this push is a no-op. Nothing gets + # pushed and it succeeds. + git -C two push -v one +' + +test_expect_success "push with matching +: and negative refspec" ' + test_when_finished "test_unconfig -C two remote.one.push" && + + # The same set-up as above, whose side-effect was a no-op. + git -C two config --add remote.one.push +: && + + # The push refuses to update the "master" branch that is checked + # out in the "one" repository, even when it is forced with +: + test_must_fail git -C two push one && + + # "master" may actually not be "master"---find it out. + current=$(git symbolic-ref HEAD) && + + # If master is in negative refspec, then the command will not attempt + # to push and succeed + git -C two config --add remote.one.push "^$current" && + + # With "master" excluded, this push is a no-op. Nothing gets + # pushed and it succeeds. + git -C two push -v one +' + test_done -- gitgitgadget
If remote.origin.push was set to ":", git segfaults during a push operation, due to bad parsing logic in query_matches_negative_refspec. Per bisect, the bug was introduced in: c0192df630 (refspec: add support for negative refspecs, 2020-09-30) We found this issue when rolling out git 2.29 at Dropbox - as several folks had "push = :" in their configuration. I based my diff off the master branch, but also confirmed that it patches cleanly onto maint - if the maintainers would like to also fix the segfault on 2.29 Update since Patch series V1: * Handled matching refspec explicitly * Added testing for "+:" case * Added comment explaining how the two loops work together Update since Patch series V2 * style suggestion in remote.c * Use test_config * Add test for a case with a matching refspec + negative refspec * Fix test_config to work with --add * Updated commit message to describe what git is told to do instead of segfaulting Update since Patch series V3 * Removed commit modifying test_config * Remove segfault-related comments in test * Consolidate the three tests to two tests (1st and 3rd test overlapped in functionality) * Base the patch series on the maint branch - since the bug affects 2.29.2 Update since Patch series V4 * Squashed in Junio's patch to handle non-master named branches * Explicitly use test_unconfig Appreciate the reviews from Junio and Eric! Happy Holidays! Nipunn Koorapati (2): negative-refspec: fix segfault on : refspec negative-refspec: improve comment on query_matches_negative_refspec remote.c | 16 ++++++++-- t/t5582-fetch-negative-refspec.sh | 51 +++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) base-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-820%2Fnipunn1313%2Fnk%2Fpush-refspec-segfault-v5 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-820/nipunn1313/nk/push-refspec-segfault-v5 Pull-Request: https://github.com/gitgitgadget/git/pull/820 Range-diff vs v4: 1: e59ff29bdef ! 1: 48c79dc3d84 negative-refspec: fix segfault on : refspec @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "fetch --prune with negat ' +test_expect_success "push with matching : and negative refspec" ' -+ test_config -C two remote.one.push : && -+ # Fails to push master w/ tip behind counterpart ++ # Manually handle cleanup, since test_config is not ++ # prepared to take arbitrary options like --add ++ test_when_finished "test_unconfig -C two remote.one.push" && ++ ++ # For convenience, we use "master" to refer to the name of ++ # the branch created by default in the following. ++ # ++ # Repositories two and one have branches other than "master" ++ # but they have no overlap---"master" is the only one that ++ # is shared between them. And the master branch at two is ++ # behind the master branch at one by one commit. ++ git -C two config --add remote.one.push : && ++ ++ # A matching push tries to update master, fails due to non-ff + test_must_fail git -C two push one && + ++ # "master" may actually not be "master"---find it out. ++ current=$(git symbolic-ref HEAD) && ++ + # If master is in negative refspec, then the command will not attempt + # to push and succeed. -+ # We do not need test_config here as we are updating remote.one.push -+ # again. The teardown of the first test_config will do --unset-all -+ git -C two config --add remote.one.push ^refs/heads/master && -+ git -C two push one ++ git -C two config --add remote.one.push "^$current" && ++ ++ # With "master" excluded, this push is a no-op. Nothing gets ++ # pushed and it succeeds. ++ git -C two push -v one +' + +test_expect_success "push with matching +: and negative refspec" ' -+ test_config -C two remote.one.push +: && -+ # Fails to push master w/ tip behind counterpart ++ test_when_finished "test_unconfig -C two remote.one.push" && ++ ++ # The same set-up as above, whose side-effect was a no-op. ++ git -C two config --add remote.one.push +: && ++ ++ # The push refuses to update the "master" branch that is checked ++ # out in the "one" repository, even when it is forced with +: + test_must_fail git -C two push one && + ++ # "master" may actually not be "master"---find it out. ++ current=$(git symbolic-ref HEAD) && ++ + # If master is in negative refspec, then the command will not attempt + # to push and succeed -+ git -C two config --add remote.one.push ^refs/heads/master && -+ git -C two push one ++ git -C two config --add remote.one.push "^$current" && ++ ++ # With "master" excluded, this push is a no-op. Nothing gets ++ # pushed and it succeeds. ++ git -C two push -v one +' + test_done 2: 20575407cc0 = 2: 1f9af0e991c negative-refspec: improve comment on query_matches_negative_refspec -- gitgitgadget
If remote.origin.push was set to ":", git segfaults during a push operation, due to bad parsing logic in query_matches_negative_refspec. Per bisect, the bug was introduced in: c0192df630 (refspec: add support for negative refspecs, 2020-09-30) We found this issue when rolling out git 2.29 at Dropbox - as several folks had "push = :" in their configuration. I based my diff off the master branch, but also confirmed that it patches cleanly onto maint - if the maintainers would like to also fix the segfault on 2.29 Update since Patch series V1: * Handled matching refspec explicitly * Added testing for "+:" case * Added comment explaining how the two loops work together Update since Patch series V2 * style suggestion in remote.c * Use test_config * Add test for a case with a matching refspec + negative refspec * Fix test_config to work with --add * Updated commit message to describe what git is told to do instead of segfaulting Update since Patch series V3 * Removed commit modifying test_config * Remove segfault-related comments in test * Consolidate the three tests to two tests (1st and 3rd test overlapped in functionality) * Base the patch series on the maint branch - since the bug affects 2.29.2 Appreciate the reviews from Junio and Eric! Happy Holidays! Nipunn Koorapati (2): negative-refspec: fix segfault on : refspec negative-refspec: improve comment on query_matches_negative_refspec remote.c | 16 +++++++++++++--- t/t5582-fetch-negative-refspec.sh | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) base-commit: 898f80736c75878acc02dc55672317fcc0e0a5a6 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-820%2Fnipunn1313%2Fnk%2Fpush-refspec-segfault-v4 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-820/nipunn1313/nk/push-refspec-segfault-v4 Pull-Request: https://github.com/gitgitgadget/git/pull/820 Range-diff vs v3: 1: 733c674bd19 < -: ----------- test-lib-functions: handle --add in test_config 2: 20cff2f5c59 ! 1: e59ff29bdef negative-refspec: fix segfault on : refspec @@ Commit message (refspec: add support for negative refspecs, 2020-09-30) looks at refspec->src assuming it is never NULL, however when remote.origin.push is set to ":", then refspec->src is NULL, - causing a segfault within strcmp + causing a segfault within strcmp. Tell git to handle matching refspec by adding the needle to the set of positively matched refspecs, since matching ":" refspecs match anything as src. - Added testing for matching refspec pushes fetch-negative-refspec - both individually and in combination with a negative refspec + Add test for matching refspec pushes fetch-negative-refspec + both individually and in combination with a negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "fetch --prune with negat ) ' -+test_expect_success "push with matching ':' refspec" ' ++test_expect_success "push with matching : and negative refspec" ' + test_config -C two remote.one.push : && -+ # Fails w/ tip behind counterpart - but should not segfault -+ test_must_fail git -C two push one -+' ++ # Fails to push master w/ tip behind counterpart ++ test_must_fail git -C two push one && + -+test_expect_success "push with matching '+:' refspec" ' -+ test_config -C two remote.one.push +: && -+ # Fails w/ tip behind counterpart - but should not segfault -+ test_must_fail git -C two push one ++ # If master is in negative refspec, then the command will not attempt ++ # to push and succeed. ++ # We do not need test_config here as we are updating remote.one.push ++ # again. The teardown of the first test_config will do --unset-all ++ git -C two config --add remote.one.push ^refs/heads/master && ++ git -C two push one +' + -+test_expect_success "push with matching and negative refspec" ' -+ test_config -C two --add remote.one.push : && ++test_expect_success "push with matching +: and negative refspec" ' ++ test_config -C two remote.one.push +: && + # Fails to push master w/ tip behind counterpart + test_must_fail git -C two push one && + -+ # If master is in negative refspec, then the command will succeed -+ test_config -C two --add remote.one.push ^refs/heads/master && ++ # If master is in negative refspec, then the command will not attempt ++ # to push and succeed ++ git -C two config --add remote.one.push ^refs/heads/master && + git -C two push one +' + 3: 0fd4e9f7459 = 2: 20575407cc0 negative-refspec: improve comment on query_matches_negative_refspec -- gitgitgadget
From: Nipunn Koorapati <nipunn@dropbox.com> Comment did not adequately explain how the two loops work together to achieve the goal of querying for matching of any negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remote.c b/remote.c index 4f1a4099f1a..4d150a316ed 100644 --- a/remote.c +++ b/remote.c @@ -736,6 +736,12 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite * item uses the destination. To handle this, we apply pattern * refspecs in reverse to figure out if the query source matches any * of the negative refspecs. + * + * The first loop finds and expands all positive refspecs + * matched by the queried ref. + * + * The second loop checks if any of the results of the first loop + * match any negative refspec. */ for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; -- gitgitgadget
From: Nipunn Koorapati <nipunn@dropbox.com> The logic added to check for negative pathspec match by c0192df630 (refspec: add support for negative refspecs, 2020-09-30) looks at refspec->src assuming it is never NULL, however when remote.origin.push is set to ":", then refspec->src is NULL, causing a segfault within strcmp. Tell git to handle matching refspec by adding the needle to the set of positively matched refspecs, since matching ":" refspecs match anything as src. Add test for matching refspec pushes fetch-negative-refspec both individually and in combination with a negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 10 +++++++--- t/t5582-fetch-negative-refspec.sh | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/remote.c b/remote.c index 8be67f0892b..4f1a4099f1a 100644 --- a/remote.c +++ b/remote.c @@ -751,9 +751,13 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite if (match_name_with_pattern(key, needle, value, &expn_name)) string_list_append_nodup(&reversed, expn_name); - } else { - if (!strcmp(needle, refspec->src)) - string_list_append(&reversed, refspec->src); + } else if (refspec->matching) { + /* For the special matching refspec, any query should match */ + string_list_append(&reversed, needle); + } else if (!refspec->src) { + BUG("refspec->src should not be null here"); + } else if (!strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); } } diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 8c61e28fec8..a4960c586b1 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -186,4 +186,28 @@ test_expect_success "fetch --prune with negative refspec" ' ) ' +test_expect_success "push with matching : and negative refspec" ' + test_config -C two remote.one.push : && + # Fails to push master w/ tip behind counterpart + test_must_fail git -C two push one && + + # If master is in negative refspec, then the command will not attempt + # to push and succeed. + # We do not need test_config here as we are updating remote.one.push + # again. The teardown of the first test_config will do --unset-all + git -C two config --add remote.one.push ^refs/heads/master && + git -C two push one +' + +test_expect_success "push with matching +: and negative refspec" ' + test_config -C two remote.one.push +: && + # Fails to push master w/ tip behind counterpart + test_must_fail git -C two push one && + + # If master is in negative refspec, then the command will not attempt + # to push and succeed + git -C two config --add remote.one.push ^refs/heads/master && + git -C two push one +' + test_done -- gitgitgadget
On Sun, Dec 20, 2020 at 9:05 PM Nipunn Koorapati via GitGitGadget <gitgitgadget@gmail.com> wrote: > The logic added to check for negative pathspec match by c0192df630 > (refspec: add support for negative refspecs, 2020-09-30) looks at > refspec->src assuming it is never NULL, however when > remote.origin.push is set to ":", then refspec->src is NULL, > causing a segfault within strcmp > > Tell git to handle matching refspec by adding the needle to the > set of positively matched refspecs, since matching ":" refspecs > match anything as src. > > Added testing for matching refspec pushes fetch-negative-refspec s/Added testing/Add test/ > both individually and in combination with a negative refspec > > Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> > --- > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > @@ -186,4 +186,26 @@ test_expect_success "fetch --prune with negative refspec" ' > +test_expect_success "push with matching ':' refspec" ' > + test_config -C two remote.one.push : && > + # Fails w/ tip behind counterpart - but should not segfault > + test_must_fail git -C two push one > +' Nit: It is understood implicitly that Git should not segfault (or indeed any software). That's also implied by use of test_must_fail() which explicitly distinguishes expected failures from unexpected failures (where segfault falls in the category of unexpected failure). Therefore, it doesn't really add value to say "but should not segfault" in the comment. Same observation applies to the other similarly-worded comments in this patch. Not alone worth a re-roll, but perhaps worth changing if you do re-roll.
If remote.origin.push was set to ":", git segfaults during a push operation, due to bad parsing logic in query_matches_negative_refspec. Per bisect, the bug was introduced in: c0192df630 (refspec: add support for negative refspecs, 2020-09-30) We found this issue when rolling out git 2.29 at Dropbox - as several folks had "push = :" in their configuration. I based my diff off the master branch, but also confirmed that it patches cleanly onto maint - if the maintainers would like to also fix the segfault on 2.29 Update since Patch series V1: * Handled matching refspec explicitly * Added testing for "+:" case * Added comment explaining how the two loops work together Update since Patch series V2 * style suggestion in remote.c * Use test_config * Add test for a case with a matching refspec + negative refspec * Fix test_config to work with --add * Updated commit message to describe what git is told to do instead of segfaulting Nipunn Koorapati (3): test-lib-functions: handle --add in test_config negative-refspec: fix segfault on : refspec negative-refspec: improve comment on query_matches_negative_refspec remote.c | 16 +++++++++++++--- t/t5582-fetch-negative-refspec.sh | 22 ++++++++++++++++++++++ t/test-lib-functions.sh | 9 ++++++++- 3 files changed, 43 insertions(+), 4 deletions(-) base-commit: 6d3ef5b467eccd2769f1aa1c555d317d3c8dc707 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-820%2Fnipunn1313%2Fnk%2Fpush-refspec-segfault-v3 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-820/nipunn1313/nk/push-refspec-segfault-v3 Pull-Request: https://github.com/gitgitgadget/git/pull/820 Range-diff vs v2: -: ----------- > 1: 733c674bd19 test-lib-functions: handle --add in test_config 1: e42200b644a ! 2: 20cff2f5c59 negative-refspec: fix segfault on : refspec @@ Commit message remote.origin.push is set to ":", then refspec->src is NULL, causing a segfault within strcmp - Added testing for this case in fetch-negative-refspec + Tell git to handle matching refspec by adding the needle to the + set of positively matched refspecs, since matching ":" refspecs + match anything as src. + + Added testing for matching refspec pushes fetch-negative-refspec + both individually and in combination with a negative refspec Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> @@ remote.c: static int query_matches_negative_refspec(struct refspec *rs, struct r + } else if (refspec->matching) { + /* For the special matching refspec, any query should match */ + string_list_append(&reversed, needle); -+ } else if (refspec->src == NULL) { ++ } else if (!refspec->src) { + BUG("refspec->src should not be null here"); + } else if (!strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "fetch --prune with negat ' +test_expect_success "push with matching ':' refspec" ' -+ ( -+ cd two && -+ git config remote.one.push : && -+ # Fails w/ tip behind counterpart - but should not segfault -+ test_must_fail git push one master && ++ test_config -C two remote.one.push : && ++ # Fails w/ tip behind counterpart - but should not segfault ++ test_must_fail git -C two push one ++' ++ ++test_expect_success "push with matching '+:' refspec" ' ++ test_config -C two remote.one.push +: && ++ # Fails w/ tip behind counterpart - but should not segfault ++ test_must_fail git -C two push one ++' + -+ git config remote.one.push +: && -+ # Fails w/ tip behind counterpart - but should not segfault -+ test_must_fail git push one master && ++test_expect_success "push with matching and negative refspec" ' ++ test_config -C two --add remote.one.push : && ++ # Fails to push master w/ tip behind counterpart ++ test_must_fail git -C two push one && + -+ git config --unset remote.one.push -+ ) ++ # If master is in negative refspec, then the command will succeed ++ test_config -C two --add remote.one.push ^refs/heads/master && ++ git -C two push one +' + test_done 2: 8da8d9cd1c5 = 3: 0fd4e9f7459 negative-refspec: improve comment on query_matches_negative_refspec -- gitgitgadget
From: Nipunn Koorapati <nipunn@dropbox.com> Comment did not adequately explain how the two loops work together to achieve the goal of querying for matching of any negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remote.c b/remote.c index 7323694b163..c3f85c17ca7 100644 --- a/remote.c +++ b/remote.c @@ -736,6 +736,12 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite * item uses the destination. To handle this, we apply pattern * refspecs in reverse to figure out if the query source matches any * of the negative refspecs. + * + * The first loop finds and expands all positive refspecs + * matched by the queried ref. + * + * The second loop checks if any of the results of the first loop + * match any negative refspec. */ for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; -- gitgitgadget
From: Nipunn Koorapati <nipunn@dropbox.com> The logic added to check for negative pathspec match by c0192df630 (refspec: add support for negative refspecs, 2020-09-30) looks at refspec->src assuming it is never NULL, however when remote.origin.push is set to ":", then refspec->src is NULL, causing a segfault within strcmp Tell git to handle matching refspec by adding the needle to the set of positively matched refspecs, since matching ":" refspecs match anything as src. Added testing for matching refspec pushes fetch-negative-refspec both individually and in combination with a negative refspec Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 10 +++++++--- t/t5582-fetch-negative-refspec.sh | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/remote.c b/remote.c index 9f2450cb51b..7323694b163 100644 --- a/remote.c +++ b/remote.c @@ -751,9 +751,13 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite if (match_name_with_pattern(key, needle, value, &expn_name)) string_list_append_nodup(&reversed, expn_name); - } else { - if (!strcmp(needle, refspec->src)) - string_list_append(&reversed, refspec->src); + } else if (refspec->matching) { + /* For the special matching refspec, any query should match */ + string_list_append(&reversed, needle); + } else if (!refspec->src) { + BUG("refspec->src should not be null here"); + } else if (!strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); } } diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 8c61e28fec8..30209e98a62 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -186,4 +186,26 @@ test_expect_success "fetch --prune with negative refspec" ' ) ' +test_expect_success "push with matching ':' refspec" ' + test_config -C two remote.one.push : && + # Fails w/ tip behind counterpart - but should not segfault + test_must_fail git -C two push one +' + +test_expect_success "push with matching '+:' refspec" ' + test_config -C two remote.one.push +: && + # Fails w/ tip behind counterpart - but should not segfault + test_must_fail git -C two push one +' + +test_expect_success "push with matching and negative refspec" ' + test_config -C two --add remote.one.push : && + # Fails to push master w/ tip behind counterpart + test_must_fail git -C two push one && + + # If master is in negative refspec, then the command will succeed + test_config -C two --add remote.one.push ^refs/heads/master && + git -C two push one +' + test_done -- gitgitgadget
On Sat, Dec 19, 2020 at 5:00 PM Nipunn Koorapati via GitGitGadget <gitgitgadget@gmail.com> wrote: > The logic added to check for negative pathspec match by c0192df630 > (refspec: add support for negative refspecs, 2020-09-30) looks at > refspec->src assuming it is never NULL, however when > remote.origin.push is set to ":", then refspec->src is NULL, > causing a segfault within strcmp > > Added testing for this case in fetch-negative-refspec A couple minor comments below... > Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> > --- > diff --git a/remote.c b/remote.c > @@ -751,9 +751,13 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite > + } else if (refspec->matching) { > + /* For the special matching refspec, any query should match */ > + string_list_append(&reversed, needle); > + } else if (refspec->src == NULL) { > + BUG("refspec->src should not be null here"); I realize that you copied Junio's example, but style on this project is to write this as: } else if (!refspec->src) { ... > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > @@ -186,4 +186,19 @@ test_expect_success "fetch --prune with negative refspec" ' > +test_expect_success "push with matching ':' refspec" ' > + ( > + cd two && > + git config remote.one.push : && > + # Fails w/ tip behind counterpart - but should not segfault > + test_must_fail git push one master && > + > + git config remote.one.push +: && > + # Fails w/ tip behind counterpart - but should not segfault > + test_must_fail git push one master && > + > + git config --unset remote.one.push > + ) > +' If anything in this test fails prior to the final `git config --unset`, then that cleanup command won't be executed, which might negatively impact tests which follow. To ensure cleanup whether the test succeeds or fails, use test_config(). Unfortunately, test_config() has the limitation that it can't be used in subshells, so you may have to restructure the test a bit, perhaps like this: test_config remote.one.push : && ( cd two && test_must_fail git push one master && git config remote.one.push +: && test_must_fail git push one master ) Driving the test with a for-loop and taking advantage of -C to avoid the subshell is also an option: for v in : +: do test_config -C two remote.one.push $v && test_must_fail git -C two push one master || return 1 done
From: Nipunn Koorapati <nipunn@dropbox.com> Comment did not adequately explain how the two loops work together to achieve the goal of querying for matching of any negative refspec. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remote.c b/remote.c index cbb3113b105..6cdaa8da75a 100644 --- a/remote.c +++ b/remote.c @@ -736,6 +736,12 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite * item uses the destination. To handle this, we apply pattern * refspecs in reverse to figure out if the query source matches any * of the negative refspecs. + * + * The first loop finds and expands all positive refspecs + * matched by the queried ref. + * + * The second loop checks if any of the results of the first loop + * match any negative refspec. */ for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; -- gitgitgadget
Previously, if remote.origin.push was set to ":", git would segfault during a push operation, due to bad parsing logic in query_matches_negative_refspec. Per bisect, the bug was introduced in: c0192df630 (refspec: add support for negative refspecs, 2020-09-30) We found this issue when rolling out git 2.29 at Dropbox - as several folks had "push = :" in their configuration. I based my diff off the master branch, but also confirmed that it patches cleanly onto maint - if the maintainers would like to also fix the segfault on 2.29 Update since Patch series V1: * Handled matching refspec explicitly * Added testing for "+:" case * Added comment explaining how the two loops work together It may be wise to add additional testing for a case with a matching refspec + negative refspec with expected behavior Nipunn Koorapati (2): negative-refspec: fix segfault on : refspec negative-refspec: improve comment on query_matches_negative_refspec remote.c | 16 +++++++++++++--- t/t5582-fetch-negative-refspec.sh | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) base-commit: 6d3ef5b467eccd2769f1aa1c555d317d3c8dc707 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-820%2Fnipunn1313%2Fnk%2Fpush-refspec-segfault-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-820/nipunn1313/nk/push-refspec-segfault-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/820 Range-diff vs v1: 1: 743e848653f ! 1: e42200b644a negative-refspec: fix segfault on : refspec @@ Metadata ## Commit message ## negative-refspec: fix segfault on : refspec - Previously, if remote.origin.push was set to ":", - git would segfault during a push operation, due to bad - parsing logic in query_matches_negative_refspec. Per - bisect, the bug was introduced in: - c0192df630 (refspec: add support for negative refspecs, 2020-09-30) + The logic added to check for negative pathspec match by c0192df630 + (refspec: add support for negative refspecs, 2020-09-30) looks at + refspec->src assuming it is never NULL, however when + remote.origin.push is set to ":", then refspec->src is NULL, + causing a segfault within strcmp Added testing for this case in fetch-negative-refspec @@ remote.c: static int query_matches_negative_refspec(struct refspec *rs, struct r - } else { - if (!strcmp(needle, refspec->src)) - string_list_append(&reversed, refspec->src); -+ } else if (refspec->src != NULL && !strcmp(needle, refspec->src)) { ++ } else if (refspec->matching) { ++ /* For the special matching refspec, any query should match */ ++ string_list_append(&reversed, needle); ++ } else if (refspec->src == NULL) { ++ BUG("refspec->src should not be null here"); ++ } else if (!strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); } } @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "fetch --prune with negat ) ' -+test_expect_success "push with empty refspec" ' ++test_expect_success "push with matching ':' refspec" ' + ( + cd two && + git config remote.one.push : && + # Fails w/ tip behind counterpart - but should not segfault + test_must_fail git push one master && ++ ++ git config remote.one.push +: && ++ # Fails w/ tip behind counterpart - but should not segfault ++ test_must_fail git push one master && ++ + git config --unset remote.one.push + ) +' -: ----------- > 2: 8da8d9cd1c5 negative-refspec: improve comment on query_matches_negative_refspec -- gitgitgadget
From: Nipunn Koorapati <nipunn@dropbox.com> The logic added to check for negative pathspec match by c0192df630 (refspec: add support for negative refspecs, 2020-09-30) looks at refspec->src assuming it is never NULL, however when remote.origin.push is set to ":", then refspec->src is NULL, causing a segfault within strcmp Added testing for this case in fetch-negative-refspec Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- remote.c | 10 +++++++--- t/t5582-fetch-negative-refspec.sh | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/remote.c b/remote.c index 9f2450cb51b..cbb3113b105 100644 --- a/remote.c +++ b/remote.c @@ -751,9 +751,13 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite if (match_name_with_pattern(key, needle, value, &expn_name)) string_list_append_nodup(&reversed, expn_name); - } else { - if (!strcmp(needle, refspec->src)) - string_list_append(&reversed, refspec->src); + } else if (refspec->matching) { + /* For the special matching refspec, any query should match */ + string_list_append(&reversed, needle); + } else if (refspec->src == NULL) { + BUG("refspec->src should not be null here"); + } else if (!strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); } } diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 8c61e28fec8..58b42fabd97 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -186,4 +186,19 @@ test_expect_success "fetch --prune with negative refspec" ' ) ' +test_expect_success "push with matching ':' refspec" ' + ( + cd two && + git config remote.one.push : && + # Fails w/ tip behind counterpart - but should not segfault + test_must_fail git push one master && + + git config remote.one.push +: && + # Fails w/ tip behind counterpart - but should not segfault + test_must_fail git push one master && + + git config --unset remote.one.push + ) +' + test_done -- gitgitgadget
"Nipunn Koorapati via GitGitGadget" <gitgitgadget@gmail.com> writes: > From: Nipunn Koorapati <nipunn@dropbox.com> > > Previously, if remote.origin.push was set to ":", > git would segfault during a push operation, due to bad > parsing logic in query_matches_negative_refspec. Per > bisect, the bug was introduced in: > c0192df630 (refspec: add support for negative refspecs, 2020-09-30) > > Added testing for this case in fetch-negative-refspec Thanks. Our local convention in this project is to write about the status-quo without the patch under discussion in the present tense, and describe the fix as if we are giving orders to the codebase to become like so (or giving orders to the monkeys sitting in front of the keyboard to update the code). I'd explain the "problem description" part of the above perhaps like so: The logic added to check for negative pathspec match by c0192df630 (refspec: add support for negative refspecs, 2020-09-30) looks at refspec->src assuming it never is NULL, but when remote.origin.push is set to ":" (i.e. "matching"), refspec->src is NULL, causing a segfauilt. But stepping back a bit, a "matching" push is saying "if we have branch 'hello', and they also have branch 'hello', push ours to theirs". So if the query is asking about 'hello' (e.g. needle is 'hello'), shouldn't a refspec ":" have the same effect as a refspec "hello:hello", instead of getting ignored like this patch does? Original author of the feature (Jacob) cc'ed for insight. - Can we have refspec->src==NULL in cases other than where refspec->matching is true? If not, then perhaps the patch should insert, before the problematic "else if" clause, something like if (match_name_with_pattern(...)) string_list_append_nodup(...); + } else if (refspec->matching) { + ... behaviour for the matching case ... + } else if (refspec->src == NULL) { + BUG("refspec->src cannot be null here"); } else { if (!strcmp(needle, refspec->src)) - We'd need to decide if ignoring is the right behaviour for the matching refspec. I do not recall what we decided the logic of the function should be offhand. > We found this issue when rolling out git 2.29 at Dropbox - as several > folks had "push = :" in their configuration. I based my diff off the > master branch, but also confirmed that it patches cleanly onto maint - > if the maintainers would like to also fix the segfault on 2.29 Yes, it is very much appreciated you were considerate to base the patch on the maintenance track. We want the code to do with the right thing with ":" matching refspec. > diff --git a/remote.c b/remote.c > index 9f2450cb51b..8ab8d25294c 100644 > --- a/remote.c > +++ b/remote.c > @@ -751,9 +751,8 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite > > if (match_name_with_pattern(key, needle, value, &expn_name)) > string_list_append_nodup(&reversed, expn_name); > - } else { > - if (!strcmp(needle, refspec->src)) > - string_list_append(&reversed, refspec->src); > + } else if (refspec->src != NULL && !strcmp(needle, refspec->src)) { > + string_list_append(&reversed, refspec->src); > } > } > > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh > index 8c61e28fec8..4960378e0b7 100755 > --- a/t/t5582-fetch-negative-refspec.sh > +++ b/t/t5582-fetch-negative-refspec.sh > @@ -186,4 +186,14 @@ test_expect_success "fetch --prune with negative refspec" ' > ) > ' > > +test_expect_success "push with empty refspec" ' s/empty/matching/ (see "git push --help" and look for "The special refspec :"). > + ( > + cd two && > + git config remote.one.push : && > + # Fails w/ tip behind counterpart - but should not segfault > + test_must_fail git push one master && > + git config --unset remote.one.push > + ) > +' > + > test_done > > base-commit: 6d3ef5b467eccd2769f1aa1c555d317d3c8dc707
From: Nipunn Koorapati <nipunn@dropbox.com> Previously, if remote.origin.push was set to ":", git would segfault during a push operation, due to bad parsing logic in query_matches_negative_refspec. Per bisect, the bug was introduced in: c0192df630 (refspec: add support for negative refspecs, 2020-09-30) Added testing for this case in fetch-negative-refspec Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> --- negative-refspec: fix segfault on : refspec Previously, if remote.origin.push was set to ":", git would segfault during a push operation, due to bad parsing logic in query_matches_negative_refspec. Per bisect, the bug was introduced in: c0192df630 (refspec: add support for negative refspecs, 2020-09-30) We found this issue when rolling out git 2.29 at Dropbox - as several folks had "push = :" in their configuration. I based my diff off the master branch, but also confirmed that it patches cleanly onto maint - if the maintainers would like to also fix the segfault on 2.29 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-820%2Fnipunn1313%2Fnk%2Fpush-refspec-segfault-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-820/nipunn1313/nk/push-refspec-segfault-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/820 remote.c | 5 ++--- t/t5582-fetch-negative-refspec.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/remote.c b/remote.c index 9f2450cb51b..8ab8d25294c 100644 --- a/remote.c +++ b/remote.c @@ -751,9 +751,8 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite if (match_name_with_pattern(key, needle, value, &expn_name)) string_list_append_nodup(&reversed, expn_name); - } else { - if (!strcmp(needle, refspec->src)) - string_list_append(&reversed, refspec->src); + } else if (refspec->src != NULL && !strcmp(needle, refspec->src)) { + string_list_append(&reversed, refspec->src); } } diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 8c61e28fec8..4960378e0b7 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -186,4 +186,14 @@ test_expect_success "fetch --prune with negative refspec" ' ) ' +test_expect_success "push with empty refspec" ' + ( + cd two && + git config remote.one.push : && + # Fails w/ tip behind counterpart - but should not segfault + test_must_fail git push one master && + git config --unset remote.one.push + ) +' + test_done base-commit: 6d3ef5b467eccd2769f1aa1c555d317d3c8dc707 -- gitgitgadget
From: Johannes Schindelin <johannes.schindelin@gmx.de> This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -e 's/retsam/niam/g' \ -- t55[4-9]*.sh t556x*) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Note that t5541 uses the reversed `master` name: `retsam`. We replace it by the equivalent for `main`: `niam`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- t/t5540-http-push-webdav.sh | 10 ++-- t/t5541-http-push-smart.sh | 42 +++++++------- t/t5542-push-http-shallow.sh | 10 ++-- t/t5543-atomic-push.sh | 82 +++++++++++++-------------- t/t5545-push-options.sh | 64 ++++++++++----------- t/t5548-push-porcelain.sh | 64 ++++++++++----------- t/t5550-http-fetch-dumb.sh | 22 ++++---- t/t5551-http-fetch-smart.sh | 22 ++++---- t/t5552-skipping-fetch-negotiator.sh | 2 +- t/t5553-set-upstream.sh | 84 ++++++++++++++-------------- t/t5560-http-backend-noserver.sh | 2 +- t/t5561-http-backend.sh | 6 +- t/t556x_common | 8 +-- t/t5570-git-daemon.sh | 18 +++--- t/t5571-pre-push-hook.sh | 6 +- t/t5572-pull-submodule.sh | 4 +- t/t5580-unc-paths.sh | 4 +- t/t5581-http-curl-verbose.sh | 4 +- t/t5582-fetch-negative-refspec.sh | 24 ++++---- 19 files changed, 239 insertions(+), 239 deletions(-) diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh index 751116e123..8b68bb38a4 100755 --- a/t/t5540-http-push-webdav.sh +++ b/t/t5540-http-push-webdav.sh @@ -7,7 +7,7 @@ test_description='test WebDAV http-push This test runs various sanity checks on http-push.' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -74,7 +74,7 @@ test_expect_success 'push already up-to-date' ' test_expect_success 'push to remote repository with unpacked refs' ' (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && rm packed-refs && - git update-ref refs/heads/master $ORIG_HEAD && + git update-ref refs/heads/main $ORIG_HEAD && git --bare update-server-info) && git push && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && @@ -94,7 +94,7 @@ test_expect_success 'http-push fetches unpacked objects' ' git remote rm origin && git reflog expire --expire=0 --all && git prune && - git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git master) + git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git main) ' test_expect_success 'http-push fetches packed objects' ' @@ -114,7 +114,7 @@ test_expect_success 'http-push fetches packed objects' ' git remote remove origin && git reflog expire --expire=0 --all && git prune && - git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master) + git push -f -v $HTTPD_URL/dumb/test_repo_packed.git main) ' test_expect_success 'create and delete remote branch' ' @@ -166,7 +166,7 @@ test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' ' ' test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \ - "$ROOT_PATH"/test_repo_clone master + "$ROOT_PATH"/test_repo_clone main test_expect_success 'push to password-protected repository (user in URL)' ' test_commit pw-user && diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index 2836b87239..bc5ccf233f 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -4,7 +4,7 @@ # test_description='test smart pushing over http via http-backend' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -145,23 +145,23 @@ test_expect_success 'used receive-pack service' ' ' test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \ - "$ROOT_PATH"/test_repo_clone master success + "$ROOT_PATH"/test_repo_clone main success test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' ' # create a dissimilarly-named remote ref so that git is unable to match the # two refs (viz. local, remote) unless an explicit refspec is provided. - git push origin master:retsam && + git push origin main:niam && echo "change changed" > path2 && git commit -a -m path2 --amend && - # push master too; this ensures there is at least one '"'push'"' command to + # push main too; this ensures there is at least one '"'push'"' command to # the remote helper and triggers interaction with the helper. - test_must_fail git push -v origin +master master:retsam >output 2>&1' + test_must_fail git push -v origin +main main:niam >output 2>&1' test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' ' - grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output && - grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output + grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *main -> main (forced update)$" output && + grep "^ ! \[rejected\] *main -> niam (non-fast-forward)$" output ' test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' ' @@ -170,7 +170,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he ' test_expect_success 'push (chunked)' ' - git checkout master && + git checkout main && test_commit commit path3 && HEAD=$(git rev-parse --verify HEAD) && test_config http.postbuffer 4 && @@ -180,9 +180,9 @@ test_expect_success 'push (chunked)' ' test $HEAD = $(git rev-parse --verify HEAD)) ' -## References of remote: atomic1(1) master(2) collateral(2) other(2) -## References of local : atomic2(2) master(1) collateral(3) other(2) collateral1(3) atomic(1) -## Atomic push : master(1) collateral(3) atomic(1) +## References of remote: atomic1(1) main(2) collateral(2) other(2) +## References of local : atomic2(2) main(1) collateral(3) other(2) collateral1(3) atomic(1) +## Atomic push : main(1) collateral(3) atomic(1) test_expect_success 'push --atomic also prevents branch creation, reports collateral' ' # Setup upstream repo - empty for now d=$HTTPD_DOCUMENT_ROOT_PATH/atomic-branches.git && @@ -195,15 +195,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat test_commit atomic2 && git branch collateral && git branch other && - git push "$up" atomic1 master collateral other && + git push "$up" atomic1 main collateral other && git tag -d atomic1 && # collateral is a valid push, but should be failed by atomic push git checkout collateral && test_commit collateral1 && - # Make master incompatible with upstream to provoke atomic - git checkout master && + # Make main incompatible with upstream to provoke atomic + git checkout main && git reset --hard HEAD^ && # Add a new branch which should be failed by atomic push. This is a @@ -211,7 +211,7 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat git branch atomic && # --atomic should cause entire push to be rejected - test_must_fail git push --atomic "$up" master atomic collateral 2>output && + test_must_fail git push --atomic "$up" main atomic collateral 2>output && # the new branch should not have been created upstream test_must_fail git -C "$d" show-ref --verify refs/heads/atomic && @@ -219,15 +219,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat # upstream should still reflect atomic2, the last thing we pushed # successfully git rev-parse atomic2 >expected && - # on master... - git -C "$d" rev-parse refs/heads/master >actual && + # on main... + git -C "$d" rev-parse refs/heads/main >actual && test_cmp expected actual && # ...and collateral. git -C "$d" rev-parse refs/heads/collateral >actual && test_cmp expected actual && # the failed refs should be indicated to the user - grep "^ ! .*rejected.* master -> master" output && + grep "^ ! .*rejected.* main -> main" output && # the collateral failure refs should be indicated to the user grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output && @@ -475,9 +475,9 @@ test_expect_success 'clone/fetch scrubs password from reflogs' ' test_commit prepare-for-force-fetch && git switch -c away && git fetch "$HTTPD_URL_USER_PASS/smart/test_repo.git" \ - +master:master && + +main:main && # should have been scrubbed down to vanilla URL - git log -g master >reflog && + git log -g main >reflog && grep "$HTTPD_URL" reflog && ! grep "$HTTPD_URL_USER_PASS" reflog ' @@ -501,7 +501,7 @@ test_expect_success 'colorize errors/hints' ' cd "$ROOT_PATH"/test_repo_clone && test_must_fail git -c color.transport=always -c color.advice=always \ -c color.push=always \ - push origin origin/master^:master 2>act && + push origin origin/main^:main 2>act && test_decode_color <act >decoded && test_i18ngrep "<RED>.*rejected.*<RESET>" decoded && test_i18ngrep "<RED>error: failed to push some refs" decoded && diff --git a/t/t5542-push-http-shallow.sh b/t/t5542-push-http-shallow.sh index 0feec9c449..c2cc83182f 100755 --- a/t/t5542-push-http-shallow.sh +++ b/t/t5542-push-http-shallow.sh @@ -2,7 +2,7 @@ test_description='push from/to a shallow clone over http' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -54,12 +54,12 @@ test_expect_success 'push to shallow repo via http' ' ( cd full && commit 9 && - git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master + git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main ) && ( cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && git fsck && - git log --format=%s top/master >actual && + git log --format=%s top/main >actual && cat <<EOF >expect && 9 4 @@ -77,11 +77,11 @@ test_expect_success 'push from shallow repo via http' ' git config http.receivepack true ) && commit 10 && - git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master && + git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main && ( cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && git fsck && - git log --format=%s top/master >actual && + git log --format=%s top/main >actual && cat <<EOF >expect && 10 4 diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh index 16a8fc7535..bfee461861 100755 --- a/t/t5543-atomic-push.sh +++ b/t/t5543-atomic-push.sh @@ -2,7 +2,7 @@ test_description='pushing to a repository using the atomic push option' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -43,9 +43,9 @@ test_expect_success 'atomic push works for a single branch' ' test_commit one && git push --mirror up && test_commit two && - git push --atomic up master + git push --atomic up main ) && - test_refs master master + test_refs main main ' test_expect_success 'atomic push works for two branches' ' @@ -58,9 +58,9 @@ test_expect_success 'atomic push works for two branches' ' test_commit two && git checkout second && test_commit three && - git push --atomic up master second + git push --atomic up main second ) && - test_refs master master && + test_refs main main && test_refs second second ' @@ -73,7 +73,7 @@ test_expect_success 'atomic push works in combination with --mirror' ' test_commit two && git push --atomic --mirror up ) && - test_refs master master && + test_refs main main && test_refs second second ' @@ -82,7 +82,7 @@ test_expect_success 'atomic push works in combination with --force' ' ( cd workbench && test_commit one && - git branch second master && + git branch second main && test_commit two_a && git checkout second && test_commit two_b && @@ -90,36 +90,36 @@ test_expect_success 'atomic push works in combination with --force' ' test_commit four && git push --mirror up && # The actual test is below - git checkout master && + git checkout main && test_commit three_a && git checkout second && git reset --hard HEAD^ && - git push --force --atomic up master second + git push --force --atomic up main second ) && - test_refs master master && + test_refs main main && test_refs second second ' -# set up two branches where master can be pushed but second can not +# set up two branches where main can be pushed but second can not # (non-fast-forward). Since second can not be pushed the whole operation -# will fail and leave master untouched. +# will fail and leave main untouched. test_expect_success 'atomic push fails if one branch fails' ' mk_repo_pair && ( cd workbench && test_commit one && - git checkout -b second master && + git checkout -b second main && test_commit two && test_commit three && test_commit four && git push --mirror up && git reset --hard HEAD~2 && test_commit five && - git checkout master && + git checkout main && test_commit six && test_must_fail git push --atomic --all up ) && - test_refs master HEAD@{7} && + test_refs main HEAD@{7} && test_refs second HEAD@{4} ' @@ -129,7 +129,7 @@ test_expect_success 'atomic push fails if one tag fails remotely' ' ( cd workbench && test_commit one && - git checkout -b second master && + git checkout -b second main && test_commit two && git push --mirror up ) && @@ -142,14 +142,14 @@ test_expect_success 'atomic push fails if one tag fails remotely' ' # see if we can now push both branches. ( cd workbench && - git checkout master && + git checkout main && test_commit three && git checkout second && test_commit four && git tag test_tag && - test_must_fail git push --tags --atomic up master second + test_must_fail git push --tags --atomic up main second ) && - test_refs master HEAD@{3} && + test_refs main HEAD@{3} && test_refs second HEAD@{1} ' @@ -158,7 +158,7 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus ( cd workbench && test_commit one && - git checkout -b second master && + git checkout -b second main && test_commit two && git push --mirror up ) && @@ -168,19 +168,19 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus HOOK="$HOOKDIR/update" && mkdir -p "$HOOKDIR" && write_script "$HOOK" <<-\EOF - # only allow update to master from now on - test "$1" = "refs/heads/master" + # only allow update to main from now on + test "$1" = "refs/heads/main" EOF ) && ( cd workbench && - git checkout master && + git checkout main && test_commit three && git checkout second && test_commit four && - test_must_fail git push --atomic up master second + test_must_fail git push --atomic up main second ) && - test_refs master HEAD@{3} && + test_refs main HEAD@{3} && test_refs second HEAD@{1} ' @@ -195,21 +195,21 @@ test_expect_success 'atomic push is not advertised if configured' ' test_commit one && git push --mirror up && test_commit two && - test_must_fail git push --atomic up master + test_must_fail git push --atomic up main ) && - test_refs master HEAD@{1} + test_refs main HEAD@{1} ' -# References in upstream : master(1) one(1) foo(1) -# References in workbench: master(2) foo(1) two(2) bar(2) -# Atomic push : master(2) two(2) bar(2) +# References in upstream : main(1) one(1) foo(1) +# References in workbench: main(2) foo(1) two(2) bar(2) +# Atomic push : main(2) two(2) bar(2) test_expect_success 'atomic push reports (reject by update hook)' ' mk_repo_pair && ( cd workbench && test_commit one && git branch foo && - git push up master one foo && + git push up main one foo && git tag -d one ) && ( @@ -231,19 +231,19 @@ test_expect_success 'atomic push reports (reject by update hook)' ' git branch bar ) && test_must_fail git -C workbench \ - push --atomic up master two bar >out 2>&1 && + push --atomic up main two bar >out 2>&1 && fmt_status_report <out >actual && cat >expect <<-EOF && To ../upstream - ! [remote rejected] master -> master (atomic push failure) + ! [remote rejected] main -> main (atomic push failure) ! [remote rejected] two -> two (atomic push failure) ! [remote rejected] bar -> bar (hook declined) EOF test_cmp expect actual ' -# References in upstream : master(1) one(1) foo(1) -# References in workbench: master(2) foo(1) two(2) bar(2) +# References in upstream : main(1) one(1) foo(1) +# References in workbench: main(2) foo(1) two(2) bar(2) test_expect_success 'atomic push reports (mirror, but reject by update hook)' ' ( cd workbench && @@ -255,7 +255,7 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' ' fmt_status_report <out >actual && cat >expect <<-EOF && To ../upstream - ! [remote rejected] master -> master (atomic push failure) + ! [remote rejected] main -> main (atomic push failure) ! [remote rejected] one (atomic push failure) ! [remote rejected] bar -> bar (hook declined) ! [remote rejected] two -> two (atomic push failure) @@ -263,21 +263,21 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' ' test_cmp expect actual ' -# References in upstream : master(2) one(1) foo(1) -# References in workbench: master(1) foo(1) two(2) bar(2) +# References in upstream : main(2) one(1) foo(1) +# References in workbench: main(1) foo(1) two(2) bar(2) test_expect_success 'atomic push reports (reject by non-ff)' ' rm upstream/.git/hooks/update && ( cd workbench && - git push up master && + git push up main && git reset --hard HEAD^ ) && test_must_fail git -C workbench \ - push --atomic up master foo bar >out 2>&1 && + push --atomic up main foo bar >out 2>&1 && fmt_status_report <out >actual && cat >expect <<-EOF && To ../upstream - ! [rejected] master -> master (non-fast-forward) + ! [rejected] main -> main (non-fast-forward) ! [rejected] bar -> bar (atomic push failed) EOF test_cmp expect actual diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh index 202d75aebe..58c7add7ee 100755 --- a/t/t5545-push-options.sh +++ b/t/t5545-push-options.sh @@ -2,7 +2,7 @@ test_description='pushing to a repository using push options' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -66,9 +66,9 @@ test_expect_success 'one push option works for a single branch' ' test_commit one && git push --mirror up && test_commit two && - git push --push-option=asdf up master + git push --push-option=asdf up main ) && - test_refs master master && + test_refs main main && echo "asdf" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -82,9 +82,9 @@ test_expect_success 'push option denied by remote' ' test_commit one && git push --mirror up && test_commit two && - test_must_fail git push --push-option=asdf up master + test_must_fail git push --push-option=asdf up main ) && - test_refs master HEAD@{1} + test_refs main HEAD@{1} ' test_expect_success 'two push options work' ' @@ -95,9 +95,9 @@ test_expect_success 'two push options work' ' test_commit one && git push --mirror up && test_commit two && - git push --push-option=asdf --push-option="more structured text" up master + git push --push-option=asdf --push-option="more structured text" up main ) && - test_refs master master && + test_refs main main && printf "asdf\nmore structured text\n" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -126,14 +126,14 @@ test_expect_success 'push options and submodules' ' git -C parent push \ --push-option=asdf --push-option="more structured text" \ - --recurse-submodules=on-demand up master && + --recurse-submodules=on-demand up main && - git -C upstream rev-parse --verify master >expect && - git -C parent/workbench rev-parse --verify master >actual && + git -C upstream rev-parse --verify main >expect && + git -C parent/workbench rev-parse --verify main >actual && test_cmp expect actual && - git -C parent_upstream rev-parse --verify master >expect && - git -C parent rev-parse --verify master >actual && + git -C parent_upstream rev-parse --verify main >expect && + git -C parent rev-parse --verify main >actual && test_cmp expect actual && printf "asdf\nmore structured text\n" >expect && @@ -151,9 +151,9 @@ test_expect_success 'default push option' ' test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default push up master + git -c push.pushOption=default push up main ) && - test_refs master master && + test_refs main main && echo "default" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -167,9 +167,9 @@ test_expect_success 'two default push options' ' test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default1 -c push.pushOption=default2 push up master + git -c push.pushOption=default1 -c push.pushOption=default2 push up main ) && - test_refs master master && + test_refs main main && printf "default1\ndefault2\n" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -183,9 +183,9 @@ test_expect_success 'push option from command line overrides from-config push op test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default push --push-option=manual up master + git -c push.pushOption=default push --push-option=manual up main ) && - test_refs master master && + test_refs main main && echo "manual" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -199,9 +199,9 @@ test_expect_success 'empty value of push.pushOption in config clears the list' ' test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up master + git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up main ) && - test_refs master master && + test_refs main main && echo "default2" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -215,16 +215,16 @@ test_expect_success 'invalid push option in config' ' test_commit one && git push --mirror up && test_commit two && - test_must_fail git -c push.pushOption push up master + test_must_fail git -c push.pushOption push up main ) && - test_refs master HEAD@{1} + test_refs main HEAD@{1} ' test_expect_success 'push options keep quoted characters intact (direct)' ' mk_repo_pair && git -C upstream config receive.advertisePushOptions true && test_commit -C workbench one && - git -C workbench push --push-option="\"embedded quotes\"" up master && + git -C workbench push --push-option="\"embedded quotes\"" up main && echo "\"embedded quotes\"" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options ' @@ -247,28 +247,28 @@ mk_http_pair () { test_expect_success 'push option denied properly by http server' ' mk_http_pair false && test_commit -C test_http_clone one && - test_must_fail git -C test_http_clone push --push-option=asdf origin master 2>actual && + test_must_fail git -C test_http_clone push --push-option=asdf origin main 2>actual && test_i18ngrep "the receiving end does not support push options" actual && - git -C test_http_clone push origin master + git -C test_http_clone push origin main ' test_expect_success 'push options work properly across http' ' mk_http_pair true && test_commit -C test_http_clone one && - git -C test_http_clone push origin master && - git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect && - git -C test_http_clone rev-parse --verify master >actual && + git -C test_http_clone push origin main && + git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect && + git -C test_http_clone rev-parse --verify main >actual && test_cmp expect actual && test_commit -C test_http_clone two && - git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin master && + git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin main && printf "asdf\nmore structured text\n" >expect && test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options && test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/post-receive.push_options && - git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect && - git -C test_http_clone rev-parse --verify master >actual && + git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect && + git -C test_http_clone rev-parse --verify main >actual && test_cmp expect actual ' @@ -276,7 +276,7 @@ test_expect_success 'push options keep quoted characters intact (http)' ' mk_http_pair true && test_commit -C test_http_clone one && - git -C test_http_clone push --push-option="\"embedded quotes\"" origin master && + git -C test_http_clone push --push-option="\"embedded quotes\"" origin main && echo "\"embedded quotes\"" >expect && test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options ' diff --git a/t/t5548-push-porcelain.sh b/t/t5548-push-porcelain.sh index 1b19b3ef55..5a761f3642 100755 --- a/t/t5548-push-porcelain.sh +++ b/t/t5548-push-porcelain.sh @@ -36,7 +36,7 @@ create_commits_in () { shift || return 1 done && - git -C "$repo" update-ref refs/heads/master $oid + git -C "$repo" update-ref refs/heads/main $oid } # Format the output of git-push, git-show-ref and other commands to make a @@ -57,8 +57,8 @@ make_user_friendly_and_stable_output () { } setup_upstream_and_workbench () { - # Upstream after setup : master(B) foo(A) bar(A) baz(A) - # Workbench after setup : master(A) + # Upstream after setup : main(B) foo(A) bar(A) baz(A) + # Workbench after setup : main(A) test_expect_success "setup upstream repository and workbench" ' rm -rf upstream.git workbench && git init --bare upstream.git && @@ -70,9 +70,9 @@ setup_upstream_and_workbench () { # this fixed-width oid will be replaced with "<OID>". git config core.abbrev 7 && git remote add origin ../upstream.git && - git update-ref refs/heads/master $A && + git update-ref refs/heads/main $A && git push origin \ - $B:refs/heads/master \ + $B:refs/heads/main \ $A:refs/heads/foo \ $A:refs/heads/bar \ $A:refs/heads/baz @@ -94,17 +94,17 @@ run_git_push_porcelain_output_test() { ;; esac - # Refs of upstream : master(B) foo(A) bar(A) baz(A) - # Refs of workbench: master(A) baz(A) next(A) - # git-push : master(A) NULL (B) baz(A) next(A) + # Refs of upstream : main(B) foo(A) bar(A) baz(A) + # Refs of workbench: main(A) baz(A) next(A) + # git-push : main(A) NULL (B) baz(A) next(A) test_expect_success "porcelain output of successful git-push ($PROTOCOL)" ' ( cd workbench && - git update-ref refs/heads/master $A && + git update-ref refs/heads/main $A && git update-ref refs/heads/baz $A && git update-ref refs/heads/next $A && git push --porcelain --force origin \ - master \ + main \ :refs/heads/foo \ $B:bar \ baz \ @@ -116,7 +116,7 @@ run_git_push_porcelain_output_test() { = refs/heads/baz:refs/heads/baz [up to date] <COMMIT-B>:refs/heads/bar <OID-A>..<OID-B> - :refs/heads/foo [deleted] - + refs/heads/master:refs/heads/master <OID-B>...<OID-A> (forced update) + + refs/heads/main:refs/heads/main <OID-B>...<OID-A> (forced update) * refs/heads/next:refs/heads/next [new branch] Done EOF @@ -127,22 +127,22 @@ run_git_push_porcelain_output_test() { cat >expect <<-EOF && <COMMIT-B> refs/heads/bar <COMMIT-A> refs/heads/baz - <COMMIT-A> refs/heads/master + <COMMIT-A> refs/heads/main <COMMIT-A> refs/heads/next EOF test_cmp expect actual ' - # Refs of upstream : master(A) bar(B) baz(A) next(A) - # Refs of workbench: master(B) bar(A) baz(A) next(A) - # git-push : master(B) bar(A) NULL next(A) + # Refs of upstream : main(A) bar(B) baz(A) next(A) + # Refs of workbench: main(B) bar(A) baz(A) next(A) + # git-push : main(B) bar(A) NULL next(A) test_expect_success "atomic push failed ($PROTOCOL)" ' ( cd workbench && - git update-ref refs/heads/master $B && + git update-ref refs/heads/main $B && git update-ref refs/heads/bar $A && test_must_fail git push --atomic --porcelain origin \ - master \ + main \ bar \ :baz \ next @@ -153,7 +153,7 @@ run_git_push_porcelain_output_test() { = refs/heads/next:refs/heads/next [up to date] ! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward) ! (delete):refs/heads/baz [rejected] (atomic push failed) - ! refs/heads/master:refs/heads/master [rejected] (atomic push failed) + ! refs/heads/main:refs/heads/main [rejected] (atomic push failed) Done EOF test_cmp expect actual && @@ -163,7 +163,7 @@ run_git_push_porcelain_output_test() { cat >expect <<-EOF && <COMMIT-B> refs/heads/bar <COMMIT-A> refs/heads/baz - <COMMIT-A> refs/heads/master + <COMMIT-A> refs/heads/main <COMMIT-A> refs/heads/next EOF test_cmp expect actual @@ -174,16 +174,16 @@ run_git_push_porcelain_output_test() { EOF ' - # Refs of upstream : master(A) bar(B) baz(A) next(A) - # Refs of workbench: master(B) bar(A) baz(A) next(A) - # git-push : master(B) bar(A) NULL next(A) + # Refs of upstream : main(A) bar(B) baz(A) next(A) + # Refs of workbench: main(B) bar(A) baz(A) next(A) + # git-push : main(B) bar(A) NULL next(A) test_expect_success "pre-receive hook declined ($PROTOCOL)" ' ( cd workbench && - git update-ref refs/heads/master $B && + git update-ref refs/heads/main $B && git update-ref refs/heads/bar $A && test_must_fail git push --porcelain --force origin \ - master \ + main \ bar \ :baz \ next @@ -194,7 +194,7 @@ run_git_push_porcelain_output_test() { = refs/heads/next:refs/heads/next [up to date] ! refs/heads/bar:refs/heads/bar [remote rejected] (pre-receive hook declined) ! :refs/heads/baz [remote rejected] (pre-receive hook declined) - ! refs/heads/master:refs/heads/master [remote rejected] (pre-receive hook declined) + ! refs/heads/main:refs/heads/main [remote rejected] (pre-receive hook declined) Done EOF test_cmp expect actual && @@ -204,7 +204,7 @@ run_git_push_porcelain_output_test() { cat >expect <<-EOF && <COMMIT-B> refs/heads/bar <COMMIT-A> refs/heads/baz - <COMMIT-A> refs/heads/master + <COMMIT-A> refs/heads/main <COMMIT-A> refs/heads/next EOF test_cmp expect actual @@ -214,14 +214,14 @@ run_git_push_porcelain_output_test() { rm "$upstream/hooks/pre-receive" ' - # Refs of upstream : master(A) bar(B) baz(A) next(A) - # Refs of workbench: master(B) bar(A) baz(A) next(A) - # git-push : master(B) bar(A) NULL next(A) + # Refs of upstream : main(A) bar(B) baz(A) next(A) + # Refs of workbench: main(B) bar(A) baz(A) next(A) + # git-push : main(B) bar(A) NULL next(A) test_expect_success "non-fastforward push ($PROTOCOL)" ' ( cd workbench && test_must_fail git push --porcelain origin \ - master \ + main \ bar \ :baz \ next @@ -231,7 +231,7 @@ run_git_push_porcelain_output_test() { To <URL/of/upstream.git> = refs/heads/next:refs/heads/next [up to date] - :refs/heads/baz [deleted] - refs/heads/master:refs/heads/master <OID-A>..<OID-B> + refs/heads/main:refs/heads/main <OID-A>..<OID-B> ! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward) Done EOF @@ -241,7 +241,7 @@ run_git_push_porcelain_output_test() { make_user_friendly_and_stable_output <out >actual && cat >expect <<-EOF && <COMMIT-B> refs/heads/bar - <COMMIT-B> refs/heads/master + <COMMIT-B> refs/heads/main <COMMIT-A> refs/heads/next EOF test_cmp expect actual diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh index 9ec91792c3..2ecb06bb63 100755 --- a/t/t5550-http-fetch-dumb.sh +++ b/t/t5550-http-fetch-dumb.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='test dumb fetching over http via static file' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -29,7 +29,7 @@ test_expect_success 'create http-accessible bare repository with loose objects' hooks/post-update ) && git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - git push public master:master + git push public main:main ' test_expect_success 'clone http repository' ' @@ -40,8 +40,8 @@ test_expect_success 'clone http repository' ' test_expect_success 'list refs from outside any repository' ' cat >expect <<-EOF && - $(git rev-parse master) HEAD - $(git rev-parse master) refs/heads/master + $(git rev-parse main) HEAD + $(git rev-parse main) refs/heads/main EOF nongit git ls-remote "$HTTPD_URL/dumb/repo.git" >actual && test_cmp expect actual @@ -184,8 +184,8 @@ test_expect_success 'fetch changes via manual http-fetch' ' HEAD=$(git rev-parse --verify HEAD) && (cd clone2 && - git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) && - git checkout master-new && + git http-fetch -a -w heads/main-new $HEAD $(git config remote.origin.url) && + git checkout main-new && test $HEAD = $(git rev-parse --verify HEAD)) && test_cmp file clone2/file ' @@ -195,19 +195,19 @@ test_expect_success 'manual http-fetch without -a works just as well' ' HEAD=$(git rev-parse --verify HEAD) && (cd clone3 && - git http-fetch -w heads/master-new $HEAD $(git config remote.origin.url) && - git checkout master-new && + git http-fetch -w heads/main-new $HEAD $(git config remote.origin.url) && + git checkout main-new && test $HEAD = $(git rev-parse --verify HEAD)) && test_cmp file clone3/file ' test_expect_success 'http remote detects correct HEAD' ' - git push public master:other && + git push public main:other && (cd clone && git remote set-head origin -d && git remote set-head origin -a && git symbolic-ref refs/remotes/origin/HEAD > output && - echo refs/remotes/origin/master > expect && + echo refs/remotes/origin/main > expect && test_cmp expect output ) ' @@ -419,7 +419,7 @@ test_expect_success 'set up evil alternates scheme' ' evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git && git init --bare "$evil" && # do this by hand to avoid object existence check - printf "%s\\t%s\\n" $sha1 refs/heads/master >"$evil/info/refs" + printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs" ' # Here we'll just redirect via HTTP. In a real-world attack these would be on diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 310b89dbab..984dba22af 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='test smart fetching over http via http-backend' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -21,7 +21,7 @@ test_expect_success 'create http-accessible bare repository' ' git --bare init ) && git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - git push public master:master + git push public main:main ' setup_askpass_helper @@ -241,9 +241,9 @@ test_expect_success 'invalid Content-Type rejected' ' test_expect_success 'create namespaced refs' ' test_commit namespaced && - git push public HEAD:refs/namespaces/ns/refs/heads/master && + git push public HEAD:refs/namespaces/ns/refs/heads/main && git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \ - symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/master + symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/main ' test_expect_success 'smart clone respects namespace' ' @@ -274,7 +274,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set EOF git config http.cookiefile cookies.txt && git config http.savecookies true && - git ls-remote $HTTPD_URL/smart_cookies/repo.git master && + git ls-remote $HTTPD_URL/smart_cookies/repo.git main && # NEEDSWORK: If the overspecification of the expected result is reduced, we # might be able to run this test in all protocol versions. @@ -347,12 +347,12 @@ test_expect_success 'large fetch-pack requests can be sent using chunked encodin test_expect_success 'test allowreachablesha1inwant' ' test_when_finished "rm -rf test_reachable.git" && server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - master_sha=$(git -C "$server" rev-parse refs/heads/master) && + main_sha=$(git -C "$server" rev-parse refs/heads/main) && git -C "$server" config uploadpack.allowreachablesha1inwant 1 && git init --bare test_reachable.git && git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" && - git -C test_reachable.git fetch origin "$master_sha" + git -C test_reachable.git fetch origin "$main_sha" ' test_expect_success 'test allowreachablesha1inwant with unreachable' ' @@ -366,7 +366,7 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' ' git push public :refs/heads/doomed && server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - master_sha=$(git -C "$server" rev-parse refs/heads/master) && + main_sha=$(git -C "$server" rev-parse refs/heads/main) && git -C "$server" config uploadpack.allowreachablesha1inwant 1 && git init --bare test_reachable.git && @@ -388,7 +388,7 @@ test_expect_success 'test allowanysha1inwant with unreachable' ' git push public :refs/heads/doomed && server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - master_sha=$(git -C "$server" rev-parse refs/heads/master) && + main_sha=$(git -C "$server" rev-parse refs/heads/main) && git -C "$server" config uploadpack.allowreachablesha1inwant 1 && git init --bare test_reachable.git && @@ -447,8 +447,8 @@ test_expect_success 'using fetch command in remote-curl updates refs' ' test_commit -C "$SERVER" bar && git -C client -c protocol.version=0 fetch && - git -C "$SERVER" rev-parse master >expect && - git -C client rev-parse origin/master >actual && + git -C "$SERVER" rev-parse main >expect && + git -C client rev-parse origin/main >actual && test_cmp expect actual ' diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh index 156c704040..7b9fb4ff02 100755 --- a/t/t5552-skipping-fetch-negotiator.sh +++ b/t/t5552-skipping-fetch-negotiator.sh @@ -100,7 +100,7 @@ test_expect_success 'use ref advertisement to filter out commits' ' git -C server checkout --orphan anotherbranch && test_commit -C server to_fetch && - # The server advertising "c3" (as "refs/heads/master") means that we do + # The server advertising "c3" (as "refs/heads/main") means that we do # not need to send any ancestors of "c3", but we still need to send "c3" # itself. test_config -C client fetch.negotiationalgorithm skipping && diff --git a/t/t5553-set-upstream.sh b/t/t5553-set-upstream.sh index e78a21881f..b1d614ce18 100755 --- a/t/t5553-set-upstream.sh +++ b/t/t5553-set-upstream.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='"git fetch/pull --set-upstream" basic tests.' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -35,9 +35,9 @@ test_expect_success 'setup bare parent fetch' ' git remote add upstream parent ' -test_expect_success 'setup commit on master and other fetch' ' +test_expect_success 'setup commit on main and other fetch' ' test_commit one && - git push upstream master && + git push upstream main && git checkout -b other && test_commit two && git push upstream other @@ -46,38 +46,38 @@ test_expect_success 'setup commit on master and other fetch' ' # tests for fetch --set-upstream test_expect_success 'fetch --set-upstream does not set upstream w/o branch' ' - clear_config master other && - git checkout master && + clear_config main other && + git checkout main && git fetch --set-upstream upstream && - check_config_missing master && + check_config_missing main && check_config_missing other ' -test_expect_success 'fetch --set-upstream upstream master sets branch master but not other' ' - clear_config master other && - git fetch --set-upstream upstream master && - check_config master upstream refs/heads/master && +test_expect_success 'fetch --set-upstream upstream main sets branch main but not other' ' + clear_config main other && + git fetch --set-upstream upstream main && + check_config main upstream refs/heads/main && check_config_missing other ' test_expect_success 'fetch --set-upstream upstream other sets branch other' ' - clear_config master other && + clear_config main other && git fetch --set-upstream upstream other && - check_config master upstream refs/heads/other && + check_config main upstream refs/heads/other && check_config_missing other ' -test_expect_success 'fetch --set-upstream master:other does not set the branch other2' ' +test_expect_success 'fetch --set-upstream main:other does not set the branch other2' ' clear_config other2 && - git fetch --set-upstream upstream master:other2 && + git fetch --set-upstream upstream main:other2 && check_config_missing other2 ' test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails with invalid url' ' - # master explicitly not cleared, we check that it is not touched from previous value + # main explicitly not cleared, we check that it is not touched from previous value clear_config other other2 && test_must_fail git fetch --set-upstream http://nosuchdomain.example.com && - check_config master upstream refs/heads/other && + check_config main upstream refs/heads/other && check_config_missing other && check_config_missing other2 ' @@ -86,7 +86,7 @@ test_expect_success 'fetch --set-upstream with valid URL sets upstream to URL' ' clear_config other other2 && url="file://$PWD" && git fetch --set-upstream "$url" && - check_config master "$url" HEAD && + check_config main "$url" HEAD && check_config_missing other && check_config_missing other2 ' @@ -99,30 +99,30 @@ test_expect_success 'setup bare parent pull' ' git remote add upstream parent ' -test_expect_success 'setup commit on master and other pull' ' +test_expect_success 'setup commit on main and other pull' ' test_commit three && - git push --tags upstream master && + git push --tags upstream main && test_commit four && git push upstream other ' -test_expect_success 'pull --set-upstream upstream master sets branch master but not other' ' - clear_config master other && - git pull --set-upstream upstream master && - check_config master upstream refs/heads/master && +test_expect_success 'pull --set-upstream upstream main sets branch main but not other' ' + clear_config main other && + git pull --set-upstream upstream main && + check_config main upstream refs/heads/main && check_config_missing other ' -test_expect_success 'pull --set-upstream master:other2 does not set the branch other2' ' +test_expect_success 'pull --set-upstream main:other2 does not set the branch other2' ' clear_config other2 && - git pull --set-upstream upstream master:other2 && + git pull --set-upstream upstream main:other2 && check_config_missing other2 ' -test_expect_success 'pull --set-upstream upstream other sets branch master' ' - clear_config master other && +test_expect_success 'pull --set-upstream upstream other sets branch main' ' + clear_config main other && git pull --set-upstream upstream other && - check_config master upstream refs/heads/other && + check_config main upstream refs/heads/other && check_config_missing other ' @@ -133,47 +133,47 @@ test_expect_success 'pull --set-upstream upstream tag does not set the tag' ' ' test_expect_success 'pull --set-upstream http://nosuchdomain.example.com fails with invalid url' ' - # master explicitly not cleared, we check that it is not touched from previous value + # main explicitly not cleared, we check that it is not touched from previous value clear_config other other2 three && test_must_fail git pull --set-upstream http://nosuchdomain.example.com && - check_config master upstream refs/heads/other && + check_config main upstream refs/heads/other && check_config_missing other && check_config_missing other2 && check_config_missing three ' test_expect_success 'pull --set-upstream upstream HEAD sets branch HEAD' ' - clear_config master other && + clear_config main other && git pull --set-upstream upstream HEAD && - check_config master upstream HEAD && + check_config main upstream HEAD && git checkout other && git pull --set-upstream upstream HEAD && check_config other upstream HEAD ' test_expect_success 'pull --set-upstream upstream with more than one branch does nothing' ' - clear_config master three && - git pull --set-upstream upstream master three && - check_config_missing master && + clear_config main three && + git pull --set-upstream upstream main three && + check_config_missing main && check_config_missing three ' test_expect_success 'pull --set-upstream with valid URL sets upstream to URL' ' - clear_config master other other2 && - git checkout master && + clear_config main other other2 && + git checkout main && url="file://$PWD" && git pull --set-upstream "$url" && - check_config master "$url" HEAD && + check_config main "$url" HEAD && check_config_missing other && check_config_missing other2 ' test_expect_success 'pull --set-upstream with valid URL and branch sets branch' ' - clear_config master other other2 && - git checkout master && + clear_config main other other2 && + git checkout main && url="file://$PWD" && - git pull --set-upstream "$url" master && - check_config master "$url" refs/heads/master && + git pull --set-upstream "$url" main && + check_config main "$url" refs/heads/main && check_config_missing other && check_config_missing other2 ' diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh index 5561b7d012..d30cf4f5b8 100755 --- a/t/t5560-http-backend-noserver.sh +++ b/t/t5560-http-backend-noserver.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='test git-http-backend-noserver' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh index cba2dffdb0..9c57d84315 100755 --- a/t/t5561-http-backend.sh +++ b/t/t5561-http-backend.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='test git-http-backend' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -42,9 +42,9 @@ POST() { grep '^[^#]' >exp <<EOF -### refs/heads/master +### refs/heads/main ### -GET /smart/repo.git/refs/heads/master HTTP/1.1 404 - +GET /smart/repo.git/refs/heads/main HTTP/1.1 404 - ### getanyfile default ### diff --git a/t/t556x_common b/t/t556x_common index 359fcfe32b..670fb89477 100755 --- a/t/t556x_common +++ b/t/t556x_common @@ -22,7 +22,7 @@ test_expect_success 'setup repository' ' : >objects/info/http-alternates ) && git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - git push public master:master && + git push public main:main && (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && git repack -a -d @@ -31,7 +31,7 @@ test_expect_success 'setup repository' ' echo other >file && git add file && git commit -m two && - git push public master:master && + git push public main:main && LOOSE_URL=$(find_file objects/??) && PACK_URL=$(find_file objects/pack/*.pack) && @@ -51,8 +51,8 @@ get_static_files() { SMART=smart GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL -test_expect_success 'direct refs/heads/master not found' ' - GET refs/heads/master "404 Not Found" +test_expect_success 'direct refs/heads/main not found' ' + GET refs/heads/main "404 Not Found" ' test_expect_success 'static file is ok' ' get_static_files "200 OK" diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh index 2e99a331c5..3332a0c595 100755 --- a/t/t5570-git-daemon.sh +++ b/t/t5570-git-daemon.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='test fetching over git protocol' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -29,7 +29,7 @@ test_expect_success 'create git-accessible bare repository' ' : >git-daemon-export-ok ) && git remote add public "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" && - git push public master:master + git push public main:main ' test_expect_success 'clone git repository' ' @@ -58,12 +58,12 @@ test_expect_success 'no-op fetch without "-v" is quiet' ' ' test_expect_success 'remote detects correct HEAD' ' - git push public master:other && + git push public main:other && (cd clone && git remote set-head -d origin && git remote set-head -a origin && git symbolic-ref refs/remotes/origin/HEAD > output && - echo refs/remotes/origin/master > expect && + echo refs/remotes/origin/main > expect && test_cmp expect output ) ' @@ -151,7 +151,7 @@ test_remote_error() msg="access denied or repository not exported" test_expect_success 'clone non-existent' "test_remote_error '$msg' clone nowhere.git" -test_expect_success 'push disabled' "test_remote_error '$msg' push repo.git master" +test_expect_success 'push disabled' "test_remote_error '$msg' push repo.git main" test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git" test_expect_success 'not exported' "test_remote_error -n '$msg' fetch repo.git" @@ -159,7 +159,7 @@ stop_git_daemon start_git_daemon --informative-errors test_expect_success 'clone non-existent' "test_remote_error 'no such repository' clone nowhere.git" -test_expect_success 'push disabled' "test_remote_error 'service not enabled' push repo.git master" +test_expect_success 'push disabled' "test_remote_error 'service not enabled' push repo.git main" test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git" test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git" @@ -195,10 +195,10 @@ test_expect_success FAKENC 'hostname interpolation works after LF-stripping' ' fake_nc "$GIT_DAEMON_HOST_PORT" <input >output && depacketize <output >output.raw && - # just pick out the value of master, which avoids any protocol + # just pick out the value of main, which avoids any protocol # particulars - perl -lne "print \$1 if m{^(\\S+) refs/heads/master}" <output.raw >actual && - git -C "$repo" rev-parse master >expect && + perl -lne "print \$1 if m{^(\\S+) refs/heads/main}" <output.raw >actual && + git -C "$repo" rev-parse main >expect && test_cmp expect actual ' diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh index 971ed3da4b..ad8d5804f7 100755 --- a/t/t5571-pre-push-hook.sh +++ b/t/t5571-pre-push-hook.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='check pre-push hooks' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -51,11 +51,11 @@ EOF cat >expected <<EOF parent1 repo1 -refs/heads/master $COMMIT2 refs/heads/foreign $COMMIT1 +refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1 EOF test_expect_success 'push with hook' ' - git push parent1 master:foreign && + git push parent1 main:foreign && diff expected actual ' diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh index 1d75e3b12b..d6a75964d8 100755 --- a/t/t5572-pull-submodule.sh +++ b/t/t5572-pull-submodule.sh @@ -148,8 +148,8 @@ test_expect_success 'branch has no merge base with remote-tracking counterpart' git clone parent child && - # Reset master so that it has no merge base with - # refs/remotes/origin/master. + # Reset main so that it has no merge base with + # refs/remotes/origin/main. OTHER=$(git -C child commit-tree -m bar \ $(git -C child rev-parse HEAD^{tree})) && git -C child reset --hard "$OTHER" && diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh index da4c94cce1..cd803ae8bf 100755 --- a/t/t5580-unc-paths.sh +++ b/t/t5580-unc-paths.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='various Windows-only path tests' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -56,7 +56,7 @@ test_expect_success fetch ' git init to-fetch && ( cd to-fetch && - git fetch "$UNCPATH" master + git fetch "$UNCPATH" main ) ' diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh index 907bb062d6..cded79c16b 100755 --- a/t/t5581-http-curl-verbose.sh +++ b/t/t5581-http-curl-verbose.sh @@ -1,7 +1,7 @@ #!/bin/sh test_description='test GIT_CURL_VERBOSE' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -16,7 +16,7 @@ test_expect_success 'setup repository' ' git add file && git commit -m one && git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - git push public master:master + git push public main:main ' test_expect_success 'failure in git-upload-pack is shown' ' diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 608e9aa189..6af143c140 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -5,7 +5,7 @@ test_description='"git fetch" with negative refspecs. ' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -25,12 +25,12 @@ test_expect_success "clone and setup child repos" ' git switch -c alternate && echo >file updated again by one && git commit -a -m "updated by one again" && - git switch master + git switch main ) && git clone . two && ( cd two && - git config branch.master.remote one && + git config branch.main.remote one && git config remote.one.url ../one/.git/ && git config remote.one.fetch +refs/heads/*:refs/remotes/one/* && git config --add remote.one.fetch ^refs/heads/alternate @@ -46,9 +46,9 @@ test_expect_success "fetch one" ' test_must_fail git rev-parse --verify refs/remotes/one/alternate && git fetch one && test_must_fail git rev-parse --verify refs/remotes/one/alternate && - git rev-parse --verify refs/remotes/one/master && - mine=$(git rev-parse refs/remotes/one/master) && - his=$(cd ../one && git rev-parse refs/heads/master) && + git rev-parse --verify refs/remotes/one/main && + mine=$(git rev-parse refs/remotes/one/main) && + his=$(cd ../one && git rev-parse refs/heads/main) && test "z$mine" = "z$his" ) ' @@ -60,7 +60,7 @@ test_expect_success "fetch with negative refspec on commandline" ' cd three && alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && echo $alternate_in_one >expect && - git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/main && cut -f -1 .git/FETCH_HEAD >actual && test_cmp expect actual ) @@ -71,8 +71,8 @@ test_expect_success "fetch with negative sha1 refspec fails" ' git commit -a -m "updated by origin yet again" && ( cd three && - master_in_one=$(cd ../one && git rev-parse refs/heads/master) && - test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one + main_in_one=$(cd ../one && git rev-parse refs/heads/main) && + test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$main_in_one ) ' @@ -95,10 +95,10 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix" ( cd three && alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && - master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + main_in_one=$(cd ../one && git rev-parse refs/heads/main) && echo $alternate_in_one >expect && - echo $master_in_one >>expect && - git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master && + echo $main_in_one >>expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^main && cut -f -1 .git/FETCH_HEAD >actual && test_cmp expect actual ) -- gitgitgadget
This (big) patch series (almost) concludes the transition of Git's test suite to use init.defaultBranch=main that was started in js/default-branch-name-part-4-minus-1, continued in js/default-branch-name-adjust-t5411 and in js/default-branch-name-adjust-t5515. This transition prepares for changing the fall-back value of init.defaultBranch accordingly (which will be done in a different set of patch series, with an appropriate deprecation period), reflecting what many open source projects already did followed by GitHub, Azure Repos and others. Before doing anything else, the series starts out with a patch that marks all the test scripts that expect a specific default branch name and won't pass with any other name. Instead of one huge patch that reflects essentially a search-and-replace in the test suite, this patch series then splits the changes up into chunks that are intended to be smaller than 100kB so that they are not rejected by the Git mailing list. Interspersed between those changes are adjustments e.g. in alignment, to make it easier to review (or recreate) the search-and-replace patches. Note that this branch is based on next, mostly because it would otherwise conflict with en/merge-tests, jk/diff-release-filespec-fix and ds/maintenance-part-3. To avoid even more conflicts with topics that did not even make it to seen yet, this patch series specifically excludes t1309, t2106, t3040, t3404, t4013, t4015, t5310, t5526, t6300, t7064, t7817, t9902: in those test scripts, we will still use master for the time being. Once the topics in question have settled, I will send the appropriate follow-up patches to adjust them to use main instead. Note that even after this patch series, master is still found in t/, even outside of the tests we excluded specifically to avoid conflicts with other patch series that are currently in flight: t/perf/, the git p4 tests (because git p4 still uses p4/master to refer to the remote main branch), and some comments still refer to this name. I intend to address at least some of those, in patch series separate from the current one. Changes since v2: * The case statement setting the default branch name for each test script was replaced by an initial patch that sets the default branch name in those test scripts that need it (and only in those). This patch also modifies the linux-gcc job to verify that the test suite runs with overridden default branch name (which the now-marked test scripts over-override). * Four more test scripts were excluded from this patch series: t1309, t2106, t3040 and t4015. These are handled in four separate patch series, where I try to remove the requirement to hard-code the default branch name in the first place. Changes since v1: * Dropped the commit changing the default initial branch name for git init. * Adjusted the patch for t1402 to also replace naster by nain. * Excluded t5526 from the patches for now, to avoid clashing with pk/subsub-fetch-fix. Johannes Schindelin (28): tests: mark tests relying on the current default for `init.defaultBranch` t0060: preemptively adjust alignment t[01]*: adjust the references to the default branch name "main" t2*: adjust the references to the default branch name "main" t3[0-3]*: adjust the references to the default branch name "main" t3416: preemptively adjust alignment in a comment t34*: adjust the references to the default branch name "main" t3[5-9]*: adjust the references to the default branch name "main" t4*: adjust the references to the default branch name "main" t5323: prepare centered comment for `master` -> `main` t5[0-4]*: adjust the references to the default branch name "main" t5503: prepare aligned comment for replacing `master` with `main` t550*: adjust the references to the default branch name "main" t551*: adjust the references to the default branch name "main" t55[23]*: adjust the references to the default branch name "main" t55[4-9]*: adjust the references to the default branch name "main" t5[6-9]*: adjust the references to the default branch name "main" t6[0-3]*: adjust the references to the default branch name "main" t64*: preemptively adjust alignment to prepare for `master` -> `main` t6[4-9]*: adjust the references to the default branch name "main" t7[0-4]*: adjust the references to the default branch name "main" t7[5-9]*: adjust the references to the default branch name "main" t8*: adjust the references to the default branch name "main" t9[0-4]*: adjust the references to the default branch name "main" t9[5-7]*: adjust the references to the default branch name "main" tests(git-p4): transition to the default branch name `main` t99*: adjust the references to the default branch name "main" tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed ci/run-build-and-tests.sh | 2 + t/annotate-tests.sh | 8 +- t/lib-cvs.sh | 2 +- t/t0002-gitfile.sh | 9 +- t/t0020-crlf.sh | 11 +- t/t0021-conversion.sh | 43 +- t/t0027-auto-crlf.sh | 4 +- t/t0028-working-tree-encoding.sh | 7 +- t/t0041-usage.sh | 13 +- t/t0050-filesystem.sh | 9 +- t/t0060-path-utils.sh | 4 +- t/t0100-previous.sh | 21 +- t/t1004-read-tree-m-u-wf.sh | 43 +- t/t1008-read-tree-overlay.sh | 5 +- t/t1009-read-tree-new-index.sh | 7 +- t/t1011-read-tree-sparse-checkout.sh | 2 +- t/t1021-rerere-in-workdir.sh | 5 +- t/t1090-sparse-checkout-scope.sh | 13 +- t/t1091-sparse-checkout-builtin.sh | 5 +- t/t1300-config.sh | 11 +- t/t1301-shared-repo.sh | 7 +- t/t1305-config-include.sh | 2 +- t/t1400-update-ref.sh | 75 +-- t/t1402-check-ref-format.sh | 32 +- t/t1403-show-ref.sh | 21 +- t/t1405-main-ref-store.sh | 45 +- t/t1406-submodule-ref-store.sh | 33 +- t/t1407-worktree-ref-store.sh | 35 +- t/t1408-packed-refs.sh | 15 +- t/t1410-reflog.sh | 59 +- t/t1411-reflog-show.sh | 5 +- t/t1413-reflog-detach.sh | 27 +- t/t1414-reflog-walk.sh | 15 +- t/t1416-ref-transaction-hooks.sh | 13 +- t/t1430-bad-ref-name.sh | 55 +- t/t1450-fsck.sh | 2 +- t/t1500-rev-parse.sh | 7 +- t/t1503-rev-parse-verify.sh | 31 +- t/t1505-rev-parse-last.sh | 11 +- t/t1506-rev-parse-diagnosis.sh | 7 +- t/t1507-rev-parse-upstream.sh | 43 +- t/t1508-at-combinations.sh | 13 +- t/t1511-rev-parse-caret.sh | 29 +- t/t1512-rev-parse-disambiguation.sh | 5 +- t/t1513-rev-parse-prefix.sh | 7 +- t/t1514-rev-parse-push.sh | 19 +- t/t1700-split-index.sh | 5 +- t/t2007-checkout-symlink.sh | 13 +- t/t2009-checkout-statinfo.sh | 11 +- t/t2010-checkout-ambiguous.sh | 7 +- t/t2011-checkout-invalid-head.sh | 19 +- t/t2012-checkout-last.sh | 51 +- t/t2015-checkout-unborn.sh | 5 +- t/t2017-checkout-orphan.sh | 47 +- t/t2020-checkout-detach.sh | 31 +- t/t2022-checkout-paths.sh | 25 +- t/t2023-checkout-m.sh | 13 +- t/t2024-checkout-dwim.sh | 70 +-- t/t2027-checkout-track.sh | 9 +- t/t2030-unresolve-info.sh | 9 +- t/t2060-switch.sh | 33 +- t/t2070-restore.sh | 7 +- t/t2400-worktree-add.sh | 69 +-- t/t2401-worktree-prune.sh | 5 +- t/t2402-worktree-list.sh | 23 +- t/t2405-worktree-submodule.sh | 9 +- t/t3200-branch.sh | 251 ++++----- t/t3201-branch-contains.sh | 85 +-- t/t3202-show-branch-octopus.sh | 5 +- t/t3203-branch-output.sh | 43 +- t/t3204-branch-name-interpretation.sh | 9 +- t/t3205-branch-color.sh | 11 +- t/t3206-range-diff.sh | 43 +- t/t3206/history.export | 2 +- t/t3210-pack-refs.sh | 7 +- t/t3211-peel-ref.sh | 7 +- t/t3301-notes.sh | 6 +- t/t3302-notes-index-expensive.sh | 5 +- t/t3303-notes-subtrees.sh | 11 +- t/t3304-notes-mixed.sh | 11 +- t/t3308-notes-merge.sh | 2 +- t/t3320-notes-merge-worktrees.sh | 7 +- t/t3400-rebase.sh | 63 +-- t/t3402-rebase-merge.sh | 47 +- t/t3403-rebase-skip.sh | 9 +- t/t3404-rebase-interactive.sh | 3 + t/t3405-rebase-malformed.sh | 11 +- t/t3406-rebase-message.sh | 27 +- t/t3407-rebase-abort.sh | 21 +- t/t3408-rebase-multi-line.sh | 5 +- t/t3409-rebase-preserve-merges.sh | 13 +- t/t3412-rebase-root.sh | 31 +- t/t3413-rebase-hook.sh | 45 +- t/t3415-rebase-autosquash.sh | 5 +- t/t3416-rebase-onto-threedots.sh | 57 +- t/t3418-rebase-continue.sh | 27 +- t/t3419-rebase-patch-id.sh | 15 +- t/t3420-rebase-autostash.sh | 11 +- t/t3423-rebase-reword.sh | 6 +- t/t3427-rebase-subtree.sh | 23 +- t/t3430-rebase-merges.sh | 19 +- t/t3431-rebase-fork-point.sh | 35 +- t/t3432-rebase-fast-forward.sh | 37 +- t/t3434-rebase-i18n.sh | 11 +- t/t3435-rebase-gpg-sign.sh | 7 +- t/t3436-rebase-more-options.sh | 2 +- t/t3500-cherry.sh | 15 +- t/t3501-revert-cherry-pick.sh | 7 +- t/t3502-cherry-pick-merge.sh | 5 +- t/t3503-cherry-pick-root.sh | 13 +- t/t3504-cherry-pick-rerere.sh | 27 +- t/t3505-cherry-pick-empty.sh | 27 +- t/t3506-cherry-pick-ff.sh | 11 +- t/t3507-cherry-pick-conflict.sh | 5 +- t/t3508-cherry-pick-many-commits.sh | 41 +- t/t3509-cherry-pick-merge-df.sh | 5 +- t/t3512-cherry-pick-submodule.sh | 5 +- t/t3600-rm.sh | 13 +- t/t3701-add-interactive.sh | 7 +- t/t3901-i18n-patch.sh | 43 +- t/t3903-stash.sh | 35 +- t/t3910-mac-os-precompose.sh | 9 +- t/t4013-diff-various.sh | 3 + t/t4014-format-patch.sh | 179 ++++--- t/t4017-diff-retval.sh | 5 +- t/t4038-diff-combined.sh | 17 +- t/t4041-diff-submodule-option.sh | 5 +- t/t4048-diff-combined-binary.sh | 13 +- t/t4052-stat-output.sh | 7 +- t/t4056-diff-order.sh | 5 +- t/t4057-diff-combined-paths.sh | 23 +- t/t4061-diff-indent.sh | 27 +- t/t4066-diff-emit-delay.sh | 5 +- t/t4068-diff-symmetric-merge-base.sh | 51 +- t/t4103-apply-binary.sh | 39 +- t/t4108-apply-threeway.sh | 17 +- t/t4121-apply-diffs.sh | 5 +- t/t4122-apply-symlink-inside.sh | 9 +- t/t4150-am.sh | 29 +- t/t4200-rerere.sh | 23 +- t/t4201-shortlog.sh | 5 +- t/t4202-log.sh | 109 ++-- t/t4203-mailmap.sh | 5 +- t/t4204-patch-id.sh | 29 +- t/t4207-log-decoration-colors.sh | 9 +- t/t4208-log-magic-pathspec.sh | 7 +- t/t4211-line-log.sh | 3 + t/t4211/history.export | 2 +- t/t4214-log-graph-octopus.sh | 5 +- t/t4216-log-bloom.sh | 7 +- t/t4253-am-keep-cr-dos.sh | 23 +- t/t4257-am-interactive.sh | 2 +- t/t5150-request-pull.sh | 37 +- t/t5304-prune.sh | 5 +- t/t5305-include-tag.sh | 5 +- t/t5310-pack-bitmaps.sh | 3 + t/t5312-prune-corruption.sh | 19 +- t/t5317-pack-objects-filter-objects.sh | 5 +- t/t5322-pack-objects-sparse.sh | 5 +- t/t5323-pack-redundant.sh | 66 +-- t/t5400-send-pack.sh | 63 +-- t/t5401-update-hooks.sh | 24 +- t/t5402-post-merge-hook.sh | 5 +- t/t5403-post-checkout-hook.sh | 9 +- t/t5404-tracking-branches.sh | 11 +- t/t5405-send-pack-rewind.sh | 9 +- t/t5407-post-rewrite-hook.sh | 5 +- t/t5410-receive-pack-alternates.sh | 7 +- t/t5500-fetch-pack.sh | 31 +- t/t5501-fetch-push-alternates.sh | 7 +- t/t5502-quickfetch.sh | 9 +- t/t5503-tagfollow.sh | 15 +- t/t5504-fetch-receive-strict.sh | 23 +- t/t5505-remote.sh | 151 +++--- t/t5506-remote-groups.sh | 7 +- t/t5509-fetch-push-namespaces.sh | 33 +- t/t5510-fetch.sh | 165 +++--- t/t5511-refspec.sh | 12 +- t/t5512-ls-remote.sh | 29 +- t/t5514-fetch-multiple.sh | 33 +- t/t5516-fetch-push.sh | 503 +++++++++--------- t/t5517-push-mirror.sh | 127 ++--- t/t5518-fetch-exit-status.sh | 9 +- t/t5519-push-alternates.sh | 15 +- t/t5520-pull.sh | 33 +- t/t5521-pull-options.sh | 19 +- t/t5523-push-upstream.sh | 33 +- t/t5526-fetch-submodules.sh | 3 + t/t5527-fetch-odd-refs.sh | 17 +- t/t5528-push-default.sh | 101 ++-- t/t5529-push-errors.sh | 2 +- t/t5530-upload-pack-error.sh | 2 +- t/t5531-deep-submodule-push.sh | 191 +++---- t/t5533-push-cas.sh | 145 ++--- t/t5534-push-signed.sh | 7 +- t/t5537-fetch-shallow.sh | 33 +- t/t5538-push-shallow.sh | 25 +- t/t5539-fetch-http-shallow.sh | 17 +- t/t5540-http-push-webdav.sh | 11 +- t/t5541-http-push-smart.sh | 43 +- t/t5542-push-http-shallow.sh | 11 +- t/t5543-atomic-push.sh | 83 +-- t/t5545-push-options.sh | 65 +-- t/t5548-push-porcelain.sh | 64 +-- t/t5550-http-fetch-dumb.sh | 23 +- t/t5551-http-fetch-smart.sh | 23 +- t/t5552-skipping-fetch-negotiator.sh | 2 +- t/t5553-set-upstream.sh | 85 +-- t/t5560-http-backend-noserver.sh | 3 + t/t5561-http-backend.sh | 7 +- t/t556x_common | 8 +- t/t5570-git-daemon.sh | 19 +- t/t5571-pre-push-hook.sh | 7 +- t/t5572-pull-submodule.sh | 4 +- t/t5580-unc-paths.sh | 5 +- t/t5581-http-curl-verbose.sh | 5 +- t/t5582-fetch-negative-refspec.sh | 25 +- t/t5601-clone.sh | 7 +- t/t5604-clone-reference.sh | 15 +- t/t5605-clone-local.sh | 13 +- t/t5606-clone-options.sh | 11 +- t/t5607-clone-bundle.sh | 17 +- t/t5608-clone-2gb.sh | 2 +- t/t5609-clone-branch.sh | 9 +- t/t5610-clone-detached.sh | 7 +- t/t5611-clone-config.sh | 19 +- t/t5612-clone-refspec.sh | 45 +- t/t5614-clone-submodules-shallow.sh | 2 +- t/t5616-partial-clone.sh | 53 +- t/t5617-clone-submodules-remote.sh | 9 +- t/t5700-protocol-v1.sh | 19 +- t/t5701-git-serve.sh | 19 +- t/t5702-protocol-v2.sh | 53 +- t/t5703-upload-pack-ref-in-want.sh | 63 +-- t/t5801-remote-helpers.sh | 27 +- t/t6000-rev-list-misc.sh | 5 +- t/t6001-rev-list-graft.sh | 5 +- t/t6004-rev-list-path-optim.sh | 17 +- t/t6006-rev-list-format.sh | 17 +- t/t6007-rev-list-cherry-pick-file.sh | 7 +- t/t6008-rev-list-submodule.sh | 5 +- t/t6009-rev-list-parent.sh | 9 +- t/t6012-rev-list-simplify.sh | 11 +- t/t6013-rev-list-reverse-parents.sh | 13 +- t/t6016-rev-list-graph-simplify-history.sh | 5 +- t/t6017-rev-list-stdin.sh | 11 +- t/t6018-rev-list-glob.sh | 53 +- t/t6019-rev-list-ancestry-path.sh | 9 +- t/t6030-bisect-porcelain.sh | 13 +- t/t6040-tracking-info.sh | 57 +- t/t6050-replace.sh | 13 +- t/t6101-rev-parse-parents.sh | 5 +- t/t6110-rev-list-sparse.sh | 5 +- t/t6111-rev-list-treesame.sh | 9 +- t/t6112-rev-list-filters-objects.sh | 17 +- t/t6120-describe.sh | 23 +- t/t6200-fmt-merge-msg.sh | 53 +- t/t6300-for-each-ref.sh | 3 + t/t6302-for-each-ref-filter.sh | 61 ++- t/t6400-merge-df.sh | 9 +- t/t6402-merge-rename.sh | 49 +- t/t6404-recursive-merge.sh | 7 +- t/t6405-merge-symlinks.sh | 17 +- t/t6406-merge-attr.sh | 27 +- t/t6407-merge-binary.sh | 9 +- t/t6409-merge-subtree.sh | 19 +- t/t6411-merge-filemode.sh | 13 +- t/t6412-merge-large-rename.sh | 9 +- t/t6413-merge-crlf.sh | 5 +- t/t6414-merge-rename-nocruft.sh | 5 +- t/t6415-merge-dir-to-symlink.sh | 25 +- t/t6416-recursive-corner-cases.sh | 31 +- t/t6417-merge-ours-theirs.sh | 31 +- t/t6418-merge-text-auto.sh | 15 +- t/t6419-merge-ignorecase.sh | 13 +- t/t6422-merge-rename-corner-cases.sh | 15 +- t/t6425-merge-rename-delete.sh | 5 +- t/t6427-diff3-conflict-markers.sh | 17 +- t/t6430-merge-recursive.sh | 21 +- t/t6432-merge-recursive-space-options.sh | 9 +- t/t6433-merge-toplevel.sh | 11 +- t/t6434-merge-recursive-rename-options.sh | 9 +- t/t6436-merge-overwrite.sh | 5 +- t/t6437-submodule-merge.sh | 17 +- t/t6439-merge-co-error-msgs.sh | 9 +- t/t6501-freshen-objects.sh | 5 +- t/t7003-filter-branch.sh | 43 +- t/t7004-tag.sh | 11 +- t/t7030-verify-tag.sh | 5 +- t/t7060-wtstatus.sh | 29 +- t/t7063-status-untracked-cache.sh | 17 +- t/t7064-wtstatus-pv2.sh | 3 + t/t7102-reset.sh | 9 +- t/t7113-post-index-change-hook.sh | 5 +- t/t7201-co.sh | 113 ++-- t/t7400-submodule-basic.sh | 23 +- t/t7403-submodule-sync.sh | 13 +- t/t7406-submodule-update.sh | 41 +- t/t7407-submodule-foreach.sh | 27 +- t/t7409-submodule-detached-work-tree.sh | 11 +- t/t7417-submodule-path-url.sh | 5 +- t/t7501-commit-basic-functionality.sh | 5 +- t/t7502-commit-porcelain.sh | 15 +- ...3-pre-commit-and-pre-merge-commit-hooks.sh | 45 +- t/t7504-commit-msg-hook.sh | 27 +- t/t7505-prepare-commit-msg-hook.sh | 23 +- t/t7508-status.sh | 58 +- t/t7510-signed-commit.sh | 5 +- t/t7512-status-help.sh | 43 +- t/t7517-per-repo-email.sh | 15 +- t/t7600-merge.sh | 47 +- t/t7606-merge-custom.sh | 2 +- t/t7608-merge-messages.sh | 39 +- t/t7610-mergetool.sh | 177 +++--- t/t7611-merge-abort.sh | 7 +- t/t7612-merge-verify-signatures.sh | 5 +- t/t7614-merge-signoff.sh | 27 +- t/t7701-repack-unpack-unreachable.sh | 5 +- t/t7800-difftool.sh | 41 +- t/t7810-grep.sh | 31 +- t/t8001-annotate.sh | 5 +- t/t8002-blame.sh | 3 + t/t8003-blame-corner-cases.sh | 7 +- t/t8004-blame-with-conflicts.sh | 17 +- t/t8012-blame-colors.sh | 3 + t/t9001-send-email.sh | 31 +- t/t9100-git-svn-basic.sh | 5 +- t/t9145-git-svn-master-branch.sh | 9 +- t/t9151-svn-mergeinfo.sh | 5 +- t/t9155-git-svn-fetch-deleted-tag.sh | 5 +- t/t9156-git-svn-fetch-deleted-tag-2.sh | 9 +- t/t9163-git-svn-reset-clears-caches.sh | 5 +- t/t9169-git-svn-dcommit-crlf.sh | 5 +- t/t9300-fast-import.sh | 85 +-- t/t9301-fast-import-notes.sh | 17 +- t/t9302-fast-import-unpack-limit.sh | 16 +- t/t9350-fast-export.sh | 89 ++-- t/t9351-fast-export-anonymize.sh | 7 +- t/t9400-git-cvsserver-server.sh | 35 +- t/t9401-git-cvsserver-crlf.sh | 19 +- t/t9402-git-cvsserver-refs.sh | 11 +- t/t9500-gitweb-standalone-no-errors.sh | 23 +- t/t9501-gitweb-standalone-http-status.sh | 17 +- t/t9502-gitweb-standalone-parse-output.sh | 19 +- t/t9600-cvsimport.sh | 5 +- t/t9601-cvsimport-vendor-branch.sh | 19 +- t/t9602-cvsimport-branches-tags.sh | 7 +- t/t9603-cvsimport-patchsets.sh | 11 +- t/t9800-git-p4-basic.sh | 5 +- t/t9801-git-p4-branch.sh | 19 +- t/t9806-git-p4-options.sh | 21 +- t/t9807-git-p4-submit.sh | 5 +- t/t9811-git-p4-label-import.sh | 5 +- t/t9902-completion.sh | 3 + t/t9903-bash-prompt.sh | 117 ++-- 355 files changed, 4835 insertions(+), 3861 deletions(-) base-commit: aff20da3a209088e7f8f3632077fa11b86453d67 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-762%2Fdscho%2Fuse-main-as-default-branch-name-v3 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-762/dscho/use-main-as-default-branch-name-v3 Pull-Request: https://github.com/gitgitgadget/git/pull/762 Range-diff vs v2: -: ---------- > 1: e9ee22525a tests: mark tests relying on the current default for `init.defaultBranch` 1: 0a05d319c0 = 2: 8c2e158c8f t0060: preemptively adjust alignment 2: b8fa037791 ! 3: 9b7749dcde t[01]*: adjust the references to the default branch name "main" @@ Metadata ## Commit message ## t[01]*: adjust the references to the default branch name "main" - This trick was performed via + Carefully excluding t1309, which sees independent development elsewhere + at the time of writing, we transition above-mentioned tests to the + default branch name `main`. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ - -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh) + -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh && + git checkout HEAD -- t1309\*) Note that t5533 contains a variation of the name `master` (`naster`) that we rename here, too. @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t0002-gitfile.sh ## +@@ t/t0002-gitfile.sh: test_description='.git file + + Verify that plumbing commands work when .git is a file + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0002-gitfile.sh: test_expect_success 'enter_repo non-strict mode' ' git ls-remote enter_repo >actual && cat >expected <<-EOF && @@ t/t0002-gitfile.sh: test_expect_success 'enter_repo strict mode' ' test_cmp expected actual ## t/t0020-crlf.sh ## +@@ + + test_description='CRLF conversion' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0020-crlf.sh: test_expect_success 'checkout with existing .gitattributes' ' git add .gitattributes .file && git commit -m second && @@ t/t0020-crlf.sh: test_expect_success 'checkout when deleting .gitattributes' ' ' ## t/t0021-conversion.sh ## +@@ + + test_description='blob conversion via gitattributes' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0021-conversion.sh: test_expect_success PERL 'required process filter should filter data' ' test_cmp_count expected.log debug.log && @@ t/t0027-auto-crlf.sh: test_expect_success 'ls-files --eol -o Text/Binary' ' printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE" >LF && ## t/t0028-working-tree-encoding.sh ## +@@ + + test_description='working-tree-encoding conversion via gitattributes' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0028-working-tree-encoding.sh: test_expect_success 'error if encoding round trip is not the same during refresh TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) && git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le && @@ t/t0028-working-tree-encoding.sh: test_expect_success 'error if encoding garbage test_i18ngrep "error: BOM is required" err.out ## t/t0041-usage.sh ## +@@ + + test_description='Test commands behavior when given invalid argument value' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0041-usage.sh: test_expect_success 'tag usage error' ' ' @@ t/t0041-usage.sh: test_expect_success 'for-each-ref --contains <inexistent_objec ' ## t/t0050-filesystem.sh ## +@@ + + test_description='Various filesystem issues' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0050-filesystem.sh: test_expect_success "setup case tests" ' git mv camelcase tmp && git mv tmp CamelCase && @@ t/t0060-path-utils.sh: test_git_path GIT_COMMON_DIR=bar info/sparse-checkout test_git_path GIT_COMMON_DIR=bar config bar/config ## t/t0100-previous.sh ## +@@ + + test_description='previous branch syntax @{-n}' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t0100-previous.sh: test_expect_success 'branch -d @{-1}' ' test_commit A && git checkout -b junk && @@ t/t0100-previous.sh: test_expect_success 'merge @{-1}~1' ' ## t/t1004-read-tree-m-u-wf.sh ## +@@ + + test_description='read-tree -m -u checks working tree files' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1004-read-tree-m-u-wf.sh: test_expect_success 'two-way setup' ' git branch side && git tag -f branch-point && @@ t/t1004-read-tree-m-u-wf.sh: test_expect_success 'three-way not complaining on a test_expect_success '3-way not overwriting local changes (setup)' ' ## t/t1008-read-tree-overlay.sh ## +@@ + + test_description='test multi-tree read-tree without merging' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1008-read-tree-overlay.sh: test_expect_success setup ' ' @@ t/t1008-read-tree-overlay.sh: test_expect_success setup ' test_cmp expect actual ## t/t1009-read-tree-new-index.sh ## +@@ + + test_description='test read-tree into a fresh index file' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1009-read-tree-new-index.sh: test_expect_success setup ' test_expect_success 'non-existent index file' ' @@ t/t1011-read-tree-sparse-checkout.sh | M init.t ## t/t1021-rerere-in-workdir.sh ## +@@ + #!/bin/sh + + test_description='rerere run in a workdir' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1021-rerere-in-workdir.sh: test_expect_success SYMLINKS setup ' test_tick && git commit -a -m goodbye && @@ t/t1021-rerere-in-workdir.sh: test_expect_success SYMLINKS setup ' test_expect_success SYMLINKS 'rerere in workdir' ' ## t/t1090-sparse-checkout-scope.sh ## +@@ + + test_description='sparse checkout scope tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1090-sparse-checkout-scope.sh: test_expect_success 'create feature branch' ' git commit -m "modification" ' @@ t/t1090-sparse-checkout-scope.sh: test_expect_success 'merge feature branch into test_path_is_file c && ## t/t1091-sparse-checkout-builtin.sh ## +@@ + + test_description='sparse checkout builtin tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1091-sparse-checkout-builtin.sh: test_expect_success 'interaction with clone --no-checkout (unborn index)' ' test_path_is_missing clone_no_checkout/.git/index && @@ t/t1091-sparse-checkout-builtin.sh: test_expect_success 'interaction with clone ' ## t/t1300-config.sh ## +@@ + + test_description='Test git config in different settings' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1300-config.sh: test_expect_success 'check split_cmdline return' " echo foo > foo && git add foo && @@ t/t1300-config.sh: test_expect_success '--show-origin blob' ' ## t/t1301-shared-repo.sh ## +@@ + + test_description='Test shared repository initialization' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1301-shared-repo.sh: test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' ' umask 077 && git config core.sharedRepository group && @@ t/t1305-config-include.sh: test_expect_success SYMLINKS 'conditional include, gi git checkout -b foo-branch && echo 9 >expect && - ## t/t1309-early-config.sh ## -@@ t/t1309-early-config.sh: test_expect_failure 'ignore .git/ with invalid config' ' - - test_expect_success 'early config and onbranch' ' - echo "[broken" >broken && -- test_with_config "[includeif \"onbranch:master\"]path=../broken" -+ test_with_config "[includeif \"onbranch:main\"]path=../broken" - ' + ## t/t1400-update-ref.sh ## +@@ + # - test_expect_success 'onbranch config outside of git repo' ' -- test_config_global includeIf.onbranch:master.path non-existent && -+ test_config_global includeIf.onbranch:main.path non-existent && - nongit git help - ' + test_description='Test git update-ref and basic ref logging' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - - ## t/t1400-update-ref.sh ## -@@ t/t1400-update-ref.sh: test_description='Test git update-ref and basic ref logging' + . ./test-lib.sh Z=$ZERO_OID @@ t/t1402-check-ref-format.sh: test_expect_success 'check-ref-format --branch @{-1 ## t/t1403-show-ref.sh ## +@@ + #!/bin/sh + + test_description='show-ref' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1403-show-ref.sh: test_expect_success setup ' git checkout -b side && test_commit B && @@ t/t1403-show-ref.sh: test_expect_success 'show-ref -d' ' done >expect.heads && ## t/t1405-main-ref-store.sh ## +@@ + + test_description='test main ref store api' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1405-main-ref-store.sh: test_expect_success 'peel_ref(new-tag)' ' test_cmp expected actual ' @@ t/t1405-main-ref-store.sh: test_expect_success 'for_each_reflog()' ' ## t/t1406-submodule-ref-store.sh ## +@@ + + test_description='test submodule ref store api' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1406-submodule-ref-store.sh: test_expect_success 'setup' ' ( cd sub && @@ t/t1406-submodule-ref-store.sh: test_expect_success 'for_each_reflog()' ' ## t/t1407-worktree-ref-store.sh ## +@@ + + test_description='test worktree ref store api' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1407-worktree-ref-store.sh: RMAIN="test-tool ref-store worktree:main" test_expect_success 'setup' ' @@ t/t1407-worktree-ref-store.sh: test_expect_success 'for_each_reflog()' ' ' ## t/t1408-packed-refs.sh ## +@@ + + test_description='packed-refs entries are covered by loose refs' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1408-packed-refs.sh: test_expect_success setup ' git commit --allow-empty -m one && one=$(git rev-parse HEAD) && @@ t/t1408-packed-refs.sh: test_expect_success setup ' ' ## t/t1410-reflog.sh ## +@@ + # + + test_description='Test prune and reflog expiration' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1410-reflog.sh: test_expect_success setup ' check_fsck && @@ t/t1410-reflog.sh: test_expect_success 'stale dirs do not cause d/f conflicts (r ' ## t/t1411-reflog-show.sh ## +@@ + #!/bin/sh + + test_description='Test reflog display routines' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1411-reflog-show.sh: test_expect_success 'git log -g -p shows diffs vs. parents' ' ' @@ t/t1411-reflog-show.sh: test_expect_success 'git log -g -p shows diffs vs. paren ## t/t1413-reflog-detach.sh ## -@@ t/t1413-reflog-detach.sh: test_description='Test reflog interaction with detached HEAD' +@@ + #!/bin/sh + + test_description='Test reflog interaction with detached HEAD' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh reset_state () { @@ t/t1413-reflog-detach.sh: test_expect_success 'switch to branch' ' test_cmp expect actual ## t/t1414-reflog-walk.sh ## +@@ + #!/bin/sh + + test_description='various tests of reflog walk (log -g) behavior' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1414-reflog-walk.sh: test_expect_success 'set up some reflog entries' ' test_commit two && git checkout -b side HEAD^ && @@ t/t1414-reflog-walk.sh: test_expect_success 'walking multiple reflogs shows all' ## t/t1416-ref-transaction-hooks.sh ## +@@ + + test_description='reference transaction hooks' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1416-ref-transaction-hooks.sh: test_expect_success 'hook gets all queued updates in prepared state' ' EOF cat >expect <<-EOF && @@ t/t1416-ref-transaction-hooks.sh: test_expect_success 'hook gets all queued upda test_cmp expect actual ## t/t1430-bad-ref-name.sh ## +@@ + #!/bin/sh + + test_description='Test handling of ref names that check-ref-format rejects' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1430-bad-ref-name.sh: test_expect_success 'fast-import: fail on invalid branch name ".badbranchname"' corrupt COMMIT @@ t/t1450-fsck.sh . ./test-lib.sh ## t/t1500-rev-parse.sh ## +@@ + #!/bin/sh + + test_description='test git rev-parse' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1500-rev-parse.sh: test_expect_success 'showing the superproject correctly' ' test_commit -C super/dir/sub branch1_commit && git -C super add dir/sub && @@ t/t1500-rev-parse.sh: test_expect_success 'showing the superproject correctly' ' test_commit -C super branch2_commit && ## t/t1503-rev-parse-verify.sh ## +@@ t/t1503-rev-parse-verify.sh: test_description='test git rev-parse --verify' + + exec </dev/null + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1503-rev-parse-verify.sh: test_expect_success 'works with one good rev' ' test "$rev_hash3" = "$HASH3" && rev_hash4=$(git rev-parse --verify $HASH4) && @@ t/t1503-rev-parse-verify.sh: test_expect_success 'no stdout output on error' ' test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' ' ## t/t1505-rev-parse-last.sh ## +@@ + + test_description='test @{-N} syntax' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1505-rev-parse-last.sh: test_expect_success 'setup' ' make_commit 3 && git checkout side && @@ t/t1505-rev-parse-last.sh: test_expect_success '@{-1}@{1} works' ' test_expect_success '@{-3} fails' ' ## t/t1506-rev-parse-diagnosis.sh ## +@@ t/t1506-rev-parse-diagnosis.sh: test_description='test git rev-parse diagnosis for invalid argument' + + exec </dev/null + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1506-rev-parse-diagnosis.sh: test_expect_success 'incorrect file in :path and :N:path' ' ' @@ t/t1506-rev-parse-diagnosis.sh: test_expect_success 'incorrect file in :path and ' ## t/t1507-rev-parse-upstream.sh ## +@@ + + test_description='test <branch>@{upstream} syntax' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1507-rev-parse-upstream.sh: test_expect_success 'setup' ' test_commit 1 && git checkout -b side && @@ t/t1507-rev-parse-upstream.sh: test_expect_success 'log -g other@{u}@{now}' ' Date: Thu Apr 7 15:15:13 2005 -0700 ## t/t1508-at-combinations.sh ## +@@ + #!/bin/sh + + test_description='test various @{X} syntax combinations together' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1508-at-combinations.sh: fail() { } @@ t/t1508-at-combinations.sh: check "@{-1}@{1}" commit old-one check "@@/at-test" ref refs/heads/@@/at-test ## t/t1511-rev-parse-caret.sh ## +@@ + + test_description='tests for ref^{stuff}' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1511-rev-parse-caret.sh: test_expect_success 'setup' ' git commit -m Initial && git tag -a -m commit commit-tag && @@ t/t1511-rev-parse-caret.sh: test_expect_success 'ref^{tag}' ' ## t/t1512-rev-parse-disambiguation.sh ## +@@ t/t1512-rev-parse-disambiguation.sh: one tagged as v1.0.0. They all have one regular file each. + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1512-rev-parse-disambiguation.sh: test_expect_success 'more history' ' side=$(git rev-parse HEAD) && @@ t/t1512-rev-parse-disambiguation.sh: test_expect_success 'more history' ' # clean up a0blgqsjc as well. If you use resolve, merge will ## t/t1513-rev-parse-prefix.sh ## +@@ + + test_description='Tests for rev-parse --prefix' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1513-rev-parse-prefix.sh: test_expect_success 'disambiguate path with valid prefix' ' ' @@ t/t1513-rev-parse-prefix.sh: test_expect_success 'disambiguate path with valid p test_cmp expected actual ## t/t1514-rev-parse-push.sh ## +@@ + #!/bin/sh + + test_description='test <branch>@{push} syntax' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1514-rev-parse-push.sh: test_expect_success 'setup' ' git remote add other other.git && test_commit base && @@ t/t1514-rev-parse-push.sh: test_expect_success 'setup' ' test_expect_success 'triangular @{push} fails with default=simple' ' ## t/t1700-split-index.sh ## +@@ + + test_description='split index mode tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t1700-split-index.sh: test_expect_success 'do not refresh null base index' ' test_commit initial && git checkout -b side-branch && @@ t/t1700-split-index.sh: test_expect_success 'do not refresh null base index' ' git update-index --split-index && test_commit more && # must not write a new shareindex, or we wont catch the problem - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;; - esac - -+case "$TEST_NUMBER" in -+[01]*) -+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main -+ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME -+ ;; -+esac -+ - # If --stress was passed, run this test repeatedly in several parallel loops. - if test "$GIT_TEST_STRESS_STARTED" = "done" - then 3: 0d4f1275f7 ! 4: f5dbc0d5bb t2*: adjust the references to the default branch name "main" @@ Metadata ## Commit message ## t2*: adjust the references to the default branch name "main" - This trick was performed via + Carefully excluding t2106, which sees independent development elsewhere + at the time of writing, we transition above-mentioned tests to the + default branch name `main`. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ - -e 's/Master/Main/g' -- t2*.sh) + -e 's/Master/Main/g' -- t2*.sh && + git checkout HEAD -- t2106\*) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t2007-checkout-symlink.sh ## +@@ + + test_description='git checkout to switch between branches with symlink<->dir' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2007-checkout-symlink.sh: test_expect_success setup ' echo hello >frotz/filfre && git add frotz/filfre && @@ t/t2007-checkout-symlink.sh: test_expect_success setup ' test_expect_success 'switch from dir to symlink' ' ## t/t2009-checkout-statinfo.sh ## +@@ + + test_description='checkout should leave clean stat info' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2009-checkout-statinfo.sh: test_expect_success 'branch switching' ' git reset --hard && test "$(git diff-files --raw)" = "" && @@ t/t2009-checkout-statinfo.sh: test_expect_success 'path checkout' ' ' ## t/t2010-checkout-ambiguous.sh ## +@@ + + test_description='checkout and pathspecs/refspecs ambiguities' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2010-checkout-ambiguous.sh: test_expect_success 'reference must be a tree' ' ' @@ t/t2010-checkout-ambiguous.sh: test_expect_success 'disambiguate checking out fr ' ## t/t2011-checkout-invalid-head.sh ## +@@ + + test_description='checkout switching away from an invalid branch' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2011-checkout-invalid-head.sh: test_expect_success 'setup' ' ' @@ t/t2011-checkout-invalid-head.sh: test_expect_success 'pack refs' ' test_done ## t/t2012-checkout-last.sh ## +@@ + + test_description='checkout can switch to last branch and merge base' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2012-checkout-last.sh: test_expect_success 'first branch switch' ' test_expect_success '"checkout -" switches back' ' @@ t/t2012-checkout-last.sh: test_expect_success 'merge base test setup' ' test_done ## t/t2015-checkout-unborn.sh ## +@@ + #!/bin/sh + + test_description='checkout from unborn branch' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2015-checkout-unborn.sh: test_expect_success 'setup' ' git add file && git commit -m base @@ t/t2015-checkout-unborn.sh: test_expect_success 'setup' ' test_expect_success 'checkout from unborn preserves untracked files' ' ## t/t2017-checkout-orphan.sh ## +@@ t/t2017-checkout-orphan.sh: test_description='git checkout --orphan + + Main Tests for --orphan functionality.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2017-checkout-orphan.sh: test_expect_success '--orphan creates a new orphan branch from HEAD' ' test_tick && git commit -m "Third Commit" && @@ t/t2017-checkout-orphan.sh: test_expect_success '--orphan with -l makes reflog w ' ## t/t2020-checkout-detach.sh ## +@@ + #!/bin/sh + + test_description='checkout into detached HEAD state' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2020-checkout-detach.sh: check_no_orphan_warning() { } @@ t/t2020-checkout-detach.sh: test_expect_success 'describe_detached_head prints n cat >1st_detach <<-EOF && ## t/t2022-checkout-paths.sh ## -@@ t/t2022-checkout-paths.sh: test_description='checkout $tree -- $paths' +@@ + #!/bin/sh + + test_description='checkout $tree -- $paths' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh test_expect_success setup ' mkdir dir && @@ t/t2022-checkout-paths.sh: test_expect_success 'do not touch unmerged entries ma ' ## t/t2023-checkout-m.sh ## +@@ t/t2023-checkout-m.sh: test_description='checkout -m -- <conflicted path> + + Ensures that checkout -m on a resolved file restores the conflicted file' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2023-checkout-m.sh: test_expect_success setup ' test_tick && test_commit both.txt both.txt initial && @@ t/t2024-checkout-dwim.sh: test_expect_success 'loosely defined local base branch status_uno_is_clean && ## t/t2027-checkout-track.sh ## +@@ + + test_description='tests for git branch --track' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2027-checkout-track.sh: test_expect_success 'setup' ' ' @@ t/t2027-checkout-track.sh: test_expect_success 'setup' ' ## t/t2030-unresolve-info.sh ## +@@ + + test_description='undoing resolution' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2030-unresolve-info.sh: test_expect_success setup ' test_commit fourth fi/le fourth && git checkout add-add && @@ t/t2030-unresolve-info.sh: test_expect_success 'rerere forget (binary)' ' test_must_fail git merge fifth && ## t/t2060-switch.sh ## +@@ + + test_description='switch basic functionality' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2060-switch.sh: test_expect_success 'switch branch' ' ' @@ t/t2060-switch.sh: test_expect_success 'switching ignores file of same branch na test_must_fail git switch foo && ## t/t2070-restore.sh ## +@@ + + test_description='restore basic functionality' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2070-restore.sh: test_expect_success 'setup' ' echo ignored >ignored && echo /ignored >.gitignore && @@ t/t2070-restore.sh: test_expect_success 'restore --ignore-unmerged ignores unmer git commit -am second && test_must_fail git merge first && - ## t/t2106-update-index-assume-unchanged.sh ## -@@ t/t2106-update-index-assume-unchanged.sh: test_expect_success 'do not switch branches with dirty file' \ - git checkout other && - echo dirt >file && - git update-index --assume-unchanged file && -- test_must_fail git checkout master' -+ test_must_fail git checkout main' - - test_done - ## t/t2400-worktree-add.sh ## +@@ + + test_description='test git worktree add' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2400-worktree-add.sh: test_expect_success 'setup' ' test_expect_success '"add" an existing worktree' ' @@ t/t2400-worktree-add.sh: test_branch_upstream () { "refs/heads/*:refs/remotes/$1/*" && ## t/t2401-worktree-prune.sh ## +@@ + + test_description='prune $GIT_DIR/worktrees' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2401-worktree-prune.sh: test_expect_success 'not prune recent checkouts' ' test_expect_success 'not prune proper checkouts' ' @@ t/t2401-worktree-prune.sh: test_expect_success 'not prune recent checkouts' ' ' ## t/t2402-worktree-list.sh ## +@@ + + test_description='test git worktree list' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2402-worktree-list.sh: test_expect_success 'rev-parse --git-common-dir on main worktree' ' test_expect_success 'rev-parse --git-path objects linked worktree' ' echo "$(git rev-parse --show-toplevel)/.git/objects" >expect && @@ t/t2402-worktree-list.sh: test_expect_success '"list" all worktrees --porcelain git -C there worktree list >out && ## t/t2405-worktree-submodule.sh ## +@@ + + test_description='Combination of submodules and multiple worktrees' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t2405-worktree-submodule.sh: test_expect_success 'add superproject worktree' ' ' @@ t/t2405-worktree-submodule.sh: test_expect_success 'add superproject worktree an grep "file1 updated" out ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --[01]*) -+[0-2]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 4: aee29a0528 ! 5: 090ac6e9a1 t3[0-3]*: adjust the references to the default branch name "main" @@ Metadata ## Commit message ## t3[0-3]*: adjust the references to the default branch name "main" - This trick was performed via + Carefully excluding t3040, which sees independent development elsewhere + at the time of writing, we transition above-mentioned tests to the + default branch name `main`. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ - -e 's/Master/Main/g' -- t3[0-3]*.sh t3206/*) + -e 's/Master/Main/g' -- t3[0-3]*.sh t3206/* && + git checkout HEAD -- t3040\*) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> - ## t/t3040-subprojects-basic.sh ## -@@ t/t3040-subprojects-basic.sh: test_expect_success 'checkout in superproject' ' - ' + ## t/t3200-branch.sh ## +@@ - # just interesting what happened... --# git diff --name-status -M save master -+# git diff --name-status -M save main + test_description='git branch assorted tests' - test_done - - ## t/t3200-branch.sh ## +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3200-branch.sh: test_expect_success 'branch -h in broken repository' ' ( cd broken && @@ t/t3200-branch.sh: test_expect_success 'option override configured sort' ' ) ## t/t3201-branch-contains.sh ## +@@ + + test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3201-branch-contains.sh: test_expect_success setup ' echo 1 >file && @@ t/t3201-branch-contains.sh: test_expect_success 'branch --merged combined with - EOF ## t/t3202-show-branch-octopus.sh ## +@@ + + test_description='test show-branch with more than 8 heads' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3202-show-branch-octopus.sh: test_expect_success 'setup' ' for i in $numbers @@ t/t3202-show-branch-octopus.sh: test_expect_success 'setup' ' test_tick && ## t/t3203-branch-output.sh ## +@@ + #!/bin/sh + + test_description='git branch display tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3203-branch-output.sh: test_expect_success 'make remote branches' ' cat >expect <<'EOF' branch-one @@ t/t3203-branch-output.sh: test_expect_success '--color overrides auto-color' ' ambiguous $one one ## t/t3204-branch-name-interpretation.sh ## +@@ t/t3204-branch-name-interpretation.sh: Branch name arguments are usually names which are taken to be inside of + refs/heads/, but we interpret some magic syntax like @{-1}, @{upstream}, etc. + This script aims to check the behavior of those corner cases. + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3204-branch-name-interpretation.sh: test_expect_success 'update branch via @{-1}' ' git branch previous one && @@ t/t3204-branch-name-interpretation.sh: test_expect_success 'disallow deleting re expect_branch refs/remotes/origin/previous one && ## t/t3205-branch-color.sh ## -@@ t/t3205-branch-color.sh: test_description='basic branch output coloring' +@@ + #!/bin/sh + + test_description='basic branch output coloring' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh test_expect_success 'set up some sample branches' ' test_commit foo && @@ t/t3205-branch-color.sh: test_expect_success 'set up some color config' ' test_decode_color <actual.raw >actual && ## t/t3206-range-diff.sh ## +@@ + + test_description='range-diff tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3206-range-diff.sh: test_expect_success 'setup' ' ' @@ t/t3206/history.export: mark :11 committer Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200 ## t/t3210-pack-refs.sh ## +@@ t/t3210-pack-refs.sh: test_description='git pack-refs should not change the branch semantic + This test runs git pack-refs and git show-ref and checks that the branch + semantic is still the same. + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3210-pack-refs.sh: test_expect_success 'delete ref with dangling packed version' ' git commit --allow-empty -m "future garbage" && git pack-refs --all && @@ t/t3210-pack-refs.sh: test_expect_success 'retry acquiring packed-refs.lock' ' ln -s my-deviant-packed-refs .git/packed-refs && ## t/t3211-peel-ref.sh ## +@@ + #!/bin/sh + + test_description='tests for the peel_ref optimization of packed-refs' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3211-peel-ref.sh: print_ref() { test_expect_success 'set up expected show-ref output' ' @@ t/t3301-notes.sh: test_expect_success 'git notes copy diagnoses too many or too ## t/t3302-notes-index-expensive.sh ## +@@ + + test_description='Test commit notes index (expensive!)' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3302-notes-index-expensive.sh: create_repo () { notemark=$(($mark+1)) test_tick && @@ t/t3302-notes-index-expensive.sh: create_repo () { data <<COMMIT ## t/t3303-notes-subtrees.sh ## +@@ + + test_description='Test commit notes organized in subtrees' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3303-notes-subtrees.sh: test_expect_success "setup: create $number_of_commits commits" ' nr=$(($nr+1)) && test_tick && @@ t/t3303-notes-subtrees.sh: test_concatenated_notes () { second_note_path=$(echo "$sha1" | sed "$2") ## t/t3304-notes-mixed.sh ## +@@ + + test_description='Test notes trees that also contain non-notes' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3304-notes-mixed.sh: test_expect_success "setup: create a couple of commits" ' test_tick && @@ t/t3308-notes-merge.sh: test_expect_success 'fail to merge into various non-note test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x ## t/t3320-notes-merge-worktrees.sh ## +@@ + + test_description='Test merging of notes trees in multiple worktrees' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3320-notes-merge-worktrees.sh: test_expect_success 'modify notes ref ourselves (x)' ' ' @@ t/t3320-notes-merge-worktrees.sh: test_expect_success 'modify notes ref ourselve ' test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --[0-2]*) -+[0-2]*|3[0-3]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 5: 041ad86e33 ! 6: c8494f4602 t3416: preemptively adjust alignment in a comment @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t3416-rebase-onto-threedots.sh ## -@@ t/t3416-rebase-onto-threedots.sh: test_description='git rebase --onto A...B' +@@ t/t3416-rebase-onto-threedots.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME # # F---G topic G' # / / 6: 2f62b3f469 ! 7: c0d02e4d9d t34*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t3400-rebase.sh ## +@@ t/t3400-rebase.sh: test_description='git rebase assorted tests + This test runs git rebase and checks that the author information is not lost + among other things. + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3400-rebase.sh: test_expect_success 'prepare repository with topic branches' ' git update-index --add Y && git commit -m "Add Y." && @@ t/t3400-rebase.sh: test_expect_success 'rebase -c rebase.useBuiltin=false warnin ## t/t3402-rebase-merge.sh ## +@@ + + test_description='git rebase --merge test' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3402-rebase-merge.sh: test_expect_success setup ' git commit -m"initial" && git branch side && @@ t/t3402-rebase-merge.sh: test_expect_success '--reapply-cherry-picks refrains fr git -C client rev-list --objects --all --missing=print >missing_list && ## t/t3403-rebase-skip.sh ## +@@ + + test_description='git rebase --merge --skip tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3403-rebase-skip.sh: test_expect_success setup ' ' @@ t/t3403-rebase-skip.sh: test_expect_success 'rebase moves back to skip-reference test_expect_success 'rebase --skip with --merge' ' ## t/t3405-rebase-malformed.sh ## +@@ + + test_description='rebase should handle arbitrary git message' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3405-rebase-malformed.sh: test_expect_success setup ' git add file3 && git commit --allow-empty-message -m "" && @@ t/t3405-rebase-malformed.sh: test_expect_success 'rebase commit with multi-line test_expect_success 'rebase -i commit with empty message' ' ## t/t3406-rebase-message.sh ## +@@ + + test_description='messages from rebase operation' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3406-rebase-message.sh: test_expect_success 'setup' ' ' @@ t/t3406-rebase-message.sh: test_expect_success 'rebase -i onto unrelated history test_i18ngrep "5 files changed" actual ## t/t3407-rebase-abort.sh ## +@@ + + test_description='git rebase --abort tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3407-rebase-abort.sh: testrebase() { cd "$work_dir" && # Clean up the state from the previous one @@ t/t3407-rebase-abort.sh: test_expect_success 'rebase --merge --quit' ' git rebase --quit && ## t/t3408-rebase-multi-line.sh ## +@@ + + test_description='rebasing a commit with multi-line first paragraph.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3408-rebase-multi-line.sh: But otherwise with a sane description." side2 && test_expect_success rebase ' @@ t/t3408-rebase-multi-line.sh: But otherwise with a sane description." side2 && test_cmp expect actual ## t/t3409-rebase-preserve-merges.sh ## +@@ t/t3409-rebase-preserve-merges.sh: test_description='git rebase -p should preserve merges + + Run "git rebase -p" and check that merges are properly carried along + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3409-rebase-preserve-merges.sh: export GIT_AUTHOR_EMAIL # Clone 2 (conflicting merge): @@ t/t3409-rebase-preserve-merges.sh: test_expect_success 'setup for merge-preservi git clone ./. clone3 && ## t/t3412-rebase-root.sh ## +@@ t/t3412-rebase-root.sh: test_description='git rebase --root + + Tests if git rebase --root --onto <newparent> can rebase the root commit. + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3412-rebase-root.sh: test_expect_success 'prepare repository' ' test_expect_success 'rebase --root fails with too many args' ' @@ t/t3412-rebase-root.sh: EOF ## t/t3413-rebase-hook.sh ## +@@ + + test_description='git rebase with its hook(s)' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3413-rebase-hook.sh: test_expect_success setup ' git add git && test_tick && @@ t/t3413-rebase-hook.sh: test_expect_success 'rebase --no-verify overrides pre-re ' ## t/t3415-rebase-autosquash.sh ## +@@ + + test_description='auto squash' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3415-rebase-autosquash.sh: test_expect_success 'wrapped original subject' ' test_expect_success 'abort last squash' ' @@ t/t3415-rebase-autosquash.sh: test_expect_success 'wrapped original subject' ' git commit --allow-empty -m first && ## t/t3416-rebase-onto-threedots.sh ## -@@ t/t3416-rebase-onto-threedots.sh: test_description='git rebase --onto A...B' +@@ + + test_description='git rebase --onto A...B' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-rebase.sh" @@ t/t3416-rebase-onto-threedots.sh: test_expect_success 'rebase -i --keep-base mas test_done ## t/t3418-rebase-continue.sh ## +@@ + + test_description='git rebase --continue tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3418-rebase-continue.sh: test_expect_success 'setup' ' git checkout -b topic HEAD^ && test_commit "commit-new-file-F2-on-topic-branch" F2 22 && @@ t/t3418-rebase-continue.sh: test_rerere_autoupdate () { git add F2 && ## t/t3419-rebase-patch-id.sh ## +@@ + + test_description='git rebase - test patch id computation' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3419-rebase-patch-id.sh: test_expect_success 'setup' ' test_expect_success 'setup: 500 lines' ' @@ t/t3419-rebase-patch-id.sh: test_expect_success 'setup attributes' ' git commit -q -m squashed && ## t/t3420-rebase-autostash.sh ## +@@ + # + + test_description='git rebase --autostash tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3420-rebase-autostash.sh: test_expect_success setup ' git add . && test_tick && @@ t/t3423-rebase-reword.sh: test_expect_success 'reword after a conflict preserves git add file-2 && ## t/t3427-rebase-subtree.sh ## +@@ t/t3427-rebase-subtree.sh: test_description='git rebase tests for -Xsubtree + + This test runs git rebase and tests the subtree strategy. + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3427-rebase-subtree.sh: commit_message() { # # topic_1 - topic_2 - topic_3 @@ t/t3430-rebase-merges.sh: Initial setup: \ \ / \ F - G (second) \ + Conflicting-G + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3430-rebase-merges.sh: test_expect_success 'setup' ' git checkout -b first && test_commit B && @@ t/t3430-rebase-merges.sh: test_expect_success 'labels that are object IDs are re git commit -m "Merge commit '\''$third'\'' into labels" && ## t/t3431-rebase-fork-point.sh ## -@@ t/t3431-rebase-fork-point.sh: test_description='git rebase --fork-point test' +@@ + + test_description='git rebase --fork-point test' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ t/t3431-rebase-fork-point.sh: test_rebase 'G F C E D B A' --no-fork-point git tag one && ## t/t3432-rebase-fast-forward.sh ## +@@ + + test_description='ensure rebase fast-forwards commits when possible' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3432-rebase-fast-forward.sh: test_rebase_same_head_ () { changes='no changes' @@ t/t3434-rebase-i18n.sh: test_description='rebase with changing encoding \ 3 - 4 first \ + 5 - 6 second + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3434-rebase-i18n.sh: test_expect_success 'rebase --rebase-merges update encoding eucJP to UTF-8' ' git config i18n.commitencoding eucJP && git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second && @@ t/t3434-rebase-i18n.sh: test_rebase_continue_update_encode () { git add two.t && ## t/t3435-rebase-gpg-sign.sh ## +@@ + + test_description='test rebase --[no-]gpg-sign' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3435-rebase-gpg-sign.sh: test_expect_success 'setup: merge commit' ' test_commit fork-point && git switch -c side && @@ t/t3436-rebase-more-options.sh: test_expect_success 'setup' ' rm foo && test_write_lines "line 1" " line 2" "line 3" >file && git commit -am "add file" && - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --[0-2]*|3[0-3]*) -+3404) -+ # Avoid conflicts with patch series that are cooking at the same time -+ # as the patch series changing the default of `init.defaultBranch`. -+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master -+ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME -+ ;; -+[0-2]*|3[0-4]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 7: 0cf754646e ! 8: db3a104750 t3[5-9]*: adjust the references to the default branch name "main" @@ t/t3500-cherry.sh +This test cherry-picks one local change of two into main branch, and checks that git cherry only returns the second patch in the local branch ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh @@ t/t3500-cherry.sh: test_expect_success \ test_tick && @@ t/t3500-cherry.sh: test_expect_success \ test_expect_success 'cherry ignores whitespace' ' ## t/t3501-revert-cherry-pick.sh ## +@@ t/t3501-revert-cherry-pick.sh: test_description='test cherry-pick and revert with renames + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3501-revert-cherry-pick.sh: test_expect_success 'cherry-pick on unborn branch' ' test_expect_success 'cherry-pick "-" to pick from previous branch' ' git checkout unborn && @@ t/t3501-revert-cherry-pick.sh: test_expect_success 'cherry-pick "-" is meaningle git cat-file commit HEAD | grep ^Signed-off-by: >signoff && ## t/t3502-cherry-pick-merge.sh ## +@@ t/t3502-cherry-pick-merge.sh: test_description='cherry picking and reverting a merge + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3502-cherry-pick-merge.sh: test_expect_success setup ' echo new line >B && git commit -m "add line to B" B && @@ t/t3502-cherry-pick-merge.sh: test_expect_success setup ' ## t/t3503-cherry-pick-root.sh ## +@@ + + test_description='test cherry-picking (and reverting) a root commit' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3503-cherry-pick-root.sh: test_expect_success setup ' test_expect_success 'cherry-pick a root commit' ' @@ t/t3503-cherry-pick-root.sh: test_expect_success 'cherry-pick two root commits' test_cmp expect.file2 file2 && ## t/t3504-cherry-pick-rerere.sh ## -@@ t/t3504-cherry-pick-rerere.sh: test_description='cherry-pick should rerere for conflicts' +@@ + + test_description='cherry-pick should rerere for conflicts' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh test_expect_success setup ' test_commit foo && @@ t/t3504-cherry-pick-rerere.sh: test_expect_success 'cherry-pick --continue rejec test_done ## t/t3505-cherry-pick-empty.sh ## +@@ + + test_description='test cherry-picking an empty commit' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3505-cherry-pick-empty.sh: test_expect_success setup ' test_tick && git commit --allow-empty-message -m "" && @@ t/t3505-cherry-pick-empty.sh: test_expect_success 'cherry-pick a commit that bec ## t/t3506-cherry-pick-ff.sh ## +@@ + + test_description='test cherry-picking with --ff option' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3506-cherry-pick-ff.sh: test_expect_success setup ' ' @@ t/t3506-cherry-pick-ff.sh: test_expect_success 'merge setup' ' git checkout -b new A ## t/t3507-cherry-pick-conflict.sh ## +@@ t/t3507-cherry-pick-conflict.sh: test_description='test cherry-pick and revert with conflicts + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3507-cherry-pick-conflict.sh: test_expect_success setup ' test_commit redundant-pick foo c redundant && git commit --allow-empty --allow-empty-message && @@ t/t3507-cherry-pick-conflict.sh: test_expect_success setup ' ' ## t/t3508-cherry-pick-many-commits.sh ## +@@ + + test_description='test cherry-picking many commits' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3508-cherry-pick-many-commits.sh: test_expect_success setup ' ' @@ t/t3508-cherry-pick-many-commits.sh: test_expect_success 'cherry-pick -3 fourth git rev-list --reverse first..fourth | git cherry-pick --stdin && ## t/t3509-cherry-pick-merge-df.sh ## +@@ + #!/bin/sh + + test_description='Test cherry-pick with directory/file conflicts' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3509-cherry-pick-merge-df.sh: test_expect_success 'Setup rename across paths each below D/F conflicts' ' test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' ' @@ t/t3509-cherry-pick-merge-df.sh: test_expect_success 'Setup rename across paths ## t/t3512-cherry-pick-submodule.sh ## +@@ + + test_description='cherry-pick can handle submodules' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3512-cherry-pick-submodule.sh: test_expect_success 'unrelated submodule/file conflict is ignored' ' git add a_file && git commit -m "modify a file" && @@ t/t3512-cherry-pick-submodule.sh: test_expect_success 'unrelated submodule/file git submodule update sub && ## t/t3600-rm.sh ## +@@ + + test_description='Test of the various options to git rm.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3600-rm.sh: test_expect_success 'setup submodule conflict' ' echo 1 >nitfol && git add nitfol && @@ t/t3600-rm.sh: test_expect_success 'checking out a commit after submodule remova echo "?? submod/" >expected && ## t/t3701-add-interactive.sh ## +@@ + #!/bin/sh + + test_description='add -i basic tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3701-add-interactive.sh: test_expect_success 'patch mode ignores unmerged entries' ' test_commit non-conflict && git checkout -b side && @@ t/t3701-add-interactive.sh: test_expect_success 'patch mode ignores unmerged ent echo y | git add -p >output && ## t/t3901-i18n-patch.sh ## +@@ + + test_description='i18n settings and format-patch | am pipe' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3901-i18n-patch.sh: test_expect_success setup ' # the first commit on the side branch is UTF-8 @@ t/t3901-i18n-patch.sh: test_expect_success !MINGW 'am (L/U)' ' git am out-u1 out-u2 && ## t/t3903-stash.sh ## +@@ + + test_description='Test git stash' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3903-stash.sh: test_expect_success 'stash branch' ' git commit file -m second && git stash branch stashbranch && @@ t/t3903-stash.sh: test_expect_success 'create with multiple arguments for the me git add foo && ## t/t3910-mac-os-precompose.sh ## +@@ + + test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t3910-mac-os-precompose.sh: test_expect_success "git checkout link nfd" ' git checkout l.$Odiarnfd ' @@ t/t3910-mac-os-precompose.sh: test_expect_success "Add long decomposed filename" git reset --hard && git checkout -b mac_os_long_nfc_fn ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-2]*|3[0-4]*) -+[0-3]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 8: cf6c1d1d83 ! 9: 0164eb9745 t4*: adjust the references to the default branch name "main" @@ Metadata ## Commit message ## t4*: adjust the references to the default branch name "main" - Carefully excluding t4013, which sees independent development elsewhere - at the time of writing, we use `main` as the default branch name in t4*. - This trick was performed via + Carefully excluding t4013 and t4015, which see independent development + elsewhere at the time of writing, we use `main` as the default branch + name in t4*. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t4014-format-patch.sh ## +@@ + + test_description='various format-patch tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4014-format-patch.sh: test_expect_success setup ' test_tick && git commit -m "Side changes #3 with \\n backslash-n in it." && @@ t/t4014-format-patch.sh: test_expect_success 'format-patch --pretty=mboxrd' ' test_commit fleep blorp ' - ## t/t4015-diff-whitespace.sh ## -@@ t/t4015-diff-whitespace.sh: test_expect_success 'combined diff with autocrlf conversion' ' - echo >x goodbye && - git commit -m "the other side" x && - git config core.autocrlf true && -- test_must_fail git merge master && -+ test_must_fail git merge main && - - git diff >actual.raw && - sed -e "1,/^@@@/d" actual.raw >actual && - ## t/t4017-diff-retval.sh ## +@@ + + test_description='Return value of diffs' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4017-diff-retval.sh: test_expect_success 'check detects leftover conflict markers' ' git checkout HEAD^ && echo binary >>b && @@ t/t4017-diff-retval.sh: test_expect_success 'check detects leftover conflict mar test 3 = $(grep "conflict marker" test.out | wc -l) && ## t/t4038-diff-combined.sh ## +@@ + + test_description='combined diff' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4038-diff-combined.sh: test_expect_success 'check --cc --raw with forty trees' ' ' @@ t/t4038-diff-combined.sh: test_expect_success 'combine diff gets tree sorting ri printf "MM\tfoo\n" >expect && ## t/t4041-diff-submodule-option.sh ## +@@ t/t4041-diff-submodule-option.sh: test_description='Support for verbose submodule differences in git diff + This test tries to verify the sanity of the --submodule option of git diff. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4041-diff-submodule-option.sh: test_expect_success 'diff --submodule with objects referenced by alternates' ' (cd super && (cd sub && @@ t/t4041-diff-submodule-option.sh: test_expect_success 'diff --submodule with obj ) && ## t/t4048-diff-combined-binary.sh ## +@@ + #!/bin/sh + + test_description='combined and merge diff handle binary files and textconv' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4048-diff-combined-binary.sh: test_expect_success 'setup binary merge conflict' ' echo threeQ3 | q_to_nul >binary && git commit -a -m three && @@ t/t4048-diff-combined-binary.sh: index $three,$two..0000000 ' ## t/t4052-stat-output.sh ## +@@ + + test_description='test --stat output of various commands' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4052-stat-output.sh: cat >expect <<'EOF' EOF test_expect_success 'merge --stat respects COLUMNS (big change)' ' @@ t/t4052-stat-output.sh: cat >expect <<'EOF' ' ## t/t4056-diff-order.sh ## +@@ + + test_description='diff order' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4056-diff-order.sh: done test_expect_success 'setup for testing combine-diff order' ' git checkout -b tmp HEAD~ && @@ t/t4056-diff-order.sh: done ' ## t/t4057-diff-combined-paths.sh ## +@@ + + test_description='combined diff show only paths that are different to all parents' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4057-diff-combined-paths.sh: test_expect_success 'trivial merge - combine-diff empty' ' echo $i/2 >>$i.txt done && @@ t/t4057-diff-combined-paths.sh: test_expect_success 'merge removed a file' ' git commit --amend && ## t/t4061-diff-indent.sh ## +@@ + test_description='Test diff indent heuristic. + + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4061-diff-indent.sh: test_expect_success 'diff-index: nice spaces with --indent-heuristic' ' git reset --soft HEAD~ && git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted && @@ t/t4061-diff-indent.sh: test_expect_success 'diff-files: --no-indent-heuristic o test_done ## t/t4066-diff-emit-delay.sh ## +@@ + #!/bin/sh + + test_description='test combined/stat/moved interaction' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4066-diff-emit-delay.sh: test_expect_success 'set up history with a merge' ' test_commit B && git checkout -b side HEAD^ && @@ t/t4066-diff-emit-delay.sh: test_expect_success 'set up history with a merge' ' ## t/t4068-diff-symmetric-merge-base.sh ## -@@ t/t4068-diff-symmetric-merge-base.sh: test_description='behavior of diff with symmetric-diff setups and --merge-base' +@@ + + test_description='behavior of diff with symmetric-diff setups and --merge-base' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh # build these situations: # - normal merge with one merge base (br1...b2r); @@ t/t4068-diff-symmetric-merge-base.sh: do ## t/t4103-apply-binary.sh ## +@@ + test_description='git apply handling binary patches + + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4103-apply-binary.sh: test_expect_success 'setup' ' git update-index --add --remove file1 file2 file3 file4 && git commit -m "Second Version" && @@ t/t4103-apply-binary.sh: test_expect_success 'check binary diff with replacement test_expect_success 'apply binary diff -- should fail.' \ ## t/t4108-apply-threeway.sh ## +@@ + + test_description='git apply --3way' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4108-apply-threeway.sh: test_expect_success setup ' test_tick && test_write_lines 1 two 3 4 5 six 7 >one && @@ t/t4108-apply-threeway.sh: test_expect_success 'apply with --3way with rerere en # but rerere should have replayed the recorded resolution ## t/t4121-apply-diffs.sh ## +@@ + #!/bin/sh + + test_description='git apply for contextually independent diffs' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4121-apply-diffs.sh: test_expect_success 'setup' \ git commit -a -q -m 2 && echo 9 >>file && @@ t/t4121-apply-diffs.sh: test_expect_success 'setup' \ 'check if contextually independent diffs for the same file apply' \ ## t/t4122-apply-symlink-inside.sh ## +@@ + #!/bin/sh + + test_description='apply to deeper directory without getting fooled with symlink' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4122-apply-symlink-inside.sh: test_expect_success apply ' test_expect_success 'check result' ' @@ t/t4122-apply-symlink-inside.sh: test_expect_success apply ' ## t/t4150-am.sh ## +@@ + + test_description='git am running' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4150-am.sh: test_expect_success setup ' test_tick && git commit -m "added another file" && @@ t/t4200-rerere.sh: test_description='git rerere +++++++ [main] initial ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh @@ t/t4200-rerere.sh: test_expect_success 'setup' ' test_tick && @@ t/t4200-rerere.sh: test_expect_success 'setup simple stage 1 handling' ' ) ## t/t4201-shortlog.sh ## +@@ + test_description='git shortlog + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4201-shortlog.sh: test_expect_success 'shortlog with revision pseudo options' ' ' @@ t/t4201-shortlog.sh: test_expect_success 'shortlog with revision pseudo options' ' ## t/t4202-log.sh ## +@@ + + test_description='git log' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4202-log.sh: test_expect_success 'set up merge history' ' git checkout -b side HEAD~4 && test_commit side-1 1 1 && @@ t/t4202-log.sh: test_expect_success 'log diagnoses bogus HEAD' ' echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD && ## t/t4203-mailmap.sh ## +@@ + + test_description='.mailmap configurations' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4203-mailmap.sh: test_expect_success 'No mailmap files, but configured' ' test_expect_success 'setup mailmap blob tests' ' @@ t/t4203-mailmap.sh: test_expect_success 'No mailmap files, but configured' ' EOF ## t/t4204-patch-id.sh ## +@@ + + test_description='git patch-id' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4204-patch-id.sh: test_expect_success 'setup' ' test_write_lines $as b >foo && test_write_lines $as b >bar && @@ t/t4204-patch-id.sh: test_expect_success '--stable overrides patchid.stable = fa test_expect_success 'patch-id respects config from subdir' ' ## t/t4207-log-decoration-colors.sh ## +@@ + + test_description='Test for "git log --decorate" colors' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4207-log-decoration-colors.sh: test_expect_success setup ' cat >expected <<EOF @@ t/t4207-log-decoration-colors.sh: test_expect_success setup ' ## t/t4208-log-magic-pathspec.sh ## +@@ + + test_description='magic pathspec tests using git-log' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4208-log-magic-pathspec.sh: test_expect_success '"git log :/a -- " should not be ambiguous' ' ' @@ t/t4208-log-magic-pathspec.sh: test_expect_success 'command line pathspec parsin git log --merge -- a ' + ## t/t4211-line-log.sh ## +@@ + #!/bin/sh + + test_description='test log -L' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh + ## t/t4211/history.export ## @@ t/t4211/history.export: long f(long x) return s; @@ t/t4211/history.export: long f(long x) committer Thomas Rast <trast@student.ethz.ch> 1362045024 +0100 ## t/t4214-log-graph-octopus.sh ## +@@ + + test_description='git log --graph of skewed left octopus merge.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4214-log-graph-octopus.sh: test_cmp_colored_graph () { test_expect_success 'set up merge history' ' test_commit initial && @@ t/t4214-log-graph-octopus.sh: test_cmp_colored_graph () { test_commit $i $i $i tag$i || return $? ## t/t4216-log-bloom.sh ## +@@ + #!/bin/sh + + test_description='git log for a path with Bloom filters' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4216-log-bloom.sh: test_expect_success 'setup test - repo, commits, commit graph, log outputs' ' test_commit c10 file_to_be_deleted && git checkout -b side HEAD~4 && @@ t/t4216-log-bloom.sh: do test_bloom_filters_used "$option -- $path" && ## t/t4253-am-keep-cr-dos.sh ## +@@ + test_description='git-am mbox with dos line ending. + + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t4253-am-keep-cr-dos.sh: test_expect_success 'setup repository with dos files' ' test_expect_success 'am with dos files without --keep-cr' ' @@ t/t4257-am-interactive.sh: test_expect_success 'set up patches to apply' ' ' # Sanity check our setup. - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404) -+3404|4013) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-3]*) -+[0-4]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 9: 6ff4594a28 = 10: 36d633a5ec t5323: prepare centered comment for `master` -> `main` 10: be29e07892 ! 11: d9d1d14681 t5[0-4]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5150-request-pull.sh ## +@@ + + test_description='Test workflows involving pull request.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5150-request-pull.sh: test_expect_success 'setup' ' test_tick && git commit -m "\"Thirty days\", a reminder of month lengths" && @@ t/t5150-request-pull.sh: test_expect_success 'pull request with stale object' ' test_must_fail git request-pull initial "$downstream_url" tags/full \ ## t/t5304-prune.sh ## +@@ + # + + test_description='prune' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no reflog' ' test_expect_success 'prune: prune former HEAD after checking out branch' ' @@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no ## t/t5305-include-tag.sh ## +@@ + #!/bin/sh + + test_description='git pack-object --include-tag' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5305-include-tag.sh: test_expect_success 'check unpacked result (have all objects)' ' test_expect_success 'single-branch clone can transfer tag' ' @@ t/t5305-include-tag.sh: test_expect_success 'check unpacked result (have all obj ## t/t5312-prune-corruption.sh ## +@@ t/t5312-prune-corruption.sh: bail out or to proceed using it as a reachable tip, but it is _not_ + OK to proceed as if it did not exist. Otherwise we might silently + delete objects that cannot be recovered. + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5312-prune-corruption.sh: test_expect_success 'disable reflogs' ' ' @@ t/t5312-prune-corruption.sh: test_expect_success 'pack-refs does not silently de ## t/t5317-pack-objects-filter-objects.sh ## +@@ + + test_description='git pack-objects using object filtering' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5317-pack-objects-filter-objects.sh: test_expect_success 'verify sparse:oid=oid-ish' ' awk -f print_2.awk ls_files_result | sort >expected && @@ t/t5317-pack-objects-filter-objects.sh: test_expect_success 'verify sparse:oid=o git -C r4 index-pack ../filter.pack && ## t/t5322-pack-objects-sparse.sh ## +@@ + #!/bin/sh + + test_description='pack-objects object selection using sparse algorithm' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5322-pack-objects-sparse.sh: test_expect_success 'setup repo' ' git commit -m "Initialized trees" && for i in $(test_seq 1 3) @@ t/t5323-pack-redundant.sh: test_expect_success 'shared: one pack is redundant wi # P1 | x x x x x x x x | ## t/t5400-send-pack.sh ## +@@ + test_description='See why rewinding head breaks send-pack + + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5400-send-pack.sh: test_expect_success 'pack the destination repository' ' ' @@ t/t5401-update-hooks.sh: test_expect_success 'pre-receive hook that forgets to r ' ## t/t5402-post-merge-hook.sh ## +@@ + # + + test_description='Test the post-merge hook.' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5402-post-merge-hook.sh: test_expect_success setup ' git update-index a && tree1=$(git write-tree) && @@ t/t5402-post-merge-hook.sh: test_expect_success setup ' git clone ./. clone2 && ## t/t5403-post-checkout-hook.sh ## +@@ + # + + test_description='Test the post-checkout hook.' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5403-post-checkout-hook.sh: test_expect_success setup ' test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' ' @@ t/t5403-post-checkout-hook.sh: test_expect_success 'post-checkout receives the r read old new flag <.git/post-checkout.args && ## t/t5404-tracking-branches.sh ## +@@ + + test_description='tracking branch update checks for git push' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5404-tracking-branches.sh: test_expect_success 'prepare pushable branches' ' git checkout -b b2 origin/b2 && echo aa-b2 >>file && @@ t/t5404-tracking-branches.sh: test_expect_success 'mixed-success push returns er test_expect_success 'check tracking branches not updated for failed refs' ' ## t/t5405-send-pack-rewind.sh ## +@@ + + test_description='forced push to replace commit we do not have' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5405-send-pack-rewind.sh: test_expect_success setup ' mkdir another && ( cd another && @@ t/t5405-send-pack-rewind.sh: test_expect_success 'forced push should succeed' ' ' ## t/t5407-post-rewrite-hook.sh ## +@@ + # + + test_description='Test the post-rewrite hook.' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5407-post-rewrite-hook.sh: test_expect_success 'setup' ' git checkout A^0 && test_commit E bar E && @@ t/t5407-post-rewrite-hook.sh: test_expect_success 'setup' ' mkdir .git/hooks ## t/t5410-receive-pack-alternates.sh ## -@@ t/t5410-receive-pack-alternates.sh: test_description='git receive-pack with alternate ref filtering' +@@ + + test_description='git receive-pack with alternate ref filtering' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh +@@ t/t5410-receive-pack-alternates.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME test_expect_success 'setup' ' test_commit base && git clone -s --bare . fork && @@ t/t5410-receive-pack-alternates.sh: test_description='git receive-pack with alte test_commit private ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404|4013) -+3404|4013|5310) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-4]*) -+[0-4]*|5[0-4]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 11: 5126d90a32 ! 12: f7a9bc07c7 t5503: prepare aligned comment for replacing `master` with `main` @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5503-tagfollow.sh ## -@@ t/t5503-tagfollow.sh: test_description='test automatic tag following' +@@ t/t5503-tagfollow.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME # L - A ------ O ------ B # \ \ \ # \ C - origin/cat \ 12: 332677cbf9 ! 13: 4d7eb7dc28 t550*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5500-fetch-pack.sh ## +@@ + + test_description='Testing multi_ack pack fetching' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5500-fetch-pack.sh: test_expect_success 'in_vain resetted upon ACK' ' rm -rf myserver myclient && git init myserver && @@ t/t5500-fetch-pack.sh: test_expect_success 'fetching deepen' ' three ## t/t5501-fetch-push-alternates.sh ## +@@ + #!/bin/sh + + test_description='fetch/push involving alternates' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5501-fetch-push-alternates.sh: test_expect_success setup ' test_expect_success 'pushing into a repository with the same alternate' ' ( @@ t/t5501-fetch-push-alternates.sh: test_expect_success 'pushing into a repository test_cmp one.count fetcher.count ## t/t5502-quickfetch.sh ## +@@ + + test_description='test quickfetch from local' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5502-quickfetch.sh: test_expect_success 'quickfetch should not copy from alternate' ' q }" @@ t/t5502-quickfetch.sh: test_expect_success 'quickfetch should not copy from alte ## t/t5503-tagfollow.sh ## -@@ t/t5503-tagfollow.sh: test_description='test automatic tag following' +@@ + + test_description='test automatic tag following' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh +@@ t/t5503-tagfollow.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME # L - A ------ O ------ B # \ \ \ # \ C - origin/cat \ @@ t/t5503-tagfollow.sh: test_expect_success 'new clone fetch master and tags' ' test $T = $(git rev-parse --verify tag1) && ## t/t5504-fetch-receive-strict.sh ## +@@ + #!/bin/sh + + test_description='fetch/receive strict mode' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5504-fetch-receive-strict.sh: test_expect_success 'fetch without strict' ' cd dst && git config fetch.fsckobjects false && @@ t/t5504-fetch-receive-strict.sh: test_expect_success 'push with transfer.fsckobj ## t/t5505-remote.sh ## +@@ + + test_description='git remote porcelain-ish' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5505-remote.sh: setup_repository () { git add elif && test_tick && @@ t/t5505-remote.sh: test_expect_success 'unqualified <dst> refspec DWIM and advic ) && ## t/t5506-remote-groups.sh ## +@@ + #!/bin/sh + + test_description='git remote group handling' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5506-remote-groups.sh: repo_fetched() { test_expect_success 'setup' ' mkdir one && (cd one && git init) && @@ t/t5506-remote-groups.sh: repo_fetched() { test_expect_success 'no group updates all' ' ## t/t5509-fetch-push-namespaces.sh ## +@@ + #!/bin/sh + + test_description='fetch/push involving ref namespaces' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5509-fetch-push-namespaces.sh: test_expect_success setup ' test_expect_success 'pushing into a repository using a ref namespace' ' ( @@ t/t5509-fetch-push-namespaces.sh: test_expect_success 'denyCurrentBranch and unb ) ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-4]*|5[0-4]*) -+[0-4]*|5[0-4]*|550*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 13: b7333ef201 ! 14: 88b2c30cc8 t551*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5510-fetch.sh ## +@@ t/t5510-fetch.sh: test_description='Per branch config variables affects "git fetch". + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5510-fetch.sh: test_expect_success "clone and setup child repos" ' git clone . two && ( @@ t/t5511-refspec.sh: test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzz ## t/t5512-ls-remote.sh ## +@@ + + test_description='git ls-remote' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5512-ls-remote.sh: test_expect_success 'use branch.<name>.remote if possible' ' echo "From $URL" >exp_err && @@ t/t5512-ls-remote.sh: test_expect_success 'ls-remote --sort fails gracefully out ## t/t5514-fetch-multiple.sh ## +@@ + + test_description='fetch --all works correctly' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5514-fetch-multiple.sh: setup_repository () { git add elif && test_tick && @@ t/t5514-fetch-multiple.sh: test_expect_success 'git fetch --all (skipFetchAll)' ## t/t5516-fetch-push.sh ## +@@ t/t5516-fetch-push.sh: This test checks the following functionality: + * reflogs + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5516-fetch-push.sh: test_expect_success setup ' git add path1 && test_tick && @@ t/t5516-fetch-push.sh: test_expect_success 'updateInstead with push-to-checkout git diff --quiet && ## t/t5517-push-mirror.sh ## +@@ + + test_description='pushing to a mirror repository' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5517-push-mirror.sh: invert () { } @@ t/t5517-push-mirror.sh: test_expect_success 'remote.foo.mirror=no has no effect' ## t/t5518-fetch-exit-status.sh ## +@@ + + test_description='fetch exit status test' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5518-fetch-exit-status.sh: test_expect_success setup ' echo side >file && git commit -a -m side && @@ t/t5518-fetch-exit-status.sh: test_expect_success setup ' ## t/t5519-push-alternates.sh ## +@@ + + test_description='push to a repository that borrows from elsewhere' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5519-push-alternates.sh: test_expect_success setup ' >file && git add . && @@ t/t5519-push-alternates.sh: test_expect_success 'alice works and pushes yet agai # at a commit Bob does not fully know about, but # he happens to have the commit object (but not the # necessary tree) in his repository from Alice. - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-4]*|5[0-4]*|550*) -+[0-4]*|5[0-4]*|55[01]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 14: 4b1b1ee51f ! 15: 3b73811af4 t55[23]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5520-pull.sh ## +@@ + + test_description='pulling into void' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5520-pull.sh: test_expect_success 'pulling into void' ' test_cmp file cloned/file ' @@ t/t5520-pull.sh: test_expect_success 'setup for avoiding reapplying old patches' rm -rf src && ## t/t5521-pull-options.sh ## +@@ + + test_description='pull options' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5521-pull-options.sh: test_expect_success 'git pull --force' ' cat >>.git/config <<-\EOF && [remote "one"] @@ t/t5521-pull-options.sh: test_expect_success 'git pull --all --dry-run' ' ) ## t/t5523-push-upstream.sh ## +@@ + #!/bin/sh + + test_description='push with --set-upstream' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5523-push-upstream.sh: check_config() { test_cmp expect.$1 actual.$1 } @@ t/t5523-push-upstream.sh: test_expect_success TTY 'push --no-progress suppresses ## t/t5527-fetch-odd-refs.sh ## -@@ t/t5527-fetch-odd-refs.sh: test_description='test fetching of oddly-named refs' +@@ + #!/bin/sh + + test_description='test fetching of oddly-named refs' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh # afterwards we will have: # HEAD - two @@ t/t5527-fetch-odd-refs.sh: test_expect_success LONG_REF 'fetch handles extremely ## t/t5528-push-default.sh ## +@@ + #!/bin/sh + + test_description='check various push.default settings' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5528-push-default.sh: test_push_failure () { # $1 = success or failure @@ t/t5530-upload-pack-error.sh: test_expect_success 'create empty repository' ' ## t/t5531-deep-submodule-push.sh ## +@@ + + test_description='test push with submodules' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5531-deep-submodule-push.sh: test_expect_success setup ' test_expect_success 'push works with recorded gitlink' ' ( @@ t/t5531-deep-submodule-push.sh: test_expect_success 'push propagating refspec to git -C submodule.git rev-parse branch2 >actual_submodule && ## t/t5533-push-cas.sh ## +@@ + + test_description='compare & swap push force/delete safety' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5533-push-cas.sh: setup_src_dup_dst () { ( cd dup && @@ t/t5533-push-cas.sh: test_expect_success '"--force-if-includes" should allow for ## t/t5534-push-signed.sh ## +@@ + + test_description='signed push' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5534-push-signed.sh: prepare_dst () { rm -fr dst && test_create_repo dst && @@ t/t5534-push-signed.sh: prepare_dst () { ## t/t5537-fetch-shallow.sh ## +@@ + + test_description='fetch/clone from a shallow clone' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5537-fetch-shallow.sh: test_expect_success 'fetch from shallow clone' ' cd shallow2 && git fetch && @@ t/t5537-fetch-shallow.sh: test_expect_success 'shallow fetches check connectivit ! test -e "$HTTPD_ROOT_PATH/one-time-perl" && ## t/t5538-push-shallow.sh ## +@@ + + test_description='push from/to a shallow clone' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5538-push-shallow.sh: test_expect_success 'push from shallow clone' ' ( cd shallow && @@ t/t5538-push-shallow.sh: EOF 1 ## t/t5539-fetch-http-shallow.sh ## +@@ + + test_description='fetch/clone from a shallow clone over http' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5539-fetch-http-shallow.sh: test_expect_success 'clone http repository' ' ( cd clone && @@ t/t5539-fetch-http-shallow.sh: test_expect_success 'fetching deepen' ' cat >expected <<-\EOF && four three - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404|4013|5310) -+3404|4013|5310|5526) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-4]*|5[0-4]*|55[01]*) -+[0-4]*|5[0-4]*|55[0-3]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 15: c37d97c2d8 ! 16: 5c57fbe695 t55[4-9]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5540-http-push-webdav.sh ## +@@ t/t5540-http-push-webdav.sh: test_description='test WebDAV http-push + + This test runs various sanity checks on http-push.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5540-http-push-webdav.sh: test_expect_success 'push already up-to-date' ' test_expect_success 'push to remote repository with unpacked refs' ' (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && @@ t/t5540-http-push-webdav.sh: test_expect_success 'PUT and MOVE sends object to U test_commit pw-user && ## t/t5541-http-push-smart.sh ## +@@ + # + + test_description='test smart pushing over http via http-backend' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5541-http-push-smart.sh: test_expect_success 'used receive-pack service' ' ' @@ t/t5541-http-push-smart.sh: test_expect_success 'colorize errors/hints' ' test_i18ngrep "<RED>error: failed to push some refs" decoded && ## t/t5542-push-http-shallow.sh ## +@@ + + test_description='push from/to a shallow clone over http' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5542-push-http-shallow.sh: test_expect_success 'push to shallow repo via http' ' ( cd full && @@ t/t5542-push-http-shallow.sh: test_expect_success 'push from shallow repo via ht 4 ## t/t5543-atomic-push.sh ## +@@ + + test_description='pushing to a repository using the atomic push option' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5543-atomic-push.sh: test_expect_success 'atomic push works for a single branch' ' test_commit one && git push --mirror up && @@ t/t5543-atomic-push.sh: test_expect_success 'atomic push reports (mirror, but re test_cmp expect actual ## t/t5545-push-options.sh ## +@@ + + test_description='pushing to a repository using push options' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5545-push-options.sh: test_expect_success 'one push option works for a single branch' ' test_commit one && git push --mirror up && @@ t/t5548-push-porcelain.sh: run_git_push_porcelain_output_test() { test_cmp expect actual ## t/t5550-http-fetch-dumb.sh ## +@@ + #!/bin/sh + + test_description='test dumb fetching over http via static file' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5550-http-fetch-dumb.sh: test_expect_success 'create http-accessible bare repository with loose objects' hooks/post-update ) && @@ t/t5550-http-fetch-dumb.sh: test_expect_success 'set up evil alternates scheme' # Here we'll just redirect via HTTP. In a real-world attack these would be on ## t/t5551-http-fetch-smart.sh ## +@@ + #!/bin/sh + + test_description='test smart fetching over http via http-backend' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5551-http-fetch-smart.sh: test_expect_success 'create http-accessible bare repository' ' git --bare init ) && @@ t/t5552-skipping-fetch-negotiator.sh: test_expect_success 'use ref advertisement test_config -C client fetch.negotiationalgorithm skipping && ## t/t5553-set-upstream.sh ## +@@ + #!/bin/sh + + test_description='"git fetch/pull --set-upstream" basic tests.' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5553-set-upstream.sh: test_expect_success 'setup bare parent fetch' ' git remote add upstream parent ' @@ t/t5553-set-upstream.sh: test_expect_success 'pull --set-upstream upstream tag d check_config_missing other2 ' + ## t/t5560-http-backend-noserver.sh ## +@@ + #!/bin/sh + + test_description='test git-http-backend-noserver' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh + ## t/t5561-http-backend.sh ## +@@ + #!/bin/sh + + test_description='test git-http-backend' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5561-http-backend.sh: POST() { grep '^[^#]' >exp <<EOF @@ t/t556x_common: get_static_files() { get_static_files "200 OK" ## t/t5570-git-daemon.sh ## +@@ + #!/bin/sh + + test_description='test fetching over git protocol' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5570-git-daemon.sh: test_expect_success 'create git-accessible bare repository' ' : >git-daemon-export-ok ) && @@ t/t5570-git-daemon.sh: test_expect_success FAKENC 'hostname interpolation works ## t/t5571-pre-push-hook.sh ## +@@ + #!/bin/sh + + test_description='check pre-push hooks' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5571-pre-push-hook.sh: EOF cat >expected <<EOF parent1 @@ t/t5572-pull-submodule.sh: test_expect_success 'branch has no merge base with re git -C child reset --hard "$OTHER" && ## t/t5580-unc-paths.sh ## +@@ + #!/bin/sh + + test_description='various Windows-only path tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5580-unc-paths.sh: test_expect_success fetch ' git init to-fetch && ( @@ t/t5580-unc-paths.sh: test_expect_success fetch ' ## t/t5581-http-curl-verbose.sh ## +@@ + #!/bin/sh + + test_description='test GIT_CURL_VERBOSE' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5581-http-curl-verbose.sh: test_expect_success 'setup repository' ' git add file && git commit -m one && @@ t/t5581-http-curl-verbose.sh: test_expect_success 'setup repository' ' test_expect_success 'failure in git-upload-pack is shown' ' ## t/t5582-fetch-negative-refspec.sh ## +@@ t/t5582-fetch-negative-refspec.sh: test_description='"git fetch" with negative refspecs. + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "clone and setup child repos" ' git switch -c alternate && echo >file updated again by one && @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "fetch with negative patt cut -f -1 .git/FETCH_HEAD >actual && test_cmp expect actual ) - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-4]*|5[0-4]*|55[0-3]*) -+[0-4]*|5[0-5]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 16: dda6ce098c ! 17: b2fda75261 t5[6-9]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t5601-clone.sh ## +@@ + + test_description=clone + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5601-clone.sh: test_expect_success 'clone respects global branch.autosetuprebase' ' rm -fr dst && git clone src dst && @@ t/t5601-clone.sh: test_expect_success 'clone from a repository with two identica test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another ## t/t5604-clone-reference.sh ## +@@ + # + + test_description='test clone --reference' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5604-clone-reference.sh: test_expect_success 'existence of info/alternates' ' ' @@ t/t5604-clone-reference.sh: test_expect_success 'fetch with incomplete alternate ' ## t/t5605-clone-local.sh ## +@@ + #!/bin/sh + + test_description='test local clone' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5605-clone-local.sh: test_expect_success 'preparing origin repository' ' test "$(cd a.git && git config --bool core.bare)" = true && test "$(cd x && git config --bool core.bare)" = true && @@ t/t5605-clone-local.sh: test_expect_success 'clone empty repository' ' ## t/t5606-clone-options.sh ## +@@ + #!/bin/sh + + test_description='basic clone options' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5606-clone-options.sh: test_expect_success 'setup' ' test_expect_success 'clone -o' ' @@ t/t5606-clone-options.sh: test_expect_success 'prefers config "clone.defaultRemo ## t/t5607-clone-bundle.sh ## +@@ + #!/bin/sh + + test_description='some bundle related tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5607-clone-bundle.sh: test_expect_success 'setup' ' ' @@ t/t5608-clone-2gb.sh: test_expect_success 'setup' ' echo "data 5" && ## t/t5609-clone-branch.sh ## +@@ + #!/bin/sh + + test_description='clone --branch option' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5609-clone-branch.sh: test_expect_success 'setup' ' echo one >file && git add file && git commit -m one && git checkout -b two && @@ t/t5609-clone-branch.sh: test_expect_success 'clone -b sets up tracking' ' ) ## t/t5610-clone-detached.sh ## +@@ + #!/bin/sh + + test_description='test cloning a repository with detached HEAD' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5610-clone-detached.sh: test_expect_success 'setup' ' ' @@ t/t5610-clone-detached.sh: test_expect_success 'cloned HEAD is detached' ' git clone "file://$PWD" detached-orphan ## t/t5611-clone-config.sh ## +@@ + #!/bin/sh + + test_description='tests for git clone -c key=value' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5611-clone-config.sh: test_expect_success 'clone -c config is available during clone' ' test_expect_success 'clone -c remote.origin.fetch=<refspec> works' ' @@ t/t5611-clone-config.sh: test_expect_success 'clone -c remote.<remote>.fetch=<re ' ## t/t5612-clone-refspec.sh ## -@@ t/t5612-clone-refspec.sh: test_description='test refspec written by clone-command' +@@ + #!/bin/sh + + test_description='test refspec written by clone-command' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' @@ t/t5614-clone-submodules-shallow.sh: test_description='Test shallow cloning of r mkdir sub && ## t/t5616-partial-clone.sh ## +@@ + + test_description='git partial clone' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5616-partial-clone.sh: test_expect_success 'verify that .promisor file contains refs fetched' ' test_line_count = 1 promisorlist && git -C srv.bare rev-parse --verify HEAD >headhash && @@ t/t5616-partial-clone.sh: test_expect_success 'fetch lazy-fetches only to resolv grep "fetch< version 2" trace && ## t/t5617-clone-submodules-remote.sh ## -@@ t/t5617-clone-submodules-remote.sh: test_description='Test cloning repos with submodules using remote-tracking branc +@@ + + test_description='Test cloning repos with submodules using remote-tracking branches' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh +@@ t/t5617-clone-submodules-remote.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME pwd=$(pwd) test_expect_success 'setup' ' @@ t/t5617-clone-submodules-remote.sh: test_expect_success 'clone with --single-bra ' ## t/t5700-protocol-v1.sh ## +@@ t/t5700-protocol-v1.sh: TEST_NO_CREATE_REPO=1 + GIT_TEST_PROTOCOL_VERSION=0 + export GIT_TEST_PROTOCOL_VERSION + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5700-protocol-v1.sh: test_expect_success 'fetch with git:// using protocol v1' ' GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \ fetch 2>log && @@ t/t5700-protocol-v1.sh: test_expect_success 'push with http:// using protocol v1 ## t/t5701-git-serve.sh ## +@@ + + test_description='test protocol v2 server commands' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5701-git-serve.sh: test_expect_success 'wrong object-format' ' # test_expect_success 'setup some refs and tags' ' @@ t/t5701-git-serve.sh: test_expect_success 'symrefs parameter' ' ## t/t5702-protocol-v2.sh ## +@@ t/t5702-protocol-v2.sh: test_description='test git wire-protocol version 2' + + TEST_NO_CREATE_REPO=1 + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5702-protocol-v2.sh: test_expect_success 'ref advertisement is filtered with ls-remote using protocol test_when_finished "rm -f log" && @@ t/t5702-protocol-v2.sh: test_expect_success 'push with http:// and a config of v ## t/t5703-upload-pack-ref-in-want.sh ## +@@ + + test_description='upload-pack ref-in-want' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5703-upload-pack-ref-in-want.sh: write_command () { # c(o/foo) d(o/bar) @@ t/t5703-upload-pack-ref-in-want.sh: test_expect_success 'server is initially beh ## t/t5801-remote-helpers.sh ## +@@ + + test_description='Test remote-helper import and export commands' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t5801-remote-helpers.sh: test_expect_success 'fetch multiple branches' ' (cd local && git fetch @@ t/t5801-remote-helpers.sh: test_expect_success 'fetch HEAD' ' echo more >>file && git commit -a -m more ) && - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-4]*|5[0-5]*) -+[0-5]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 17: 27d7994933 ! 18: dfbc93923b t6[0-3]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t6000-rev-list-misc.sh ## +@@ + + test_description='miscellaneous rev-list tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6000-rev-list-misc.sh: test_expect_success 'propagate uninteresting flag down correctly' ' ' @@ t/t6000-rev-list-misc.sh: test_expect_success 'propagate uninteresting flag down < that ## t/t6001-rev-list-graft.sh ## +@@ + + test_description='Revision traversal vs grafts and path limiter' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6001-rev-list-graft.sh: test_expect_success setup ' git commit -a -m "Third in one history." && A2=$(git rev-parse --verify HEAD) && @@ t/t6004-rev-list-path-optim.sh: test_description='git rev-list trivial path opti / / o---------o----o----o----o side a0 c0 c1 a1 c2 +@@ t/t6004-rev-list-path-optim.sh: test_description='git rev-list trivial path optimization test + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6004-rev-list-path-optim.sh: test_expect_success 'further setup' ' git add c && test_tick && @@ t/t6004-rev-list-path-optim.sh: test_expect_success 'path optimization 2' ' ' ## t/t6006-rev-list-format.sh ## +@@ + + test_description='git rev-list --pretty=format test' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6006-rev-list-format.sh: test_expect_success 'setup' ' test_format () { cat >expect.$1 @@ t/t6006-rev-list-format.sh: test_expect_success '"%h %gD: %gs" is same as git-re ## t/t6007-rev-list-cherry-pick-file.sh ## +@@ + + test_description='test git rev-list --cherry-pick -- file' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6007-rev-list-cherry-pick-file.sh: test_expect_success setup ' test_tick && git commit -m "E" && @@ t/t6007-rev-list-cherry-pick-file.sh: test_expect_success '--cherry-pick with in cat >expect <<EOF ## t/t6008-rev-list-submodule.sh ## +@@ + + test_description='git rev-list involving submodules that this repo has' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6008-rev-list-submodule.sh: test_expect_success 'setup' ' ' @@ t/t6008-rev-list-submodule.sh: test_expect_success 'setup' ' test_done ## t/t6009-rev-list-parent.sh ## +@@ + + test_description='ancestor culling and limiting by parent number' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6009-rev-list-parent.sh: test_expect_success 'setup roots, merges and octopuses' ' test_commit seven && git checkout -b yetanotherbranch four && @@ t/t6009-rev-list-parent.sh: test_expect_success 'dodecapus' ' git tag dodecapus && ## t/t6012-rev-list-simplify.sh ## +@@ + + test_description='merge simplification' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6012-rev-list-simplify.sh: test_expect_success setup ' git add side && test_tick && git commit -m "Side root" && @@ t/t6012-rev-list-simplify.sh: test_expect_success setup ' ## t/t6013-rev-list-reverse-parents.sh ## +@@ + + test_description='--reverse combines with --parents' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6013-rev-list-reverse-parents.sh: test_expect_success 'set up --reverse example' ' commit two && git checkout -b side HEAD^ && @@ t/t6013-rev-list-reverse-parents.sh: test_expect_success 'set up --reverse examp ## t/t6016-rev-list-graph-simplify-history.sh ## +@@ + + test_description='--graph and simplified history' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6016-rev-list-graph-simplify-history.sh: test_expect_success 'set up rev-list --graph test' ' test_commit A1 foo.txt && test_commit A2 bar.txt && @@ t/t6016-rev-list-graph-simplify-history.sh: test_expect_success 'set up rev-list git checkout -b B A1 && ## t/t6017-rev-list-stdin.sh ## +@@ + + test_description='log family learns --stdin' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6017-rev-list-stdin.sh: test_expect_success setup ' done && for i in $them @@ t/t6017-rev-list-stdin.sh: test_expect_success 'not only --stdin' ' ' ## t/t6018-rev-list-glob.sh ## +@@ + + test_description='rev-list/rev-parse --glob' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6018-rev-list-glob.sh: compare () { test_expect_success 'setup' ' @@ t/t6018-rev-list-glob.sh: test_expect_success 'shortlog accepts --glob/--tags/-- ## t/t6019-rev-list-ancestry-path.sh ## +@@ t/t6019-rev-list-ancestry-path.sh: test_description='--ancestry-path' + # --ancestry-path G..M -- G.t == L + # --ancestry-path --simplify-merges G^..M -- G.t == G L + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6019-rev-list-ancestry-path.sh: test_expect_success 'setup criss-cross' ' (cd criss-cross && git init && @@ t/t6019-rev-list-ancestry-path.sh: test_expect_success 'setup criss-cross' ' # no commits in bc descend from cb ## t/t6030-bisect-porcelain.sh ## +@@ t/t6030-bisect-porcelain.sh: test_description='Tests git bisect functionality' + + exec </dev/null + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6030-bisect-porcelain.sh: test_expect_success 'bisect start without -- takes unknown arg as pathspec' ' grep bar ".git/BISECT_NAMES" ' @@ t/t6030-bisect-porcelain.sh: test_expect_success 'bisect: --no-checkout - target git rev-list --objects BISECT_HEAD --not \$GOOD >tmp.\$\$ && ## t/t6040-tracking-info.sh ## +@@ + + test_description='remote tracking stats' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6040-tracking-info.sh: test_expect_success setup ' git branch -d brokenbase && git checkout -b b6 origin @@ t/t6040-tracking-info.sh: test_expect_success '--set-upstream-to @{-1}' ' ' ## t/t6050-replace.sh ## +@@ + # + test_description='Tests replace refs functionality' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6050-replace.sh: test_expect_success 'tag replaced commit' ' ' @@ t/t6050-replace.sh: test_expect_success GPG 'set up a merge commit with a merget git cat-file commit $HASH10 | grep "^mergetag object" ## t/t6101-rev-parse-parents.sh ## +@@ + + test_description='Test git rev-parse with different parent options' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6101-rev-parse-parents.sh: test_expect_success 'setup' ' test_commit second && git checkout --orphan tmp && @@ t/t6101-rev-parse-parents.sh: test_expect_success 'setup' ' ## t/t6110-rev-list-sparse.sh ## +@@ + #!/bin/sh + + test_description='operations that cull histories in unusual ways' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6110-rev-list-sparse.sh: test_expect_success setup ' git checkout -b side HEAD^ && test_commit D && @@ t/t6110-rev-list-sparse.sh: test_expect_success setup ' test_expect_success 'rev-list --first-parent --boundary' ' ## t/t6111-rev-list-treesame.sh ## +@@ + + test_description='TREESAME and limiting' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6111-rev-list-treesame.sh: test_expect_success setup ' git checkout other-branch && test_commit "Added other" other "Hello" C && @@ t/t6111-rev-list-treesame.sh: test_expect_success setup ' ## t/t6112-rev-list-filters-objects.sh ## +@@ + + test_description='git rev-list using object filtering' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6112-rev-list-filters-objects.sh: test_expect_success 'verify sparse:oid=oid-ish omits top-level files' ' sort >expected && @@ t/t6112-rev-list-filters-objects.sh: test_expect_success 'combine:... with more ## t/t6120-describe.sh ## +@@ t/t6120-describe.sh: test_description='test describe' + # + # First parent of a merge commit is on the same line, second parent below. + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6120-describe.sh: check_describe c-* --tags HEAD^^2 check_describe B --tags HEAD^^2^ check_describe e --tags HEAD^^^ @@ t/t6120-describe.sh: test_expect_success 'describe commits with disjoint bases 2 ) ## t/t6200-fmt-merge-msg.sh ## +@@ + + test_description='fmt-merge-msg test' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6200-fmt-merge-msg.sh: test_expect_success GPG 'set up a signed tag' ' test_expect_success 'message for merging local branch' ' echo "Merge branch ${apos}left${apos}" >expected && @@ t/t6200-fmt-merge-msg.sh: test_expect_success 'merge-msg with "merging" an annot test_done ## t/t6302-for-each-ref-filter.sh ## +@@ + + test_description='test for-each-refs usage of ref-filter APIs' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6302-for-each-ref-filter.sh: test_expect_success 'setup some history and refs' ' git tag $sign -m "A signed tag" signed-tag && git tag $sign -m "Signed doubly" doubly-signed-tag signed-tag && @@ t/t6302-for-each-ref-filter.sh: test_expect_success '--merged is compatible with git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual && rm -r worktree_dir && git worktree prune && - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404|4013|5310|5526) -+3404|4013|5310|5526|6300) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-5]*) -+[0-5]*|6[0-3]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 18: 04878e2268 = 19: 0a4bc77dac t64*: preemptively adjust alignment to prepare for `master` -> `main` 19: f0fa12b577 ! 20: 3dbc83c6a1 t6[4-9]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t6400-merge-df.sh ## +@@ + # + + test_description='Test merge with directory/file conflicts' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6400-merge-df.sh: test_expect_success 'prepare repository' ' ' @@ t/t6400-merge-df.sh: test_expect_success 'F/D conflict' ' test_expect_success 'setup modify/delete + directory/file conflict' ' ## t/t6402-merge-rename.sh ## +@@ + #!/bin/sh + + test_description='Merge-recursive merging renames' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6402-merge-rename.sh: test_expect_success 'setup' ' git branch change && git branch change+rename && @@ t/t6402-merge-rename.sh: test_expect_success 'setup spurious "refusing to lose u ' ## t/t6404-recursive-merge.sh ## +@@ + #!/bin/sh + + test_description='Test merge without common ancestors' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6404-recursive-merge.sh: test_expect_success 'setup tests' ' git add a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 && @@ t/t6404-recursive-merge.sh: test_expect_success 'setup tests' ' ## t/t6405-merge-symlinks.sh ## +@@ t/t6405-merge-symlinks.sh: test_description='merging symlinks on filesystem w/o symlink support. + This tests that git merge-recursive writes merge results as plain files + if core.symlinks is false.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6405-merge-symlinks.sh: test_expect_success 'setup' ' git branch b-file && l=$(printf file | git hash-object -t blob -w --stdin) && @@ t/t6405-merge-symlinks.sh: test_expect_success 'setup' ' ## t/t6406-merge-attr.sh ## +@@ + + test_description='per path merge controlled by merge attribute' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6406-merge-attr.sh: test_expect_success setup ' git branch side && for f in text binary union @@ t/t6406-merge-attr.sh: test_expect_success 'custom merge does not lock index' ' test_done ## t/t6407-merge-binary.sh ## +@@ + + test_description='ask merge-recursive to merge binary files' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6407-merge-binary.sh: test_expect_success setup ' git ls-files -s a >E0 && git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 && @@ t/t6407-merge-binary.sh: test_expect_success recursive ' false ## t/t6409-merge-subtree.sh ## +@@ + + test_description='subtree merge strategy' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6409-merge-subtree.sh: test_expect_success setup ' echo >>hello world && git add hello && @@ t/t6409-merge-subtree.sh: test_expect_success 'merge update' ' git ls-files -s >actual && ## t/t6411-merge-filemode.sh ## +@@ + #!/bin/sh + + test_description='merge: handle file mode' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6411-merge-filemode.sh: test_expect_success 'set up mode change in one branch' ' : >file1 && git add file1 && @@ t/t6411-merge-filemode.sh: do_both_modes resolve ' ## t/t6412-merge-large-rename.sh ## +@@ + #!/bin/sh + + test_description='merging with large rename matrix' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6412-merge-large-rename.sh: test_rename() { test_expect_success "rename ($1, $2)" ' n='$1' && @@ t/t6412-merge-large-rename.sh: test_rename() { } ## t/t6413-merge-crlf.sh ## +@@ t/t6413-merge-crlf.sh: test_description='merge conflict in crlf repo + + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6413-merge-crlf.sh: test_expect_success setup ' echo line from b | append_cr >file && git commit -m "add line from b" file && @@ t/t6413-merge-crlf.sh: test_expect_success setup ' test_expect_success 'Check "ours" is CRLF' ' ## t/t6414-merge-rename-nocruft.sh ## +@@ + #!/bin/sh + + test_description='Merge-recursive merging renames' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6414-merge-rename-nocruft.sh: test_expect_success 'setup' ' git update-index A && git commit -m "blue modify A" && @@ t/t6414-merge-rename-nocruft.sh: test_expect_success 'setup' ' # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae ## t/t6415-merge-dir-to-symlink.sh ## +@@ + #!/bin/sh + + test_description='merging when a directory was replaced with a symlink' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6415-merge-dir-to-symlink.sh: test_expect_success 'create a commit where dir a/b changed to symlink' ' test_expect_success 'checkout does not clobber untracked symlink' ' @@ t/t6415-merge-dir-to-symlink.sh: test_expect_success 'do not lose modifications test_expect_success 'setup a merge where dir a/b-2 changed to symlink' ' ## t/t6416-recursive-corner-cases.sh ## +@@ + + test_description='recursive merge corner cases involving criss-cross merges' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6416-recursive-corner-cases.sh: test_expect_success 'git detects conflict merging criss-cross+modify/delete' ' test_line_count = 2 out && @@ t/t6416-recursive-corner-cases.sh: test_expect_success 'check virtual merge base base \ ## t/t6417-merge-ours-theirs.sh ## +@@ + #!/bin/sh + + test_description='Merge-recursive ours and theirs variants' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6417-merge-ours-theirs.sh: test_expect_success setup ' sed -e "s/9/nueve/" >file <elif && git commit -a -m theirs && @@ t/t6418-merge-text-auto.sh *+ [side^] Initial ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6418-merge-text-auto.sh: test_expect_success setup ' git commit -m "add line from b" && git tag b && @@ t/t6418-merge-text-auto.sh: test_expect_success 'Test delete/normalize conflict' test_path_is_missing file ## t/t6419-merge-ignorecase.sh ## +@@ + + test_description='git-merge with case-changing rename on case-insensitive file system' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6419-merge-ignorecase.sh: test_expect_success 'merge with case-changing rename' ' >foo && git add foo && @@ t/t6419-merge-ignorecase.sh: test_expect_success 'merge with case-changing renam ## t/t6422-merge-rename-corner-cases.sh ## +@@ + test_description="recursive merge corner cases w/ renames but not criss-crosses" + # t6036 has corner cases that involve both criss-cross merges and renames + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6422-merge-rename-corner-cases.sh: test_conflicts_with_adds_and_renames() { # Setup: # L @@ t/t6422-merge-rename-corner-cases.sh: test_expect_success 'check nested conflict test_must_fail git merge-file \ ## t/t6425-merge-rename-delete.sh ## +@@ + #!/bin/sh + + test_description='Merge-recursive rename/delete conflict message' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6425-merge-rename-delete.sh: test_expect_success 'rename/delete' ' git mv A B && git commit -m "rename" && @@ t/t6425-merge-rename-delete.sh: test_expect_success 'rename/delete' ' ## t/t6427-diff3-conflict-markers.sh ## +@@ + + test_description='recursive merge diff3 style conflict markers' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6427-diff3-conflict-markers.sh: test_expect_success 'check no merge base' ' # Setup: # L1 @@ t/t6427-diff3-conflict-markers.sh: test_expect_success 'rebase --apply describes ' ## t/t6430-merge-recursive.sh ## +@@ + + test_description='merge-recursive backend test' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6430-merge-recursive.sh: test_expect_success 'setup 1' ' git add a d/e && @@ t/t6432-merge-recursive-space-options.sh *+ [remote^] Initial revision * ok 1: setup ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6432-merge-recursive-space-options.sh: test_expect_success 'setup' ' mv text.txt+ text.txt && git commit -a -m "Remove cruft" && @@ t/t6432-merge-recursive-space-options.sh: test_expect_success 'setup' ' s/Quite correct\(.*\)/It is too correct\1Q/ ## t/t6433-merge-toplevel.sh ## -@@ t/t6433-merge-toplevel.sh: test_description='"git merge" top-level frontend' +@@ + + test_description='"git merge" top-level frontend' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh t3033_reset () { @@ t/t6434-merge-recursive-rename-options.sh: test_description='merge-recursive ren D 0-old D 1-old D 2-old +@@ t/t6434-merge-recursive-rename-options.sh: they are rounded down (see, e.g., Documentation/diff-generate-patch.txt, which + mentions this in a different context). + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6434-merge-recursive-rename-options.sh: test_expect_success 'setup repo' ' get_expected_stages 2 && get_expected_stages 3 && @@ t/t6434-merge-recursive-rename-options.sh: test_expect_success 'setup repo' ' test_expect_success 'setup thresholds' ' ## t/t6436-merge-overwrite.sh ## +@@ t/t6436-merge-overwrite.sh: test_description='git-merge + + Do not overwrite changes.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6436-merge-overwrite.sh: test_expect_success 'set up unborn branch and content' ' ' @@ t/t6436-merge-overwrite.sh: test_expect_success 'set up unborn branch and conten grep foo expect && ## t/t6437-submodule-merge.sh ## +@@ + + test_description='merging with submodules' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6437-submodule-merge.sh: test_expect_success setup ' test_tick && git commit -m root && @@ t/t6437-submodule-merge.sh: test_expect_success 'setup for recursive merge with git commit -m c && ## t/t6439-merge-co-error-msgs.sh ## +@@ + + test_description='unpack-trees error messages' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6439-merge-co-error-msgs.sh: test_expect_success 'setup' ' git add two three four five && git commit -m Second && @@ t/t6439-merge-co-error-msgs.sh: test_expect_success 'not_uptodate_dir porcelain test_must_fail git checkout branch 2>out && ## t/t6501-freshen-objects.sh ## +@@ + # to refer to an existing tree). + + test_description='check pruning of dependent objects' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t6501-freshen-objects.sh: for repack in '' true; do git checkout -b experiment && commit abandon && @@ t/t6501-freshen-objects.sh: for repack in '' true; do git branch -D experiment ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-5]*|6[0-3]*) -+[0-6]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 20: f9c30dc516 ! 21: 2315a253f6 t7[0-4]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t7003-filter-branch.sh ## +@@ + #!/bin/sh + + test_description='git filter-branch' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7003-filter-branch.sh: test_expect_success 'setup' ' mkdir dir && test_commit dir/D && @@ t/t7003-filter-branch.sh: test_expect_success 'automatic remapping to ancestor w ## t/t7004-tag.sh ## +@@ t/t7004-tag.sh: test_description='git tag + + Tests for operations with tags.' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7004-tag.sh: test_expect_success 'checking that branch head with --no-contains lists all but " @@ t/t7004-tag.sh: test_expect_success ULIMIT_STACK_SIZE '--contains and --no-conta test_must_be_empty actual && ## t/t7030-verify-tag.sh ## +@@ + #!/bin/sh + + test_description='signed tag tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7030-verify-tag.sh: test_expect_success GPG 'create signed tags' ' echo 3 >elif && git add elif && test_tick && git commit -m "third on side" && @@ t/t7030-verify-tag.sh: test_expect_success GPG 'create signed tags' ' ## t/t7060-wtstatus.sh ## +@@ + + test_description='basic work tree status reporting' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7060-wtstatus.sh: EOF git checkout -b side HEAD^ && git rm foo && @@ t/t7060-wtstatus.sh: test_expect_success 'status --branch with detached HEAD' ' ## HEAD (no branch) ## t/t7063-status-untracked-cache.sh ## +@@ + + test_description='test untracked cache' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7063-status-untracked-cache.sh: EOF test_expect_success 'set up sparse checkout' ' echo "done/[a-z]*" >.git/info/sparse-checkout && @@ t/t7063-status-untracked-cache.sh: test_expect_success '"status" after file repl status_is_clean ## t/t7102-reset.sh ## +@@ t/t7102-reset.sh: test_description='git reset + + Documented tests for git reset' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7102-reset.sh: test_expect_success 'trying to do reset --soft with pending merge should fail' ' printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile && git commit -a -m "the change in branch2" && @@ t/t7102-reset.sh: test_expect_success '--hard reset to ORIG_HEAD should clear a ' ## t/t7113-post-index-change-hook.sh ## +@@ + + test_description='post index change hook' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7113-post-index-change-hook.sh: test_expect_success 'test checkout and reset trigger the hook' ' EOF : force index to be dirty && @@ t/t7201-co.sh: Test switching across them. ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7201-co.sh: test_expect_success setup ' fill a b c d e f >two && git commit -a -m "Renamer R one->uno, M two" && @@ t/t7201-co.sh: test_expect_success 'checkout --conflict=diff3' ' ! grep "^Previous HEAD" error.log ## t/t7400-submodule-basic.sh ## +@@ t/t7400-submodule-basic.sh: This test tries to verify basic sanity of the init, update and status + subcommands of git submodule. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7400-submodule-basic.sh: inspect() { } @@ t/t7400-submodule-basic.sh: test_expect_success 'apply submodule diff' ' ## t/t7403-submodule-sync.sh ## +@@ t/t7403-submodule-sync.sh: test_description='git submodule sync + These tests exercise the "git submodule sync" subcommand. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7403-submodule-sync.sh: test_expect_success 'change submodule url' ' ( cd super && @@ t/t7403-submodule-sync.sh: test_expect_success '"git submodule sync --recursive" ' ## t/t7406-submodule-update.sh ## -@@ t/t7406-submodule-update.sh: submodule and "git submodule update --rebase/--merge" does not detach the HEAD. +@@ t/t7406-submodule-update.sh: This test verifies that "git submodule update" detaches the HEAD of the + submodule and "git submodule update --rebase/--merge" does not detach the HEAD. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh +@@ t/t7406-submodule-update.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME compare_head() { @@ t/t7406-submodule-update.sh: test_expect_success 'submodule update places git-di ) ## t/t7407-submodule-foreach.sh ## +@@ t/t7407-submodule-foreach.sh: This test verifies that "git submodule foreach" correctly visits all submodules + that are currently checked out. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7407-submodule-foreach.sh: sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD) sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD) @@ t/t7407-submodule-foreach.sh: test_expect_success 'ensure "status --cached --rec test_expect_success 'test "status --recursive" from sub directory' ' ## t/t7409-submodule-detached-work-tree.sh ## +@@ t/t7409-submodule-detached-work-tree.sh: on detached working trees + ' + + TEST_NO_CREATE_REPO=1 +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7409-submodule-detached-work-tree.sh: test_expect_success 'submodule on detached working tree' ' git rev-parse --verify HEAD >actual && test_cmp ../../../../expect actual @@ t/t7409-submodule-detached-work-tree.sh: test_expect_success 'submodule on detac cd home && ## t/t7417-submodule-path-url.sh ## +@@ + #!/bin/sh + + test_description='check handling of .gitmodule path with dash' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7417-submodule-path-url.sh: test_expect_success MINGW 'submodule paths disallows trailing spaces' ' sed "s/sub/sub /" <tree >tree.new && tree=$(git -C super mktree <tree.new) && @@ t/t7417-submodule-path-url.sh: test_expect_success MINGW 'submodule paths disall test_must_fail git clone --recurse-submodules super dst 2>err && test_i18ngrep "sub " err - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404|4013|5310|5526|6300) -+3404|4013|5310|5526|6300|7064) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-6]*) -+[0-6]*|7[0-4]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 21: 2b269ca983 ! 22: 20eef6cc97 t7[5-9]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t7501-commit-basic-functionality.sh ## +@@ + # signoff + + test_description='git commit' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7501-commit-basic-functionality.sh: test_expect_success 'same tree (merge and amend merge)' ' echo zero >zero && git add zero && @@ t/t7501-commit-basic-functionality.sh: test_expect_success 'same tree (merge and git diff HEAD^ HEAD >actual && ## t/t7502-commit-porcelain.sh ## +@@ + + test_description='git commit porcelain-ish' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7502-commit-porcelain.sh: test_expect_success 'output summary format for merges' ' output_tests_cleanup() { @@ t/t7502-commit-porcelain.sh: git reset -q --hard sed -n -e "s/^parent //p" -e "/^$/q" raw >actual && ## t/t7503-pre-commit-and-pre-merge-commit-hooks.sh ## +@@ + + test_description='pre-commit and pre-merge-commit hooks' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7503-pre-commit-and-pre-merge-commit-hooks.sh: test_expect_success 'root commit' ' git add foo && git commit -m "make it non-ff" && @@ t/t7503-pre-commit-and-pre-merge-commit-hooks.sh: test_expect_success POSIXPERM ## t/t7504-commit-msg-hook.sh ## +@@ + + test_description='commit-msg hook' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7504-commit-msg-hook.sh: test_expect_success '--no-verify with failing hook (editor)' ' test_expect_success 'merge fails with failing hook' ' @@ t/t7504-commit-msg-hook.sh: test_expect_success "hook doesn't edit commit messag git add file2 && ## t/t7505-prepare-commit-msg-hook.sh ## +@@ + + test_description='prepare-commit-msg hook' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7505-prepare-commit-msg-hook.sh: test_expect_success 'set up commits for rebasing' ' do test_commit rebase-$i c $i @@ t/t7508-status.sh: test_expect_success 'git commit --dry-run will show a staged (use "git pull" to merge the remote branch into yours) ## t/t7510-signed-commit.sh ## +@@ + #!/bin/sh + + test_description='signed commit tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7510-signed-commit.sh: test_expect_success GPG 'create signed commits' ' echo 3 >elif && git add elif && test_tick && git commit -m "third on side" && @@ t/t7510-signed-commit.sh: test_expect_success GPG 'create signed commits' ' ## t/t7512-status-help.sh ## +@@ + + test_description='git status advice' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7512-status-help.sh: test_expect_success 'prepare for conflicts' ' git config --global advice.statusuoption false && test_commit init main.txt init && @@ t/t7512-status-help.sh: EOF test_commit two_commit main.txt two && ## t/t7517-per-repo-email.sh ## +@@ + + test_description='per-repo forced setting of email address' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7517-per-repo-email.sh: test_expect_success 'set up rebase scenarios' ' test_expect_success 'fast-forward rebase does not care about ident' ' @@ t/t7600-merge.sh: Testing basic merge operations/option parsing. + * [c1] commit 1 + [c6] c6 + [c5] c5 +@@ t/t7600-merge.sh: Testing basic merge operations/option parsing. + +++++++* [c0] commit 0 + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7600-merge.sh: test_expect_success 'merge c0 with c1 with --ff-only' ' test_debug 'git log --graph --decorate --oneline --all' @@ t/t7606-merge-custom.sh: test_description="git merge * | (tag: c1) c1 ## t/t7608-merge-messages.sh ## +@@ + #!/bin/sh + + test_description='test auto-generated merge messages' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7608-merge-messages.sh: check_oneline() { } @@ t/t7608-merge-messages.sh: check_oneline() { test_done ## t/t7610-mergetool.sh ## -@@ t/t7610-mergetool.sh: Testing basic merge tool invocation' +@@ t/t7610-mergetool.sh: test_description='git mergetool + + Testing basic merge tool invocation' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # All the mergetool test work by checking out a temporary branch based @@ t/t7611-merge-abort.sh: Set up repo with conflicting and non-conflicting branche # \ # --- foo/barf/bazf <-- conflict_branch # \ +@@ t/t7611-merge-abort.sh: Next, test git merge --abort with the following variables: + - changed/unchanged worktree after merge + - changed/unchanged index after merge + ' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7611-merge-abort.sh: test_expect_success 'setup' ' git checkout -b clean_branch HEAD^ && echo bart > bar && @@ t/t7611-merge-abort.sh: test_expect_success 'setup' ' pre_merge_head="$(git rev-parse HEAD)" ## t/t7612-merge-verify-signatures.sh ## +@@ + #!/bin/sh + + test_description='merge signature verification tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7612-merge-verify-signatures.sh: test_expect_success GPG 'create signed commits' ' echo 3 >baz && git add baz && test_tick && git commit -SB7227189 -m "untrusted on side" && @@ t/t7612-merge-verify-signatures.sh: test_expect_success GPG 'create signed commi test_expect_success GPG 'merge unsigned commit with verification' ' ## t/t7614-merge-signoff.sh ## -@@ t/t7614-merge-signoff.sh: This test runs git merge --signoff and makes sure that it works. +@@ t/t7614-merge-signoff.sh: test_description='git merge --signoff + This test runs git merge --signoff and makes sure that it works. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh +@@ t/t7614-merge-signoff.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME test_setup() { # Expected commit message after merge --signoff cat >expected-signed <<EOF && @@ t/t7614-merge-signoff.sh: test_expect_success 'setup' ' ' ## t/t7701-repack-unpack-unreachable.sh ## +@@ + + test_description='git repack works correctly' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7701-repack-unpack-unreachable.sh: test_expect_success '-A with -d option leaves unreachable objects unpacked' ' git commit -a -m more_content && csha1=$(git rev-parse HEAD^{commit}) && @@ t/t7701-repack-unpack-unreachable.sh: test_expect_success '-A with -d option lea git commit -a -m even_more_content && ## t/t7800-difftool.sh ## +@@ t/t7800-difftool.sh: test_description='git-difftool + Testing basic diff tool invocation + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7800-difftool.sh: test_expect_success 'basic usage requires no repo' ' test_i18ngrep ^usage: output ' @@ t/t7800-difftool.sh: run_dir_diff_test 'difftool --dir-diff with unmerged files' cat >expect <<-EOF && ## t/t7810-grep.sh ## +@@ + test_description='git grep various. + ' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t7810-grep.sh: test_expect_success 'grep -e -- -- path' ' ' @@ t/t7810-grep.sh: test_expect_success 'grep --no-index pattern -- path' ' test_cmp expect actual ' - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404|4013|5310|5526|6300|7064) -+3404|4013|5310|5526|6300|7064|7817) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-6]*|7[0-4]*) -+[0-7]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 22: 5cac0065c8 ! 23: e37bc3c792 t8*: adjust the references to the default branch name "main" @@ t/annotate-tests.sh: test_expect_success 'blame --first-parent blames merge for test_expect_success 'setup evil merge' ' ## t/t8001-annotate.sh ## +@@ + #!/bin/sh + + test_description='git annotate' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t8001-annotate.sh: PROG='git annotate' . "$TEST_DIRECTORY"/annotate-tests.sh @@ t/t8001-annotate.sh: PROG='git annotate' test 2 = $(grep A <authors | wc -l) && test 2 = $(grep B <authors | wc -l) + ## t/t8002-blame.sh ## +@@ + #!/bin/sh + + test_description='git blame' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh + ## t/t8003-blame-corner-cases.sh ## +@@ + #!/bin/sh + + test_description='git blame corner cases' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t8003-blame-corner-cases.sh: test_expect_success 'blame wholesale copy and more in the index' ' test_expect_success 'blame during cherry-pick with file rename conflict' ' @@ t/t8003-blame-corner-cases.sh: test_expect_success 'blame wholesale copy and mor git add rodent && ## t/t8004-blame-with-conflicts.sh ## +@@ + # Based on a test case submitted by Björn Steinbrink. + + test_description='git blame on conflicted files' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t8004-blame-with-conflicts.sh: test_expect_success 'setup first case' ' git add file2 && git commit --author "U Gly <ug@localhost>" -m ugly && @@ t/t8004-blame-with-conflicts.sh: Even more" > file2 && exit 1 else - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-7]*) -+[0-8]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; + ## t/t8012-blame-colors.sh ## +@@ + #!/bin/sh + + test_description='colored git blame' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh 23: 57e90d459a ! 24: 3e81bc89a2 t9[0-4]*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t9001-send-email.sh ## +@@ + #!/bin/sh + + test_description='git send-email' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9001-send-email.sh: test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' ' ' @@ t/t9001-send-email.sh: test_expect_success $PREREQ 'test that send-email works o test_expect_success $PREREQ 'test that sendmail config is rejected' ' ## t/t9100-git-svn-basic.sh ## +@@ + test_description='git svn basic tests' + GIT_SVN_LC_ALL=${LC_ALL:-$LANG} + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-svn.sh @@ t/t9100-git-svn-basic.sh: test_expect_success 'dcommit $rev does not clobber current branch' ' test refs/heads/my-bar = $(git symbolic-ref HEAD) && git log refs/remotes/bar | grep "change 1" && @@ t/t9145-git-svn-master-branch.sh # Copyright (c) 2009 Eric Wong # -test_description='git svn initial master branch is "trunk" if possible' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +test_description='git svn initial main branch is "trunk" if possible' - . ./lib-git-svn.sh ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - test_expect_success 'setup test repository' ' + . ./lib-git-svn.sh @@ t/t9145-git-svn-master-branch.sh: test_expect_success 'setup test repository' ' svn_cmd import -m b/b i "$svnrepo/branches/b" ' @@ t/t9145-git-svn-master-branch.sh: test_expect_success 'setup test repository' ' ## t/t9151-svn-mergeinfo.sh ## +@@ + + test_description='git-svn svn mergeinfo properties' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-svn.sh @@ t/t9151-svn-mergeinfo.sh: test_expect_success 'merging two branches in one commit is detected correctly' ' ' @@ t/t9151-svn-mergeinfo.sh: test_expect_success 'merging two branches in one commi ## t/t9155-git-svn-fetch-deleted-tag.sh ## +@@ + + test_description='git svn fetch deleted tag' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-svn.sh @@ t/t9155-git-svn-fetch-deleted-tag.sh: test_expect_success 'fetch deleted tags from same revision with checksum error' git svn fetch && @@ t/t9155-git-svn-fetch-deleted-tag.sh: test_expect_success 'fetch deleted tags fr test_done ## t/t9156-git-svn-fetch-deleted-tag-2.sh ## +@@ + + test_description='git svn fetch deleted tag 2' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-svn.sh @@ t/t9156-git-svn-fetch-deleted-tag-2.sh: test_expect_success 'fetch deleted tags from same revision with no checksum erro cd git_project && git svn fetch && @@ t/t9156-git-svn-fetch-deleted-tag-2.sh: test_expect_success 'fetch deleted tags test_done ## t/t9163-git-svn-reset-clears-caches.sh ## +@@ + # + + test_description='git svn reset clears memoized caches' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-svn.sh @@ t/t9163-git-svn-reset-clears-caches.sh: test_expect_success 'fetch to merge-base (a)' ' test_expect_success 'rebase looses SVN merge (m)' ' git svn rebase && @@ t/t9163-git-svn-reset-clears-caches.sh: test_expect_success 'fetch to merge-base # git svn fetch creates correct history with merge commit ## t/t9169-git-svn-dcommit-crlf.sh ## +@@ + #!/bin/sh + + test_description='git svn dcommit CRLF' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-svn.sh @@ t/t9169-git-svn-dcommit-crlf.sh: test_expect_success 'setup commit repository' ' p=$(git rev-parse HEAD) && t=$(git write-tree) && @@ t/t9169-git-svn-dcommit-crlf.sh: test_expect_success 'setup commit repository' ' git svn dcommit && ## t/t9300-fast-import.sh ## +@@ + # + + test_description='test git fast-import utility' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9300-fast-import.sh: test_expect_success 'A: create pack from stdin' ' mark :4 data $file4_len @@ t/t9300-fast-import.sh: test_expect_success 'Y: rewrite submodules' ' ## t/t9301-fast-import-notes.sh ## -@@ t/t9301-fast-import-notes.sh: test_description='test git fast-import of notes objects' +@@ + # + + test_description='test git fast-import of notes objects' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh +@@ t/t9301-fast-import-notes.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME test_tick cat >input <<INPUT_END @@ t/t9302-fast-import-unpack-limit.sh: test_expect_success 'lookups after checkpoi make sure from "unpacked sha1 reference" works, too ## t/t9350-fast-export.sh ## +@@ + # + + test_description='git fast-export' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9350-fast-export.sh: test_expect_success 'setup' ' git commit -m sitzt file2 && test_tick && @@ t/t9350-fast-export.sh: test_expect_success 'merge commit gets exported with --i ' ## t/t9351-fast-export-anonymize.sh ## +@@ + #!/bin/sh + + test_description='basic tests for fast-export --anonymize' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9351-fast-export-anonymize.sh: test_expect_success 'stream retains other as refname' ' ' @@ t/t9351-fast-export-anonymize.sh: test_expect_success 'repo has original shape a ' ## t/t9400-git-cvsserver-server.sh ## +@@ t/t9400-git-cvsserver-server.sh: test_description='git-cvsserver access + tests read access to a git repository with the + cvs CLI client via git-cvsserver server' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9400-git-cvsserver-server.sh: test_expect_success 'setup' ' touch secondrootfile && git add secondrootfile && @@ t/t9400-git-cvsserver-server.sh: test_expect_success 'cvs co -c (shows module da xbranch: ## t/t9401-git-cvsserver-crlf.sh ## +@@ t/t9401-git-cvsserver-crlf.sh: test_description='git-cvsserver -kb modes + tests -kb mode for binary files when accessing a git + repository using cvs CLI client via git-cvsserver server' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9401-git-cvsserver-crlf.sh: test_expect_success 'setup' ' ' @@ t/t9401-git-cvsserver-crlf.sh: test_expect_success 'update subdir of other copy git add multilineTxt.c && ## t/t9402-git-cvsserver-refs.sh ## +@@ t/t9402-git-cvsserver-refs.sh: test_description='git-cvsserver and git refspecs + tests ability for git-cvsserver to switch between and compare + tags, branches and other git refspecs' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./test-lib.sh @@ t/t9402-git-cvsserver-refs.sh: test_expect_success 'setup v1, b1' ' rm -rf cvswork @@ t/t9402-git-cvsserver-refs.sh: test_expect_success 'setup simple b2' ' check_start_tree cvswork && check_file cvswork textfile.c v1 && check_file cvswork t2 v1 && - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-8]*) -+[0-8]*|9[0-4]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 24: f9e01de17f ! 25: cda06e253d t9[5-7]*: adjust the references to the default branch name "main" @@ t/lib-cvs.sh: setup_cvs_test_repository () { else ## t/t9500-gitweb-standalone-no-errors.sh ## +@@ t/t9500-gitweb-standalone-no-errors.sh: commandline, and checks that it would not write any errors + or warnings to log.' + + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./gitweb-lib.sh @@ t/t9500-gitweb-standalone-no-errors.sh: test_expect_success \ echo "Branch" >>b && git add b && @@ t/t9500-gitweb-standalone-no-errors.sh: test_expect_success \ test_done ## t/t9501-gitweb-standalone-http-status.sh ## +@@ t/t9501-gitweb-standalone-http-status.sh: commandline, and checks that it returns the expected HTTP status + code and message.' + + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./gitweb-lib.sh @@ t/t9501-gitweb-standalone-http-status.sh: test_debug 'cat gitweb.headers' # snapshot hash ids @@ t/t9501-gitweb-standalone-http-status.sh: test_expect_success DATE_PARSER 'modif test_debug 'cat gitweb.headers' ## t/t9502-gitweb-standalone-parse-output.sh ## +@@ t/t9502-gitweb-standalone-parse-output.sh: commandline, and checks that it produces the correct output, either + in the HTTP header or the actual script output.' + + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./gitweb-lib.sh @@ t/t9502-gitweb-standalone-parse-output.sh: test_expect_success 'snapshot: HEAD' ' ' test_debug 'cat gitweb.headers && cat file_list' @@ t/t9502-gitweb-standalone-parse-output.sh: test_expect_success 'snapshot: short ## t/t9600-cvsimport.sh ## +@@ + #!/bin/sh + + test_description='git cvsimport basic tests' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-cvs.sh @@ t/t9600-cvsimport.sh: test_expect_success PERL 'no .git/cvs-revisions created by default' ' ' @@ t/t9600-cvsimport.sh: test_expect_success PERL 'no .git/cvs-revisions created by test_done ## t/t9601-cvsimport-vendor-branch.sh ## +@@ + # tag has been removed. + + test_description='git cvsimport handling of vendor branches' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-cvs.sh @@ t/t9601-cvsimport-vendor-branch.sh: test_expect_success PERL 'import a module with a vendor branch' ' ' @@ t/t9601-cvsimport-vendor-branch.sh: test_expect_success PERL 'import a module wi ## t/t9602-cvsimport-branches-tags.sh ## +@@ + # t9602/README. + + test_description='git cvsimport handling of branches and tags' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-cvs.sh @@ t/t9602-cvsimport-branches-tags.sh: test_expect_success PERL 'import module' ' ' @@ t/t9602-cvsimport-branches-tags.sh: test_expect_success PERL 'import module' ' ## t/t9603-cvsimport-patchsets.sh ## +@@ + # bug. + + test_description='git cvsimport testing for correct patchset estimation' +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-cvs.sh @@ t/t9603-cvsimport-patchsets.sh: test_expect_failure PERL 'import with criss cross times on revisions' ' git cvsimport -p"-x" -C module-git module && ( @@ t/t9603-cvsimport-patchsets.sh: test_expect_failure PERL 'import with criss cros echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000 Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A && - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-8]*|9[0-4]*) -+[0-8]*|9[0-7]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 25: 4da4b69114 ! 26: fb8584d993 tests(git-p4): transition to the default branch name `main` @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t9800-git-p4-basic.sh ## +@@ + + test_description='git p4 tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-p4.sh @@ t/t9800-git-p4-basic.sh: test_expect_success 'clone --bare should make a bare repository' ' git config --get --bool core.bare true && git rev-parse --verify refs/remotes/p4/master && @@ t/t9800-git-p4-basic.sh: test_expect_success 'clone --bare should make a bare re ' ## t/t9801-git-p4-branch.sh ## +@@ + + test_description='git p4 tests for p4 branches' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-p4.sh @@ t/t9801-git-p4-branch.sh: test_expect_success 'import main, no branch detection' ' ( cd "$git" && @@ t/t9801-git-p4-branch.sh: test_expect_success 'use-client-spec detect-branches s test_path_is_missing b3-file3_1 ## t/t9806-git-p4-options.sh ## +@@ + + test_description='git p4 options' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-p4.sh @@ t/t9806-git-p4-options.sh: test_expect_success 'clone no --git-dir' ' test_must_fail git p4 clone --git-dir=xx //depot ' @@ t/t9806-git-p4-options.sh: test_expect_success 'clone --use-client-spec' ' ) ## t/t9807-git-p4-submit.sh ## +@@ + + test_description='git p4 submit' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-p4.sh @@ t/t9807-git-p4-submit.sh: test_expect_success 'submit with allowSubmit' ' git config git-p4.skipSubmitEdit true && git config git-p4.allowSubmit "nobranch" && @@ t/t9807-git-p4-submit.sh: test_expect_success 'submit with allowSubmit' ' ' ## t/t9811-git-p4-label-import.sh ## +@@ + + test_description='git p4 label tests' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-git-p4.sh @@ t/t9811-git-p4-label-import.sh: test_expect_success 'tag that cannot be exported' ' git add main/f12 && git commit -m "adding f12" && @@ t/t9811-git-p4-label-import.sh: test_expect_success 'tag that cannot be exported git p4 submit --export-labels ) && ( - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TEST_NUMBER" in - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-8]*|9[0-7]*) -+[0-8]*|9[0-8]*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 26: cfa29c7f71 ! 27: bbc17c8ee5 t99*: adjust the references to the default branch name "main" @@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## t/t9903-bash-prompt.sh ## +@@ + + test_description='test git-specific bash prompt functions' + +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + + . ./lib-bash.sh @@ t/t9903-bash-prompt.sh: test_expect_success 'setup for prompt tests' ' echo 3 >file && git commit -m "third b1" file && @@ t/t9903-bash-prompt.sh: test_expect_success 'prompt - hide if pwd ignored - env test_config bash.hideIfPwdIgnored false && ( cd ignored_dir && - - ## t/test-lib.sh ## -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in - esac - - case "$TEST_NUMBER" in --3404|4013|5310|5526|6300|7064|7817) -+3404|4013|5310|5526|6300|7064|7817|9902) - # Avoid conflicts with patch series that are cooking at the same time - # as the patch series changing the default of `init.defaultBranch`. - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; --[0-8]*|9[0-8]*) -+*) - GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME - ;; 27: fc0c1f6463 = 28: ec9b9cab88 tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed -- gitgitgadget
From: Johannes Schindelin <johannes.schindelin@gmx.de> In addition to the manual adjustment to let the `linux-gcc` CI job run the test suite with `master` and then with `main`, this patch makes sure that GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME is set in all test scripts that currently rely on the initial branch name being `master by default. To determine which test scripts to mark up, the first step was to force-set the default branch name to `master` in - all test scripts that contain the keyword `master`, - t4211, which expects `t/t4211/history.export` with a hard-coded ref to initialize the default branch, - t5560 because it sources `t/t556x_common` which uses `master`, - t8002 and t8012 because both source `t/annotate-tests.sh` which also uses `master`) This trick was performed by this command: $ sed -i '/^ *\. \.\/\(test-lib\|lib-\(bash\|cvs\|git-svn\)\|gitweb-lib\)\.sh$/i\ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\ ' $(git grep -l master t/t[0-9]*.sh) \ t/t4211*.sh t/t5560*.sh t/t8002*.sh t/t8012*.sh After that, careful, manual inspection revealed that some of the test scripts containing the needle `master` do not actually rely on a specific default branch name: either they mention `master` only in a comment, or they initialize that branch specificially, or they do not actually refer to the current default branch. Therefore, the aforementioned modification was undone in those test scripts thusly: $ git checkout HEAD -- \ t/t0027-auto-crlf.sh t/t0060-path-utils.sh \ t/t1011-read-tree-sparse-checkout.sh \ t/t1305-config-include.sh t/t1309-early-config.sh \ t/t1402-check-ref-format.sh t/t1450-fsck.sh \ t/t2024-checkout-dwim.sh \ t/t2106-update-index-assume-unchanged.sh \ t/t3040-subprojects-basic.sh t/t3301-notes.sh \ t/t3308-notes-merge.sh t/t3423-rebase-reword.sh \ t/t3436-rebase-more-options.sh \ t/t4015-diff-whitespace.sh t/t4257-am-interactive.sh \ t/t5323-pack-redundant.sh t/t5401-update-hooks.sh \ t/t5511-refspec.sh t/t5526-fetch-submodules.sh \ t/t5529-push-errors.sh t/t5530-upload-pack-error.sh \ t/t5548-push-porcelain.sh \ t/t5552-skipping-fetch-negotiator.sh \ t/t5572-pull-submodule.sh t/t5608-clone-2gb.sh \ t/t5614-clone-submodules-shallow.sh \ t/t7508-status.sh t/t7606-merge-custom.sh \ t/t9302-fast-import-unpack-limit.sh We excluded one set of test scripts in these commands, though: the range of `git p4` tests. The reason? `git p4` stores the (foreign) remote branch in the branch called `p4/master`, which is obviously not the default branch. Manual analysis revealed that only five of these tests actually require a specific default branch name to pass; They were modified thusly: $ sed -i '/^ *\. \.\/lib-git-p4\.sh$/i\ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\ ' t/t980[0167]*.sh t/t9811*.sh Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- ci/run-build-and-tests.sh | 2 ++ t/t0002-gitfile.sh | 3 +++ t/t0020-crlf.sh | 3 +++ t/t0021-conversion.sh | 3 +++ t/t0028-working-tree-encoding.sh | 3 +++ t/t0041-usage.sh | 3 +++ t/t0050-filesystem.sh | 3 +++ t/t0100-previous.sh | 3 +++ t/t1004-read-tree-m-u-wf.sh | 3 +++ t/t1008-read-tree-overlay.sh | 3 +++ t/t1009-read-tree-new-index.sh | 3 +++ t/t1021-rerere-in-workdir.sh | 3 +++ t/t1090-sparse-checkout-scope.sh | 3 +++ t/t1091-sparse-checkout-builtin.sh | 3 +++ t/t1300-config.sh | 3 +++ t/t1301-shared-repo.sh | 3 +++ t/t1400-update-ref.sh | 3 +++ t/t1403-show-ref.sh | 3 +++ t/t1405-main-ref-store.sh | 3 +++ t/t1406-submodule-ref-store.sh | 3 +++ t/t1407-worktree-ref-store.sh | 3 +++ t/t1408-packed-refs.sh | 3 +++ t/t1410-reflog.sh | 3 +++ t/t1411-reflog-show.sh | 3 +++ t/t1413-reflog-detach.sh | 3 +++ t/t1414-reflog-walk.sh | 3 +++ t/t1416-ref-transaction-hooks.sh | 3 +++ t/t1430-bad-ref-name.sh | 3 +++ t/t1500-rev-parse.sh | 3 +++ t/t1503-rev-parse-verify.sh | 3 +++ t/t1505-rev-parse-last.sh | 3 +++ t/t1506-rev-parse-diagnosis.sh | 3 +++ t/t1507-rev-parse-upstream.sh | 3 +++ t/t1508-at-combinations.sh | 3 +++ t/t1511-rev-parse-caret.sh | 3 +++ t/t1512-rev-parse-disambiguation.sh | 3 +++ t/t1513-rev-parse-prefix.sh | 3 +++ t/t1514-rev-parse-push.sh | 3 +++ t/t1700-split-index.sh | 3 +++ t/t2007-checkout-symlink.sh | 3 +++ t/t2009-checkout-statinfo.sh | 3 +++ t/t2010-checkout-ambiguous.sh | 3 +++ t/t2011-checkout-invalid-head.sh | 3 +++ t/t2012-checkout-last.sh | 3 +++ t/t2015-checkout-unborn.sh | 3 +++ t/t2017-checkout-orphan.sh | 3 +++ t/t2020-checkout-detach.sh | 3 +++ t/t2022-checkout-paths.sh | 3 +++ t/t2023-checkout-m.sh | 3 +++ t/t2027-checkout-track.sh | 3 +++ t/t2030-unresolve-info.sh | 3 +++ t/t2060-switch.sh | 3 +++ t/t2070-restore.sh | 3 +++ t/t2400-worktree-add.sh | 3 +++ t/t2401-worktree-prune.sh | 3 +++ t/t2402-worktree-list.sh | 3 +++ t/t2405-worktree-submodule.sh | 3 +++ t/t3200-branch.sh | 3 +++ t/t3201-branch-contains.sh | 3 +++ t/t3202-show-branch-octopus.sh | 3 +++ t/t3203-branch-output.sh | 3 +++ t/t3204-branch-name-interpretation.sh | 3 +++ t/t3205-branch-color.sh | 3 +++ t/t3206-range-diff.sh | 3 +++ t/t3210-pack-refs.sh | 3 +++ t/t3211-peel-ref.sh | 3 +++ t/t3302-notes-index-expensive.sh | 3 +++ t/t3303-notes-subtrees.sh | 3 +++ t/t3304-notes-mixed.sh | 3 +++ t/t3320-notes-merge-worktrees.sh | 3 +++ t/t3400-rebase.sh | 3 +++ t/t3402-rebase-merge.sh | 3 +++ t/t3403-rebase-skip.sh | 3 +++ t/t3404-rebase-interactive.sh | 3 +++ t/t3405-rebase-malformed.sh | 3 +++ t/t3406-rebase-message.sh | 3 +++ t/t3407-rebase-abort.sh | 3 +++ t/t3408-rebase-multi-line.sh | 3 +++ t/t3409-rebase-preserve-merges.sh | 3 +++ t/t3412-rebase-root.sh | 3 +++ t/t3413-rebase-hook.sh | 3 +++ t/t3415-rebase-autosquash.sh | 3 +++ t/t3416-rebase-onto-threedots.sh | 3 +++ t/t3418-rebase-continue.sh | 3 +++ t/t3419-rebase-patch-id.sh | 3 +++ t/t3420-rebase-autostash.sh | 3 +++ t/t3427-rebase-subtree.sh | 3 +++ t/t3430-rebase-merges.sh | 3 +++ t/t3431-rebase-fork-point.sh | 3 +++ t/t3432-rebase-fast-forward.sh | 3 +++ t/t3434-rebase-i18n.sh | 3 +++ t/t3435-rebase-gpg-sign.sh | 3 +++ t/t3500-cherry.sh | 3 +++ t/t3501-revert-cherry-pick.sh | 3 +++ t/t3502-cherry-pick-merge.sh | 3 +++ t/t3503-cherry-pick-root.sh | 3 +++ t/t3504-cherry-pick-rerere.sh | 3 +++ t/t3505-cherry-pick-empty.sh | 3 +++ t/t3506-cherry-pick-ff.sh | 3 +++ t/t3507-cherry-pick-conflict.sh | 3 +++ t/t3508-cherry-pick-many-commits.sh | 3 +++ t/t3509-cherry-pick-merge-df.sh | 3 +++ t/t3512-cherry-pick-submodule.sh | 3 +++ t/t3600-rm.sh | 3 +++ t/t3701-add-interactive.sh | 3 +++ t/t3901-i18n-patch.sh | 3 +++ t/t3903-stash.sh | 3 +++ t/t3910-mac-os-precompose.sh | 3 +++ t/t4013-diff-various.sh | 3 +++ t/t4014-format-patch.sh | 3 +++ t/t4017-diff-retval.sh | 3 +++ t/t4038-diff-combined.sh | 3 +++ t/t4041-diff-submodule-option.sh | 3 +++ t/t4048-diff-combined-binary.sh | 3 +++ t/t4052-stat-output.sh | 3 +++ t/t4056-diff-order.sh | 3 +++ t/t4057-diff-combined-paths.sh | 3 +++ t/t4061-diff-indent.sh | 3 +++ t/t4066-diff-emit-delay.sh | 3 +++ t/t4068-diff-symmetric-merge-base.sh | 3 +++ t/t4103-apply-binary.sh | 3 +++ t/t4108-apply-threeway.sh | 3 +++ t/t4121-apply-diffs.sh | 3 +++ t/t4122-apply-symlink-inside.sh | 3 +++ t/t4150-am.sh | 3 +++ t/t4200-rerere.sh | 3 +++ t/t4201-shortlog.sh | 3 +++ t/t4202-log.sh | 3 +++ t/t4203-mailmap.sh | 3 +++ t/t4204-patch-id.sh | 3 +++ t/t4207-log-decoration-colors.sh | 3 +++ t/t4208-log-magic-pathspec.sh | 3 +++ t/t4211-line-log.sh | 3 +++ t/t4214-log-graph-octopus.sh | 3 +++ t/t4216-log-bloom.sh | 3 +++ t/t4253-am-keep-cr-dos.sh | 3 +++ t/t5150-request-pull.sh | 3 +++ t/t5304-prune.sh | 3 +++ t/t5305-include-tag.sh | 3 +++ t/t5310-pack-bitmaps.sh | 3 +++ t/t5312-prune-corruption.sh | 3 +++ t/t5317-pack-objects-filter-objects.sh | 3 +++ t/t5322-pack-objects-sparse.sh | 3 +++ t/t5400-send-pack.sh | 3 +++ t/t5402-post-merge-hook.sh | 3 +++ t/t5403-post-checkout-hook.sh | 3 +++ t/t5404-tracking-branches.sh | 3 +++ t/t5405-send-pack-rewind.sh | 3 +++ t/t5407-post-rewrite-hook.sh | 3 +++ t/t5410-receive-pack-alternates.sh | 3 +++ t/t5500-fetch-pack.sh | 3 +++ t/t5501-fetch-push-alternates.sh | 3 +++ t/t5502-quickfetch.sh | 3 +++ t/t5503-tagfollow.sh | 3 +++ t/t5504-fetch-receive-strict.sh | 3 +++ t/t5505-remote.sh | 3 +++ t/t5506-remote-groups.sh | 3 +++ t/t5509-fetch-push-namespaces.sh | 3 +++ t/t5510-fetch.sh | 3 +++ t/t5512-ls-remote.sh | 3 +++ t/t5514-fetch-multiple.sh | 3 +++ t/t5516-fetch-push.sh | 3 +++ t/t5517-push-mirror.sh | 3 +++ t/t5518-fetch-exit-status.sh | 3 +++ t/t5519-push-alternates.sh | 3 +++ t/t5520-pull.sh | 3 +++ t/t5521-pull-options.sh | 3 +++ t/t5523-push-upstream.sh | 3 +++ t/t5526-fetch-submodules.sh | 3 +++ t/t5527-fetch-odd-refs.sh | 3 +++ t/t5528-push-default.sh | 3 +++ t/t5531-deep-submodule-push.sh | 3 +++ t/t5533-push-cas.sh | 3 +++ t/t5534-push-signed.sh | 3 +++ t/t5537-fetch-shallow.sh | 3 +++ t/t5538-push-shallow.sh | 3 +++ t/t5539-fetch-http-shallow.sh | 3 +++ t/t5540-http-push-webdav.sh | 3 +++ t/t5541-http-push-smart.sh | 3 +++ t/t5542-push-http-shallow.sh | 3 +++ t/t5543-atomic-push.sh | 3 +++ t/t5545-push-options.sh | 3 +++ t/t5550-http-fetch-dumb.sh | 3 +++ t/t5551-http-fetch-smart.sh | 3 +++ t/t5553-set-upstream.sh | 3 +++ t/t5560-http-backend-noserver.sh | 3 +++ t/t5561-http-backend.sh | 3 +++ t/t5570-git-daemon.sh | 3 +++ t/t5571-pre-push-hook.sh | 3 +++ t/t5580-unc-paths.sh | 3 +++ t/t5581-http-curl-verbose.sh | 3 +++ t/t5582-fetch-negative-refspec.sh | 3 +++ t/t5601-clone.sh | 3 +++ t/t5604-clone-reference.sh | 3 +++ t/t5605-clone-local.sh | 3 +++ t/t5606-clone-options.sh | 3 +++ t/t5607-clone-bundle.sh | 3 +++ t/t5609-clone-branch.sh | 3 +++ t/t5610-clone-detached.sh | 3 +++ t/t5611-clone-config.sh | 3 +++ t/t5612-clone-refspec.sh | 3 +++ t/t5616-partial-clone.sh | 3 +++ t/t5617-clone-submodules-remote.sh | 3 +++ t/t5700-protocol-v1.sh | 3 +++ t/t5701-git-serve.sh | 3 +++ t/t5702-protocol-v2.sh | 3 +++ t/t5703-upload-pack-ref-in-want.sh | 3 +++ t/t5801-remote-helpers.sh | 3 +++ t/t6000-rev-list-misc.sh | 3 +++ t/t6001-rev-list-graft.sh | 3 +++ t/t6004-rev-list-path-optim.sh | 3 +++ t/t6006-rev-list-format.sh | 3 +++ t/t6007-rev-list-cherry-pick-file.sh | 3 +++ t/t6008-rev-list-submodule.sh | 3 +++ t/t6009-rev-list-parent.sh | 3 +++ t/t6012-rev-list-simplify.sh | 3 +++ t/t6013-rev-list-reverse-parents.sh | 3 +++ t/t6016-rev-list-graph-simplify-history.sh | 3 +++ t/t6017-rev-list-stdin.sh | 3 +++ t/t6018-rev-list-glob.sh | 3 +++ t/t6019-rev-list-ancestry-path.sh | 3 +++ t/t6030-bisect-porcelain.sh | 3 +++ t/t6040-tracking-info.sh | 3 +++ t/t6050-replace.sh | 3 +++ t/t6101-rev-parse-parents.sh | 3 +++ t/t6110-rev-list-sparse.sh | 3 +++ t/t6111-rev-list-treesame.sh | 3 +++ t/t6112-rev-list-filters-objects.sh | 3 +++ t/t6120-describe.sh | 3 +++ t/t6200-fmt-merge-msg.sh | 3 +++ t/t6300-for-each-ref.sh | 3 +++ t/t6302-for-each-ref-filter.sh | 3 +++ t/t6400-merge-df.sh | 3 +++ t/t6402-merge-rename.sh | 3 +++ t/t6404-recursive-merge.sh | 3 +++ t/t6405-merge-symlinks.sh | 3 +++ t/t6406-merge-attr.sh | 3 +++ t/t6407-merge-binary.sh | 3 +++ t/t6409-merge-subtree.sh | 3 +++ t/t6411-merge-filemode.sh | 3 +++ t/t6412-merge-large-rename.sh | 3 +++ t/t6413-merge-crlf.sh | 3 +++ t/t6414-merge-rename-nocruft.sh | 3 +++ t/t6415-merge-dir-to-symlink.sh | 3 +++ t/t6416-recursive-corner-cases.sh | 3 +++ t/t6417-merge-ours-theirs.sh | 3 +++ t/t6418-merge-text-auto.sh | 3 +++ t/t6419-merge-ignorecase.sh | 3 +++ t/t6422-merge-rename-corner-cases.sh | 3 +++ t/t6425-merge-rename-delete.sh | 3 +++ t/t6427-diff3-conflict-markers.sh | 3 +++ t/t6430-merge-recursive.sh | 3 +++ t/t6432-merge-recursive-space-options.sh | 3 +++ t/t6433-merge-toplevel.sh | 3 +++ t/t6434-merge-recursive-rename-options.sh | 3 +++ t/t6436-merge-overwrite.sh | 3 +++ t/t6437-submodule-merge.sh | 3 +++ t/t6439-merge-co-error-msgs.sh | 3 +++ t/t6501-freshen-objects.sh | 3 +++ t/t7003-filter-branch.sh | 3 +++ t/t7004-tag.sh | 3 +++ t/t7030-verify-tag.sh | 3 +++ t/t7060-wtstatus.sh | 3 +++ t/t7063-status-untracked-cache.sh | 3 +++ t/t7064-wtstatus-pv2.sh | 3 +++ t/t7102-reset.sh | 3 +++ t/t7113-post-index-change-hook.sh | 3 +++ t/t7201-co.sh | 3 +++ t/t7400-submodule-basic.sh | 3 +++ t/t7403-submodule-sync.sh | 3 +++ t/t7406-submodule-update.sh | 3 +++ t/t7407-submodule-foreach.sh | 3 +++ t/t7409-submodule-detached-work-tree.sh | 3 +++ t/t7417-submodule-path-url.sh | 3 +++ t/t7501-commit-basic-functionality.sh | 3 +++ t/t7502-commit-porcelain.sh | 3 +++ t/t7503-pre-commit-and-pre-merge-commit-hooks.sh | 3 +++ t/t7504-commit-msg-hook.sh | 3 +++ t/t7505-prepare-commit-msg-hook.sh | 3 +++ t/t7510-signed-commit.sh | 3 +++ t/t7512-status-help.sh | 3 +++ t/t7517-per-repo-email.sh | 3 +++ t/t7600-merge.sh | 3 +++ t/t7608-merge-messages.sh | 3 +++ t/t7610-mergetool.sh | 3 +++ t/t7611-merge-abort.sh | 3 +++ t/t7612-merge-verify-signatures.sh | 3 +++ t/t7614-merge-signoff.sh | 3 +++ t/t7701-repack-unpack-unreachable.sh | 3 +++ t/t7800-difftool.sh | 3 +++ t/t7810-grep.sh | 3 +++ t/t8001-annotate.sh | 3 +++ t/t8002-blame.sh | 3 +++ t/t8003-blame-corner-cases.sh | 3 +++ t/t8004-blame-with-conflicts.sh | 3 +++ t/t8012-blame-colors.sh | 3 +++ t/t9001-send-email.sh | 3 +++ t/t9100-git-svn-basic.sh | 3 +++ t/t9145-git-svn-master-branch.sh | 3 +++ t/t9151-svn-mergeinfo.sh | 3 +++ t/t9155-git-svn-fetch-deleted-tag.sh | 3 +++ t/t9156-git-svn-fetch-deleted-tag-2.sh | 3 +++ t/t9163-git-svn-reset-clears-caches.sh | 3 +++ t/t9169-git-svn-dcommit-crlf.sh | 3 +++ t/t9300-fast-import.sh | 3 +++ t/t9301-fast-import-notes.sh | 3 +++ t/t9350-fast-export.sh | 3 +++ t/t9351-fast-export-anonymize.sh | 3 +++ t/t9400-git-cvsserver-server.sh | 3 +++ t/t9401-git-cvsserver-crlf.sh | 3 +++ t/t9402-git-cvsserver-refs.sh | 3 +++ t/t9500-gitweb-standalone-no-errors.sh | 3 +++ t/t9501-gitweb-standalone-http-status.sh | 3 +++ t/t9502-gitweb-standalone-parse-output.sh | 3 +++ t/t9600-cvsimport.sh | 3 +++ t/t9601-cvsimport-vendor-branch.sh | 3 +++ t/t9602-cvsimport-branches-tags.sh | 3 +++ t/t9603-cvsimport-patchsets.sh | 3 +++ t/t9800-git-p4-basic.sh | 3 +++ t/t9801-git-p4-branch.sh | 3 +++ t/t9806-git-p4-options.sh | 3 +++ t/t9807-git-p4-submit.sh | 3 +++ t/t9811-git-p4-label-import.sh | 3 +++ t/t9902-completion.sh | 3 +++ t/t9903-bash-prompt.sh | 3 +++ 325 files changed, 974 insertions(+) diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 6c27b886b8..50e0b90073 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -13,6 +13,7 @@ esac make case "$jobname" in linux-gcc) + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main make test export GIT_TEST_SPLIT_INDEX=yes export GIT_TEST_FULL_IN_PACK_ARRAY=true @@ -22,6 +23,7 @@ linux-gcc) export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1 export GIT_TEST_MULTI_PACK_INDEX=1 export GIT_TEST_ADD_I_USE_BUILTIN=1 + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master make test ;; linux-clang) diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh index 960ed150cb..0a396c95e5 100755 --- a/t/t0002-gitfile.sh +++ b/t/t0002-gitfile.sh @@ -4,6 +4,9 @@ test_description='.git file Verify that plumbing commands work when .git is a file ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh objpath() { diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index b63ba62e5d..0d43189048 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -2,6 +2,9 @@ test_description='CRLF conversion' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh has_cr() { diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index f6deaf498b..adf862aef1 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -2,6 +2,9 @@ test_description='blob conversion via gitattributes' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh TEST_ROOT="$PWD" diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index bfc4fb9af5..ccdc91c41c 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -2,6 +2,9 @@ test_description='working-tree-encoding conversion via gitattributes' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh index 5b927b76fe..068b784e72 100755 --- a/t/t0041-usage.sh +++ b/t/t0041-usage.sh @@ -2,6 +2,9 @@ test_description='Test commands behavior when given invalid argument value' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup ' ' diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh index 608673fb77..368f7d515b 100755 --- a/t/t0050-filesystem.sh +++ b/t/t0050-filesystem.sh @@ -2,6 +2,9 @@ test_description='Various filesystem issues' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh auml=$(printf '\303\244') diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh index 58c0b7e9b6..c3c2770ab3 100755 --- a/t/t0100-previous.sh +++ b/t/t0100-previous.sh @@ -2,6 +2,9 @@ test_description='previous branch syntax @{-n}' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'branch -d @{-1}' ' diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh index 181956b241..57caa3a73f 100755 --- a/t/t1004-read-tree-m-u-wf.sh +++ b/t/t1004-read-tree-m-u-wf.sh @@ -2,6 +2,9 @@ test_description='read-tree -m -u checks working tree files' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh diff --git a/t/t1008-read-tree-overlay.sh b/t/t1008-read-tree-overlay.sh index cf96016844..edb89447c7 100755 --- a/t/t1008-read-tree-overlay.sh +++ b/t/t1008-read-tree-overlay.sh @@ -2,6 +2,9 @@ test_description='test multi-tree read-tree without merging' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh diff --git a/t/t1009-read-tree-new-index.sh b/t/t1009-read-tree-new-index.sh index 59b3aa4bc4..b9bab37ac0 100755 --- a/t/t1009-read-tree-new-index.sh +++ b/t/t1009-read-tree-new-index.sh @@ -2,6 +2,9 @@ test_description='test read-tree into a fresh index file' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh index 301e071ff7..9177871c99 100755 --- a/t/t1021-rerere-in-workdir.sh +++ b/t/t1021-rerere-in-workdir.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='rerere run in a workdir' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success SYMLINKS setup ' diff --git a/t/t1090-sparse-checkout-scope.sh b/t/t1090-sparse-checkout-scope.sh index f35a73dd20..d731322633 100755 --- a/t/t1090-sparse-checkout-scope.sh +++ b/t/t1090-sparse-checkout-scope.sh @@ -2,6 +2,9 @@ test_description='sparse checkout scope tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh index 84acfc48b6..25e68ca036 100755 --- a/t/t1091-sparse-checkout-builtin.sh +++ b/t/t1091-sparse-checkout-builtin.sh @@ -2,6 +2,9 @@ test_description='sparse checkout builtin tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh list_files() { diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 825d9a184f..67e201b5c1 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -5,6 +5,9 @@ test_description='Test git config in different settings' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'clear default config' ' diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index 2dc853d1be..c573438f98 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -5,6 +5,9 @@ test_description='Test shared repository initialization' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Remove a default ACL from the test dir if possible. diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 4c01e08551..4ae6f50c02 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -4,6 +4,9 @@ # test_description='Test git update-ref and basic ref logging' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh Z=$ZERO_OID diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh index 5d955c3bff..aaf32f3b07 100755 --- a/t/t1403-show-ref.sh +++ b/t/t1403-show-ref.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='show-ref' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh index 74af927fba..531059b871 100755 --- a/t/t1405-main-ref-store.sh +++ b/t/t1405-main-ref-store.sh @@ -2,6 +2,9 @@ test_description='test main ref store api' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh RUN="test-tool ref-store main" diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh index 36b7ef5046..126518c155 100755 --- a/t/t1406-submodule-ref-store.sh +++ b/t/t1406-submodule-ref-store.sh @@ -2,6 +2,9 @@ test_description='test submodule ref store api' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh RUN="test-tool ref-store submodule:sub" diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh index 9a84858118..aede1c20d7 100755 --- a/t/t1407-worktree-ref-store.sh +++ b/t/t1407-worktree-ref-store.sh @@ -2,6 +2,9 @@ test_description='test worktree ref store api' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh RWT="test-tool ref-store worktree:wt" diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh index 1e44a17eea..fd58388232 100755 --- a/t/t1408-packed-refs.sh +++ b/t/t1408-packed-refs.sh @@ -2,6 +2,9 @@ test_description='packed-refs entries are covered by loose refs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 730a43d9dd..aa02ca488d 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -4,6 +4,9 @@ # test_description='Test prune and reflog expiration' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_have () { diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh index 985daf1def..f6fecff671 100755 --- a/t/t1411-reflog-show.sh +++ b/t/t1411-reflog-show.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Test reflog display routines' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh index c730600d8a..140914aa29 100755 --- a/t/t1413-reflog-detach.sh +++ b/t/t1413-reflog-detach.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Test reflog interaction with detached HEAD' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh reset_state () { diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh index 1181a9fb28..c463b5fc29 100755 --- a/t/t1414-reflog-walk.sh +++ b/t/t1414-reflog-walk.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='various tests of reflog walk (log -g) behavior' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'set up some reflog entries' ' diff --git a/t/t1416-ref-transaction-hooks.sh b/t/t1416-ref-transaction-hooks.sh index f6e741c6c0..a26a6b782d 100755 --- a/t/t1416-ref-transaction-hooks.sh +++ b/t/t1416-ref-transaction-hooks.sh @@ -2,6 +2,9 @@ test_description='reference transaction hooks' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh index c7878a60ed..8c4353746b 100755 --- a/t/t1430-bad-ref-name.sh +++ b/t/t1430-bad-ref-name.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Test handling of ref names that check-ref-format rejects' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh index 408b97d5af..d23da4e8de 100755 --- a/t/t1500-rev-parse.sh +++ b/t/t1500-rev-parse.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test git rev-parse' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # usage: [options] label is-bare is-inside-git is-inside-work prefix git-dir absolute-git-dir diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh index dc9fe3cbf1..e4343c49b2 100755 --- a/t/t1503-rev-parse-verify.sh +++ b/t/t1503-rev-parse-verify.sh @@ -6,6 +6,9 @@ test_description='test git rev-parse --verify' exec </dev/null +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh add_line_into_file() diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh index 4969edb314..9bd0307b5d 100755 --- a/t/t1505-rev-parse-last.sh +++ b/t/t1505-rev-parse-last.sh @@ -2,6 +2,9 @@ test_description='test @{-N} syntax' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh index e2ae15a2cf..694d74fc01 100755 --- a/t/t1506-rev-parse-diagnosis.sh +++ b/t/t1506-rev-parse-diagnosis.sh @@ -4,6 +4,9 @@ test_description='test git rev-parse diagnosis for invalid argument' exec </dev/null +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_did_you_mean () diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh index dfc0d96d8a..521233a3c3 100755 --- a/t/t1507-rev-parse-upstream.sh +++ b/t/t1507-rev-parse-upstream.sh @@ -2,6 +2,9 @@ test_description='test <branch>@{upstream} syntax' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh index 4a9964e9dc..8e73633761 100755 --- a/t/t1508-at-combinations.sh +++ b/t/t1508-at-combinations.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test various @{X} syntax combinations together' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check() { diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh index e0a49a651f..cfb2ea5e04 100755 --- a/t/t1511-rev-parse-caret.sh +++ b/t/t1511-rev-parse-caret.sh @@ -2,6 +2,9 @@ test_description='tests for ref^{stuff}' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh index 18fa6cf40d..2ef1f2b7e8 100755 --- a/t/t1512-rev-parse-disambiguation.sh +++ b/t/t1512-rev-parse-disambiguation.sh @@ -20,6 +20,9 @@ one tagged as v1.0.0. They all have one regular file each. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if ! test_have_prereq SHA1 diff --git a/t/t1513-rev-parse-prefix.sh b/t/t1513-rev-parse-prefix.sh index 87ec3ae714..d151ef9218 100755 --- a/t/t1513-rev-parse-prefix.sh +++ b/t/t1513-rev-parse-prefix.sh @@ -2,6 +2,9 @@ test_description='Tests for rev-parse --prefix' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh index 788cc91e45..173ba2792b 100755 --- a/t/t1514-rev-parse-push.sh +++ b/t/t1514-rev-parse-push.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test <branch>@{push} syntax' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh resolve () { diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh index 12a5568844..7d4a6f1e93 100755 --- a/t/t1700-split-index.sh +++ b/t/t1700-split-index.sh @@ -2,6 +2,9 @@ test_description='split index mode tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # We need total control of index splitting here diff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh index fc9aad530e..8879a78b85 100755 --- a/t/t2007-checkout-symlink.sh +++ b/t/t2007-checkout-symlink.sh @@ -4,6 +4,9 @@ test_description='git checkout to switch between branches with symlink<->dir' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t2009-checkout-statinfo.sh b/t/t2009-checkout-statinfo.sh index f3c2152087..9af4d6ca5e 100755 --- a/t/t2009-checkout-statinfo.sh +++ b/t/t2009-checkout-statinfo.sh @@ -2,6 +2,9 @@ test_description='checkout should leave clean stat info' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh index 2e47fe01cf..3f5431e033 100755 --- a/t/t2010-checkout-ambiguous.sh +++ b/t/t2010-checkout-ambiguous.sh @@ -2,6 +2,9 @@ test_description='checkout and pathspecs/refspecs ambiguities' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh index 0e8d56aa76..fede33ff1f 100755 --- a/t/t2011-checkout-invalid-head.sh +++ b/t/t2011-checkout-invalid-head.sh @@ -2,6 +2,9 @@ test_description='checkout switching away from an invalid branch' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh index e7ba8c505f..16bf19f7ee 100755 --- a/t/t2012-checkout-last.sh +++ b/t/t2012-checkout-last.sh @@ -2,6 +2,9 @@ test_description='checkout can switch to last branch and merge base' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh index 37bdcedcc9..669a70c76f 100755 --- a/t/t2015-checkout-unborn.sh +++ b/t/t2015-checkout-unborn.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='checkout from unborn branch' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh index 655f278c5f..999e976c62 100755 --- a/t/t2017-checkout-orphan.sh +++ b/t/t2017-checkout-orphan.sh @@ -7,6 +7,9 @@ test_description='git checkout --orphan Main Tests for --orphan functionality.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh TEST_FILE=foo diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh index b748db9946..45d87c23b1 100755 --- a/t/t2020-checkout-detach.sh +++ b/t/t2020-checkout-detach.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='checkout into detached HEAD state' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_detached () { diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh index 6844afafc0..fc0f5b775c 100755 --- a/t/t2022-checkout-paths.sh +++ b/t/t2022-checkout-paths.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='checkout $tree -- $paths' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t2023-checkout-m.sh b/t/t2023-checkout-m.sh index fca3f85824..f2f4f5b3ac 100755 --- a/t/t2023-checkout-m.sh +++ b/t/t2023-checkout-m.sh @@ -4,6 +4,9 @@ test_description='checkout -m -- <conflicted path> Ensures that checkout -m on a resolved file restores the conflicted file' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t2027-checkout-track.sh b/t/t2027-checkout-track.sh index bcba1bf90c..4e1419ca98 100755 --- a/t/t2027-checkout-track.sh +++ b/t/t2027-checkout-track.sh @@ -2,6 +2,9 @@ test_description='tests for git branch --track' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh index 309199bca2..3fe29fc3ee 100755 --- a/t/t2030-unresolve-info.sh +++ b/t/t2030-unresolve-info.sh @@ -2,6 +2,9 @@ test_description='undoing resolution' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_resolve_undo () { diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh index 68c9101b02..4de9299705 100755 --- a/t/t2060-switch.sh +++ b/t/t2060-switch.sh @@ -2,6 +2,9 @@ test_description='switch basic functionality' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh index 89e5a142c9..6941769c9a 100755 --- a/t/t2070-restore.sh +++ b/t/t2070-restore.sh @@ -2,6 +2,9 @@ test_description='restore basic functionality' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh index 5a7495474a..35cef266e9 100755 --- a/t/t2400-worktree-add.sh +++ b/t/t2400-worktree-add.sh @@ -2,6 +2,9 @@ test_description='test git worktree add' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh index a6ce7f590b..e6fc27de1e 100755 --- a/t/t2401-worktree-prune.sh +++ b/t/t2401-worktree-prune.sh @@ -2,6 +2,9 @@ test_description='prune $GIT_DIR/worktrees' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success initialize ' diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh index 795ddca2e4..3b23b0fdb7 100755 --- a/t/t2402-worktree-list.sh +++ b/t/t2402-worktree-list.sh @@ -2,6 +2,9 @@ test_description='test git worktree list' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh index e1b2bfd87e..cca2aea658 100755 --- a/t/t2405-worktree-submodule.sh +++ b/t/t2405-worktree-submodule.sh @@ -2,6 +2,9 @@ test_description='Combination of submodules and multiple worktrees' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh base_path=$(pwd -P) diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index a0b832d59e..04b568cf21 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -5,6 +5,9 @@ test_description='git branch assorted tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index 3733cd0091..532cdbe9ae 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -2,6 +2,9 @@ test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3202-show-branch-octopus.sh b/t/t3202-show-branch-octopus.sh index 6adf47869c..bbf7129dd8 100755 --- a/t/t3202-show-branch-octopus.sh +++ b/t/t3202-show-branch-octopus.sh @@ -2,6 +2,9 @@ test_description='test show-branch with more than 8 heads' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh numbers="1 2 3 4 5 6 7 8 9 10" diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh index d65586541d..a2144dd8e5 100755 --- a/t/t3203-branch-output.sh +++ b/t/t3203-branch-output.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git branch display tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t3204-branch-name-interpretation.sh b/t/t3204-branch-name-interpretation.sh index 698d9cc4f3..dd315ebf04 100755 --- a/t/t3204-branch-name-interpretation.sh +++ b/t/t3204-branch-name-interpretation.sh @@ -6,6 +6,9 @@ Branch name arguments are usually names which are taken to be inside of refs/heads/, but we interpret some magic syntax like @{-1}, @{upstream}, etc. This script aims to check the behavior of those corner cases. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh expect_branch() { diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh index 289625c464..8b54a9252b 100755 --- a/t/t3205-branch-color.sh +++ b/t/t3205-branch-color.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='basic branch output coloring' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'set up some sample branches' ' diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index 6eb344be03..3813ddc85e 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -2,6 +2,9 @@ test_description='range-diff tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Note that because of the range-diff's heuristics, test_commit does more diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index f41b2afb99..90eea19564 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -9,6 +9,9 @@ test_description='git pack-refs should not change the branch semantic This test runs git pack-refs and git show-ref and checks that the branch semantic is still the same. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'enable reflogs' ' diff --git a/t/t3211-peel-ref.sh b/t/t3211-peel-ref.sh index 3b7caca421..f3d9c6b6b6 100755 --- a/t/t3211-peel-ref.sh +++ b/t/t3211-peel-ref.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='tests for the peel_ref optimization of packed-refs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'create annotated tag in refs/tags' ' diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh index 7217c5e222..1564befe00 100755 --- a/t/t3302-notes-index-expensive.sh +++ b/t/t3302-notes-index-expensive.sh @@ -5,6 +5,9 @@ test_description='Test commit notes index (expensive!)' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh create_repo () { diff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh index 704aee81ef..16f3438355 100755 --- a/t/t3303-notes-subtrees.sh +++ b/t/t3303-notes-subtrees.sh @@ -2,6 +2,9 @@ test_description='Test commit notes organized in subtrees' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh number_of_commits=100 diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh index 1709e8c00b..6a7b8e2829 100755 --- a/t/t3304-notes-mixed.sh +++ b/t/t3304-notes-mixed.sh @@ -2,6 +2,9 @@ test_description='Test notes trees that also contain non-notes' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh number_of_commits=100 diff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh index 823fdbda1f..f86975414c 100755 --- a/t/t3320-notes-merge-worktrees.sh +++ b/t/t3320-notes-merge-worktrees.sh @@ -5,6 +5,9 @@ test_description='Test merging of notes trees in multiple worktrees' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup commit' ' diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh index 40d2975995..61577591d0 100755 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@ -8,6 +8,9 @@ test_description='git rebase assorted tests This test runs git rebase and checks that the author information is not lost among other things. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh GIT_AUTHOR_NAME=author@name diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh index 6e032716a6..d79a11b686 100755 --- a/t/t3402-rebase-merge.sh +++ b/t/t3402-rebase-merge.sh @@ -5,6 +5,9 @@ test_description='git rebase --merge test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh T="A quick brown fox diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index a927774910..c9936cb1d9 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -5,6 +5,9 @@ test_description='git rebase --merge --skip tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 1e56696e4f..9c91524e12 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -25,6 +25,9 @@ Initial setup: where A, B, D and G all touch file1, and one, two, three, four all touch file "conflict". ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh index 860e63e444..d8f6d2e3cb 100755 --- a/t/t3405-rebase-malformed.sh +++ b/t/t3405-rebase-malformed.sh @@ -2,6 +2,9 @@ test_description='rebase should handle arbitrary git message' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh index 4afc528165..863db3ac4c 100755 --- a/t/t3406-rebase-message.sh +++ b/t/t3406-rebase-message.sh @@ -2,6 +2,9 @@ test_description='messages from rebase operation' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh index 97efea0f56..e3c1851f40 100755 --- a/t/t3407-rebase-abort.sh +++ b/t/t3407-rebase-abort.sh @@ -2,6 +2,9 @@ test_description='git rebase --abort tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh ### Test that we handle space characters properly diff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh index d2bd7c17b0..6dd56c4c15 100755 --- a/t/t3408-rebase-multi-line.sh +++ b/t/t3408-rebase-multi-line.sh @@ -2,6 +2,9 @@ test_description='rebasing a commit with multi-line first paragraph.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh index 3b340f1ece..609efc96f9 100755 --- a/t/t3409-rebase-preserve-merges.sh +++ b/t/t3409-rebase-preserve-merges.sh @@ -6,6 +6,9 @@ test_description='git rebase -p should preserve merges Run "git rebase -p" and check that merges are properly carried along ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if ! test_have_prereq REBASE_P; then diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh index 21632a984e..07597643c5 100755 --- a/t/t3412-rebase-root.sh +++ b/t/t3412-rebase-root.sh @@ -4,6 +4,9 @@ test_description='git rebase --root Tests if git rebase --root --onto <newparent> can rebase the root commit. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh log_with_names () { diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh index b6833e9a5f..86a1b82d65 100755 --- a/t/t3413-rebase-hook.sh +++ b/t/t3413-rebase-hook.sh @@ -2,6 +2,9 @@ test_description='git rebase with its hook(s)' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh index 7bab6000dc..35eb8e2bb2 100755 --- a/t/t3415-rebase-autosquash.sh +++ b/t/t3415-rebase-autosquash.sh @@ -2,6 +2,9 @@ test_description='auto squash' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh index 9c2548423b..0f5b814aaf 100755 --- a/t/t3416-rebase-onto-threedots.sh +++ b/t/t3416-rebase-onto-threedots.sh @@ -2,6 +2,9 @@ test_description='git rebase --onto A...B' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-rebase.sh" diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index 7a2da972fd..445cb843ba 100755 --- a/t/t3418-rebase-continue.sh +++ b/t/t3418-rebase-continue.sh @@ -2,6 +2,9 @@ test_description='git rebase --continue tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh index 1f32faa4a4..c5fe58d68b 100755 --- a/t/t3419-rebase-patch-id.sh +++ b/t/t3419-rebase-patch-id.sh @@ -2,6 +2,9 @@ test_description='git rebase - test patch id computation' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh scramble () { diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh index ca331733fb..95facc49aa 100755 --- a/t/t3420-rebase-autostash.sh +++ b/t/t3420-rebase-autostash.sh @@ -4,6 +4,9 @@ # test_description='git rebase --autostash tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh index 5839719ba1..254ed18452 100755 --- a/t/t3427-rebase-subtree.sh +++ b/t/t3427-rebase-subtree.sh @@ -4,6 +4,9 @@ test_description='git rebase tests for -Xsubtree This test runs git rebase and tests the subtree strategy. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index b454f400eb..22d929bd31 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -18,6 +18,9 @@ Initial setup: \ Conflicting-G ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh . "$TEST_DIRECTORY"/lib-log-graph.sh diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh index 172562789e..af862e5bcc 100755 --- a/t/t3431-rebase-fork-point.sh +++ b/t/t3431-rebase-fork-point.sh @@ -5,6 +5,9 @@ test_description='git rebase --fork-point test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # A---B---D---E (master) diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh index a29eda87e9..112a18d630 100755 --- a/t/t3432-rebase-fast-forward.sh +++ b/t/t3432-rebase-fast-forward.sh @@ -5,6 +5,9 @@ test_description='ensure rebase fast-forwards commits when possible' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh index c7c835cde9..26fd33cbed 100755 --- a/t/t3434-rebase-i18n.sh +++ b/t/t3434-rebase-i18n.sh @@ -14,6 +14,9 @@ Initial setup: 5 - 6 second ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh compare_msg () { diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh index 54120b09d6..d169bc511d 100755 --- a/t/t3435-rebase-gpg-sign.sh +++ b/t/t3435-rebase-gpg-sign.sh @@ -5,6 +5,9 @@ test_description='test rebase --[no-]gpg-sign' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-rebase.sh" . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh index 2b8d9cb38e..99905dd49a 100755 --- a/t/t3500-cherry.sh +++ b/t/t3500-cherry.sh @@ -8,6 +8,9 @@ test_description='git cherry should detect patches integrated upstream This test cherry-picks one local change of two into master branch, and checks that git cherry only returns the second patch in the local branch ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh GIT_AUTHOR_EMAIL=bogus_email_address diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh index 3669dfb1be..6a10714e22 100755 --- a/t/t3501-revert-cherry-pick.sh +++ b/t/t3501-revert-cherry-pick.sh @@ -10,6 +10,9 @@ test_description='test cherry-pick and revert with renames ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh index 8b635a196d..774ad9ce14 100755 --- a/t/t3502-cherry-pick-merge.sh +++ b/t/t3502-cherry-pick-merge.sh @@ -8,6 +8,9 @@ test_description='cherry picking and reverting a merge ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh index e27f39d1e5..00c622d5dc 100755 --- a/t/t3503-cherry-pick-root.sh +++ b/t/t3503-cherry-pick-root.sh @@ -2,6 +2,9 @@ test_description='test cherry-picking (and reverting) a root commit' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh index 80a0d08706..860ba0b496 100755 --- a/t/t3504-cherry-pick-rerere.sh +++ b/t/t3504-cherry-pick-rerere.sh @@ -2,6 +2,9 @@ test_description='cherry-pick should rerere for conflicts' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh index 5f911bb529..20cd4052d4 100755 --- a/t/t3505-cherry-pick-empty.sh +++ b/t/t3505-cherry-pick-empty.sh @@ -2,6 +2,9 @@ test_description='test cherry-picking an empty commit' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh index 9d5adbc130..a105a782f6 100755 --- a/t/t3506-cherry-pick-ff.sh +++ b/t/t3506-cherry-pick-ff.sh @@ -2,6 +2,9 @@ test_description='test cherry-picking with --ff option' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh index a21adcf0e4..e94264e578 100755 --- a/t/t3507-cherry-pick-conflict.sh +++ b/t/t3507-cherry-pick-conflict.sh @@ -9,6 +9,9 @@ test_description='test cherry-pick and revert with conflicts ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh pristine_detach () { diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh index 23070a7b73..b967bf0639 100755 --- a/t/t3508-cherry-pick-many-commits.sh +++ b/t/t3508-cherry-pick-many-commits.sh @@ -2,6 +2,9 @@ test_description='test cherry-picking many commits' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_head_differs_from() { diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh index 1e5b3948df..83cab7b2ed 100755 --- a/t/t3509-cherry-pick-merge-df.sh +++ b/t/t3509-cherry-pick-merge-df.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Test cherry-pick with directory/file conflicts' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'Initialize repository' ' diff --git a/t/t3512-cherry-pick-submodule.sh b/t/t3512-cherry-pick-submodule.sh index 6ece1d8573..ff33c6d5c9 100755 --- a/t/t3512-cherry-pick-submodule.sh +++ b/t/t3512-cherry-pick-submodule.sh @@ -2,6 +2,9 @@ test_description='cherry-pick can handle submodules' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-submodule-update.sh diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index efec8d13b6..3baa64bf99 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -5,6 +5,9 @@ test_description='Test of the various options to git rm.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Setup some files to be removed, some with funny characters diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index ca04fac417..9be7527531 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='add -i basic tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index 923eb01f0e..bde27227b6 100755 --- a/t/t3901-i18n-patch.sh +++ b/t/t3901-i18n-patch.sh @@ -5,6 +5,9 @@ test_description='i18n settings and format-patch | am pipe' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_encoding () { diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 9f7ca98967..49d52c46ad 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -5,6 +5,9 @@ test_description='Test git stash' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff_cmp () { diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh index 54ce19e353..a2d1cdec6d 100755 --- a/t/t3910-mac-os-precompose.sh +++ b/t/t3910-mac-os-precompose.sh @@ -5,6 +5,9 @@ test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if ! test_have_prereq UTF8_NFD_TO_NFC diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index f72d456d3b..45f68ebcdb 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -5,6 +5,9 @@ test_description='Various diff formatting options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index c5e5e0da3f..276aea32a6 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -5,6 +5,9 @@ test_description='various format-patch tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh index 95a7ca7070..0b379c307b 100755 --- a/t/t4017-diff-retval.sh +++ b/t/t4017-diff-retval.sh @@ -2,6 +2,9 @@ test_description='Return value of diffs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh index 94680836ce..e873abb1da 100755 --- a/t/t4038-diff-combined.sh +++ b/t/t4038-diff-combined.sh @@ -2,6 +2,9 @@ test_description='combined diff' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index f852136585..8014cd684b 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -9,6 +9,9 @@ test_description='Support for verbose submodule differences in git diff This test tries to verify the sanity of the --submodule option of git diff. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Tested non-UTF-8 encoding diff --git a/t/t4048-diff-combined-binary.sh b/t/t4048-diff-combined-binary.sh index 7f9ad9fa3d..e2780e697a 100755 --- a/t/t4048-diff-combined-binary.sh +++ b/t/t4048-diff-combined-binary.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='combined and merge diff handle binary files and textconv' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup binary merge conflict' ' diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh index 28c053849a..a9aef7f986 100755 --- a/t/t4052-stat-output.sh +++ b/t/t4052-stat-output.sh @@ -5,6 +5,9 @@ test_description='test --stat output of various commands' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t4056-diff-order.sh b/t/t4056-diff-order.sh index 43dd474a12..723eee4e8e 100755 --- a/t/t4056-diff-order.sh +++ b/t/t4056-diff-order.sh @@ -2,6 +2,9 @@ test_description='diff order' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh create_files () { diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh index 0b78573733..71af157bf9 100755 --- a/t/t4057-diff-combined-paths.sh +++ b/t/t4057-diff-combined-paths.sh @@ -2,6 +2,9 @@ test_description='combined diff show only paths that are different to all parents' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # verify that diffc.expect matches output of diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh index 0f7a6d97a8..cbe64d5f79 100755 --- a/t/t4061-diff-indent.sh +++ b/t/t4061-diff-indent.sh @@ -3,6 +3,9 @@ test_description='Test diff indent heuristic. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh index 6331f63b12..1983f1ebbe 100755 --- a/t/t4066-diff-emit-delay.sh +++ b/t/t4066-diff-emit-delay.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test combined/stat/moved interaction' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # This test covers a weird 3-way interaction between "--cc -p", which will run diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh index 03487cc945..55d47352ba 100755 --- a/t/t4068-diff-symmetric-merge-base.sh +++ b/t/t4068-diff-symmetric-merge-base.sh @@ -2,6 +2,9 @@ test_description='behavior of diff with symmetric-diff setups and --merge-base' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # build these situations: diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh index 1b420e3b5f..ee4a74b132 100755 --- a/t/t4103-apply-binary.sh +++ b/t/t4103-apply-binary.sh @@ -6,6 +6,9 @@ test_description='git apply handling binary patches ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh index d7349ced6b..0a091dc5a0 100755 --- a/t/t4108-apply-threeway.sh +++ b/t/t4108-apply-threeway.sh @@ -2,6 +2,9 @@ test_description='git apply --3way' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh print_sanitized_conflicted_diff () { diff --git a/t/t4121-apply-diffs.sh b/t/t4121-apply-diffs.sh index 66368effd5..60deb3bf78 100755 --- a/t/t4121-apply-diffs.sh +++ b/t/t4121-apply-diffs.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git apply for contextually independent diffs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh echo '1 diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh index 4acb3f336e..71deaf779d 100755 --- a/t/t4122-apply-symlink-inside.sh +++ b/t/t4122-apply-symlink-inside.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='apply to deeper directory without getting fooled with symlink' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 3ecbef6f8e..e1ffc04852 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -2,6 +2,9 @@ test_description='git am running' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup: messages' ' diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index b12b43e9e9..1f1a809c60 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -22,6 +22,9 @@ test_description='git rerere ++++++ [master] initial ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 3d5c4a2086..ad6d3eebe5 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -6,6 +6,9 @@ test_description='git shortlog ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 56d34ed465..6c7a3cfc2c 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -2,6 +2,9 @@ test_description='git log' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" . "$TEST_DIRECTORY/lib-terminal.sh" diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 586c3a86b1..8a2f8984f6 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -2,6 +2,9 @@ test_description='.mailmap configurations' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh fuzz_blame () { diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh index 8ff8bd84c7..46ecb777f4 100755 --- a/t/t4204-patch-id.sh +++ b/t/t4204-patch-id.sh @@ -2,6 +2,9 @@ test_description='git patch-id' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh index 60f040cab8..6c868df38d 100755 --- a/t/t4207-log-decoration-colors.sh +++ b/t/t4207-log-decoration-colors.sh @@ -5,6 +5,9 @@ test_description='Test for "git log --decorate" colors' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh index 6cdbe4747a..1938d4a58f 100755 --- a/t/t4208-log-magic-pathspec.sh +++ b/t/t4208-log-magic-pathspec.sh @@ -2,6 +2,9 @@ test_description='magic pathspec tests using git-log' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 85d151423d..59c258429d 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test log -L' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup (import history)' ' diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh index a080325098..981b83513a 100755 --- a/t/t4214-log-graph-octopus.sh +++ b/t/t4214-log-graph-octopus.sh @@ -2,6 +2,9 @@ test_description='git log --graph of skewed left octopus merge.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-log-graph.sh diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh index d11040ce41..b3f3820dbb 100755 --- a/t/t4216-log-bloom.sh +++ b/t/t4216-log-bloom.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git log for a path with Bloom filters' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh GIT_TEST_COMMIT_GRAPH=0 diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh index 6e1b73ec3a..ec7ba62d67 100755 --- a/t/t4253-am-keep-cr-dos.sh +++ b/t/t4253-am-keep-cr-dos.sh @@ -6,6 +6,9 @@ test_description='git-am mbox with dos line ending. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Three patches which will be added as files with dos line ending. diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh index c1811ea0f4..752e1fb2d2 100755 --- a/t/t5150-request-pull.sh +++ b/t/t5150-request-pull.sh @@ -2,6 +2,9 @@ test_description='Test workflows involving pull request.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if ! test_have_prereq PERL diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh index df60f18fb8..bd5f71e396 100755 --- a/t/t5304-prune.sh +++ b/t/t5304-prune.sh @@ -4,6 +4,9 @@ # test_description='prune' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh day=$((60*60*24)) diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh index a5eca210b8..2e56887ed5 100755 --- a/t/t5305-include-tag.sh +++ b/t/t5305-include-tag.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git pack-object --include-tag' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh TRASH=$(pwd) diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh index 8318781d2b..7842eb0977 100755 --- a/t/t5310-pack-bitmaps.sh +++ b/t/t5310-pack-bitmaps.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='exercise basic bitmap functionality' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh objpath () { diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh index da9d59940d..c70b5db2a0 100755 --- a/t/t5312-prune-corruption.sh +++ b/t/t5312-prune-corruption.sh @@ -8,6 +8,9 @@ bail out or to proceed using it as a reachable tip, but it is _not_ OK to proceed as if it did not exist. Otherwise we might silently delete objects that cannot be recovered. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'disable reflogs' ' diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh index dc0446574b..f19c521292 100755 --- a/t/t5317-pack-objects-filter-objects.sh +++ b/t/t5317-pack-objects-filter-objects.sh @@ -2,6 +2,9 @@ test_description='git pack-objects using object filtering' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Test blob:none filter. diff --git a/t/t5322-pack-objects-sparse.sh b/t/t5322-pack-objects-sparse.sh index a581eaf529..c92658d026 100755 --- a/t/t5322-pack-objects-sparse.sh +++ b/t/t5322-pack-objects-sparse.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='pack-objects object selection using sparse algorithm' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup repo' ' diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index cc86ef213e..6be028f3e2 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -6,6 +6,9 @@ test_description='See why rewinding head breaks send-pack ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh cnt=64 diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh index 4aeea8f5b7..27fc6ec4f3 100755 --- a/t/t5402-post-merge-hook.sh +++ b/t/t5402-post-merge-hook.sh @@ -4,6 +4,9 @@ # test_description='Test the post-merge hook.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh index a39b3b5c78..ed91aadd95 100755 --- a/t/t5403-post-checkout-hook.sh +++ b/t/t5403-post-checkout-hook.sh @@ -4,6 +4,9 @@ # test_description='Test the post-checkout hook.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh index 2762f420bc..da37b22fc5 100755 --- a/t/t5404-tracking-branches.sh +++ b/t/t5404-tracking-branches.sh @@ -2,6 +2,9 @@ test_description='tracking branch update checks for git push' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5405-send-pack-rewind.sh b/t/t5405-send-pack-rewind.sh index 235fb7686a..1f5b33b562 100755 --- a/t/t5405-send-pack-rewind.sh +++ b/t/t5405-send-pack-rewind.sh @@ -2,6 +2,9 @@ test_description='forced push to replace commit we do not have' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh index 80750a817e..78bffa64d7 100755 --- a/t/t5407-post-rewrite-hook.sh +++ b/t/t5407-post-rewrite-hook.sh @@ -4,6 +4,9 @@ # test_description='Test the post-rewrite hook.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5410-receive-pack-alternates.sh b/t/t5410-receive-pack-alternates.sh index f00d0da860..30a4e6bb1a 100755 --- a/t/t5410-receive-pack-alternates.sh +++ b/t/t5410-receive-pack-alternates.sh @@ -2,6 +2,9 @@ test_description='git receive-pack with alternate ref filtering' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 3557374312..4edb8c196e 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -5,6 +5,9 @@ test_description='Testing multi_ack pack fetching' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Test fetch-pack/upload-pack pair. diff --git a/t/t5501-fetch-push-alternates.sh b/t/t5501-fetch-push-alternates.sh index 1bc57ac03f..96ce28b6ba 100755 --- a/t/t5501-fetch-push-alternates.sh +++ b/t/t5501-fetch-push-alternates.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='fetch/push involving alternates' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh count_objects () { diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh index 7a46cbdbe6..e15a472e4c 100755 --- a/t/t5502-quickfetch.sh +++ b/t/t5502-quickfetch.sh @@ -2,6 +2,9 @@ test_description='test quickfetch from local' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh index 6041a4dd32..cd1f407174 100755 --- a/t/t5503-tagfollow.sh +++ b/t/t5503-tagfollow.sh @@ -2,6 +2,9 @@ test_description='test automatic tag following' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # End state of the repository: diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index 1a16ac4c0d..7fe21b176d 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='fetch/receive strict mode' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup and inject "corrupt or missing" object' ' diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index eaa6e90220..2b6e1f50f8 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -2,6 +2,9 @@ test_description='git remote porcelain-ish' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh setup_repository () { diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh index 83d5558c0e..bf3aa85da5 100755 --- a/t/t5506-remote-groups.sh +++ b/t/t5506-remote-groups.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git remote group handling' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh mark() { diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh index a67f792adf..f234dba91a 100755 --- a/t/t5509-fetch-push-namespaces.sh +++ b/t/t5509-fetch-push-namespaces.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='fetch/push involving ref namespaces' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 5d673358f9..4af490b6db 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -5,6 +5,9 @@ test_description='Per branch config variables affects "git fetch". ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh D=$(pwd) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index e98c3a0174..a892807de2 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -2,6 +2,9 @@ test_description='git ls-remote' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh generate_references () { diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh index bd202ec6f3..f12a83f82b 100755 --- a/t/t5514-fetch-multiple.sh +++ b/t/t5514-fetch-multiple.sh @@ -2,6 +2,9 @@ test_description='fetch --all works correctly' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh setup_repository () { diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index d11382f769..7003467523 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -14,6 +14,9 @@ This test checks the following functionality: * reflogs ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh D=$(pwd) diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh index e4edd56404..aa6405b452 100755 --- a/t/t5517-push-mirror.sh +++ b/t/t5517-push-mirror.sh @@ -2,6 +2,9 @@ test_description='pushing to a mirror repository' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh D=$(pwd) diff --git a/t/t5518-fetch-exit-status.sh b/t/t5518-fetch-exit-status.sh index c2060bb870..a94d0744d0 100755 --- a/t/t5518-fetch-exit-status.sh +++ b/t/t5518-fetch-exit-status.sh @@ -5,6 +5,9 @@ test_description='fetch exit status test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh index 11fcd37700..0f199d0ccb 100755 --- a/t/t5519-push-alternates.sh +++ b/t/t5519-push-alternates.sh @@ -2,6 +2,9 @@ test_description='push to a repository that borrows from elsewhere' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 9fae07cdfa..b6b21c6cd1 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -2,6 +2,9 @@ test_description='pulling into void' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh modify () { diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh index db1a381cd9..f0806f3eb5 100755 --- a/t/t5521-pull-options.sh +++ b/t/t5521-pull-options.sh @@ -2,6 +2,9 @@ test_description='pull options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh index e47b5db5d6..0e6c7c251b 100755 --- a/t/t5523-push-upstream.sh +++ b/t/t5523-push-upstream.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='push with --set-upstream' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh index dd8e423d25..40fb276e0e 100755 --- a/t/t5526-fetch-submodules.sh +++ b/t/t5526-fetch-submodules.sh @@ -3,6 +3,9 @@ test_description='Recursive "git fetch" for submodules' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh pwd=$(pwd) diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh index 3b0cb98422..4aa1fb7281 100755 --- a/t/t5527-fetch-odd-refs.sh +++ b/t/t5527-fetch-odd-refs.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test fetching of oddly-named refs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # afterwards we will have: diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh index f0a287d97d..b39b5171dc 100755 --- a/t/t5528-push-default.sh +++ b/t/t5528-push-default.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='check various push.default settings' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup bare remotes' ' diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh index 4ad059e6be..010f5a0207 100755 --- a/t/t5531-deep-submodule-push.sh +++ b/t/t5531-deep-submodule-push.sh @@ -2,6 +2,9 @@ test_description='test push with submodules' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh index 7813e8470e..a7f0f098dd 100755 --- a/t/t5533-push-cas.sh +++ b/t/t5533-push-cas.sh @@ -2,6 +2,9 @@ test_description='compare & swap push force/delete safety' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh setup_srcdst_basic () { diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh index af0385fb89..6ab458684d 100755 --- a/t/t5534-push-signed.sh +++ b/t/t5534-push-signed.sh @@ -2,6 +2,9 @@ test_description='signed push' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh index a55202d2d3..6de384a5ea 100755 --- a/t/t5537-fetch-shallow.sh +++ b/t/t5537-fetch-shallow.sh @@ -2,6 +2,9 @@ test_description='fetch/clone from a shallow clone' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh commit() { diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh index ecbf84d21c..1253429d5d 100755 --- a/t/t5538-push-shallow.sh +++ b/t/t5538-push-shallow.sh @@ -2,6 +2,9 @@ test_description='push from/to a shallow clone' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh commit() { diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh index 82aa99ae87..1da2a7533e 100755 --- a/t/t5539-fetch-http-shallow.sh +++ b/t/t5539-fetch-http-shallow.sh @@ -2,6 +2,9 @@ test_description='fetch/clone from a shallow clone over http' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh index 450321fddb..751116e123 100755 --- a/t/t5540-http-push-webdav.sh +++ b/t/t5540-http-push-webdav.sh @@ -7,6 +7,9 @@ test_description='test WebDAV http-push This test runs various sanity checks on http-push.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if git http-push > /dev/null 2>&1 || [ $? -eq 128 ] diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index 187454f5dd..2836b87239 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -4,6 +4,9 @@ # test_description='test smart pushing over http via http-backend' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh ROOT_PATH="$PWD" diff --git a/t/t5542-push-http-shallow.sh b/t/t5542-push-http-shallow.sh index ddc1db722d..0feec9c449 100755 --- a/t/t5542-push-http-shallow.sh +++ b/t/t5542-push-http-shallow.sh @@ -2,6 +2,9 @@ test_description='push from/to a shallow clone over http' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh index 620c30d58f..16a8fc7535 100755 --- a/t/t5543-atomic-push.sh +++ b/t/t5543-atomic-push.sh @@ -2,6 +2,9 @@ test_description='pushing to a repository using the atomic push option' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh mk_repo_pair () { diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh index 38e6f7340e..202d75aebe 100755 --- a/t/t5545-push-options.sh +++ b/t/t5545-push-options.sh @@ -2,6 +2,9 @@ test_description='pushing to a repository using push options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh mk_repo_pair () { diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh index 483578b2d7..9ec91792c3 100755 --- a/t/t5550-http-fetch-dumb.sh +++ b/t/t5550-http-fetch-dumb.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test dumb fetching over http via static file' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index e40e9ed52f..310b89dbab 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test smart fetching over http via http-backend' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd diff --git a/t/t5553-set-upstream.sh b/t/t5553-set-upstream.sh index 7622981cbf..e78a21881f 100755 --- a/t/t5553-set-upstream.sh +++ b/t/t5553-set-upstream.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='"git fetch/pull --set-upstream" basic tests.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_config () { diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh index 9fafcf1945..5561b7d012 100755 --- a/t/t5560-http-backend-noserver.sh +++ b/t/t5560-http-backend-noserver.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test git-http-backend-noserver' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY" diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh index 6eb0294978..cba2dffdb0 100755 --- a/t/t5561-http-backend.sh +++ b/t/t5561-http-backend.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test git-http-backend' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh index 8f69a7854f..2e99a331c5 100755 --- a/t/t5570-git-daemon.sh +++ b/t/t5570-git-daemon.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test fetching over git protocol' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-git-daemon.sh diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh index ac53d63869..971ed3da4b 100755 --- a/t/t5571-pre-push-hook.sh +++ b/t/t5571-pre-push-hook.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='check pre-push hooks' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Setup hook that always succeeds diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh index cf768b3a27..da4c94cce1 100755 --- a/t/t5580-unc-paths.sh +++ b/t/t5580-unc-paths.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='various Windows-only path tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if test_have_prereq CYGWIN diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh index 927aad0820..907bb062d6 100755 --- a/t/t5581-http-curl-verbose.sh +++ b/t/t5581-http-curl-verbose.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test GIT_CURL_VERBOSE' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh index 8c61e28fec..608e9aa189 100755 --- a/t/t5582-fetch-negative-refspec.sh +++ b/t/t5582-fetch-negative-refspec.sh @@ -5,6 +5,9 @@ test_description='"git fetch" with negative refspecs. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 7df3c5373a..e01c5fe02d 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -2,6 +2,9 @@ test_description=clone +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh X= diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh index 2f7be23044..20fbb1e9a3 100755 --- a/t/t5604-clone-reference.sh +++ b/t/t5604-clone-reference.sh @@ -4,6 +4,9 @@ # test_description='test clone --reference' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh base_dir=$(pwd) diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh index af23419ebf..94028044b0 100755 --- a/t/t5605-clone-local.sh +++ b/t/t5605-clone-local.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test local clone' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh repo_is_hardlinked() { diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh index 7f082fb23b..3893a49e6d 100755 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='basic clone options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh index 26985f4b44..6e2e4adbb4 100755 --- a/t/t5607-clone-bundle.sh +++ b/t/t5607-clone-bundle.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='some bundle related tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5609-clone-branch.sh b/t/t5609-clone-branch.sh index 6e7a7be052..e4d5124f89 100755 --- a/t/t5609-clone-branch.sh +++ b/t/t5609-clone-branch.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='clone --branch option' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_HEAD() { diff --git a/t/t5610-clone-detached.sh b/t/t5610-clone-detached.sh index 8b0d607df1..ba63ba8f42 100755 --- a/t/t5610-clone-detached.sh +++ b/t/t5610-clone-detached.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test cloning a repository with detached HEAD' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh head_is_detached() { diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh index 8e0fd39823..be4ae10c82 100755 --- a/t/t5611-clone-config.sh +++ b/t/t5611-clone-config.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='tests for git clone -c key=value' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'clone -c sets config in cloned repo' ' diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh index e3b436d8ae..9e37f7fef7 100755 --- a/t/t5612-clone-refspec.sh +++ b/t/t5612-clone-refspec.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test refspec written by clone-command' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index f4d49d8335..b2c3ed4088 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -2,6 +2,9 @@ test_description='git partial clone' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # create a normal "src" repo where we can later create new commits. diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh index 1a041df10b..cba468fc53 100755 --- a/t/t5617-clone-submodules-remote.sh +++ b/t/t5617-clone-submodules-remote.sh @@ -2,6 +2,9 @@ test_description='Test cloning repos with submodules using remote-tracking branches' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh pwd=$(pwd) diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh index 022901b9eb..7f0056c1ed 100755 --- a/t/t5700-protocol-v1.sh +++ b/t/t5700-protocol-v1.sh @@ -8,6 +8,9 @@ TEST_NO_CREATE_REPO=1 GIT_TEST_PROTOCOL_VERSION=0 export GIT_TEST_PROTOCOL_VERSION +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Test protocol v1 with 'git://' transport diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh index a1f5fdc9fd..66c47e61d8 100755 --- a/t/t5701-git-serve.sh +++ b/t/t5701-git-serve.sh @@ -2,6 +2,9 @@ test_description='test protocol v2 server commands' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'test capability advertisement' ' diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index 7d5b17909b..f1f77fe089 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -4,6 +4,9 @@ test_description='test git wire-protocol version 2' TEST_NO_CREATE_REPO=1 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Test protocol v2 with 'git://' transport diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index b46940b725..c3a52d478f 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -2,6 +2,9 @@ test_description='upload-pack ref-in-want' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh get_actual_refs () { diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 0f04b6cddb..1ecefb57fe 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -5,6 +5,9 @@ test_description='Test remote-helper import and export commands' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh index fc4d55dcb2..664000adf0 100755 --- a/t/t6000-rev-list-misc.sh +++ b/t/t6000-rev-list-misc.sh @@ -2,6 +2,9 @@ test_description='miscellaneous rev-list tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh index 7504ba4751..67c384f1e8 100755 --- a/t/t6001-rev-list-graft.sh +++ b/t/t6001-rev-list-graft.sh @@ -2,6 +2,9 @@ test_description='Revision traversal vs grafts and path limiter' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh index 3e8c42ee0b..ff788199e3 100755 --- a/t/t6004-rev-list-path-optim.sh +++ b/t/t6004-rev-list-path-optim.sh @@ -13,6 +13,9 @@ test_description='git rev-list trivial path optimization test ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 99a1eaf332..bbbd577f10 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -5,6 +5,9 @@ test_description='git rev-list --pretty=format test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t6007-rev-list-cherry-pick-file.sh b/t/t6007-rev-list-cherry-pick-file.sh index f0268372d2..51547ac3a5 100755 --- a/t/t6007-rev-list-cherry-pick-file.sh +++ b/t/t6007-rev-list-cherry-pick-file.sh @@ -2,6 +2,9 @@ test_description='test git rev-list --cherry-pick -- file' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # A---B---D---F diff --git a/t/t6008-rev-list-submodule.sh b/t/t6008-rev-list-submodule.sh index c4af9ca0a7..871ace31e2 100755 --- a/t/t6008-rev-list-submodule.sh +++ b/t/t6008-rev-list-submodule.sh @@ -5,6 +5,9 @@ test_description='git rev-list involving submodules that this repo has' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh index 916d9692bc..114f755d52 100755 --- a/t/t6009-rev-list-parent.sh +++ b/t/t6009-rev-list-parent.sh @@ -2,6 +2,9 @@ test_description='ancestor culling and limiting by parent number' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_revlist () { diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh index fd202fcb94..d163c24859 100755 --- a/t/t6012-rev-list-simplify.sh +++ b/t/t6012-rev-list-simplify.sh @@ -2,6 +2,9 @@ test_description='merge simplification' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh note () { diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh index 89458d370f..0298174956 100755 --- a/t/t6013-rev-list-reverse-parents.sh +++ b/t/t6013-rev-list-reverse-parents.sh @@ -2,6 +2,9 @@ test_description='--reverse combines with --parents' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh index f5e6e92f5b..3fb7ee0be4 100755 --- a/t/t6016-rev-list-graph-simplify-history.sh +++ b/t/t6016-rev-list-graph-simplify-history.sh @@ -7,6 +7,9 @@ test_description='--graph and simplified history' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'set up rev-list --graph test' ' diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh index 667b37564e..e51fe7b9bc 100755 --- a/t/t6017-rev-list-stdin.sh +++ b/t/t6017-rev-list-stdin.sh @@ -5,6 +5,9 @@ test_description='log family learns --stdin' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check () { diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh index fe2f3cec3d..60a351c26a 100755 --- a/t/t6018-rev-list-glob.sh +++ b/t/t6018-rev-list-glob.sh @@ -2,6 +2,9 @@ test_description='rev-list/rev-parse --glob' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh commit () { diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh index 353f84313f..aeb7defaa3 100755 --- a/t/t6019-rev-list-ancestry-path.sh +++ b/t/t6019-rev-list-ancestry-path.sh @@ -21,6 +21,9 @@ test_description='--ancestry-path' # --ancestry-path G..M -- G.t == L # --ancestry-path --simplify-merges G^..M -- G.t == G L +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_merge () { diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index aa226381be..7dc65c73cd 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -6,6 +6,9 @@ test_description='Tests git bisect functionality' exec </dev/null +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh add_line_into_file() diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh index 50a934e1b2..bc95ff6f54 100755 --- a/t/t6040-tracking-info.sh +++ b/t/t6040-tracking-info.sh @@ -2,6 +2,9 @@ test_description='remote tracking stats' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh advance () { diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index c80dc10b8f..0a53462a61 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -4,6 +4,9 @@ # test_description='Tests replace refs functionality' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh index 7531262a5e..19a56f4a4d 100755 --- a/t/t6101-rev-parse-parents.sh +++ b/t/t6101-rev-parse-parents.sh @@ -5,6 +5,9 @@ test_description='Test git rev-parse with different parent options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_cmp_rev_output () { diff --git a/t/t6110-rev-list-sparse.sh b/t/t6110-rev-list-sparse.sh index 656ac7fe9d..69411862d6 100755 --- a/t/t6110-rev-list-sparse.sh +++ b/t/t6110-rev-list-sparse.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='operations that cull histories in unusual ways' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh index 4244638285..58b8d42bf3 100755 --- a/t/t6111-rev-list-treesame.sh +++ b/t/t6111-rev-list-treesame.sh @@ -13,6 +13,9 @@ test_description='TREESAME and limiting' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh note () { diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh index de0e5a5d36..5f39c3adb3 100755 --- a/t/t6112-rev-list-filters-objects.sh +++ b/t/t6112-rev-list-filters-objects.sh @@ -2,6 +2,9 @@ test_description='git rev-list using object filtering' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Test the blob:none filter. diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index f822d5d328..360e65d3b9 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -11,6 +11,9 @@ test_description='test describe' # # First parent of a merge commit is on the same line, second parent below. +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_describe () { diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index f3e66eaf9b..725b356d1e 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -5,6 +5,9 @@ test_description='fmt-merge-msg test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index b359023189..b03740d634 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -5,6 +5,9 @@ test_description='for-each-ref test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh index 0a21669f56..0f3e6aa011 100755 --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -2,6 +2,9 @@ test_description='test for-each-refs usage of ref-filter APIs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh index 9da0838216..5fab2d2dd7 100755 --- a/t/t6400-merge-df.sh +++ b/t/t6400-merge-df.sh @@ -4,6 +4,9 @@ # test_description='Test merge with directory/file conflicts' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'prepare repository' ' diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh index 3f64f62224..227c2feb08 100755 --- a/t/t6402-merge-rename.sh +++ b/t/t6402-merge-rename.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Merge-recursive merging renames' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh modify () { diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh index b1c3d4dda4..bdf8169456 100755 --- a/t/t6404-recursive-merge.sh +++ b/t/t6404-recursive-merge.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Test merge without common ancestors' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # This scenario is based on a real-world repository of Shawn Pearce. diff --git a/t/t6405-merge-symlinks.sh b/t/t6405-merge-symlinks.sh index 6c0a90d044..140e9e6ce6 100755 --- a/t/t6405-merge-symlinks.sh +++ b/t/t6405-merge-symlinks.sh @@ -8,6 +8,9 @@ test_description='merging symlinks on filesystem w/o symlink support. This tests that git merge-recursive writes merge results as plain files if core.symlinks is false.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh index 76a55f838c..7fe4034d58 100755 --- a/t/t6406-merge-attr.sh +++ b/t/t6406-merge-attr.sh @@ -5,6 +5,9 @@ test_description='per path merge controlled by merge attribute' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6407-merge-binary.sh b/t/t6407-merge-binary.sh index 4e6c7cb77e..826deacfd7 100755 --- a/t/t6407-merge-binary.sh +++ b/t/t6407-merge-binary.sh @@ -2,6 +2,9 @@ test_description='ask merge-recursive to merge binary files' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh index b8e8b6f642..e2c1cfc9fe 100755 --- a/t/t6409-merge-subtree.sh +++ b/t/t6409-merge-subtree.sh @@ -2,6 +2,9 @@ test_description='subtree merge strategy' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh index 87741efad3..7b66abfdbb 100755 --- a/t/t6411-merge-filemode.sh +++ b/t/t6411-merge-filemode.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='merge: handle file mode' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'set up mode change in one branch' ' diff --git a/t/t6412-merge-large-rename.sh b/t/t6412-merge-large-rename.sh index 80777386dc..d6840078c4 100755 --- a/t/t6412-merge-large-rename.sh +++ b/t/t6412-merge-large-rename.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='merging with large rename matrix' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh count() { diff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh index e8d65eefb5..3bd8e3e899 100755 --- a/t/t6413-merge-crlf.sh +++ b/t/t6413-merge-crlf.sh @@ -8,6 +8,9 @@ test_description='merge conflict in crlf repo ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6414-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh index a25e730460..42824dcf49 100755 --- a/t/t6414-merge-rename-nocruft.sh +++ b/t/t6414-merge-rename-nocruft.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Merge-recursive merging renames' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh index 2eddcc7664..32c0b62496 100755 --- a/t/t6415-merge-dir-to-symlink.sh +++ b/t/t6415-merge-dir-to-symlink.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='merging when a directory was replaced with a symlink' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'create a commit where dir a/b changed to symlink' ' diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh index 887c2195a9..6a740771ed 100755 --- a/t/t6416-recursive-corner-cases.sh +++ b/t/t6416-recursive-corner-cases.sh @@ -2,6 +2,9 @@ test_description='recursive merge corner cases involving criss-cross merges' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-merge.sh diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh index 0aebc6c028..e7883f890a 100755 --- a/t/t6417-merge-ours-theirs.sh +++ b/t/t6417-merge-ours-theirs.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Merge-recursive ours and theirs variants' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh index 30983d18b1..91b43de00d 100755 --- a/t/t6418-merge-text-auto.sh +++ b/t/t6418-merge-text-auto.sh @@ -12,6 +12,9 @@ test_description='CRLF merge conflict across text=auto change *+ [side^] Initial ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b diff --git a/t/t6419-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh index 531850d834..9996a94431 100755 --- a/t/t6419-merge-ignorecase.sh +++ b/t/t6419-merge-ignorecase.sh @@ -2,6 +2,9 @@ test_description='git-merge with case-changing rename on case-insensitive file system' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if ! test_have_prereq CASE_INSENSITIVE_FS diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh index 78bfaf17f0..70c8af7f51 100755 --- a/t/t6422-merge-rename-corner-cases.sh +++ b/t/t6422-merge-rename-corner-cases.sh @@ -3,6 +3,9 @@ test_description="recursive merge corner cases w/ renames but not criss-crosses" # t6036 has corner cases that involve both criss-cross merges and renames +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-merge.sh diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh index f79d021590..e58e3dfba1 100755 --- a/t/t6425-merge-rename-delete.sh +++ b/t/t6425-merge-rename-delete.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='Merge-recursive rename/delete conflict message' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'rename/delete' ' diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh index f4655bb358..c192ee4e42 100755 --- a/t/t6427-diff3-conflict-markers.sh +++ b/t/t6427-diff3-conflict-markers.sh @@ -2,6 +2,9 @@ test_description='recursive merge diff3 style conflict markers' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Setup: diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh index 9c08e63af2..acb2868260 100755 --- a/t/t6430-merge-recursive.sh +++ b/t/t6430-merge-recursive.sh @@ -2,6 +2,9 @@ test_description='merge-recursive backend test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-merge.sh diff --git a/t/t6432-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh index b56180ee4a..1333cbb148 100755 --- a/t/t6432-merge-recursive-space-options.sh +++ b/t/t6432-merge-recursive-space-options.sh @@ -11,6 +11,9 @@ test_description='merge-recursive space options * ok 1: setup ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b diff --git a/t/t6433-merge-toplevel.sh b/t/t6433-merge-toplevel.sh index e29c284b9b..2d51b2d08c 100755 --- a/t/t6433-merge-toplevel.sh +++ b/t/t6433-merge-toplevel.sh @@ -2,6 +2,9 @@ test_description='"git merge" top-level frontend' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh t3033_reset () { diff --git a/t/t6434-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh index 3d9fae68c4..7e877e96e2 100755 --- a/t/t6434-merge-recursive-rename-options.sh +++ b/t/t6434-merge-recursive-rename-options.sh @@ -26,6 +26,9 @@ they are rounded down (see, e.g., Documentation/diff-generate-patch.txt, which mentions this in a different context). ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh get_expected_stages () { diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh index dd9376842f..7d5691c1b4 100755 --- a/t/t6436-merge-overwrite.sh +++ b/t/t6436-merge-overwrite.sh @@ -4,6 +4,9 @@ test_description='git-merge Do not overwrite changes.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh index 3ead2b726f..14fa46edf3 100755 --- a/t/t6437-submodule-merge.sh +++ b/t/t6437-submodule-merge.sh @@ -2,6 +2,9 @@ test_description='merging with submodules' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # diff --git a/t/t6439-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh index 5c8894d94f..e5542ceb24 100755 --- a/t/t6439-merge-co-error-msgs.sh +++ b/t/t6439-merge-co-error-msgs.sh @@ -2,6 +2,9 @@ test_description='unpack-trees error messages' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh index 8a3bb4105b..bda5069044 100755 --- a/t/t6501-freshen-objects.sh +++ b/t/t6501-freshen-objects.sh @@ -25,6 +25,9 @@ # to refer to an existing tree). test_description='check pruning of dependent objects' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # We care about reachability, so we do not want to use diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 36477cb1f4..db496fa039 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git filter-branch' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 05f411c821..0e3086c4a6 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -7,6 +7,9 @@ test_description='git tag Tests for operations with tags.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh . "$TEST_DIRECTORY"/lib-terminal.sh diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh index 5c5bc32ccb..bcb3c4f035 100755 --- a/t/t7030-verify-tag.sh +++ b/t/t7030-verify-tag.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='signed tag tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index d5218743e9..e65ca019eb 100755 --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@ -2,6 +2,9 @@ test_description='basic work tree status reporting' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh index a682a3d826..ae60942347 100755 --- a/t/t7063-status-untracked-cache.sh +++ b/t/t7063-status-untracked-cache.sh @@ -2,6 +2,9 @@ test_description='test untracked cache' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # On some filesystems (e.g. FreeBSD's ext2 and ufs) directory mtime diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh index 537787e598..07954b2142 100755 --- a/t/t7064-wtstatus-pv2.sh +++ b/t/t7064-wtstatus-pv2.sh @@ -5,6 +5,9 @@ test_description='git status --porcelain=v2 This test exercises porcelain V2 output for git status.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index b1affb001f..4af43d26f1 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -7,6 +7,9 @@ test_description='git reset Documented tests for git reset' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh commit_msg () { diff --git a/t/t7113-post-index-change-hook.sh b/t/t7113-post-index-change-hook.sh index f011ad7eec..8872c32f94 100755 --- a/t/t7113-post-index-change-hook.sh +++ b/t/t7113-post-index-change-hook.sh @@ -2,6 +2,9 @@ test_description='post index change hook' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t7201-co.sh b/t/t7201-co.sh index b36a93056f..12567543c4 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -20,6 +20,9 @@ Test switching across them. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_tick diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index fec7e0299d..8addc0c8c9 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -9,6 +9,9 @@ This test tries to verify basic sanity of the init, update and status subcommands of git submodule. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'submodule deinit works on empty repository' ' diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh index 0726799e74..c95559bed5 100755 --- a/t/t7403-submodule-sync.sh +++ b/t/t7403-submodule-sync.sh @@ -8,6 +8,9 @@ test_description='git submodule sync These tests exercise the "git submodule sync" subcommand. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index acb8766ac2..825b1a7e0c 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -9,6 +9,9 @@ This test verifies that "git submodule update" detaches the HEAD of the submodule and "git submodule update --rebase/--merge" does not detach the HEAD. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh index 6b2aa917e1..632defc53b 100755 --- a/t/t7407-submodule-foreach.sh +++ b/t/t7407-submodule-foreach.sh @@ -9,6 +9,9 @@ This test verifies that "git submodule foreach" correctly visits all submodules that are currently checked out. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t7409-submodule-detached-work-tree.sh b/t/t7409-submodule-detached-work-tree.sh index fc018e3638..e9428e2b59 100755 --- a/t/t7409-submodule-detached-work-tree.sh +++ b/t/t7409-submodule-detached-work-tree.sh @@ -10,6 +10,9 @@ on detached working trees ' TEST_NO_CREATE_REPO=1 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'submodule on detached working tree' ' diff --git a/t/t7417-submodule-path-url.sh b/t/t7417-submodule-path-url.sh index f7e7e94d7b..0a514e951c 100755 --- a/t/t7417-submodule-path-url.sh +++ b/t/t7417-submodule-path-url.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='check handling of .gitmodule path with dash' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'create submodule with dash in path' ' diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh index 110b4bf459..9a1414f31d 100755 --- a/t/t7501-commit-basic-functionality.sh +++ b/t/t7501-commit-basic-functionality.sh @@ -7,6 +7,9 @@ # signoff test_description='git commit' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/diff-lib.sh" diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh index 14c92e4c25..c8c16bf1c9 100755 --- a/t/t7502-commit-porcelain.sh +++ b/t/t7502-commit-porcelain.sh @@ -2,6 +2,9 @@ test_description='git commit porcelain-ish' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh commit_msg_is () { diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh index b3485450a2..8d3f4ab0d7 100755 --- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh +++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh @@ -2,6 +2,9 @@ test_description='pre-commit and pre-merge-commit hooks' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh HOOKDIR="$(git rev-parse --git-dir)/hooks" diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh index 31b9c6a2c1..17fb1d8499 100755 --- a/t/t7504-commit-msg-hook.sh +++ b/t/t7504-commit-msg-hook.sh @@ -2,6 +2,9 @@ test_description='commit-msg hook' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'with no hook' ' diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 94f85cdf83..978c90abbb 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505-prepare-commit-msg-hook.sh @@ -2,6 +2,9 @@ test_description='prepare-commit-msg hook' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'set up commits for rebasing' ' diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh index 6baaa1ad91..a5a36cab85 100755 --- a/t/t7510-signed-commit.sh +++ b/t/t7510-signed-commit.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='signed commit tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh GNUPGHOME_NOT_USED=$GNUPGHOME . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh index 29518e0949..fbd760f7e6 100755 --- a/t/t7512-status-help.sh +++ b/t/t7512-status-help.sh @@ -7,6 +7,9 @@ test_description='git status advice' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh index b2401cec3e..344d72a5c0 100755 --- a/t/t7517-per-repo-email.sh +++ b/t/t7517-per-repo-email.sh @@ -6,6 +6,9 @@ test_description='per-repo forced setting of email address' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup a likely user.useConfigOnly use case' ' diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index 1c85f75555..0ad866c08c 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -26,6 +26,9 @@ Testing basic merge operations/option parsing. +++++++* [c0] commit 0 ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh index 8e7e0a5865..7059c2a54b 100755 --- a/t/t7608-merge-messages.sh +++ b/t/t7608-merge-messages.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='test auto-generated merge messages' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh check_oneline() { diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh index 70afdd06fa..e65645d5e9 100755 --- a/t/t7610-mergetool.sh +++ b/t/t7610-mergetool.sh @@ -7,6 +7,9 @@ test_description='git mergetool Testing basic merge tool invocation' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # All the mergetool test work by checking out a temporary branch based diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh index 7c84a518aa..ed072bfb19 100755 --- a/t/t7611-merge-abort.sh +++ b/t/t7611-merge-abort.sh @@ -22,6 +22,9 @@ Next, test git merge --abort with the following variables: - changed/unchanged worktree after merge - changed/unchanged index after merge ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh index a426f3a89a..b4ec88f996 100755 --- a/t/t7612-merge-verify-signatures.sh +++ b/t/t7612-merge-verify-signatures.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='merge signature verification tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" diff --git a/t/t7614-merge-signoff.sh b/t/t7614-merge-signoff.sh index c1b8446f49..ea4eeee35f 100755 --- a/t/t7614-merge-signoff.sh +++ b/t/t7614-merge-signoff.sh @@ -5,6 +5,9 @@ test_description='git merge --signoff This test runs git merge --signoff and makes sure that it works. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # Setup test files diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh index 48261ba080..375f43a721 100755 --- a/t/t7701-repack-unpack-unreachable.sh +++ b/t/t7701-repack-unpack-unreachable.sh @@ -2,6 +2,9 @@ test_description='git repack works correctly' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh fsha1= diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index a578b35761..f938efa296 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -8,6 +8,9 @@ test_description='git-difftool Testing basic diff tool invocation ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh difftool_test_setup () diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 991d5bd9c0..47ec993962 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -6,6 +6,9 @@ test_description='git grep various. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh cat >hello.c <<EOF diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh index 72176e42c1..f661007c85 100755 --- a/t/t8001-annotate.sh +++ b/t/t8001-annotate.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git annotate' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh PROG='git annotate' diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh index 015973e8fe..89a319d2c7 100755 --- a/t/t8002-blame.sh +++ b/t/t8002-blame.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git blame' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh PROG='git blame -c' diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh index ba8013b002..0613d889db 100755 --- a/t/t8003-blame-corner-cases.sh +++ b/t/t8003-blame-corner-cases.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git blame corner cases' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh pick_fc='s/^[0-9a-f^]* *\([^ ]*\) *(\([^ ]*\) .*/\1-\2/' diff --git a/t/t8004-blame-with-conflicts.sh b/t/t8004-blame-with-conflicts.sh index 9c353ab222..ffce1d1195 100755 --- a/t/t8004-blame-with-conflicts.sh +++ b/t/t8004-blame-with-conflicts.sh @@ -3,6 +3,9 @@ # Based on a test case submitted by Björn Steinbrink. test_description='git blame on conflicted files' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup first case' ' diff --git a/t/t8012-blame-colors.sh b/t/t8012-blame-colors.sh index ed38f74de9..d55b3e22c9 100755 --- a/t/t8012-blame-colors.sh +++ b/t/t8012-blame-colors.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='colored git blame' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh PROG='git blame -c' diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index a08f72596a..3d160d939e 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git send-email' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh # May be altered later in the test diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index e4bb22034e..9a6f2c38f1 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -6,6 +6,9 @@ test_description='git svn basic tests' GIT_SVN_LC_ALL=${LC_ALL:-$LANG} +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh case "$GIT_SVN_LC_ALL" in diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh index 3bbf341f6a..053571ca5c 100755 --- a/t/t9145-git-svn-master-branch.sh +++ b/t/t9145-git-svn-master-branch.sh @@ -3,6 +3,9 @@ # Copyright (c) 2009 Eric Wong # test_description='git svn initial master branch is "trunk" if possible' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh test_expect_success 'setup test repository' ' diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh index 4f6c06ecb2..9188c761de 100755 --- a/t/t9151-svn-mergeinfo.sh +++ b/t/t9151-svn-mergeinfo.sh @@ -5,6 +5,9 @@ test_description='git-svn svn mergeinfo properties' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh test_expect_success 'load svn dump' " diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh index 184336f346..9d6cc40add 100755 --- a/t/t9155-git-svn-fetch-deleted-tag.sh +++ b/t/t9155-git-svn-fetch-deleted-tag.sh @@ -2,6 +2,9 @@ test_description='git svn fetch deleted tag' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh test_expect_success 'setup svn repo' ' diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh index 7a6e33ba3c..ba78bfb676 100755 --- a/t/t9156-git-svn-fetch-deleted-tag-2.sh +++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh @@ -2,6 +2,9 @@ test_description='git svn fetch deleted tag 2' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh test_expect_success 'setup svn repo' ' diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh index d6245cee08..e48faf92af 100755 --- a/t/t9163-git-svn-reset-clears-caches.sh +++ b/t/t9163-git-svn-reset-clears-caches.sh @@ -4,6 +4,9 @@ # test_description='git svn reset clears memoized caches' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh svn_ver="$(svn --version --quiet)" diff --git a/t/t9169-git-svn-dcommit-crlf.sh b/t/t9169-git-svn-dcommit-crlf.sh index 54b1f61a2a..47ae51c54f 100755 --- a/t/t9169-git-svn-dcommit-crlf.sh +++ b/t/t9169-git-svn-dcommit-crlf.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git svn dcommit CRLF' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-svn.sh test_expect_success 'setup commit repository' ' diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 308c1ef42c..404a42999e 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -4,6 +4,9 @@ # test_description='test git fast-import utility' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh index 14c1baa739..0c5bfbde0e 100755 --- a/t/t9301-fast-import-notes.sh +++ b/t/t9301-fast-import-notes.sh @@ -4,6 +4,9 @@ # test_description='test git fast-import of notes objects' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 1372842559..6c8830ece5 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -4,6 +4,9 @@ # test_description='git fast-export' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh index 5ac2c3b5ee..4130c8a837 100755 --- a/t/t9351-fast-export-anonymize.sh +++ b/t/t9351-fast-export-anonymize.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='basic tests for fast-export --anonymize' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup simple repo' ' diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh index 4a46f31c41..7d23e6ba94 100755 --- a/t/t9400-git-cvsserver-server.sh +++ b/t/t9400-git-cvsserver-server.sh @@ -8,6 +8,9 @@ test_description='git-cvsserver access tests read access to a git repository with the cvs CLI client via git-cvsserver server' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh if ! test_have_prereq PERL; then diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh index c7a0dd84a4..0062341dbf 100755 --- a/t/t9401-git-cvsserver-crlf.sh +++ b/t/t9401-git-cvsserver-crlf.sh @@ -9,6 +9,9 @@ test_description='git-cvsserver -kb modes tests -kb mode for binary files when accessing a git repository using cvs CLI client via git-cvsserver server' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh marked_as () { diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh index 6436c91a3c..33b6db1648 100755 --- a/t/t9402-git-cvsserver-refs.sh +++ b/t/t9402-git-cvsserver-refs.sh @@ -5,6 +5,9 @@ test_description='git-cvsserver and git refspecs tests ability for git-cvsserver to switch between and compare tags, branches and other git refspecs' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh ######### diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index b484e3e250..fa36bf5e83 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -10,6 +10,9 @@ commandline, and checks that it would not write any errors or warnings to log.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./gitweb-lib.sh # ---------------------------------------------------------------------- diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh index 2a0ffed870..6b0adf28d2 100755 --- a/t/t9501-gitweb-standalone-http-status.sh +++ b/t/t9501-gitweb-standalone-http-status.sh @@ -10,6 +10,9 @@ commandline, and checks that it returns the expected HTTP status code and message.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./gitweb-lib.sh # diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh index e38cbc97d3..76d90eccd8 100755 --- a/t/t9502-gitweb-standalone-parse-output.sh +++ b/t/t9502-gitweb-standalone-parse-output.sh @@ -10,6 +10,9 @@ commandline, and checks that it produces the correct output, either in the HTTP header or the actual script output.' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./gitweb-lib.sh # ---------------------------------------------------------------------- diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 251fdd66c4..9257d664f2 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -1,6 +1,9 @@ #!/bin/sh test_description='git cvsimport basic tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-cvs.sh if ! test_have_prereq NOT_ROOT; then diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh index 827d39f5bf..700c2688d2 100755 --- a/t/t9601-cvsimport-vendor-branch.sh +++ b/t/t9601-cvsimport-vendor-branch.sh @@ -32,6 +32,9 @@ # tag has been removed. test_description='git cvsimport handling of vendor branches' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-cvs.sh setup_cvs_test_repository t9601 diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh index e1db323f54..7b1fb36e67 100755 --- a/t/t9602-cvsimport-branches-tags.sh +++ b/t/t9602-cvsimport-branches-tags.sh @@ -4,6 +4,9 @@ # t9602/README. test_description='git cvsimport handling of branches and tags' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-cvs.sh setup_cvs_test_repository t9602 diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh index e7a91611dc..87cd8c0c6b 100755 --- a/t/t9603-cvsimport-patchsets.sh +++ b/t/t9603-cvsimport-patchsets.sh @@ -12,6 +12,9 @@ # bug. test_description='git cvsimport testing for correct patchset estimation' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-cvs.sh setup_cvs_test_repository t9603 diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh index c98c1dfc23..c920b84778 100755 --- a/t/t9800-git-p4-basic.sh +++ b/t/t9800-git-p4-basic.sh @@ -2,6 +2,9 @@ test_description='git p4 tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh index a3abd778f9..ebfe9d8195 100755 --- a/t/t9801-git-p4-branch.sh +++ b/t/t9801-git-p4-branch.sh @@ -2,6 +2,9 @@ test_description='git p4 tests for p4 branches' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh index 4e794a01bf..c7629b6c7d 100755 --- a/t/t9806-git-p4-options.sh +++ b/t/t9806-git-p4-options.sh @@ -2,6 +2,9 @@ test_description='git p4 options' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh index eaaae414a1..f12e6f7206 100755 --- a/t/t9807-git-p4-submit.sh +++ b/t/t9807-git-p4-submit.sh @@ -2,6 +2,9 @@ test_description='git p4 submit' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh index c1446f26ab..c53952ac14 100755 --- a/t/t9811-git-p4-label-import.sh +++ b/t/t9811-git-p4-label-import.sh @@ -2,6 +2,9 @@ test_description='git p4 label tests' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-git-p4.sh test_expect_success 'start p4d' ' diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 5c01c75d40..ac436df3b4 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -5,6 +5,9 @@ test_description='test bash completion' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-bash.sh complete () diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index ab5da2cabc..f5b5935c2c 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash-prompt.sh @@ -5,6 +5,9 @@ test_description='test git-specific bash prompt functions' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./lib-bash.sh . "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh" -- gitgitgadget
The latest feature release Git v2.29.0 is now available at the usual places. It is comprised of 627 non-merge commits since v2.28.0, contributed by 89 people, 24 of which are new faces. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/ The following public repositories all have a copy of the 'v2.29.0' tag and the 'master' branch that the tag points at: url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.28.0 are as follows. Welcome to the Git development community! Aaron Lipman, Adrian Moennich, Ákos Uzonyi, Antti Keränen, Christian Schlack, Conor Davis, Daniel Santos, Eric Huber, Evan Gates, Han Xin, Hugo Locurcio, Kyohei Kadota, Lin Sun, Nikita Leonov, Noam Yorav-Raphael, pudinha, Raymond E. Pasco, Ryan Zoeller, Samanta Navarro, Serg Tereshchenko, Sibi Siddharthan, Simon Legner, Steve Kemp, and Theodore Dubois. Returning contributors who helped this release are as follows. Thanks for your continued support. Ævar Arnfjörð Bjarmason, Alban Gruin, Alessandro Menti, Alexander Shopov, Alex Henrie, Alex Riesen, Andrei Rybak, Beat Bolli, Ben Wijen, brian m. carlson, Christian Couder, Chris Torek, Danny Lin, Denton Liu, Derrick Stolee, Đoàn Trần Công Danh, Drew DeVault, Edmundo Carmona Antoranz, Elijah Newren, Emily Shaffer, Emir Sarı, Eric Sunshine, Han-Wen Nienhuys, Hariom Verma, Jacob Keller, Jean-Noël Avila, Jeff Hostetler, Jeff King, Jiang Xin, Johannes Berg, Johannes Schindelin, Johannes Sixt, Jonathan Tan, Jordi Mas, Junio C Hamano, Kazuhiro Kato, Luke Diamand, Martin Ågren, Matheus Tavares, Matthew Rogers, Matthias Rüster, Michael Forney, Michal Privoznik, Miriam Rubio, Orgad Shaneh, Patrick Steinhardt, Paul Mackerras, Peter Krefting, Philippe Blain, Phillip Wood, Pranit Bauva, Prathamesh Chavan, Pratyush Yadav, René Scharfe, Rohit Ashiwal, Sergey Organov, Shourya Shukla, Stefan Dotterweich, Stefan Haller, SZEDER Gábor, Taylor Blau, Thomas Guyot-Sionnest, Trần Ngọc Quân, Yi-Jyun Pan, and Роман Донченко. ---------------------------------------------------------------- Git 2.29 Release Notes ====================== Updates since v2.28 ------------------- UI, Workflows & Features * "git help log" has been enhanced by sharing more material from the documentation for the underlying "git rev-list" command. * "git for-each-ref --format=<>" learned %(contents:size). * "git merge" learned to selectively omit " into <branch>" at the end of the title of default merge message with merge.suppressDest configuration. * The component to respond to "git fetch" request is made more configurable to selectively allow or reject object filtering specification used for partial cloning. * Stop when "sendmail.*" configuration variables are defined, which could be a mistaken attempt to define "sendemail.*" variables. * The existing backends for "git mergetool" based on variants of vim have been refactored and then support for "nvim" has been added. * "git bisect" learns the "--first-parent" option to find the first breakage along the first-parent chain. * "git log --first-parent -p" showed patches only for single-parent commits on the first-parent chain; the "--first-parent" option has been made to imply "-m". Use "--no-diff-merges" to restore the previous behaviour to omit patches for merge commits. * The commit labels used to explain each side of conflicted hunks placed by the sequencer machinery have been made more readable by humans. * The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. * The recent addition of SHA-256 support is marked as experimental in the documentation. * "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. * Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. * The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. * "git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * "git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. * "format-patch --range-diff=<prev> <origin>..HEAD" has been taught not to ignore <origin> when <prev> is a single version. * "add -p" now allows editing paths that were only added in intent. * The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. * "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. * "git maintenance", a "git gc"'s big brother, has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. * "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). * "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. * The transport protocol v2 has become the default again. * The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. * The command line completion (in contrib/) learned that "git restore -s <TAB>" is often followed by a refname. * "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. * "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * "git fetch" and "git push" support negative refspecs. * "git format-patch" learns to take "whenAble" as a possible value for the format.useAutoBase configuration variable to become no-op when the automatically computed base does not make sense. * Credential helpers are now allowed to terminate lines with CRLF line ending, as well as LF line ending. Performance, Internal Implementation, Development Support etc. * The changed-path Bloom filter is improved using ideas from an independent implementation. * Updates to the changed-paths bloom filter. * The test framework has been updated so that most tests will run with predictable (artificial) timestamps. * Preliminary clean-up of the refs API in preparation for adding a new refs backend "reftable". * Dev support to limit the use of test_must_fail to only git commands. * While packing many objects in a repository with a promissor remote, lazily fetching missing objects from the promissor remote one by one may be inefficient---the code now attempts to fetch all the missing objects in batch (obviously this won't work for a lazy clone that lazily fetches tree objects as you cannot even enumerate what blobs are missing until you learn which trees are missing). * The pretend-object mechanism checks if the given object already exists in the object store before deciding to keep the data in-core, but the check would have triggered lazy fetching of such an object from a promissor remote. * The argv_array API is useful for not just managing argv but any "vector" (NULL-terminated array) of strings, and has seen adoption to a certain degree. It has been renamed to "strvec" to reduce the barrier to adoption. * The final leg of SHA-256 transition plus doc updates. Note that there is no interoperability between SHA-1 and SHA-256 repositories yet. * CMake support to build with MSVC for Windows bypassing the Makefile. * A new helper function has_object() has been introduced to make it easier to mark object existence checks that do and don't want to trigger lazy fetches, and a few such checks are converted using it. * A no-op replacement function implemented as a C preprocessor macro does not perform as good a job as one implemented as a "static inline" function in catching errors in parameters; replace the former with the latter in <git-compat-util.h> header. * Test framework update. (merge d572f52a64 es/test-cmp-typocatcher later to maint). * Updates to "git merge" tests, in preparation for a new merge strategy backend. * midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. * The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. * An unused binary has been discarded, and and a bunch of commands have been turned into into built-in. * A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. * Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. * Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. * "git index-pack" learned to resolve deltified objects with greater parallelism. * "diff-highlight" (in contrib/) had a logic to flush its output upon seeing a blank line but the way it detected a blank line was broken. * The logic to skip testing on the tagged commit and the tag itself was not quite consistent which led to failure of Windows test tasks. It has been revamped to consistently skip revisions that have already been tested, based on the tree object of the revision. Fixes since v2.28 ----------------- * The "mediawiki" remote backend which lives in contrib/mw-to-git/ and is not built with git by default, had an RCE bug allowing a malicious MediaWiki server operator to inject arbitrary commands for execution by a cloning client. This has been fixed. The bug was discovered and reported by Joern Schneeweisz of GitLab to the git-security mailing list. Its practical impact due to the obscurity of git-remote-mediawiki was deemed small enough to forgo a dedicated security release. * "git clone --separate-git-dir=$elsewhere" used to stomp on the contents of the existing directory $elsewhere, which has been taught to fail when $elsewhere is not an empty directory. (merge dfaa209a79 bw/fail-cloning-into-non-empty later to maint). * With the base fix to 2.27 regresion, any new extensions in a v0 repository would still be silently honored, which is not quite right. Instead, complain and die loudly. (merge ec91ffca04 jk/reject-newer-extensions-in-v0 later to maint). * Fetching from a lazily cloned repository resulted at the server side in attempts to lazy fetch objects that the client side has, many of which will not be available from the third-party anyway. (merge 77aa0941ce jt/avoid-lazy-fetching-upon-have-check later to maint). * Fix to an ancient bug caused by an over-eager attempt for optimization. (merge a98f7fb366 rs/add-index-entry-optim-fix later to maint). * Pushing a ref whose name contains non-ASCII character with the "--force-with-lease" option did not work over smart HTTP protocol, which has been corrected. (merge cd85b447bf bc/push-cas-cquoted-refname later to maint). * "git mv src dst", when src is an unmerged path, errored out correctly but with an incorrect error message to claim that src is not tracked, which has been clarified. (merge 9b906af657 ct/mv-unmerged-path-error later to maint). * Fix to a regression introduced during 2.27 cycle. (merge cada7308ad en/fill-directory-exponential later to maint). * Command line completion (in contrib/) update. (merge 688b87c81b mp/complete-show-color-moved later to maint). * All "mergy" operations that internally use the merge-recursive machinery should honor the merge.renormalize configuration, but many of them didn't. * Doc cleanup around "worktree". (merge dc9c144be5 es/worktree-doc-cleanups later to maint). * The "git blame --first-parent" option was not documented, but now it is. (merge 11bc12ae1e rp/blame-first-parent-doc later to maint). * The logic to find the ref transaction hook script attempted to cache the path to the found hook without realizing that it needed to keep a copied value, as the API it used returned a transitory buffer space. This has been corrected. (merge 09b2aa30c9 ps/ref-transaction-hook later to maint). * Recent versions of "git diff-files" shows a diff between the index and the working tree for "intent-to-add" paths as a "new file" patch; "git apply --cached" should be able to take "git diff-files" and should act as an equivalent to "git add" for the path, but the command failed to do so for such a path. (merge 4c025c667e rp/apply-cached-with-i-t-a later to maint). * "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a bit was not showing the mode bits from the working tree. (merge cb0dd22b82 rp/ita-diff-modefix later to maint). * Ring buffer with size 4 used for bin-hex translation resulted in a wrong object name in the sequencer's todo output, which has been corrected. (merge 5da69c0dac ak/sequencer-fix-find-uniq-abbrev later to maint). * When given more than one target line ranges, "git blame -La,b -Lc,d" was over-eager to coalesce groups of original lines and showed incorrect results, which has been corrected. (merge c2ebaa27d6 jk/blame-coalesce-fix later to maint). * The regexp to identify the function boundary for FORTRAN programs has been updated. (merge 75c3b6b2e8 pb/userdiff-fortran-update later to maint). * A few end-user facing messages have been updated to be hash-algorithm agnostic. (merge 4279000d3e jc/object-names-are-not-sha-1 later to maint). * "unlink" emulation on MinGW has been optimized. (merge 680e0b4524 jh/mingw-unlink later to maint). * The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. (merge ccf236a23a es/init-no-separate-git-dir-in-bare later to maint). * "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. (merge ab282aa548 en/dir-nonbare-embedded later to maint). * Fix some incorrect UNLEAK() annotations. (merge 3e19816dc0 jk/unleak-fixes later to maint). * Use more buffered I/O where we used to call many small write(2)s. (merge a698d67b08 rs/more-buffered-io later to maint). * The patch-id computation did not ignore the "incomplete last line" marker like whitespaces. (merge 82a62015a7 rs/patch-id-with-incomplete-line later to maint). * Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifiers>" are the only two allowed forms, which has been corrected. (merge 2c22e102f8 hv/ref-filter-trailers-atom-parsing-fix later to maint). * Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. (merge fbff95b67f jk/index-pack-w-more-threads later to maint). * "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. (merge bfda204ade rs/checkout-no-overlay-pathspec-fix later to maint). * The description of --cached/--index options in "git apply --help" has been updated. (merge d064702be3 rp/apply-cached-doc later to maint). * Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and running "git log --ignore-missing $ZERO_OID" fell back to start digging from HEAD; it has been corrected to become a no-op, like "git log --tags=no-tag-matches-this-pattern" does. (merge 04a0e98515 jk/rev-input-given-fix later to maint). * Various callers of run_command API have been modernized. (merge afbdba391e jc/run-command-use-embedded-args later to maint). * List of options offered and accepted by "git add -i/-p" were inconsistent, which have been corrected. (merge ce910287e7 pw/add-p-allowed-options-fix later to maint). * "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. (merge 1cf3d5db9b mr/diff-hide-stat-wo-textual-change later to maint). * It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. (merge 6479ea4a8a jk/xrealloc-avoid-use-after-free later to maint). * "git status" has trouble showing where it came from by interpreting reflog entries that record certain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error and allow "status" to show its output. * "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. (merge 85a1ec2c32 mf/submodule-summary-with-correct-repository later to maint). * Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. (merge 378fe5fc3d mt/config-fail-nongit-early later to maint). * There is a logic to estimate how many objects are in the repository, which is meant to run once per process invocation, but it ran every time the estimated value was requested. (merge 67bb65de5d jk/dont-count-existing-objects-twice later to maint). * "git remote set-head" that failed still said something that hints the operation went through, which was misleading. (merge 5a07c6c3c2 cs/don-t-pretend-a-failed-remote-set-head-succeeded later to maint). * "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. (merge 4e735c1326 ar/fetch-ipversion-in-all later to maint). * The "unshelve" subcommand of "git p4" incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. (merge 0acbf5997f ld/p4-unshelve-fix later to maint). * "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. * Adjust sample hooks for hash algorithm other than SHA-1. (merge d8d3d632f4 dl/zero-oid-in-hooks later to maint). * "git range-diff" showed incorrect diffstat, which has been corrected. * Earlier we taught "git pull" to warn when the user does not say the histories need to be merged, rebased or accepts only fast- forwarding, but the warning triggered for those who have set the pull.ff configuration variable. (merge 54200cef86 ah/pull later to maint). * Compilation fix around type punning. (merge 176380fd11 jk/drop-unaligned-loads later to maint). * "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. (merge 610e2b9240 jc/blame-ignore-fix later to maint). * "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. (merge 73c6de06af cc/bisect-start-fix later to maint). * The explanation of the "scissors line" has been clarified. (merge 287416dba6 eg/mailinfo-doc-scissors later to maint). * A race that leads to an access to a free'd data was corrected in the codepath that reads pack files. (merge bda959c476 mt/delta-base-cache-races later to maint). * in_merge_bases_many(), a way to see if a commit is reachable from any commit in a set of commits, was totally broken when the commit-graph feature was in use, which has been corrected. (merge 8791bf1841 ds/in-merge-bases-many-optim-bug later to maint). * "git submodule update --quiet" did not squelch underlying "rebase" and "pull" commands. (merge 3ad0401e9e td/submodule-update-quiet later to maint). * The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damage to the partial clone filter in the repository, which has been corrected. * "log -c --find-object=X" did not work well to find a merge that involves a change to an object X from only one parent. (merge 957876f17d jk/diff-cc-oidfind-fix later to maint). * Other code cleanup, docfix, build fix, etc. (merge 84544f2ea3 sk/typofixes later to maint). (merge b17f411ab5 ar/help-guides-doc later to maint). (merge 98c6871fad rs/grep-simpler-parse-object-or-die-call later to maint). (merge 861c4ce141 en/typofixes later to maint). (merge 60e47f6773 sg/ci-git-path-fix-with-pyenv later to maint). (merge e2bfa50ac3 jb/doc-packfile-name later to maint). (merge 918d8ff780 es/worktree-cleanup later to maint). (merge dc156bc31f ma/t1450-quotefix later to maint). (merge 56e743426b en/merge-recursive-comment-fixes later to maint). (merge 7d23ff818f rs/bisect-oid-to-hex-fix later to maint). (merge de20baf2c9 ny/notes-doc-sample-update later to maint). (merge f649aaaf82 so/rev-parser-errormessage-fix later to maint). (merge 6103d58b7f bc/sha-256-cvs-svn-updates later to maint). (merge ac900fddb7 ma/stop-progress-null-fix later to maint). (merge e767963ab6 rs/upload-pack-sigchain-fix later to maint). (merge a831908599 rs/preserve-merges-unused-code-removal later to maint). (merge 6dfefe70a9 jb/commit-graph-doc-fix later to maint). (merge 847b37271e pb/set-url-docfix later to maint). (merge 748f733d54 mt/checkout-entry-dead-code-removal later to maint). (merge ce820cbd58 dl/subtree-docs later to maint). (merge 55fe225dde jk/leakfix later to maint). (merge ee22a29215 so/pretty-abbrev-doc later to maint). (merge 3100fd5588 jc/post-checkout-doc later to maint). (merge 17bae89476 pb/doc-external-diff-env later to maint). (merge 27ed6ccc12 jk/worktree-check-clean-leakfix later to maint). (merge 1302badd16 ea/blame-use-oideq later to maint). (merge e6d5a11fed al/t3200-back-on-a-branch later to maint). (merge 324efcf6b6 pw/add-p-leakfix later to maint). (merge 1c6ffb546b jk/add-i-fixes later to maint). (merge e40e936551 cd/commit-graph-doc later to maint). (merge 0512eabd91 jc/sequencer-stopped-sha-simplify later to maint). (merge d01141de5a so/combine-diff-simplify later to maint). (merge 3be01e5ab1 sn/fast-import-doc later to maint). ---------------------------------------------------------------- Changes since v2.28.0 are as follows: Aaron Lipman (12): t6030: modernize "git bisect run" tests rev-list: allow bisect and first-parent flags cmd_bisect__helper: defer parsing no-checkout flag bisect: introduce first-parent flag bisect: combine args passed to find_bisection() bisect: add first-parent option to documentation t3200: clean side effect of git checkout --orphan t3201: test multiple branch filter combinations Doc: cover multiple contains/no-contains filters ref-filter: allow merged and no-merged filters ref-filter: make internal reachable-filter API more precise Doc: prefer more specific file name Adrian Moennich (1): ci: fix inconsistent indentation Alban Gruin (1): t6300: fix issues related to %(contents:size) Alessandro Menti (2): l10n: it.po: update the Italian translation for Git 2.29.0 round 1 l10n: it.po: update the Italian translation Alex Henrie (1): pull: don't warn if pull.ff has been set Alex Riesen (1): fetch: pass --ipv4 and --ipv6 options to sub-fetches Alexander Shopov (1): l10n: bg.po: Updated Bulgarian translation (5013t) Andrei Rybak (1): git-help.txt: fix mentions of option --guides Antti Keränen (1): rebase -i: fix possibly wrong onto hash in todo Beat Bolli (1): gitk: rename "commit summary" to "commit reference" Ben Wijen (1): git clone: don't clone into non-empty directory Chris Torek (1): git-mv: improve error message for conflicted file Christian Couder (4): Documentation: clarify %(contents:XXXX) doc t6300: test refs pointing to tree and blob ref-filter: add support for %(contents:size) bisect: don't use invalid oid as rev when starting Christian Schlack (1): remote: don't show success message when set-head fails Conor Davis (1): commit-graph-format.txt: fix no-parent value Daniel Santos (2): l10n: Portuguese translation team has changed. Wohoo! l10n: pt_PT: make on po/pt_PT.po Danny Lin (2): contrib/subtree: fix "unsure" for --message in the document contrib/subtree: document 'push' does not take '--squash' Denton Liu (13): t3701: stop using `env` in force_color() t5324: reorder `run_with_limited_open_files test_might_fail` t7107: don't use test_must_fail() t9834: remove use of `test_might_fail p4` t9400: don't use test_must_fail with cvs test-lib-functions: restrict test_must_fail usage contrib/completion: complete options that take refs for format-patch hooks--pre-push.sample: modernize script hooks--pre-push.sample: use hash-agnostic zero OID hooks--update.sample: use hash-agnostic zero OID gitk: replace tabs with spaces compat/mingw.h: drop extern from function declaration Makefile: ASCII-sort += lists Derrick Stolee (22): commit-graph: place bloom_settings in context commit-graph: change test to die on parse, not load bloom: fix logic in get_bloom_filter() commit-graph: persist existence of changed-paths revision.c: fix whitespace multi-pack-index: repack batches below --batch-size t/README: document GIT_TEST_DEFAULT_HASH commit-graph: use the "hash version" byte multi-pack-index: use hash version byte bloom/diff: properly short-circuit on max_changes maintenance: create basic maintenance runner maintenance: add --quiet option maintenance: replace run_auto_gc() maintenance: initialize task array maintenance: add commit-graph task maintenance: add --task option maintenance: take a lock on the objects directory maintenance: create maintenance.<task>.enabled config maintenance: use pointers to check --auto maintenance: add auto condition for commit-graph task maintenance: add trace2 regions for task execution commit-reach: fix in_merge_bases_many bug Drew DeVault (1): git-send-email: die if sendmail.* config is set Edmundo Carmona Antoranz (1): blame.c: replace instance of !oidcmp for oideq Elijah Newren (26): Remove doubled words in various comments hashmap: fix typo in usage docs merge-recursive: fix unclear and outright wrong comments t6038: make tests fail for the right reason t6038: remove problematic test merge: make merge.renormalize work for all uses of merge machinery checkout: support renormalization with checkout -m <paths> Collect merge-related tests to t64xx t6418: tighten delete/normalize conflict testcase t6422: fix bad check against missing file t6416, t6422: fix incorrect untracked file count t6423: fix test setup for a couple tests t6422: fix multiple errors with the mod6 test expectations t6416, t6423: clarify some comments and fix some typos t6423: add an explanation about why one of the tests does not pass t6422, t6426: be more flexible for add/add conflicts involving renames t642[23]: be more flexible for add/add conflicts involving pair renames t6425: be more flexible with rename/delete conflict messages t3000: fix some test description typos dir: avoid prematurely marking nonbare repositories as matches sequencer: avoid garbled merge machinery messages due to commit labels mem-pool: add convenience functions for strdup and strndup mem-pool: use more standard initialization and finalization mem-pool: use consistent pool variable name dir: make clear_directory() free all relevant memory dir: fix problematic API to avoid memory leaks Emily Shaffer (1): Revert "contrib: subtree: adjust test to change in fmt-merge-msg" Emir Sarı (2): l10n: tr: v2.29.0 round 1 l10n: tr: v2.29.0 round 2 Eric Huber (1): gitk: Preserve window dimensions on exit when not using ttk themes Eric Sunshine (22): worktree: drop pointless strbuf_release() worktree: drop unused code from get_linked_worktree() worktree: drop bogus and unnecessary path munging worktree: retire special-case normalization of main worktree path git-worktree.txt: employ fixed-width typeface consistently git-worktree.txt: consistently use term "working tree" git-worktree.txt: fix minor grammatical issues git-worktree.txt: make start of new sentence more obvious git-worktree.txt: link to man pages when citing other Git commands test_cmp: diagnose incorrect arguments init: disallow --separate-git-dir with bare repository worktree: add skeleton "repair" command worktree: teach "repair" to fix worktree back-links to main worktree worktree: teach "repair" to fix outgoing links to worktrees init: teach --separate-git-dir to repair linked worktrees init: make --separate-git-dir work from within linked worktree git-checkout.txt: document -d short option for --detach worktree: teach `add` to recognize -d as shorthand for --detach git-worktree.txt: discuss branch-based vs. throwaway worktrees diff: move show_interdiff() from its own file to diff-lib diff-lib: tighten show_interdiff()'s interface format-patch: use 'origin' as start of current-series-range when known Evan Gates (1): Doc: show example scissors line Han Xin (1): send-pack: run GPG after atomic push checking Han-Wen Nienhuys (17): lib-t6000.sh: write tag using git-update-ref t3432: use git-reflog to inspect the reflog for HEAD bisect: treat BISECT_HEAD as a pseudo ref t1400: use git rev-parse for testing PSEUDOREF existence Modify pseudo refs through ref backend storage Make HEAD a PSEUDOREF rather than PER_WORKTREE. refs: move the logic to add \t to reflog to the files backend refs: split off reading loose ref data in separate function refs: fix comment about submodule ref_stores refs: move gitdir into base ref_store refs: read FETCH_HEAD and MERGE_HEAD generically refs: make refs_ref_exists public sequencer: treat CHERRY_PICK_HEAD as a pseudo ref builtin/commit: suggest update-ref for pseudoref removal sequencer: treat REVERT_HEAD as a pseudo ref refs: move REF_LOG_ONLY to refs-internal.h refs: add GIT_TRACE_REFS debugging mechanism Hariom Verma (10): t6300: unify %(trailers) and %(contents:trailers) tests ref-filter: 'contents:trailers' show error if `:` is missing ref-filter: support different email formats ref-filter: refactor `grab_objectname()` ref-filter: modify error messages in `grab_objectname()` ref-filter: rename `objectname` related functions and fields ref-filter: add `short` modifier to 'tree' atom ref-filter: add `short` modifier to 'parent' atom pretty: refactor `format_sanitized_subject()` ref-filter: add `sanitize` option for 'subject' atom Hugo Locurcio (1): bisect: swap command-line options in documentation Jacob Keller (4): refspec: fix documentation referring to refspec_item refspec: make sure stack refspec_item variables are zeroed refspec: add support for negative refspecs format-patch: teach format.useAutoBase "whenAble" option Jean-Noël Avila (6): l10n: fr: v2.29.0 rnd 1 git-bisect-lk2009: make continuation of list indented doc: use linkgit macro where needed. doc: git-remote fix ups doc: fix the bnf like style of some commands l10n: fr: v2.29.0 rnd 2 Jeff Hostetler (1): mingw: improve performance of mingw_unlink() Jeff King (82): t6000: use test_tick consistently t9700: loosen ident timezone regex t5539: make timestamp requirements more explicit t9100: explicitly unset GIT_COMMITTER_DATE test-lib: set deterministic default author/committer date t9100: stop depending on commit timestamps verify_repository_format(): complain about new extensions in v0 repo argv-array: use size_t for count and alloc argv-array: rename to strvec strvec: rename files from argv-array to strvec quote: rename sq_dequote_to_argv_array to mention strvec strvec: convert builtin/ callers away from argv_array name strvec: convert more callers away from argv_array name strvec: convert remaining callers away from argv_array name strvec: fix indentation in renamed calls strvec: update documention to avoid argv_array strvec: drop argv_array compatibility layer log: drop "--cc implies -m" logic revision: add "--no-diff-merges" option to counteract "-m" log: enable "-m" automatically with "--first-parent" doc/git-log: move "Diff Formatting" from rev-list-options doc/git-log: drop "-r" diff option doc/git-log: move "-t" into diff-options list doc/git-log: clarify handling of merge commit diffs strvec: rename struct fields config: work around gcc-10 -Wstringop-overflow warning revision: avoid out-of-bounds read/write on empty pathspec revision: avoid leak when preparing bloom filter for "/" t5616: use test_i18ngrep for upload-pack errors sideband: mark "remote error:" prefix for translation t1416: avoid hard-coded sha1 ids t8003: check output of coalesced blame t8003: factor setup out of coalesce test blame: only coalesce lines that are adjacent in result Makefile: drop builtins from MSVC pdb list make credential helpers builtins make git-bugreport a builtin make git-fast-import a builtin drop vcs-svn experiment stop calling UNLEAK() before die() ls-remote: simplify UNLEAK() usage clear_pattern_list(): clear embedded hashmaps submodule--helper: use strbuf_release() to free strbufs checkout: fix leak of non-existent branch names config: fix leaks from git_config_get_string_const() config: drop git_config_get_string_const() config: fix leak in git_config_get_expiry_in_days() submodule--helper: fix leak of core.worktree value p5302: disable thread-count parameter tests by default p5302: count up to online-cpus for thread tests index-pack: adjust default threading cap revision: set rev_input_given in handle_revision_arg() worktree: fix leak in check_clean_worktree() xrealloc: do not reuse pointer freed by zero-length realloc() add-patch: fix inverted return code of repo_read_index() add--interactive.perl: specify --no-color explicitly packfile: actually set approximate_object_count_valid diff-highlight: correctly match blank lines for flush bswap.h: drop unaligned loads Revert "fast-export: use local array to store anonymized oid" shortlog: change "author" variables to "ident" protocol: re-enable v2 protocol by default shortlog: add grouping option trailer: add interface for iterating over commit trailers shortlog: match commit trailers with --group shortlog: de-duplicate trailer values shortlog: rename parse_stdin_ident() shortlog: parse trailer idents shortlog: allow multiple groups to be specified convert: drop unused crlf_action from check_global_conv_flags_eol() drop unused argc parameters env--helper: write to opt->value in parseopt helper assert PARSE_OPT_NONEG in parse-options callbacks push: drop unused repo argument to do_push() sequencer: drop repository argument from run_git_commit() sparse-checkout: fill in some options boilerplate test-advise: check argument count with argc instead of argv sequencer: handle ignore_footer when parsing trailers dir.c: drop unused "untracked" from treat_path_fast() combine-diff: handle --find-object in multitree code path index-pack: restore "resolving deltas" progress meter index-pack: drop type_cas mutex Jiang Xin (13): transport: not report a non-head push as a branch t5411: add basic test cases for proc-receive hook receive-pack: add new proc-receive hook receive-pack: feed report options to post-receive New capability "report-status-v2" for git-push doc: add document for capability report-status-v2 receive-pack: new config receive.procReceiveRefs t5411: test updates of remote-tracking branches transport: parse report options for tracking refs doc: add documentation for the proc-receive hook l10n: git.pot: v2.29.0 round 1 (124 new, 42 removed) l10n: git.pot: v2.29.0 round 2 (1 new, 1 removed) l10n: zh_CN: for git v2.29.0 l10n round 1 and 2 Johannes Berg (2): pack-write/docs: update regarding pack naming docs: commit-graph: fix some whitespace in the diagram Johannes Schindelin (26): t3404: prepare 'short SHA-1 collision' tests for SHA-256 ci: fix indentation of the `ci-config` job ci: avoid ugly "failure" in the `ci-config` job t/test-terminal: avoid non-inclusive language fast-export: avoid using unnecessary language in a code comment t3200: avoid variations of the `master` branch name msvc: copy the correct `.pdb` files in the Makefile target `install` Optionally skip linking/copying the built-ins ci: stop linking built-ins to the dashed versions cmake: ignore files generated by CMake as run in Visual Studio tests: avoid variations of the `master` branch name t9902: avoid using the branch name `master` cmake: do find Git for Windows' shell interpreter cmake: ensure that the `vcpkg` packages are found on Windows cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows cmake: quote the path accurately when editing `test-lib.sh` cmake (Windows): let the `.dll` files be found when running the tests cmake (Windows): complain when encountering an unknown compiler cmake (Windows): initialize vcpkg/build dependencies automatically cmake (Windows): recommend using Visual Studio's built-in CMake support GitHub workflow: automatically follow minor updates of setup-msbuild help: do not expect built-in commands to be hardlinked t1415: avoid using `main` as ref name tests: avoid using the branch name `main` ci: skip GitHub workflow runs for already-tested commits/trees ci: do not skip tagged revisions in GitHub workflows Johannes Sixt (1): gitk: Un-hide selection in areas with non-default background color Jonathan Tan (33): upload-pack: do not lazy-fetch "have" objects pack-objects: refactor to oid_object_info_extended pack-objects: prefetch objects to be packed sha1-file: make pretend_object_file() not prefetch sha1-file: introduce no-lazy-fetch has_object() apply: do not lazy fetch when applying binary pack-objects: no fetch when allow-{any,promisor} fsck: do not lazy fetch known non-promisor object negotiator/noop: add noop fetch negotiator fetch: allow refspecs specified through stdin fetch: avoid reading submodule config until needed fetch: only populate existing_refs if needed fetch-pack: do not lazy-fetch during ref iteration promisor-remote: lazy-fetch objects in subprocess fetch-pack: remove no_dependents code fetch-pack: in partial clone, pass --promisor Documentation: deltaBaseCacheLimit is per-thread index-pack: remove redundant parameter index-pack: unify threaded and unthreaded code index-pack: remove redundant child field index-pack: calculate {ref,ofs}_{first,last} early index-pack: make resolve_delta() assume base data (various): document from_promisor parameter fetch-pack: document only_packfile in get_pack() fetch-pack: make packfile URIs work with transfer.fsckobjects fetch: no FETCH_HEAD display if --no-write-fetch-head sha1-name: replace unsigned int with option struct refs: move dwim_ref() to header file wt-status: tolerate dangling marks index-pack: make quantum of work smaller promisor-remote: remove unused variable fetch: do not override partial clone filter index-pack: make get_base_data() comment clearer Jordi Mas (1): l10n: Update Catalan translation Junio C Hamano (52): gitk: be prepared to be run in a bare repository reflog: cleanse messages in the refs.c layer Revert "fmt-merge-msg: stop treating `master` specially" fmt-merge-msg: allow merge destination to be omitted again First batch post 2.28 The second batch -- mostly minor typofixes Third batch Fourth batch Documentation: don't hardcode command categories twice compat-util: type-check parameters of no-op replacement functions Fifth batch Sixth batch Seventh batch messages: avoid SHA-1 in end-user facing messages Eighth batch fetch: optionally allow disabling FETCH_HEAD update Ninth batch ident: say whose identity is missing when giving user.name hint Tenth batch t3436: do not run git-merge-recursive in dashed form transport-helper: do not run git-remote-ext etc. in dashed form cvsexportcommit: do not run git programs in dashed form run_command: teach API users to use embedded 'args' more credential-cache: use child_process.args Eleventh batch doc: clarify how exit status of post-checkout hook is used Twelfth batch Thirteenth batch add -i: use the built-in version when feature.experimental is set Makefile: allow extra tweaking of distribution tarball Fourteenth batch quote_path: rename quote_path_relative() to quote_path() quote_path: give flags parameter to quote_path() quote_path: optionally allow quoting a path with SP in it quote_path: code clarification wt-status: consistently quote paths in "status --short" output quote: rename misnamed sq_lookup[] to cq_lookup[] quote: turn 'nodq' parameter into a set of flags Fifteenth batch Sixteenth batch t8013: minimum preparatory clean-up blame: validate and peel the object names on the ignore list t1506: rev-parse A..B and A...B sequencer: stop abbreviating stopped-sha file Seventeenth batch Eighteenth batch hashmap_for_each_entry(): workaround MSVC's runtime check failure #3 Nineteenth batch Git 2.29-rc0 Git 2.29-rc1 Git 2.29-rc2 Git 2.29 Kazuhiro Kato (1): gitk: fix branch name encoding error Kyohei Kadota (1): Fit to Plan 9's ANSI/POSIX compatibility layer Lin Sun (1): mergetool: allow auto-merge for meld to follow the vim-diff behavior Luke Diamand (2): git-p4 unshelve: adding a commit breaks git-p4 unshelve git-p4: use HEAD~$n to find parent commit for unshelve Martin Ågren (19): dir: check pathspecs before returning `path_excluded` t1450: fix quoting of NUL byte when corrupting pack t: don't spuriously close and reopen quotes t4104: modernize and simplify quoting progress: don't dereference before checking for NULL http-protocol.txt: document SHA-256 "want"/"have" format index-format.txt: document SHA-256 index format protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256 shallow.txt: document SHA-256 shallow format Documentation: mark `--object-format=sha256` as experimental wt-status: replace sha1 mentions with oid wt-status: print to s->fp, not stdout wt-status: introduce wt_status_state_free_buffers() worktree: inline `worktree_ref()` into its only caller worktree: update renamed variable in comment worktree: rename copy-pasted variable worktree: use skip_prefix to parse target config/fmt-merge-msg.txt: drop space in quote config/uploadpack.txt: fix typo in `--filter=tree:<n>` Matheus Tavares (4): checkout_entry(): remove unreachable error() call config: complain about --worktree outside of a git repo packfile: fix race condition on unpack_entry() packfile: fix memory leak in add_delta_base_cache() Matthew Rogers (1): diff: teach --stat to ignore uninteresting modifications Matthias Rüster (1): l10n: de.po: Update German translation for Git 2.29.0 Michael Forney (2): revision: use repository from rev_info when parsing commits submodule: use submodule repository when preparing summary Michal Privoznik (1): completion: add show --color-moved[-ws] Miriam Rubio (4): bisect--helper: BUG() in cmd_*() on invalid subcommand bisect--helper: use '-res' in 'cmd_bisect__helper' return bisect--helper: introduce new `write_in_file()` function bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' Nikita Leonov (1): credential: treat CR/LF as line endings in the credential protocol Noam Yorav-Raphael (1): docs: improve the example that illustrates git-notes path names Orgad Shaneh (5): vcbuild: fix library name for expat with make MSVC=1 vcbuild: fix batch file name in README fetch: do not look for submodule changes in unchanged refs submodule: suppress checking for file name and ref ambiguity for object ids contrib/buildsystems: fix expat library name for generated vcxproj Patrick Steinhardt (2): refs: fix interleaving hook calls with reference-transaction hook refs: remove lookup cache for reference-transaction hook Paul Mackerras (1): gitk: Resize panes correctly when reducing window size Peter Krefting (1): l10n: sv.po: Update Swedish translation (5013t0f0u) Philippe Blain (19): git-log.txt: add links to 'rev-list' and 'diff' docs revisions.txt: describe 'rev1 rev2 ...' meaning for ranges git-rev-list.txt: fix Asciidoc syntax git-rev-list.txt: tweak wording in set operations git-rev-list.txt: move description to separate file git-log.txt: include rev-list-description.txt command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers' help: drop usage of 'common' and 'useful' for guides git.txt: add list of guides fetch, pull doc: correct description of '--set-upstream' userdiff: add tests for Fortran xfuncname regex userdiff: improve Fortran xfuncname regex git-imap-send.txt: don't duplicate 'Examples' sections git-imap-send.txt: do verify SSL certificate for gmail.com git-imap-send.txt: add note about localized Gmail folders doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more git.txt: correct stale 'GIT_EXTERNAL_DIFF' description Makefile: add support for generating JSON compilation database gitsubmodules doc: invoke 'ls-files' with '--recurse-submodules' Phillip Wood (7): add -p: use ALLOC_GROW_BY instead of ALLOW_GROW add -p: fix checking of user input am: stop exporting GIT_COMMITTER_DATE rebase -i: support --committer-date-is-author-date rebase -i: support --ignore-date add -p: fix memory leak add -p: fix editing of intent-to-add paths Pranit Bauva (2): bisect--helper: reimplement `bisect_autostart` shell function in C bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C Prathamesh Chavan (1): submodule: port submodule subcommand 'summary' from shell to C Raymond E. Pasco (6): apply: allow "new file" patches on i-t-a entries blame-options.txt: document --first-parent option apply: make i-t-a entries never match worktree t4140: test apply with i-t-a paths diff-lib: use worktree mode in diffs from i-t-a entries git-apply.txt: update descriptions of --cached, --index René Scharfe (21): read-cache: remove bogus shortcut grep: avoid using oid_to_hex() with parse_object_or_die() bisect: use oid_to_hex_r() instead of memcpy()+oid_to_hex() upload-pack: remove superfluous sigchain_pop() call rebase: remove unused function reschedule_last_action connected: use buffered I/O to talk to rev-list midx: use buffered I/O to talk to pack-objects upload-pack: use buffered I/O to talk to rev-list patch-id: ignore newline at end of file in diff_flush_patch_id() checkout, restore: make pathspec recursive read-cache: fix mem-pool allocation for multi-threaded index loading push: release strbufs used for refspec formatting refspec: add and use refspec_appendf() fast-import: use write_pack_header() midx: use hashwrite_u8() in write_midx_header() pack-bitmap-write: use hashwrite_be32() in write_hash_cache() pack-write: use hashwrite_be32() in write_idx_file() archive: read short blobs in archive.c::write_archive_entry() archive: add --add-file Makefile: use git-archive --add-file ref-filter: plug memory leak in reach_filter() Rohit Ashiwal (2): rebase -i: add --ignore-whitespace flag rebase: add --reset-author-date Ryan Zoeller (2): parse-options: add --git-completion-helper-all completion: add GIT_COMPLETION_SHOW_ALL env var SZEDER Gábor (15): tree-walk.c: don't match submodule entries for 'submod/anything' commit-graph: fix parsing the Chunk Lookup table commit-graph-format.txt: all multi-byte numbers are in network byte order commit-slab: add a function to deep free entries on the slab diff.h: drop diff_tree_oid() & friends' return value commit-graph: clean up #includes commit-graph: simplify parse_commit_graph() #1 commit-graph: simplify parse_commit_graph() #2 commit-graph: simplify write_commit_graph_file() #1 commit-graph: simplify write_commit_graph_file() #2 commit-graph: unify the signatures of all write_graph_chunk_*() functions commit-graph: simplify chunk writes into loop commit-graph: check chunk sizes after writing commit-graph: check all leading directories in changed path Bloom filters ci: use absolute PYTHON_PATH in the Linux jobs Samanta Navarro (1): fast-import: fix typo in documentation Serg Tereshchenko (2): git-gui: fix mixed tabs and spaces; prefer tabs git-gui: improve dark mode support Sergey Organov (9): revision: fix die() message for "--unpacked=" revision: change "--diff-merges" option to require parameter doc/git-log: describe --diff-merges=off t/t4013: add test for --diff-merges=off pretty-options.txt: fix --no-abbrev-commit description revision: add separate field for "-m" of "diff-index -m" log_tree_diff: get rid of code duplication for first_parent_only log_tree_diff: get rid of extra check for NULL diff: get rid of redundant 'dense' argument Shourya Shukla (11): submodule: remove extra line feeds between callback struct and macro submodule: rename helper functions to avoid ambiguity t7421: introduce a test script for verifying 'summary' output t7401: modernize style t7401: use 'short' instead of 'verify' and cut in rev-parse calls t7401: change syntax of test_i18ncmp calls for clarity t7401: change indentation for enhanced readability t7401: add a NEEDSWORK submodule: eliminate unused parameters from print_submodule_summary() submodule: fix style in function definition t7421: eliminate 'grep' check in t7421.4 for mingw compatibility Sibi Siddharthan (8): Introduce CMake support for configuring Git cmake: generate the shell/perl/python scripts and templates, translations cmake: installation support for git cmake: support for testing git with ctest cmake: support for testing git when building out of the source tree cmake: support for building git on windows with mingw cmake: support for building git on windows with msvc and clang. ci: modification of main.yml to use cmake for vs-build job Simon Legner (1): remote-mediawiki: fix duplicate revisions being imported Stefan Dotterweich (1): gitk: add diff lines background colors Stefan Haller (1): git-gui: blame: prevent tool tips from sticking around after Command-Tab Steve Kemp (1): comment: fix spelling mistakes inside comments Taylor Blau (18): revision: empty pathspecs should not use Bloom filters list_objects_filter_options: introduce 'list_object_filter_config_name' upload-pack.c: allow banning certain object filter(s) upload-pack.c: introduce 'uploadpackfilter.tree.maxDepth' builtin/repack.c: invalidate MIDX only when necessary midx: traverse the local MIDX first commit-graph: introduce 'get_bloom_filter_settings()' t4216: use an '&&'-chain commit-graph: pass a 'struct repository *' in more places t/helper/test-read-graph.c: prepare repo settings commit-graph: respect 'commitGraph.readChangedPaths' commit-graph.c: store maximum changed paths bloom: split 'get_bloom_filter()' in two bloom: use provided 'struct bloom_filter_settings' bloom: encode out-of-bounds filters as non-empty commit-graph: rename 'split_commit_graph_opts' builtin/commit-graph.c: introduce '--max-new-filters=<n>' commit-graph: introduce 'commitGraph.maxNewFilters' Theodore Dubois (1): submodule update: silence underlying merge/rebase with "--quiet" Thomas Guyot-Sionnest (1): diff: fix modified lines stats with --stat and --numstat Trần Ngọc Quân (1): l10n: vi(5013t): Updated translation for v2.29.0 rd2 Yi-Jyun Pan (1): l10n: zh_TW.po: v2.29.0 round 2 (2 untranslated) brian m. carlson (48): remote-curl: make --force-with-lease work with non-ASCII ref names t: make test-bloom initialize repository t1001: use $ZERO_OID t3305: make hash agnostic t6100: make hash size independent t6101: make hash size independent t6301: make hash size independent t6500: specify test values for SHA-256 t6501: avoid hard-coded objects t7003: compute appropriate length constant t7063: make hash size independent t7201: abstract away SHA-1-specific constants t7102: abstract away SHA-1-specific constants t7400: make hash size independent t7405: make hash size independent t7506: avoid checking for SHA-1-specific constants t7508: use $ZERO_OID instead of hard-coded constant t8002: make hash size independent t8003: make hash size independent t8011: make hash size independent t9300: abstract away SHA-1-specific constants t9300: use $ZERO_OID instead of hard-coded object ID t9301: make hash size independent t9350: make hash size independent t9500: ensure that algorithm info is preserved in config t9700: make hash size independent t5308: make test work with SHA-256 t0410: mark test with SHA1 prerequisite http-fetch: set up git directory before parsing pack hashes builtin/verify-pack: implement an --object-format option bundle: add new version for use with SHA-256 setup: add support for reading extensions.objectformat repository: enable SHA-256 support by default t: add test_oid option to select hash algorithm t: allow testing different hash algorithms via environment t: make SHA1 prerequisite depend on default hash ci: run tests with SHA-256 docs: add documentation for extensions.objectFormat t: remove test_oid_init in tests git-cvsexportcommit: support Perl before 5.10.1 docs: document SHA-256 pack and indices docs: fix step in transition plan t4013: improve diff-post-processor logic po: add missing letter for French message docs: explain why squash merges are broken with long-running branches docs: explain why reverts are not always applied on merge docs: explain how to deal with files that are always modified builtin/clone: avoid failure with GIT_DEFAULT_HASH pudinha (2): mergetool--lib: improve support for vimdiff-style tool variants mergetools: add support for nvimdiff (neovim) family Ákos Uzonyi (2): completion: use "prev" variable instead of introducing "prevword" completion: complete refs after 'git restore -s' Ævar Arnfjörð Bjarmason (17): remote-mediawiki doc: correct link to GitHub project remote-mediawiki doc: link to MediaWiki's current version remote-mediawiki doc: don't hardcode Debian PHP versions remote-mediawiki tests: use the login/password variables remote-mediawiki tests: use a 10 character password remote-mediawiki tests: use test_cmp in tests remote-mediawiki tests: change `[]` to `test` remote-mediawiki tests: use "$dir/" instead of "$dir." remote-mediawiki tests: use a more idiomatic dispatch table remote-mediawiki tests: replace deprecated Perl construct remote-mediawiki tests: use inline PerlIO for readability remote-mediawiki tests: use CLI installer remote-mediawiki tests: annotate failing tests remote-mediawiki: provide a list form of run_git() remote-mediawiki: convert to quoted run_git() invocation remote-mediawiki: annotate unquoted uses of run_git() remote-mediawiki: use "sh" to eliminate unquoted commands Đoàn Trần Công Danh (2): diff: index-line: respect --abbrev in object's name t5534: split stdout and stderr redirection Роман Донченко (2): gitk: don't highlight files after submodules as submodules gitk: fix the context menu not appearing in the presence of submodule diffs
A release candidate Git v2.29.0-rc2 is now available for testing at the usual places. The tree has no change since v2.29.0-rc1 The tarballs are found at: https://www.kernel.org/pub/software/scm/git/testing/ The following public repositories all have a copy of the 'v2.29.0-rc2' tag and the 'master' branch that the tag points at: url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git Thanks. ---------------------------------------------------------------- Git 2.29 Release Notes (draft) ============================== Updates since v2.28 ------------------- UI, Workflows & Features * "git help log" has been enhanced by sharing more material from the documentation for the underlying "git rev-list" command. * "git for-each-ref --format=<>" learned %(contents:size). * "git merge" learned to selectively omit " into <branch>" at the end of the title of default merge message with merge.suppressDest configuration. * The component to respond to "git fetch" request is made more configurable to selectively allow or reject object filtering specification used for partial cloning. * Stop when "sendmail.*" configuration variables are defined, which could be a mistaken attempt to define "sendemail.*" variables. * The existing backends for "git mergetool" based on variants of vim have been refactored and then support for "nvim" has been added. * "git bisect" learns the "--first-parent" option to find the first breakage along the first-parent chain. * "git log --first-parent -p" showed patches only for single-parent commits on the first-parent chain; the "--first-parent" option has been made to imply "-m". Use "--no-diff-merges" to restore the previous behaviour to omit patches for merge commits. * The commit labels used to explain each side of conflicted hunks placed by the sequencer machinery have been made more readable by humans. * The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. * The recent addition of SHA-256 support is marked as experimental in the documentation. * "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. * Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. * The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. * "git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * "git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. * "format-patch --range-diff=<prev> <origin>..HEAD" has been taught not to ignore <origin> when <prev> is a single version. * "add -p" now allows editing paths that were only added in intent. * The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. * "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. * "git maintenance", a "git gc"'s big brother, has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. * "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). * "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. * The transport protocol v2 has become the default again. * The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. * The command line completion (in contrib/) learned that "git restore -s <TAB>" is often followed by a refname. * "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. * "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * "git fetch" and "git push" support negative refspecs. * "git format-patch" learns to take "whenAble" as a possible value for the format.useAutoBase configuration variable to become no-op when the automatically computed base does not make sense. * Credential helpers are now allowed to terminate lines with CRLF line ending, as well as LF line ending. Performance, Internal Implementation, Development Support etc. * The changed-path Bloom filter is improved using ideas from an independent implementation. * Updates to the changed-paths bloom filter. * The test framework has been updated so that most tests will run with predictable (artificial) timestamps. * Preliminary clean-up of the refs API in preparation for adding a new refs backend "reftable". * Dev support to limit the use of test_must_fail to only git commands. * While packing many objects in a repository with a promissor remote, lazily fetching missing objects from the promissor remote one by one may be inefficient---the code now attempts to fetch all the missing objects in batch (obviously this won't work for a lazy clone that lazily fetches tree objects as you cannot even enumerate what blobs are missing until you learn which trees are missing). * The pretend-object mechanism checks if the given object already exists in the object store before deciding to keep the data in-core, but the check would have triggered lazy fetching of such an object from a promissor remote. * The argv_array API is useful for not just managing argv but any "vector" (NULL-terminated array) of strings, and has seen adoption to a certain degree. It has been renamed to "strvec" to reduce the barrier to adoption. * The final leg of SHA-256 transition plus doc updates. Note that there is no interoperability between SHA-1 and SHA-256 repositories yet. * CMake support to build with MSVC for Windows bypassing the Makefile. * A new helper function has_object() has been introduced to make it easier to mark object existence checks that do and don't want to trigger lazy fetches, and a few such checks are converted using it. * A no-op replacement function implemented as a C preprocessor macro does not perform as good a job as one implemented as a "static inline" function in catching errors in parameters; replace the former with the latter in <git-compat-util.h> header. * Test framework update. (merge d572f52a64 es/test-cmp-typocatcher later to maint). * Updates to "git merge" tests, in preparation for a new merge strategy backend. * midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. * The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. * An unused binary has been discarded, and and a bunch of commands have been turned into into built-in. * A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. * Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. * Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. * "git index-pack" learned to resolve deltified objects with greater parallelism. * "diff-highlight" (in contrib/) had a logic to flush its output upon seeing a blank line but the way it detected a blank line was broken. * The logic to skip testing on the tagged commit and the tag itself was not quite consistent which led to failure of Windows test tasks. It has been revamped to consistently skip revisions that have already been tested, based on the tree object of the revision. Fixes since v2.28 ----------------- * The "mediawiki" remote backend which lives in contrib/mw-to-git/ and is not built with git by default, had an RCE bug allowing a malicious MediaWiki server operator to inject arbitrary commands for execution by a cloning client. This has been fixed. The bug was discovered and reported by Joern Schneeweisz of GitLab to the git-security mailing list. Its practical impact due to the obscurity of git-remote-mediawiki was deemed small enough to forgo a dedicated security release. * "git clone --separate-git-dir=$elsewhere" used to stomp on the contents of the existing directory $elsewhere, which has been taught to fail when $elsewhere is not an empty directory. (merge dfaa209a79 bw/fail-cloning-into-non-empty later to maint). * With the base fix to 2.27 regresion, any new extensions in a v0 repository would still be silently honored, which is not quite right. Instead, complain and die loudly. (merge ec91ffca04 jk/reject-newer-extensions-in-v0 later to maint). * Fetching from a lazily cloned repository resulted at the server side in attempts to lazy fetch objects that the client side has, many of which will not be available from the third-party anyway. (merge 77aa0941ce jt/avoid-lazy-fetching-upon-have-check later to maint). * Fix to an ancient bug caused by an over-eager attempt for optimization. (merge a98f7fb366 rs/add-index-entry-optim-fix later to maint). * Pushing a ref whose name contains non-ASCII character with the "--force-with-lease" option did not work over smart HTTP protocol, which has been corrected. (merge cd85b447bf bc/push-cas-cquoted-refname later to maint). * "git mv src dst", when src is an unmerged path, errored out correctly but with an incorrect error message to claim that src is not tracked, which has been clarified. (merge 9b906af657 ct/mv-unmerged-path-error later to maint). * Fix to a regression introduced during 2.27 cycle. (merge cada7308ad en/fill-directory-exponential later to maint). * Command line completion (in contrib/) update. (merge 688b87c81b mp/complete-show-color-moved later to maint). * All "mergy" operations that internally use the merge-recursive machinery should honor the merge.renormalize configuration, but many of them didn't. * Doc cleanup around "worktree". (merge dc9c144be5 es/worktree-doc-cleanups later to maint). * The "git blame --first-parent" option was not documented, but now it is. (merge 11bc12ae1e rp/blame-first-parent-doc later to maint). * The logic to find the ref transaction hook script attempted to cache the path to the found hook without realizing that it needed to keep a copied value, as the API it used returned a transitory buffer space. This has been corrected. (merge 09b2aa30c9 ps/ref-transaction-hook later to maint). * Recent versions of "git diff-files" shows a diff between the index and the working tree for "intent-to-add" paths as a "new file" patch; "git apply --cached" should be able to take "git diff-files" and should act as an equivalent to "git add" for the path, but the command failed to do so for such a path. (merge 4c025c667e rp/apply-cached-with-i-t-a later to maint). * "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a bit was not showing the mode bits from the working tree. (merge cb0dd22b82 rp/ita-diff-modefix later to maint). * Ring buffer with size 4 used for bin-hex translation resulted in a wrong object name in the sequencer's todo output, which has been corrected. (merge 5da69c0dac ak/sequencer-fix-find-uniq-abbrev later to maint). * When given more than one target line ranges, "git blame -La,b -Lc,d" was over-eager to coalesce groups of original lines and showed incorrect results, which has been corrected. (merge c2ebaa27d6 jk/blame-coalesce-fix later to maint). * The regexp to identify the function boundary for FORTRAN programs has been updated. (merge 75c3b6b2e8 pb/userdiff-fortran-update later to maint). * A few end-user facing messages have been updated to be hash-algorithm agnostic. (merge 4279000d3e jc/object-names-are-not-sha-1 later to maint). * "unlink" emulation on MinGW has been optimized. (merge 680e0b4524 jh/mingw-unlink later to maint). * The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. (merge ccf236a23a es/init-no-separate-git-dir-in-bare later to maint). * "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. (merge ab282aa548 en/dir-nonbare-embedded later to maint). * Fix some incorrect UNLEAK() annotations. (merge 3e19816dc0 jk/unleak-fixes later to maint). * Use more buffered I/O where we used to call many small write(2)s. (merge a698d67b08 rs/more-buffered-io later to maint). * The patch-id computation did not ignore the "incomplete last line" marker like whitespaces. (merge 82a62015a7 rs/patch-id-with-incomplete-line later to maint). * Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifiers>" are the only two allowed forms, which has been corrected. (merge 2c22e102f8 hv/ref-filter-trailers-atom-parsing-fix later to maint). * Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. (merge fbff95b67f jk/index-pack-w-more-threads later to maint). * "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. (merge bfda204ade rs/checkout-no-overlay-pathspec-fix later to maint). * The description of --cached/--index options in "git apply --help" has been updated. (merge d064702be3 rp/apply-cached-doc later to maint). * Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and running "git log --ignore-missing $ZERO_OID" fell back to start digging from HEAD; it has been corrected to become a no-op, like "git log --tags=no-tag-matches-this-pattern" does. (merge 04a0e98515 jk/rev-input-given-fix later to maint). * Various callers of run_command API have been modernized. (merge afbdba391e jc/run-command-use-embedded-args later to maint). * List of options offered and accepted by "git add -i/-p" were inconsistent, which have been corrected. (merge ce910287e7 pw/add-p-allowed-options-fix later to maint). * "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. (merge 1cf3d5db9b mr/diff-hide-stat-wo-textual-change later to maint). * It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. (merge 6479ea4a8a jk/xrealloc-avoid-use-after-free later to maint). * "git status" has trouble showing where it came from by interpreting reflog entries that record certain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error and allow "status" to show its output. * "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. (merge 85a1ec2c32 mf/submodule-summary-with-correct-repository later to maint). * Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. (merge 378fe5fc3d mt/config-fail-nongit-early later to maint). * There is a logic to estimate how many objects are in the repository, which is meant to run once per process invocation, but it ran every time the estimated value was requested. (merge 67bb65de5d jk/dont-count-existing-objects-twice later to maint). * "git remote set-head" that failed still said something that hints the operation went through, which was misleading. (merge 5a07c6c3c2 cs/don-t-pretend-a-failed-remote-set-head-succeeded later to maint). * "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. (merge 4e735c1326 ar/fetch-ipversion-in-all later to maint). * The "unshelve" subcommand of "git p4" incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. (merge 0acbf5997f ld/p4-unshelve-fix later to maint). * "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. * Adjust sample hooks for hash algorithm other than SHA-1. (merge d8d3d632f4 dl/zero-oid-in-hooks later to maint). * "git range-diff" showed incorrect diffstat, which has been corrected. * Earlier we taught "git pull" to warn when the user does not say the histories need to be merged, rebased or accepts only fast- forwarding, but the warning triggered for those who have set the pull.ff configuration variable. (merge 54200cef86 ah/pull later to maint). * Compilation fix around type punning. (merge 176380fd11 jk/drop-unaligned-loads later to maint). * "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. (merge 610e2b9240 jc/blame-ignore-fix later to maint). * "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. (merge 73c6de06af cc/bisect-start-fix later to maint). * The explanation of the "scissors line" has been clarified. (merge 287416dba6 eg/mailinfo-doc-scissors later to maint). * A race that leads to an access to a free'd data was corrected in the codepath that reads pack files. (merge bda959c476 mt/delta-base-cache-races later to maint). * in_merge_bases_many(), a way to see if a commit is reachable from any commit in a set of commits, was totally broken when the commit-graph feature was in use, which has been corrected. (merge 8791bf1841 ds/in-merge-bases-many-optim-bug later to maint). * "git submodule update --quiet" did not squelch underlying "rebase" and "pull" commands. (merge 3ad0401e9e td/submodule-update-quiet later to maint). * The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damage to the partial clone filter in the repository, which has been corrected. * "log -c --find-object=X" did not work well to find a merge that involves a change to an object X from only one parent. (merge 957876f17d jk/diff-cc-oidfind-fix later to maint). * Other code cleanup, docfix, build fix, etc. (merge 84544f2ea3 sk/typofixes later to maint). (merge b17f411ab5 ar/help-guides-doc later to maint). (merge 98c6871fad rs/grep-simpler-parse-object-or-die-call later to maint). (merge 861c4ce141 en/typofixes later to maint). (merge 60e47f6773 sg/ci-git-path-fix-with-pyenv later to maint). (merge e2bfa50ac3 jb/doc-packfile-name later to maint). (merge 918d8ff780 es/worktree-cleanup later to maint). (merge dc156bc31f ma/t1450-quotefix later to maint). (merge 56e743426b en/merge-recursive-comment-fixes later to maint). (merge 7d23ff818f rs/bisect-oid-to-hex-fix later to maint). (merge de20baf2c9 ny/notes-doc-sample-update later to maint). (merge f649aaaf82 so/rev-parser-errormessage-fix later to maint). (merge 6103d58b7f bc/sha-256-cvs-svn-updates later to maint). (merge ac900fddb7 ma/stop-progress-null-fix later to maint). (merge e767963ab6 rs/upload-pack-sigchain-fix later to maint). (merge a831908599 rs/preserve-merges-unused-code-removal later to maint). (merge 6dfefe70a9 jb/commit-graph-doc-fix later to maint). (merge 847b37271e pb/set-url-docfix later to maint). (merge 748f733d54 mt/checkout-entry-dead-code-removal later to maint). (merge ce820cbd58 dl/subtree-docs later to maint). (merge 55fe225dde jk/leakfix later to maint). (merge ee22a29215 so/pretty-abbrev-doc later to maint). (merge 3100fd5588 jc/post-checkout-doc later to maint). (merge 17bae89476 pb/doc-external-diff-env later to maint). (merge 27ed6ccc12 jk/worktree-check-clean-leakfix later to maint). (merge 1302badd16 ea/blame-use-oideq later to maint). (merge e6d5a11fed al/t3200-back-on-a-branch later to maint). (merge 324efcf6b6 pw/add-p-leakfix later to maint). (merge 1c6ffb546b jk/add-i-fixes later to maint). (merge e40e936551 cd/commit-graph-doc later to maint). (merge 0512eabd91 jc/sequencer-stopped-sha-simplify later to maint). (merge d01141de5a so/combine-diff-simplify later to maint). (merge 3be01e5ab1 sn/fast-import-doc later to maint). ---------------------------------------------------------------- Changes since v2.29.0-rc1 are as follows: Junio C Hamano (1): Git 2.29-rc2
A release candidate Git v2.29.0-rc1 is now available for testing at the usual places. It is comprised of 605 non-merge commits since v2.28.0, contributed by 77 people, 22 of which are new faces. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/testing/ The following public repositories all have a copy of the 'v2.29.0-rc1' tag and the 'master' branch that the tag points at: url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.28.0 are as follows. Welcome to the Git development community! Aaron Lipman, Adrian Moennich, Ákos Uzonyi, Antti Keränen, Christian Schlack, Conor Davis, Eric Huber, Evan Gates, Han Xin, Hugo Locurcio, Kyohei Kadota, Lin Sun, Nikita Leonov, Noam Yorav-Raphael, pudinha, Raymond E. Pasco, Ryan Zoeller, Samanta Navarro, Sibi Siddharthan, Simon Legner, Steve Kemp, and Theodore Dubois. Returning contributors who helped this release are as follows. Thanks for your continued support. Ævar Arnfjörð Bjarmason, Alban Gruin, Alex Henrie, Alex Riesen, Andrei Rybak, Beat Bolli, Ben Wijen, brian m. carlson, Christian Couder, Chris Torek, Danny Lin, Denton Liu, Derrick Stolee, Đoàn Trần Công Danh, Drew DeVault, Edmundo Carmona Antoranz, Elijah Newren, Emily Shaffer, Eric Sunshine, Han-Wen Nienhuys, Hariom Verma, Jacob Keller, Jean-Noël Avila, Jeff Hostetler, Jeff King, Jiang Xin, Johannes Berg, Johannes Schindelin, Johannes Sixt, Jonathan Tan, Junio C Hamano, Kazuhiro Kato, Luke Diamand, Martin Ågren, Matheus Tavares, Matthew Rogers, Michael Forney, Michal Privoznik, Miriam Rubio, Orgad Shaneh, Patrick Steinhardt, Paul Mackerras, Philippe Blain, Phillip Wood, Pranit Bauva, Prathamesh Chavan, René Scharfe, Rohit Ashiwal, Sergey Organov, Shourya Shukla, Stefan Dotterweich, SZEDER Gábor, Taylor Blau, Thomas Guyot-Sionnest, and Роман Донченко. ---------------------------------------------------------------- Git 2.29 Release Notes (draft) ============================== Updates since v2.28 ------------------- UI, Workflows & Features * "git help log" has been enhanced by sharing more material from the documentation for the underlying "git rev-list" command. * "git for-each-ref --format=<>" learned %(contents:size). * "git merge" learned to selectively omit " into <branch>" at the end of the title of default merge message with merge.suppressDest configuration. * The component to respond to "git fetch" request is made more configurable to selectively allow or reject object filtering specification used for partial cloning. * Stop when "sendmail.*" configuration variables are defined, which could be a mistaken attempt to define "sendemail.*" variables. * The existing backends for "git mergetool" based on variants of vim have been refactored and then support for "nvim" has been added. * "git bisect" learns the "--first-parent" option to find the first breakage along the first-parent chain. * "git log --first-parent -p" showed patches only for single-parent commits on the first-parent chain; the "--first-parent" option has been made to imply "-m". Use "--no-diff-merges" to restore the previous behaviour to omit patches for merge commits. * The commit labels used to explain each side of conflicted hunks placed by the sequencer machinery have been made more readable by humans. * The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. * The recent addition of SHA-256 support is marked as experimental in the documentation. * "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. * Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. * The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. * "git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * "git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. * "format-patch --range-diff=<prev> <origin>..HEAD" has been taught not to ignore <origin> when <prev> is a single version. * "add -p" now allows editing paths that were only added in intent. * The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. * "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. * "git maintenance", a "git gc"'s big brother, has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. * "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). * "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. * The transport protocol v2 has become the default again. * The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. * The command line completion (in contrib/) learned that "git restore -s <TAB>" is often followed by a refname. * "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. * "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * "git fetch" and "git push" support negative refspecs. * "git format-patch" learns to take "whenAble" as a possible value for the format.useAutoBase configuration variable to become no-op when the automatically computed base does not make sense. * Credential helpers are now allowed to terminate lines with CRLF line ending, as well as LF line ending. Performance, Internal Implementation, Development Support etc. * The changed-path Bloom filter is improved using ideas from an independent implementation. * Updates to the changed-paths bloom filter. * The test framework has been updated so that most tests will run with predictable (artificial) timestamps. * Preliminary clean-up of the refs API in preparation for adding a new refs backend "reftable". * Dev support to limit the use of test_must_fail to only git commands. * While packing many objects in a repository with a promissor remote, lazily fetching missing objects from the promissor remote one by one may be inefficient---the code now attempts to fetch all the missing objects in batch (obviously this won't work for a lazy clone that lazily fetches tree objects as you cannot even enumerate what blobs are missing until you learn which trees are missing). * The pretend-object mechanism checks if the given object already exists in the object store before deciding to keep the data in-core, but the check would have triggered lazy fetching of such an object from a promissor remote. * The argv_array API is useful for not just managing argv but any "vector" (NULL-terminated array) of strings, and has seen adoption to a certain degree. It has been renamed to "strvec" to reduce the barrier to adoption. * The final leg of SHA-256 transition plus doc updates. Note that there is no interoperability between SHA-1 and SHA-256 repositories yet. * CMake support to build with MSVC for Windows bypassing the Makefile. * A new helper function has_object() has been introduced to make it easier to mark object existence checks that do and don't want to trigger lazy fetches, and a few such checks are converted using it. * A no-op replacement function implemented as a C preprocessor macro does not perform as good a job as one implemented as a "static inline" function in catching errors in parameters; replace the former with the latter in <git-compat-util.h> header. * Test framework update. (merge d572f52a64 es/test-cmp-typocatcher later to maint). * Updates to "git merge" tests, in preparation for a new merge strategy backend. * midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. * The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. * An unused binary has been discarded, and and a bunch of commands have been turned into into built-in. * A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. * Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. * Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. * "git index-pack" learned to resolve deltified objects with greater parallelism. * "diff-highlight" (in contrib/) had a logic to flush its output upon seeing a blank line but the way it detected a blank line was broken. * The logic to skip testing on the tagged commit and the tag itself was not quite consistent which led to failure of Windows test tasks. It has been revamped to consistently skip revisions that have already been tested, based on the tree object of the revision. Fixes since v2.28 ----------------- * The "mediawiki" remote backend which lives in contrib/mw-to-git/ and is not built with git by default, had an RCE bug allowing a malicious MediaWiki server operator to inject arbitrary commands for execution by a cloning client. This has been fixed. The bug was discovered and reported by Joern Schneeweisz of GitLab to the git-security mailing list. Its practical impact due to the obscurity of git-remote-mediawiki was deemed small enough to forgo a dedicated security release. * "git clone --separate-git-dir=$elsewhere" used to stomp on the contents of the existing directory $elsewhere, which has been taught to fail when $elsewhere is not an empty directory. (merge dfaa209a79 bw/fail-cloning-into-non-empty later to maint). * With the base fix to 2.27 regresion, any new extensions in a v0 repository would still be silently honored, which is not quite right. Instead, complain and die loudly. (merge ec91ffca04 jk/reject-newer-extensions-in-v0 later to maint). * Fetching from a lazily cloned repository resulted at the server side in attempts to lazy fetch objects that the client side has, many of which will not be available from the third-party anyway. (merge 77aa0941ce jt/avoid-lazy-fetching-upon-have-check later to maint). * Fix to an ancient bug caused by an over-eager attempt for optimization. (merge a98f7fb366 rs/add-index-entry-optim-fix later to maint). * Pushing a ref whose name contains non-ASCII character with the "--force-with-lease" option did not work over smart HTTP protocol, which has been corrected. (merge cd85b447bf bc/push-cas-cquoted-refname later to maint). * "git mv src dst", when src is an unmerged path, errored out correctly but with an incorrect error message to claim that src is not tracked, which has been clarified. (merge 9b906af657 ct/mv-unmerged-path-error later to maint). * Fix to a regression introduced during 2.27 cycle. (merge cada7308ad en/fill-directory-exponential later to maint). * Command line completion (in contrib/) update. (merge 688b87c81b mp/complete-show-color-moved later to maint). * All "mergy" operations that internally use the merge-recursive machinery should honor the merge.renormalize configuration, but many of them didn't. * Doc cleanup around "worktree". (merge dc9c144be5 es/worktree-doc-cleanups later to maint). * The "git blame --first-parent" option was not documented, but now it is. (merge 11bc12ae1e rp/blame-first-parent-doc later to maint). * The logic to find the ref transaction hook script attempted to cache the path to the found hook without realizing that it needed to keep a copied value, as the API it used returned a transitory buffer space. This has been corrected. (merge 09b2aa30c9 ps/ref-transaction-hook later to maint). * Recent versions of "git diff-files" shows a diff between the index and the working tree for "intent-to-add" paths as a "new file" patch; "git apply --cached" should be able to take "git diff-files" and should act as an equivalent to "git add" for the path, but the command failed to do so for such a path. (merge 4c025c667e rp/apply-cached-with-i-t-a later to maint). * "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a bit was not showing the mode bits from the working tree. (merge cb0dd22b82 rp/ita-diff-modefix later to maint). * Ring buffer with size 4 used for bin-hex translation resulted in a wrong object name in the sequencer's todo output, which has been corrected. (merge 5da69c0dac ak/sequencer-fix-find-uniq-abbrev later to maint). * When given more than one target line ranges, "git blame -La,b -Lc,d" was over-eager to coalesce groups of original lines and showed incorrect results, which has been corrected. (merge c2ebaa27d6 jk/blame-coalesce-fix later to maint). * The regexp to identify the function boundary for FORTRAN programs has been updated. (merge 75c3b6b2e8 pb/userdiff-fortran-update later to maint). * A few end-user facing messages have been updated to be hash-algorithm agnostic. (merge 4279000d3e jc/object-names-are-not-sha-1 later to maint). * "unlink" emulation on MinGW has been optimized. (merge 680e0b4524 jh/mingw-unlink later to maint). * The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. (merge ccf236a23a es/init-no-separate-git-dir-in-bare later to maint). * "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. (merge ab282aa548 en/dir-nonbare-embedded later to maint). * Fix some incorrect UNLEAK() annotations. (merge 3e19816dc0 jk/unleak-fixes later to maint). * Use more buffered I/O where we used to call many small write(2)s. (merge a698d67b08 rs/more-buffered-io later to maint). * The patch-id computation did not ignore the "incomplete last line" marker like whitespaces. (merge 82a62015a7 rs/patch-id-with-incomplete-line later to maint). * Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifiers>" are the only two allowed forms, which has been corrected. (merge 2c22e102f8 hv/ref-filter-trailers-atom-parsing-fix later to maint). * Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. (merge fbff95b67f jk/index-pack-w-more-threads later to maint). * "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. (merge bfda204ade rs/checkout-no-overlay-pathspec-fix later to maint). * The description of --cached/--index options in "git apply --help" has been updated. (merge d064702be3 rp/apply-cached-doc later to maint). * Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and running "git log --ignore-missing $ZERO_OID" fell back to start digging from HEAD; it has been corrected to become a no-op, like "git log --tags=no-tag-matches-this-pattern" does. (merge 04a0e98515 jk/rev-input-given-fix later to maint). * Various callers of run_command API have been modernized. (merge afbdba391e jc/run-command-use-embedded-args later to maint). * List of options offered and accepted by "git add -i/-p" were inconsistent, which have been corrected. (merge ce910287e7 pw/add-p-allowed-options-fix later to maint). * "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. (merge 1cf3d5db9b mr/diff-hide-stat-wo-textual-change later to maint). * It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. (merge 6479ea4a8a jk/xrealloc-avoid-use-after-free later to maint). * "git status" has trouble showing where it came from by interpreting reflog entries that record certain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error and allow "status" to show its output. * "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. (merge 85a1ec2c32 mf/submodule-summary-with-correct-repository later to maint). * Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. (merge 378fe5fc3d mt/config-fail-nongit-early later to maint). * There is a logic to estimate how many objects are in the repository, which is meant to run once per process invocation, but it ran every time the estimated value was requested. (merge 67bb65de5d jk/dont-count-existing-objects-twice later to maint). * "git remote set-head" that failed still said something that hints the operation went through, which was misleading. (merge 5a07c6c3c2 cs/don-t-pretend-a-failed-remote-set-head-succeeded later to maint). * "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. (merge 4e735c1326 ar/fetch-ipversion-in-all later to maint). * The "unshelve" subcommand of "git p4" incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. (merge 0acbf5997f ld/p4-unshelve-fix later to maint). * "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. * Adjust sample hooks for hash algorithm other than SHA-1. (merge d8d3d632f4 dl/zero-oid-in-hooks later to maint). * "git range-diff" showed incorrect diffstat, which has been corrected. * Earlier we taught "git pull" to warn when the user does not say the histories need to be merged, rebased or accepts only fast- forwarding, but the warning triggered for those who have set the pull.ff configuration variable. (merge 54200cef86 ah/pull later to maint). * Compilation fix around type punning. (merge 176380fd11 jk/drop-unaligned-loads later to maint). * "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. (merge 610e2b9240 jc/blame-ignore-fix later to maint). * "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. (merge 73c6de06af cc/bisect-start-fix later to maint). * The explanation of the "scissors line" has been clarified. (merge 287416dba6 eg/mailinfo-doc-scissors later to maint). * A race that leads to an access to a free'd data was corrected in the codepath that reads pack files. (merge bda959c476 mt/delta-base-cache-races later to maint). * in_merge_bases_many(), a way to see if a commit is reachable from any commit in a set of commits, was totally broken when the commit-graph feature was in use, which has been corrected. (merge 8791bf1841 ds/in-merge-bases-many-optim-bug later to maint). * "git submodule update --quiet" did not squelch underlying "rebase" and "pull" commands. (merge 3ad0401e9e td/submodule-update-quiet later to maint). * The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damage to the partial clone filter in the repository, which has been corrected. * "log -c --find-object=X" did not work well to find a merge that involves a change to an object X from only one parent. (merge 957876f17d jk/diff-cc-oidfind-fix later to maint). * Other code cleanup, docfix, build fix, etc. (merge 84544f2ea3 sk/typofixes later to maint). (merge b17f411ab5 ar/help-guides-doc later to maint). (merge 98c6871fad rs/grep-simpler-parse-object-or-die-call later to maint). (merge 861c4ce141 en/typofixes later to maint). (merge 60e47f6773 sg/ci-git-path-fix-with-pyenv later to maint). (merge e2bfa50ac3 jb/doc-packfile-name later to maint). (merge 918d8ff780 es/worktree-cleanup later to maint). (merge dc156bc31f ma/t1450-quotefix later to maint). (merge 56e743426b en/merge-recursive-comment-fixes later to maint). (merge 7d23ff818f rs/bisect-oid-to-hex-fix later to maint). (merge de20baf2c9 ny/notes-doc-sample-update later to maint). (merge f649aaaf82 so/rev-parser-errormessage-fix later to maint). (merge 6103d58b7f bc/sha-256-cvs-svn-updates later to maint). (merge ac900fddb7 ma/stop-progress-null-fix later to maint). (merge e767963ab6 rs/upload-pack-sigchain-fix later to maint). (merge a831908599 rs/preserve-merges-unused-code-removal later to maint). (merge 6dfefe70a9 jb/commit-graph-doc-fix later to maint). (merge 847b37271e pb/set-url-docfix later to maint). (merge 748f733d54 mt/checkout-entry-dead-code-removal later to maint). (merge ce820cbd58 dl/subtree-docs later to maint). (merge 55fe225dde jk/leakfix later to maint). (merge ee22a29215 so/pretty-abbrev-doc later to maint). (merge 3100fd5588 jc/post-checkout-doc later to maint). (merge 17bae89476 pb/doc-external-diff-env later to maint). (merge 27ed6ccc12 jk/worktree-check-clean-leakfix later to maint). (merge 1302badd16 ea/blame-use-oideq later to maint). (merge e6d5a11fed al/t3200-back-on-a-branch later to maint). (merge 324efcf6b6 pw/add-p-leakfix later to maint). (merge 1c6ffb546b jk/add-i-fixes later to maint). (merge e40e936551 cd/commit-graph-doc later to maint). (merge 0512eabd91 jc/sequencer-stopped-sha-simplify later to maint). (merge d01141de5a so/combine-diff-simplify later to maint). (merge 3be01e5ab1 sn/fast-import-doc later to maint). ---------------------------------------------------------------- Changes since v2.28.0 are as follows: Aaron Lipman (12): t6030: modernize "git bisect run" tests rev-list: allow bisect and first-parent flags cmd_bisect__helper: defer parsing no-checkout flag bisect: introduce first-parent flag bisect: combine args passed to find_bisection() bisect: add first-parent option to documentation t3200: clean side effect of git checkout --orphan t3201: test multiple branch filter combinations Doc: cover multiple contains/no-contains filters ref-filter: allow merged and no-merged filters ref-filter: make internal reachable-filter API more precise Doc: prefer more specific file name Adrian Moennich (1): ci: fix inconsistent indentation Alban Gruin (1): t6300: fix issues related to %(contents:size) Alex Henrie (1): pull: don't warn if pull.ff has been set Alex Riesen (1): fetch: pass --ipv4 and --ipv6 options to sub-fetches Andrei Rybak (1): git-help.txt: fix mentions of option --guides Antti Keränen (1): rebase -i: fix possibly wrong onto hash in todo Beat Bolli (1): gitk: rename "commit summary" to "commit reference" Ben Wijen (1): git clone: don't clone into non-empty directory Chris Torek (1): git-mv: improve error message for conflicted file Christian Couder (4): Documentation: clarify %(contents:XXXX) doc t6300: test refs pointing to tree and blob ref-filter: add support for %(contents:size) bisect: don't use invalid oid as rev when starting Christian Schlack (1): remote: don't show success message when set-head fails Conor Davis (1): commit-graph-format.txt: fix no-parent value Danny Lin (2): contrib/subtree: fix "unsure" for --message in the document contrib/subtree: document 'push' does not take '--squash' Denton Liu (13): t3701: stop using `env` in force_color() t5324: reorder `run_with_limited_open_files test_might_fail` t7107: don't use test_must_fail() t9834: remove use of `test_might_fail p4` t9400: don't use test_must_fail with cvs test-lib-functions: restrict test_must_fail usage contrib/completion: complete options that take refs for format-patch hooks--pre-push.sample: modernize script hooks--pre-push.sample: use hash-agnostic zero OID hooks--update.sample: use hash-agnostic zero OID gitk: replace tabs with spaces compat/mingw.h: drop extern from function declaration Makefile: ASCII-sort += lists Derrick Stolee (22): commit-graph: place bloom_settings in context commit-graph: change test to die on parse, not load bloom: fix logic in get_bloom_filter() commit-graph: persist existence of changed-paths revision.c: fix whitespace multi-pack-index: repack batches below --batch-size t/README: document GIT_TEST_DEFAULT_HASH commit-graph: use the "hash version" byte multi-pack-index: use hash version byte bloom/diff: properly short-circuit on max_changes maintenance: create basic maintenance runner maintenance: add --quiet option maintenance: replace run_auto_gc() maintenance: initialize task array maintenance: add commit-graph task maintenance: add --task option maintenance: take a lock on the objects directory maintenance: create maintenance.<task>.enabled config maintenance: use pointers to check --auto maintenance: add auto condition for commit-graph task maintenance: add trace2 regions for task execution commit-reach: fix in_merge_bases_many bug Drew DeVault (1): git-send-email: die if sendmail.* config is set Edmundo Carmona Antoranz (1): blame.c: replace instance of !oidcmp for oideq Elijah Newren (26): Remove doubled words in various comments hashmap: fix typo in usage docs merge-recursive: fix unclear and outright wrong comments t6038: make tests fail for the right reason t6038: remove problematic test merge: make merge.renormalize work for all uses of merge machinery checkout: support renormalization with checkout -m <paths> Collect merge-related tests to t64xx t6418: tighten delete/normalize conflict testcase t6422: fix bad check against missing file t6416, t6422: fix incorrect untracked file count t6423: fix test setup for a couple tests t6422: fix multiple errors with the mod6 test expectations t6416, t6423: clarify some comments and fix some typos t6423: add an explanation about why one of the tests does not pass t6422, t6426: be more flexible for add/add conflicts involving renames t642[23]: be more flexible for add/add conflicts involving pair renames t6425: be more flexible with rename/delete conflict messages t3000: fix some test description typos dir: avoid prematurely marking nonbare repositories as matches sequencer: avoid garbled merge machinery messages due to commit labels mem-pool: add convenience functions for strdup and strndup mem-pool: use more standard initialization and finalization mem-pool: use consistent pool variable name dir: make clear_directory() free all relevant memory dir: fix problematic API to avoid memory leaks Emily Shaffer (1): Revert "contrib: subtree: adjust test to change in fmt-merge-msg" Eric Huber (1): gitk: Preserve window dimensions on exit when not using ttk themes Eric Sunshine (22): worktree: drop pointless strbuf_release() worktree: drop unused code from get_linked_worktree() worktree: drop bogus and unnecessary path munging worktree: retire special-case normalization of main worktree path git-worktree.txt: employ fixed-width typeface consistently git-worktree.txt: consistently use term "working tree" git-worktree.txt: fix minor grammatical issues git-worktree.txt: make start of new sentence more obvious git-worktree.txt: link to man pages when citing other Git commands test_cmp: diagnose incorrect arguments init: disallow --separate-git-dir with bare repository worktree: add skeleton "repair" command worktree: teach "repair" to fix worktree back-links to main worktree worktree: teach "repair" to fix outgoing links to worktrees init: teach --separate-git-dir to repair linked worktrees init: make --separate-git-dir work from within linked worktree git-checkout.txt: document -d short option for --detach worktree: teach `add` to recognize -d as shorthand for --detach git-worktree.txt: discuss branch-based vs. throwaway worktrees diff: move show_interdiff() from its own file to diff-lib diff-lib: tighten show_interdiff()'s interface format-patch: use 'origin' as start of current-series-range when known Evan Gates (1): Doc: show example scissors line Han Xin (1): send-pack: run GPG after atomic push checking Han-Wen Nienhuys (17): lib-t6000.sh: write tag using git-update-ref t3432: use git-reflog to inspect the reflog for HEAD bisect: treat BISECT_HEAD as a pseudo ref t1400: use git rev-parse for testing PSEUDOREF existence Modify pseudo refs through ref backend storage Make HEAD a PSEUDOREF rather than PER_WORKTREE. refs: move the logic to add \t to reflog to the files backend refs: split off reading loose ref data in separate function refs: fix comment about submodule ref_stores refs: move gitdir into base ref_store refs: read FETCH_HEAD and MERGE_HEAD generically refs: make refs_ref_exists public sequencer: treat CHERRY_PICK_HEAD as a pseudo ref builtin/commit: suggest update-ref for pseudoref removal sequencer: treat REVERT_HEAD as a pseudo ref refs: move REF_LOG_ONLY to refs-internal.h refs: add GIT_TRACE_REFS debugging mechanism Hariom Verma (10): t6300: unify %(trailers) and %(contents:trailers) tests ref-filter: 'contents:trailers' show error if `:` is missing ref-filter: support different email formats ref-filter: refactor `grab_objectname()` ref-filter: modify error messages in `grab_objectname()` ref-filter: rename `objectname` related functions and fields ref-filter: add `short` modifier to 'tree' atom ref-filter: add `short` modifier to 'parent' atom pretty: refactor `format_sanitized_subject()` ref-filter: add `sanitize` option for 'subject' atom Hugo Locurcio (1): bisect: swap command-line options in documentation Jacob Keller (4): refspec: fix documentation referring to refspec_item refspec: make sure stack refspec_item variables are zeroed refspec: add support for negative refspecs format-patch: teach format.useAutoBase "whenAble" option Jean-Noël Avila (4): git-bisect-lk2009: make continuation of list indented doc: use linkgit macro where needed. doc: git-remote fix ups doc: fix the bnf like style of some commands Jeff Hostetler (1): mingw: improve performance of mingw_unlink() Jeff King (82): t6000: use test_tick consistently t9700: loosen ident timezone regex t5539: make timestamp requirements more explicit t9100: explicitly unset GIT_COMMITTER_DATE test-lib: set deterministic default author/committer date t9100: stop depending on commit timestamps verify_repository_format(): complain about new extensions in v0 repo argv-array: use size_t for count and alloc argv-array: rename to strvec strvec: rename files from argv-array to strvec quote: rename sq_dequote_to_argv_array to mention strvec strvec: convert builtin/ callers away from argv_array name strvec: convert more callers away from argv_array name strvec: convert remaining callers away from argv_array name strvec: fix indentation in renamed calls strvec: update documention to avoid argv_array strvec: drop argv_array compatibility layer log: drop "--cc implies -m" logic revision: add "--no-diff-merges" option to counteract "-m" log: enable "-m" automatically with "--first-parent" doc/git-log: move "Diff Formatting" from rev-list-options doc/git-log: drop "-r" diff option doc/git-log: move "-t" into diff-options list doc/git-log: clarify handling of merge commit diffs strvec: rename struct fields config: work around gcc-10 -Wstringop-overflow warning revision: avoid out-of-bounds read/write on empty pathspec revision: avoid leak when preparing bloom filter for "/" t5616: use test_i18ngrep for upload-pack errors sideband: mark "remote error:" prefix for translation t1416: avoid hard-coded sha1 ids t8003: check output of coalesced blame t8003: factor setup out of coalesce test blame: only coalesce lines that are adjacent in result Makefile: drop builtins from MSVC pdb list make credential helpers builtins make git-bugreport a builtin make git-fast-import a builtin drop vcs-svn experiment stop calling UNLEAK() before die() ls-remote: simplify UNLEAK() usage clear_pattern_list(): clear embedded hashmaps submodule--helper: use strbuf_release() to free strbufs checkout: fix leak of non-existent branch names config: fix leaks from git_config_get_string_const() config: drop git_config_get_string_const() config: fix leak in git_config_get_expiry_in_days() submodule--helper: fix leak of core.worktree value p5302: disable thread-count parameter tests by default p5302: count up to online-cpus for thread tests index-pack: adjust default threading cap revision: set rev_input_given in handle_revision_arg() worktree: fix leak in check_clean_worktree() xrealloc: do not reuse pointer freed by zero-length realloc() add-patch: fix inverted return code of repo_read_index() add--interactive.perl: specify --no-color explicitly packfile: actually set approximate_object_count_valid diff-highlight: correctly match blank lines for flush bswap.h: drop unaligned loads Revert "fast-export: use local array to store anonymized oid" shortlog: change "author" variables to "ident" protocol: re-enable v2 protocol by default shortlog: add grouping option trailer: add interface for iterating over commit trailers shortlog: match commit trailers with --group shortlog: de-duplicate trailer values shortlog: rename parse_stdin_ident() shortlog: parse trailer idents shortlog: allow multiple groups to be specified convert: drop unused crlf_action from check_global_conv_flags_eol() drop unused argc parameters env--helper: write to opt->value in parseopt helper assert PARSE_OPT_NONEG in parse-options callbacks push: drop unused repo argument to do_push() sequencer: drop repository argument from run_git_commit() sparse-checkout: fill in some options boilerplate test-advise: check argument count with argc instead of argv sequencer: handle ignore_footer when parsing trailers dir.c: drop unused "untracked" from treat_path_fast() combine-diff: handle --find-object in multitree code path index-pack: restore "resolving deltas" progress meter index-pack: drop type_cas mutex Jiang Xin (10): transport: not report a non-head push as a branch t5411: add basic test cases for proc-receive hook receive-pack: add new proc-receive hook receive-pack: feed report options to post-receive New capability "report-status-v2" for git-push doc: add document for capability report-status-v2 receive-pack: new config receive.procReceiveRefs t5411: test updates of remote-tracking branches transport: parse report options for tracking refs doc: add documentation for the proc-receive hook Johannes Berg (2): pack-write/docs: update regarding pack naming docs: commit-graph: fix some whitespace in the diagram Johannes Schindelin (26): t3404: prepare 'short SHA-1 collision' tests for SHA-256 ci: fix indentation of the `ci-config` job ci: avoid ugly "failure" in the `ci-config` job t/test-terminal: avoid non-inclusive language fast-export: avoid using unnecessary language in a code comment t3200: avoid variations of the `master` branch name msvc: copy the correct `.pdb` files in the Makefile target `install` Optionally skip linking/copying the built-ins ci: stop linking built-ins to the dashed versions cmake: ignore files generated by CMake as run in Visual Studio tests: avoid variations of the `master` branch name t9902: avoid using the branch name `master` cmake: do find Git for Windows' shell interpreter cmake: ensure that the `vcpkg` packages are found on Windows cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows cmake: quote the path accurately when editing `test-lib.sh` cmake (Windows): let the `.dll` files be found when running the tests cmake (Windows): complain when encountering an unknown compiler cmake (Windows): initialize vcpkg/build dependencies automatically cmake (Windows): recommend using Visual Studio's built-in CMake support GitHub workflow: automatically follow minor updates of setup-msbuild help: do not expect built-in commands to be hardlinked t1415: avoid using `main` as ref name tests: avoid using the branch name `main` ci: skip GitHub workflow runs for already-tested commits/trees ci: do not skip tagged revisions in GitHub workflows Johannes Sixt (1): gitk: Un-hide selection in areas with non-default background color Jonathan Tan (33): upload-pack: do not lazy-fetch "have" objects pack-objects: refactor to oid_object_info_extended pack-objects: prefetch objects to be packed sha1-file: make pretend_object_file() not prefetch sha1-file: introduce no-lazy-fetch has_object() apply: do not lazy fetch when applying binary pack-objects: no fetch when allow-{any,promisor} fsck: do not lazy fetch known non-promisor object negotiator/noop: add noop fetch negotiator fetch: allow refspecs specified through stdin fetch: avoid reading submodule config until needed fetch: only populate existing_refs if needed fetch-pack: do not lazy-fetch during ref iteration promisor-remote: lazy-fetch objects in subprocess fetch-pack: remove no_dependents code fetch-pack: in partial clone, pass --promisor Documentation: deltaBaseCacheLimit is per-thread index-pack: remove redundant parameter index-pack: unify threaded and unthreaded code index-pack: remove redundant child field index-pack: calculate {ref,ofs}_{first,last} early index-pack: make resolve_delta() assume base data (various): document from_promisor parameter fetch-pack: document only_packfile in get_pack() fetch-pack: make packfile URIs work with transfer.fsckobjects fetch: no FETCH_HEAD display if --no-write-fetch-head sha1-name: replace unsigned int with option struct refs: move dwim_ref() to header file wt-status: tolerate dangling marks index-pack: make quantum of work smaller promisor-remote: remove unused variable fetch: do not override partial clone filter index-pack: make get_base_data() comment clearer Junio C Hamano (50): gitk: be prepared to be run in a bare repository reflog: cleanse messages in the refs.c layer Revert "fmt-merge-msg: stop treating `master` specially" fmt-merge-msg: allow merge destination to be omitted again First batch post 2.28 The second batch -- mostly minor typofixes Third batch Fourth batch Documentation: don't hardcode command categories twice compat-util: type-check parameters of no-op replacement functions Fifth batch Sixth batch Seventh batch messages: avoid SHA-1 in end-user facing messages Eighth batch fetch: optionally allow disabling FETCH_HEAD update Ninth batch ident: say whose identity is missing when giving user.name hint Tenth batch t3436: do not run git-merge-recursive in dashed form transport-helper: do not run git-remote-ext etc. in dashed form cvsexportcommit: do not run git programs in dashed form run_command: teach API users to use embedded 'args' more credential-cache: use child_process.args Eleventh batch doc: clarify how exit status of post-checkout hook is used Twelfth batch Thirteenth batch add -i: use the built-in version when feature.experimental is set Makefile: allow extra tweaking of distribution tarball Fourteenth batch quote_path: rename quote_path_relative() to quote_path() quote_path: give flags parameter to quote_path() quote_path: optionally allow quoting a path with SP in it quote_path: code clarification wt-status: consistently quote paths in "status --short" output quote: rename misnamed sq_lookup[] to cq_lookup[] quote: turn 'nodq' parameter into a set of flags Fifteenth batch Sixteenth batch t8013: minimum preparatory clean-up blame: validate and peel the object names on the ignore list t1506: rev-parse A..B and A...B sequencer: stop abbreviating stopped-sha file Seventeenth batch Eighteenth batch hashmap_for_each_entry(): workaround MSVC's runtime check failure #3 Nineteenth batch Git 2.29-rc0 Git 2.29-rc1 Kazuhiro Kato (1): gitk: fix branch name encoding error Kyohei Kadota (1): Fit to Plan 9's ANSI/POSIX compatibility layer Lin Sun (1): mergetool: allow auto-merge for meld to follow the vim-diff behavior Luke Diamand (2): git-p4 unshelve: adding a commit breaks git-p4 unshelve git-p4: use HEAD~$n to find parent commit for unshelve Martin Ågren (19): dir: check pathspecs before returning `path_excluded` t1450: fix quoting of NUL byte when corrupting pack t: don't spuriously close and reopen quotes t4104: modernize and simplify quoting progress: don't dereference before checking for NULL http-protocol.txt: document SHA-256 "want"/"have" format index-format.txt: document SHA-256 index format protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256 shallow.txt: document SHA-256 shallow format Documentation: mark `--object-format=sha256` as experimental wt-status: replace sha1 mentions with oid wt-status: print to s->fp, not stdout wt-status: introduce wt_status_state_free_buffers() worktree: inline `worktree_ref()` into its only caller worktree: update renamed variable in comment worktree: rename copy-pasted variable worktree: use skip_prefix to parse target config/fmt-merge-msg.txt: drop space in quote config/uploadpack.txt: fix typo in `--filter=tree:<n>` Matheus Tavares (4): checkout_entry(): remove unreachable error() call config: complain about --worktree outside of a git repo packfile: fix race condition on unpack_entry() packfile: fix memory leak in add_delta_base_cache() Matthew Rogers (1): diff: teach --stat to ignore uninteresting modifications Michael Forney (2): revision: use repository from rev_info when parsing commits submodule: use submodule repository when preparing summary Michal Privoznik (1): completion: add show --color-moved[-ws] Miriam Rubio (4): bisect--helper: BUG() in cmd_*() on invalid subcommand bisect--helper: use '-res' in 'cmd_bisect__helper' return bisect--helper: introduce new `write_in_file()` function bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' Nikita Leonov (1): credential: treat CR/LF as line endings in the credential protocol Noam Yorav-Raphael (1): docs: improve the example that illustrates git-notes path names Orgad Shaneh (5): vcbuild: fix library name for expat with make MSVC=1 vcbuild: fix batch file name in README fetch: do not look for submodule changes in unchanged refs submodule: suppress checking for file name and ref ambiguity for object ids contrib/buildsystems: fix expat library name for generated vcxproj Patrick Steinhardt (2): refs: fix interleaving hook calls with reference-transaction hook refs: remove lookup cache for reference-transaction hook Paul Mackerras (1): gitk: Resize panes correctly when reducing window size Philippe Blain (19): git-log.txt: add links to 'rev-list' and 'diff' docs revisions.txt: describe 'rev1 rev2 ...' meaning for ranges git-rev-list.txt: fix Asciidoc syntax git-rev-list.txt: tweak wording in set operations git-rev-list.txt: move description to separate file git-log.txt: include rev-list-description.txt command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers' help: drop usage of 'common' and 'useful' for guides git.txt: add list of guides fetch, pull doc: correct description of '--set-upstream' userdiff: add tests for Fortran xfuncname regex userdiff: improve Fortran xfuncname regex git-imap-send.txt: don't duplicate 'Examples' sections git-imap-send.txt: do verify SSL certificate for gmail.com git-imap-send.txt: add note about localized Gmail folders doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more git.txt: correct stale 'GIT_EXTERNAL_DIFF' description Makefile: add support for generating JSON compilation database gitsubmodules doc: invoke 'ls-files' with '--recurse-submodules' Phillip Wood (7): add -p: use ALLOC_GROW_BY instead of ALLOW_GROW add -p: fix checking of user input am: stop exporting GIT_COMMITTER_DATE rebase -i: support --committer-date-is-author-date rebase -i: support --ignore-date add -p: fix memory leak add -p: fix editing of intent-to-add paths Pranit Bauva (2): bisect--helper: reimplement `bisect_autostart` shell function in C bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C Prathamesh Chavan (1): submodule: port submodule subcommand 'summary' from shell to C Raymond E. Pasco (6): apply: allow "new file" patches on i-t-a entries blame-options.txt: document --first-parent option apply: make i-t-a entries never match worktree t4140: test apply with i-t-a paths diff-lib: use worktree mode in diffs from i-t-a entries git-apply.txt: update descriptions of --cached, --index René Scharfe (21): read-cache: remove bogus shortcut grep: avoid using oid_to_hex() with parse_object_or_die() bisect: use oid_to_hex_r() instead of memcpy()+oid_to_hex() upload-pack: remove superfluous sigchain_pop() call rebase: remove unused function reschedule_last_action connected: use buffered I/O to talk to rev-list midx: use buffered I/O to talk to pack-objects upload-pack: use buffered I/O to talk to rev-list patch-id: ignore newline at end of file in diff_flush_patch_id() checkout, restore: make pathspec recursive read-cache: fix mem-pool allocation for multi-threaded index loading push: release strbufs used for refspec formatting refspec: add and use refspec_appendf() fast-import: use write_pack_header() midx: use hashwrite_u8() in write_midx_header() pack-bitmap-write: use hashwrite_be32() in write_hash_cache() pack-write: use hashwrite_be32() in write_idx_file() archive: read short blobs in archive.c::write_archive_entry() archive: add --add-file Makefile: use git-archive --add-file ref-filter: plug memory leak in reach_filter() Rohit Ashiwal (2): rebase -i: add --ignore-whitespace flag rebase: add --reset-author-date Ryan Zoeller (2): parse-options: add --git-completion-helper-all completion: add GIT_COMPLETION_SHOW_ALL env var SZEDER Gábor (15): tree-walk.c: don't match submodule entries for 'submod/anything' commit-graph: fix parsing the Chunk Lookup table commit-graph-format.txt: all multi-byte numbers are in network byte order commit-slab: add a function to deep free entries on the slab diff.h: drop diff_tree_oid() & friends' return value commit-graph: clean up #includes commit-graph: simplify parse_commit_graph() #1 commit-graph: simplify parse_commit_graph() #2 commit-graph: simplify write_commit_graph_file() #1 commit-graph: simplify write_commit_graph_file() #2 commit-graph: unify the signatures of all write_graph_chunk_*() functions commit-graph: simplify chunk writes into loop commit-graph: check chunk sizes after writing commit-graph: check all leading directories in changed path Bloom filters ci: use absolute PYTHON_PATH in the Linux jobs Samanta Navarro (1): fast-import: fix typo in documentation Sergey Organov (9): revision: fix die() message for "--unpacked=" revision: change "--diff-merges" option to require parameter doc/git-log: describe --diff-merges=off t/t4013: add test for --diff-merges=off pretty-options.txt: fix --no-abbrev-commit description revision: add separate field for "-m" of "diff-index -m" log_tree_diff: get rid of code duplication for first_parent_only log_tree_diff: get rid of extra check for NULL diff: get rid of redundant 'dense' argument Shourya Shukla (11): submodule: remove extra line feeds between callback struct and macro submodule: rename helper functions to avoid ambiguity t7421: introduce a test script for verifying 'summary' output t7401: modernize style t7401: use 'short' instead of 'verify' and cut in rev-parse calls t7401: change syntax of test_i18ncmp calls for clarity t7401: change indentation for enhanced readability t7401: add a NEEDSWORK submodule: eliminate unused parameters from print_submodule_summary() submodule: fix style in function definition t7421: eliminate 'grep' check in t7421.4 for mingw compatibility Sibi Siddharthan (8): Introduce CMake support for configuring Git cmake: generate the shell/perl/python scripts and templates, translations cmake: installation support for git cmake: support for testing git with ctest cmake: support for testing git when building out of the source tree cmake: support for building git on windows with mingw cmake: support for building git on windows with msvc and clang. ci: modification of main.yml to use cmake for vs-build job Simon Legner (1): remote-mediawiki: fix duplicate revisions being imported Stefan Dotterweich (1): gitk: add diff lines background colors Steve Kemp (1): comment: fix spelling mistakes inside comments Taylor Blau (18): revision: empty pathspecs should not use Bloom filters list_objects_filter_options: introduce 'list_object_filter_config_name' upload-pack.c: allow banning certain object filter(s) upload-pack.c: introduce 'uploadpackfilter.tree.maxDepth' builtin/repack.c: invalidate MIDX only when necessary midx: traverse the local MIDX first commit-graph: introduce 'get_bloom_filter_settings()' t4216: use an '&&'-chain commit-graph: pass a 'struct repository *' in more places t/helper/test-read-graph.c: prepare repo settings commit-graph: respect 'commitGraph.readChangedPaths' commit-graph.c: store maximum changed paths bloom: split 'get_bloom_filter()' in two bloom: use provided 'struct bloom_filter_settings' bloom: encode out-of-bounds filters as non-empty commit-graph: rename 'split_commit_graph_opts' builtin/commit-graph.c: introduce '--max-new-filters=<n>' commit-graph: introduce 'commitGraph.maxNewFilters' Theodore Dubois (1): submodule update: silence underlying merge/rebase with "--quiet" Thomas Guyot-Sionnest (1): diff: fix modified lines stats with --stat and --numstat brian m. carlson (48): remote-curl: make --force-with-lease work with non-ASCII ref names t: make test-bloom initialize repository t1001: use $ZERO_OID t3305: make hash agnostic t6100: make hash size independent t6101: make hash size independent t6301: make hash size independent t6500: specify test values for SHA-256 t6501: avoid hard-coded objects t7003: compute appropriate length constant t7063: make hash size independent t7201: abstract away SHA-1-specific constants t7102: abstract away SHA-1-specific constants t7400: make hash size independent t7405: make hash size independent t7506: avoid checking for SHA-1-specific constants t7508: use $ZERO_OID instead of hard-coded constant t8002: make hash size independent t8003: make hash size independent t8011: make hash size independent t9300: abstract away SHA-1-specific constants t9300: use $ZERO_OID instead of hard-coded object ID t9301: make hash size independent t9350: make hash size independent t9500: ensure that algorithm info is preserved in config t9700: make hash size independent t5308: make test work with SHA-256 t0410: mark test with SHA1 prerequisite http-fetch: set up git directory before parsing pack hashes builtin/verify-pack: implement an --object-format option bundle: add new version for use with SHA-256 setup: add support for reading extensions.objectformat repository: enable SHA-256 support by default t: add test_oid option to select hash algorithm t: allow testing different hash algorithms via environment t: make SHA1 prerequisite depend on default hash ci: run tests with SHA-256 docs: add documentation for extensions.objectFormat t: remove test_oid_init in tests git-cvsexportcommit: support Perl before 5.10.1 docs: document SHA-256 pack and indices docs: fix step in transition plan t4013: improve diff-post-processor logic po: add missing letter for French message docs: explain why squash merges are broken with long-running branches docs: explain why reverts are not always applied on merge docs: explain how to deal with files that are always modified builtin/clone: avoid failure with GIT_DEFAULT_HASH pudinha (2): mergetool--lib: improve support for vimdiff-style tool variants mergetools: add support for nvimdiff (neovim) family Ákos Uzonyi (2): completion: use "prev" variable instead of introducing "prevword" completion: complete refs after 'git restore -s' Ævar Arnfjörð Bjarmason (17): remote-mediawiki doc: correct link to GitHub project remote-mediawiki doc: link to MediaWiki's current version remote-mediawiki doc: don't hardcode Debian PHP versions remote-mediawiki tests: use the login/password variables remote-mediawiki tests: use a 10 character password remote-mediawiki tests: use test_cmp in tests remote-mediawiki tests: change `[]` to `test` remote-mediawiki tests: use "$dir/" instead of "$dir." remote-mediawiki tests: use a more idiomatic dispatch table remote-mediawiki tests: replace deprecated Perl construct remote-mediawiki tests: use inline PerlIO for readability remote-mediawiki tests: use CLI installer remote-mediawiki tests: annotate failing tests remote-mediawiki: provide a list form of run_git() remote-mediawiki: convert to quoted run_git() invocation remote-mediawiki: annotate unquoted uses of run_git() remote-mediawiki: use "sh" to eliminate unquoted commands Đoàn Trần Công Danh (2): diff: index-line: respect --abbrev in object's name t5534: split stdout and stderr redirection Роман Донченко (2): gitk: don't highlight files after submodules as submodules gitk: fix the context menu not appearing in the presence of submodule diffs
Here is the test coverage report for v2.29.0-rc0. I haven't sent a test-coverage report in a while due to some issues with the 'seen' branch timing out, and then I got out of the habit. Here is the uncovered code introduced in v2.29.0-rc0 that was edited since v2.28.0. Thanks, -Stolee [1] https://derrickstolee.github.io/git-test-coverage/reports/v2.29.0-rc0-commits.txt [2] https://derrickstolee.github.io/git-test-coverage/reports/v2.29.0-rc0.txt [3] https://derrickstolee.github.io/git-test-coverage/reports/v2.29.0-rc0.htm --- Uncovered code in 'v2.29.0-rc0' not in 'v2.28.0' -------------------------------------------------------- Commits introducing uncovered code: Aaron Lipman be5fe200 cmd_bisect__helper: defer parsing no-checkout flag builtin/bisect--helper.c be5fe200 906) res = bisect_next_all(the_repository, prefix); Ævar Arnfjörð Bjarmason 6a83d902 coccinelle: make use of the "type" FREE_AND_NULL() rule builtin/fast-import.c 6a83d902 995) FREE_AND_NULL(delta); Brandon Williams debca9d2 object: rename function 'typename' to 'type_name' builtin/fast-import.c debca9d2 2500) type_name(oe->type), command_buf.buf); brian m. carlson d7e6b6a8 fast-import: convert internal structs to struct object_id builtin/fast-import.c d7e6b6a8 892) fprintf(pack_edges, " %s", d7e6b6a8 893) oid_to_hex(&t->oid)); d7e6b6a8 2639) oidcpy(&n->oid, &s->oid); brian m. carlson ddddf8d7 fast-import: permit reading multiple marks files builtin/fast-import.c ddddf8d7 1145) insert_mark(marks, mark, e); brian m. carlson 912c13d5 fast-import: convert to struct object_id builtin/fast-import.c 912c13d5 2471) oidcpy(&commit_oid, &s->oid); 912c13d5 2646) } else if (!get_oid(from, &n->oid)) { 912c13d5 2811) oidcpy(&oid, &s->oid); 912c13d5 2939) strbuf_addf(&line, "%s missing\n", oid_to_hex(oid)); 912c13d5 3045) get_oid_hex(buf + strlen("object "), oid)) brian m. carlson 1bdca816 fast-import: add options for rewriting submodules builtin/fast-import.c 1bdca816 2193) return -1; 1bdca816 3068) return; 1bdca816 3328) die_errno("cannot read '%s'", f); brian m. carlson cd85b447 remote-curl: make --force-with-lease work with non-ASCII ref names remote-curl.c cd85b447 130) return -1; brian m. carlson e6a492b7 pack: convert struct pack_idx_entry to struct object_id builtin/fast-import.c e6a492b7 3103) oidcpy(&oid, &e->idx.oid); brian m. carlson 28d055bd fast-import: make hash-size independent builtin/fast-import.c 28d055bd 986) && (pack_size + PACK_SIZE_THRESHOLD + s.total_out) > max_packsize) 28d055bd 1083) && (pack_size + PACK_SIZE_THRESHOLD + len) > max_packsize) 28d055bd 2652) if (!buf || size < the_hash_algo->hexsz + 6) 28d055bd 3044) if (size < hexsz + strlen("object ") || Clemens Buchacher 98c2924c credentials: unable to connect to cache daemon builtin/credential-cache.c 98c2924c 79) die_errno("unable to connect to cache daemon"); David Barr 8dc6a373 fast-import: add 'ls' command builtin/fast-import.c 8dc6a373 3033) buf = gfi_unpack_entry(oe, &size); 8dc6a373 3047) break; 8dc6a373 3101) if (!e) David Barr 85c62395 fast-import: let importers retrieve blobs builtin/fast-import.c 85c62395 2917) die_errno("Write to frontend failed"); 85c62395 2938) strbuf_reset(&line); 85c62395 2940) cat_blob_write(line.buf, line.len); 85c62395 2941) strbuf_release(&line); 85c62395 2942) free(buf); 85c62395 2943) return; Derrick Stolee 663b2b1b maintenance: add commit-graph task builtin/gc.c 663b2b1b 813) return 1; Derrick Stolee 3103e984 maintenance: initialize task array builtin/gc.c 3103e984 933) result = 1; Derrick Stolee d7514f6e maintenance: take a lock on the objects directory builtin/gc.c d7514f6e 904) if (!opts->auto_flag && !opts->quiet) d7514f6e 907) free(lock_path); d7514f6e 908) return 0; Derrick Stolee 4ddc79b2 maintenance: add auto condition for commit-graph task builtin/gc.c 4ddc79b2 722) static int dfs_on_ref(const char *refname, 4ddc79b2 726) struct cg_auto_data *data = (struct cg_auto_data *)cb_data; 4ddc79b2 727) int result = 0; 4ddc79b2 729) struct commit_list *stack = NULL; 4ddc79b2 732) if (!peel_ref(refname, &peeled)) 4ddc79b2 733) oid = &peeled; 4ddc79b2 734) if (oid_object_info(the_repository, oid, NULL) != OBJ_COMMIT) 4ddc79b2 735) return 0; 4ddc79b2 737) commit = lookup_commit(the_repository, oid); 4ddc79b2 738) if (!commit) 4ddc79b2 739) return 0; 4ddc79b2 740) if (parse_commit(commit)) 4ddc79b2 741) return 0; 4ddc79b2 743) commit_list_append(commit, &stack); 4ddc79b2 745) while (!result && stack) { 4ddc79b2 748) commit = pop_commit(&stack); 4ddc79b2 750) for (parent = commit->parents; parent; parent = parent->next) { 4ddc79b2 751) if (parse_commit(parent->item) || 4ddc79b2 752) commit_graph_position(parent->item) != COMMIT_NOT_FROM_GRAPH || 4ddc79b2 753) parent->item->object.flags & SEEN) 4ddc79b2 754) continue; 4ddc79b2 756) parent->item->object.flags |= SEEN; 4ddc79b2 757) data->num_not_in_graph++; 4ddc79b2 759) if (data->num_not_in_graph >= data->limit) { 4ddc79b2 760) result = 1; 4ddc79b2 761) break; 4ddc79b2 764) commit_list_append(parent->item, &stack); 4ddc79b2 768) free_commit_list(stack); 4ddc79b2 769) return result; 4ddc79b2 772) static int should_write_commit_graph(void) 4ddc79b2 777) data.num_not_in_graph = 0; 4ddc79b2 778) data.limit = 100; 4ddc79b2 779) git_config_get_int("maintenance.commit-graph.auto", 4ddc79b2 782) if (!data.limit) 4ddc79b2 783) return 0; 4ddc79b2 784) if (data.limit < 0) 4ddc79b2 785) return 1; 4ddc79b2 787) result = for_each_ref(dfs_on_ref, &data); 4ddc79b2 789) clear_commit_marks_all(SEEN); 4ddc79b2 791) return result; Dmitry Ivankov 4b4963c0 fast-import: check committer name more strictly builtin/fast-import.c 4b4963c0 1975) if (strcmp("now", ltgt)) Dmitry Potapov 8db751a8 fast-import: tag may point to any object type builtin/fast-import.c 8db751a8 2812) type = OBJ_COMMIT; Elijah Newren 3164e6bd fast-import: fix handling of deleted tags builtin/fast-import.c 3164e6bd 2904) first_tag = t->next_tag; Elijah Newren 44c7e1a7 mem-pool: use more standard initialization and finalization read-cache.c 44c7e1a7 2076) istate->ce_mem_pool = xmalloc(sizeof(*istate->ce_mem_pool)); 44c7e1a7 2077) mem_pool_init(istate->ce_mem_pool, 0); 44c7e1a7 2106) mem_pool_init(p->ce_mem_pool, 44c7e1a7 2109) mem_pool_init(p->ce_mem_pool, Elijah Newren b8f50e5b fast-import: add support for new 'alias' command builtin/fast-import.c b8f50e5b 2623) return 0; Elijah Newren a762c8c1 mem-pool: add convenience functions for strdup and strndup mem-pool.c a762c8c1 108) char *mem_pool_strndup(struct mem_pool *pool, const char *str, size_t len) a762c8c1 110) char *p = memchr(str, '\0', len); a762c8c1 111) size_t actual_len = (p ? p - str : len); a762c8c1 112) char *ret = mem_pool_alloc(pool, actual_len+1); a762c8c1 114) ret[actual_len] = '\0'; a762c8c1 115) return memcpy(ret, str, actual_len); Elijah Newren f87bf284 mem-pool: use consistent pool variable name mem-pool.c f87bf284 118) int mem_pool_contains(struct mem_pool *pool, void *mem) f87bf284 123) for (p = pool->mp_block; p; p = p->next_block) Elijah Newren 253fb5f8 fast-import: Improve robustness when D->F changes provided in wrong order builtin/fast-import.c 253fb5f8 1513) return 1; Elijah Newren 7ffde293 fast-import: only allow cat-blob requests where it makes sense builtin/fast-import.c 7ffde293 2329) parse_cat_blob(v); Emily Shaffer 1411914a bugreport: add uname info builtin/bugreport.c 1411914a 21) strbuf_addf(sys_info, _("uname() failed with error '%s' (%d)\n"), 1411914a 23) errno); Eric Sunshine b214ab5a worktree: teach "repair" to fix outgoing links to worktrees worktree.c b214ab5a 663) fn = repair_noop; Eric Sunshine 59d876cc init: make --separate-git-dir work from within linked worktree builtin/init-db.c 59d876cc 664) die_errno(_("cannot chdir to %s"), mainwt.buf); Eric Sunshine 07a7f8de format-patch: use 'origin' as start of current-series-range when known builtin/log.c 07a7f8de 1689) else if (prev_is_range) Eric Wong d9545c7f fast-import: implement unpack limit builtin/fast-import.c d9545c7f 827) die_errno("Failed seeking to start of '%s'", p->pack_name); d9545c7f 3465) unpack_limit = limit; Han-Wen Nienhuys 4441f427 refs: add GIT_TRACE_REFS debugging mechanism refs/debug.c 4441f427 22) res = xmalloc(sizeof(struct debug_ref_store)); 4441f427 23) be_copy = xmalloc(sizeof(*be_copy)); 4441f427 24) *be_copy = refs_be_debug; 4441f427 26) be_copy->name = store->be->name; 4441f427 27) trace_printf_key(&trace_refs, "ref_store for %s\n", gitdir); 4441f427 28) res->refs = store; 4441f427 29) base_ref_store_init((struct ref_store *)res, be_copy); 4441f427 30) return (struct ref_store *)res; 4441f427 33) static int debug_init_db(struct ref_store *refs, struct strbuf *err) 4441f427 35) struct debug_ref_store *drefs = (struct debug_ref_store *)refs; 4441f427 36) int res = drefs->refs->be->init_db(drefs->refs, err); 4441f427 37) trace_printf_key(&trace_refs, "init_db: %d\n", res); 4441f427 38) return res; 4441f427 41) static int debug_transaction_prepare(struct ref_store *refs, 4441f427 45) struct debug_ref_store *drefs = (struct debug_ref_store *)refs; 4441f427 47) transaction->ref_store = drefs->refs; 4441f427 48) res = drefs->refs->be->transaction_prepare(drefs->refs, transaction, 4441f427 50) trace_printf_key(&trace_refs, "transaction_prepare: %d\n", res); 4441f427 51) return res; 4441f427 54) static void print_update(int i, const char *refname, 4441f427 59) char o[GIT_MAX_HEXSZ + 1] = "null"; 4441f427 60) char n[GIT_MAX_HEXSZ + 1] = "null"; 4441f427 61) if (old_oid) 4441f427 62) oid_to_hex_r(o, old_oid); 4441f427 63) if (new_oid) 4441f427 64) oid_to_hex_r(n, new_oid); 4441f427 66) type &= 0xf; /* see refs.h REF_* */ 4441f427 67) flags &= REF_HAVE_NEW | REF_HAVE_OLD | REF_NO_DEREF | 4441f427 69) trace_printf_key(&trace_refs, "%d: %s %s -> %s (F=0x%x, T=0x%x) \"%s\"\n", i, refname, 4441f427 71) } 4441f427 73) static void print_transaction(struct ref_transaction *transaction) 4441f427 76) trace_printf_key(&trace_refs, "transaction {\n"); 4441f427 77) for (i = 0; i < transaction->nr; i++) { 4441f427 78) struct ref_update *u = transaction->updates[i]; 4441f427 79) print_update(i, u->refname, &u->old_oid, &u->new_oid, u->flags, 4441f427 80) u->type, u->msg); 4441f427 82) trace_printf_key(&trace_refs, "}\n"); 4441f427 83) } 4441f427 85) static int debug_transaction_finish(struct ref_store *refs, 4441f427 89) struct debug_ref_store *drefs = (struct debug_ref_store *)refs; 4441f427 91) transaction->ref_store = drefs->refs; 4441f427 92) res = drefs->refs->be->transaction_finish(drefs->refs, transaction, 4441f427 94) print_transaction(transaction); 4441f427 95) trace_printf_key(&trace_refs, "finish: %d\n", res); 4441f427 96) return res; 4441f427 99) static int debug_transaction_abort(struct ref_store *refs, 4441f427 103) struct debug_ref_store *drefs = (struct debug_ref_store *)refs; 4441f427 105) transaction->ref_store = drefs->refs; 4441f427 106) res = drefs->refs->be->transaction_abort(drefs->refs, transaction, err); 4441f427 107) return res; 4441f427 110) static int debug_initial_transaction_commit(struct ref_store *refs, 4441f427 114) struct debug_ref_store *drefs = (struct debug_ref_store *)refs; 4441f427 116) transaction->ref_store = drefs->refs; 4441f427 117) res = drefs->refs->be->initial_transaction_commit(drefs->refs, 4441f427 119) return res; 4441f427 122) static int debug_pack_refs(struct ref_store *ref_store, unsigned int flags) 4441f427 124) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 125) int res = drefs->refs->be->pack_refs(drefs->refs, flags); 4441f427 126) trace_printf_key(&trace_refs, "pack_refs: %d\n", res); 4441f427 127) return res; 4441f427 130) static int debug_create_symref(struct ref_store *ref_store, 4441f427 134) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 135) int res = drefs->refs->be->create_symref(drefs->refs, ref_name, target, 4441f427 137) trace_printf_key(&trace_refs, "create_symref: %s -> %s \"%s\": %d\n", ref_name, 4441f427 139) return res; 4441f427 142) static int debug_delete_refs(struct ref_store *ref_store, const char *msg, 4441f427 145) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 146) int res = 4441f427 147) drefs->refs->be->delete_refs(drefs->refs, msg, refnames, flags); 4441f427 149) trace_printf_key(&trace_refs, "delete_refs {\n"); 4441f427 150) for (i = 0; i < refnames->nr; i++) 4441f427 151) trace_printf_key(&trace_refs, "%s\n", refnames->items[i].string); 4441f427 152) trace_printf_key(&trace_refs, "}: %d\n", res); 4441f427 153) return res; 4441f427 156) static int debug_rename_ref(struct ref_store *ref_store, const char *oldref, 4441f427 159) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 160) int res = drefs->refs->be->rename_ref(drefs->refs, oldref, newref, 4441f427 162) trace_printf_key(&trace_refs, "rename_ref: %s -> %s \"%s\": %d\n", oldref, newref, 4441f427 164) return res; 4441f427 167) static int debug_copy_ref(struct ref_store *ref_store, const char *oldref, 4441f427 170) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 171) int res = 4441f427 172) drefs->refs->be->copy_ref(drefs->refs, oldref, newref, logmsg); 4441f427 173) trace_printf_key(&trace_refs, "copy_ref: %s -> %s \"%s\": %d\n", oldref, newref, 4441f427 175) return res; 4441f427 183) static int debug_ref_iterator_advance(struct ref_iterator *ref_iterator) 4441f427 185) struct debug_ref_iterator *diter = 4441f427 187) int res = diter->iter->vtable->advance(diter->iter); 4441f427 188) if (res) 4441f427 189) trace_printf_key(&trace_refs, "iterator_advance: (%d)\n", res); 4441f427 191) trace_printf_key(&trace_refs, "iterator_advance: %s (0)\n", 4441f427 194) diter->base.ordered = diter->iter->ordered; 4441f427 195) diter->base.refname = diter->iter->refname; 4441f427 196) diter->base.oid = diter->iter->oid; 4441f427 197) diter->base.flags = diter->iter->flags; 4441f427 198) return res; 4441f427 201) static int debug_ref_iterator_peel(struct ref_iterator *ref_iterator, 4441f427 204) struct debug_ref_iterator *diter = 4441f427 206) int res = diter->iter->vtable->peel(diter->iter, peeled); 4441f427 207) trace_printf_key(&trace_refs, "iterator_peel: %s: %d\n", diter->iter->refname, res); 4441f427 208) return res; 4441f427 211) static int debug_ref_iterator_abort(struct ref_iterator *ref_iterator) 4441f427 213) struct debug_ref_iterator *diter = 4441f427 215) int res = diter->iter->vtable->abort(diter->iter); 4441f427 216) trace_printf_key(&trace_refs, "iterator_abort: %d\n", res); 4441f427 217) return res; 4441f427 226) debug_ref_iterator_begin(struct ref_store *ref_store, const char *prefix, 4441f427 229) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 230) struct ref_iterator *res = 4441f427 231) drefs->refs->be->iterator_begin(drefs->refs, prefix, flags); 4441f427 232) struct debug_ref_iterator *diter = xcalloc(1, sizeof(*diter)); 4441f427 233) base_ref_iterator_init(&diter->base, &debug_ref_iterator_vtable, 1); 4441f427 234) diter->iter = res; 4441f427 235) trace_printf_key(&trace_refs, "ref_iterator_begin: %s (0x%x)\n", prefix, flags); 4441f427 236) return &diter->base; 4441f427 239) static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname, 4441f427 243) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 244) int res = 0; 4441f427 246) oidcpy(oid, &null_oid); 4441f427 247) res = drefs->refs->be->read_raw_ref(drefs->refs, refname, oid, referent, 4441f427 250) if (res == 0) { 4441f427 251) trace_printf_key(&trace_refs, "read_raw_ref: %s: %s (=> %s) type %x: %d\n", 4441f427 254) trace_printf_key(&trace_refs, "read_raw_ref: %s: %d\n", refname, res); 4441f427 256) return res; 4441f427 260) debug_reflog_iterator_begin(struct ref_store *ref_store) 4441f427 262) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 263) struct ref_iterator *res = 4441f427 264) drefs->refs->be->reflog_iterator_begin(drefs->refs); 4441f427 265) trace_printf_key(&trace_refs, "for_each_reflog_iterator_begin\n"); 4441f427 266) return res; 4441f427 275) static int debug_print_reflog_ent(struct object_id *old_oid, 4441f427 280) struct debug_reflog *dbg = (struct debug_reflog *)cb_data; 4441f427 282) char o[GIT_MAX_HEXSZ + 1] = "null"; 4441f427 283) char n[GIT_MAX_HEXSZ + 1] = "null"; 4441f427 284) if (old_oid) 4441f427 285) oid_to_hex_r(o, old_oid); 4441f427 286) if (new_oid) 4441f427 287) oid_to_hex_r(n, new_oid); 4441f427 289) ret = dbg->fn(old_oid, new_oid, committer, timestamp, tz, msg, 4441f427 291) trace_printf_key(&trace_refs, "reflog_ent %s (ret %d): %s -> %s, %s %ld \"%s\"\n", 4441f427 293) return ret; 4441f427 296) static int debug_for_each_reflog_ent(struct ref_store *ref_store, 4441f427 300) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 301) struct debug_reflog dbg = { 4441f427 307) int res = drefs->refs->be->for_each_reflog_ent( 4441f427 309) trace_printf_key(&trace_refs, "for_each_reflog: %s: %d\n", refname, res); 4441f427 310) return res; 4441f427 313) static int debug_for_each_reflog_ent_reverse(struct ref_store *ref_store, 4441f427 318) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 319) struct debug_reflog dbg = { 4441f427 324) int res = drefs->refs->be->for_each_reflog_ent_reverse( 4441f427 326) trace_printf_key(&trace_refs, "for_each_reflog_reverse: %s: %d\n", refname, res); 4441f427 327) return res; 4441f427 330) static int debug_reflog_exists(struct ref_store *ref_store, const char *refname) 4441f427 332) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 333) int res = drefs->refs->be->reflog_exists(drefs->refs, refname); 4441f427 334) trace_printf_key(&trace_refs, "reflog_exists: %s: %d\n", refname, res); 4441f427 335) return res; 4441f427 338) static int debug_create_reflog(struct ref_store *ref_store, const char *refname, 4441f427 341) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 342) int res = drefs->refs->be->create_reflog(drefs->refs, refname, 4441f427 344) trace_printf_key(&trace_refs, "create_reflog: %s: %d\n", refname, res); 4441f427 345) return res; 4441f427 348) static int debug_delete_reflog(struct ref_store *ref_store, const char *refname) 4441f427 350) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 351) int res = drefs->refs->be->delete_reflog(drefs->refs, refname); 4441f427 352) trace_printf_key(&trace_refs, "delete_reflog: %s: %d\n", refname, res); 4441f427 353) return res; 4441f427 356) static int debug_reflog_expire(struct ref_store *ref_store, const char *refname, 4441f427 363) struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; 4441f427 364) int res = drefs->refs->be->reflog_expire(drefs->refs, refname, oid, 4441f427 368) trace_printf_key(&trace_refs, "reflog_expire: %s: %d\n", refname, res); 4441f427 369) return res; Hariom Verma b82445dc ref-filter: support different email formats ref-filter.c b82445dc 398) return strbuf_addf_ret(err, -1, _("unrecognized email option: %s"), arg); b82445dc 1087) eoemail = strchr(email, '>'); Hariom Verma e7601eb5 ref-filter: modify error messages in `grab_objectname()` ref-filter.c e7601eb5 384) return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name); Hariom Verma 2c22e102 ref-filter: 'contents:trailers' show error if `:` is missing ref-filter.c 2c22e102 356) return -1; Hariom Verma 905f0a4e ref-filter: add `sanitize` option for 'subject' atom ref-filter.c 905f0a4e 309) return strbuf_addf_ret(err, -1, _("unrecognized %%(subject) argument: %s"), arg); Hariom Verma 47d4676a pretty: refactor `format_sanitized_subject()` pretty.c 47d4676a 857) i++; Hariom Verma 26bc0aaf ref-filter: add `short` modifier to 'parent' atom ref-filter.c 26bc0aaf 1023) struct object_id *oid = &parents->item->object.oid; 26bc0aaf 1026) strbuf_addstr(&s, do_grab_oid("parent", oid, &used_atom[i])); Jacob Keller 7efba5fa format-patch: teach format.useAutoBase "whenAble" option builtin/log.c 7efba5fa 1505) if (die_on_failure) 7efba5fa 1524) if (die_on_failure) 7efba5fa 1529) return NULL; 7efba5fa 1547) if (die_on_failure) { 7efba5fa 1550) free(rev); 7efba5fa 1551) return NULL; 7efba5fa 1567) free(rev); 7efba5fa 1568) return NULL; 7efba5fa 1577) free(rev); 7efba5fa 1578) return NULL; Jacob Keller c0192df6 refspec: add support for negative refspecs refspec.c c0192df6 45) return 0; c0192df6 87) return 0; /* negative refspecs must not be empty */ c0192df6 93) return 0; remote.c c0192df6 812) return -1; Jeff King f5e3c0b9 credential-cache: close stderr in daemon process builtin/credential-cache--daemon.c f5e3c0b9 216) die_errno("unable to point stderr to /dev/null"); Jeff King d8410a81 fast-import: replace custom hash with hashmap.c builtin/fast-import.c d8410a81 60) e2 = container_of(entry_or_key, const struct object_entry, ent); d8410a81 61) return oidcmp(&e1->idx.oid, &e2->idx.oid); Jeff King c33ddc2e date: use strbufs in date-formatting functions builtin/fast-import.c c33ddc2e 1977) datestamp(&ident); Jeff King 22f9b7f3 strvec: convert builtin/ callers away from argv_array name builtin/am.c 22f9b7f3 1697) strvec_push(&cp.args, am_path(state, "patch")); builtin/bisect--helper.c 22f9b7f3 228) strvec_clear(&argv); builtin/bundle.c 22f9b7f3 89) strvec_push(&pack_opts, "--progress"); 22f9b7f3 91) strvec_push(&pack_opts, "--all-progress"); 22f9b7f3 93) strvec_push(&pack_opts, "--all-progress-implied"); builtin/clone.c 22f9b7f3 832) strvec_push(&args, "--progress"); builtin/describe.c 22f9b7f3 604) strvec_push(&args, "--always"); builtin/fetch.c 22f9b7f3 1562) strvec_push(argv, "-v"); builtin/gc.c 22f9b7f3 580) strvec_push(&repack, "-f"); 22f9b7f3 582) strvec_pushf(&repack, "--depth=%d", aggressive_depth); 22f9b7f3 584) strvec_pushf(&repack, "--window=%d", aggressive_window); builtin/pull.c 22f9b7f3 534) strvec_push(&args, opt_progress); 22f9b7f3 540) strvec_push(&args, opt_append); 22f9b7f3 542) strvec_push(&args, opt_upload_pack); 22f9b7f3 547) strvec_push(&args, opt_prune); 22f9b7f3 557) strvec_push(&args, "--recurse-submodules=on-demand"); 22f9b7f3 563) strvec_push(&args, max_children); 22f9b7f3 567) strvec_push(&args, opt_keep); 22f9b7f3 571) strvec_push(&args, opt_unshallow); 22f9b7f3 573) strvec_push(&args, opt_update_shallow); 22f9b7f3 575) strvec_push(&args, opt_refmap); 22f9b7f3 577) strvec_push(&args, opt_ipv4); 22f9b7f3 579) strvec_push(&args, opt_ipv6); 22f9b7f3 581) strvec_push(&args, "--show-forced-updates"); 22f9b7f3 583) strvec_push(&args, "--no-show-forced-updates"); 22f9b7f3 672) strvec_push(&args, opt_progress); 22f9b7f3 676) strvec_push(&args, opt_diffstat); 22f9b7f3 682) strvec_push(&args, opt_squash); 22f9b7f3 684) strvec_push(&args, opt_commit); 22f9b7f3 686) strvec_push(&args, opt_edit); 22f9b7f3 688) strvec_pushf(&args, "--cleanup=%s", cleanup_arg); 22f9b7f3 696) strvec_push(&args, opt_gpg_sign); 22f9b7f3 877) strvec_push(&args, "--rebase-merges"); 22f9b7f3 883) strvec_push(&args, opt_diffstat); 22f9b7f3 887) strvec_push(&args, opt_gpg_sign); 22f9b7f3 889) strvec_push(&args, "--no-autostash"); builtin/rebase.c 22f9b7f3 826) strvec_push(&am.args, opts->gpg_sign_opt); 22f9b7f3 861) strvec_clear(&am.args); 22f9b7f3 872) strvec_split(&format_patch.args, 22f9b7f3 883) strvec_clear(&am.args); 22f9b7f3 905) strvec_clear(&am.args); 22f9b7f3 914) strvec_push(&am.args, "--rerere-autoupdate"); 22f9b7f3 916) strvec_push(&am.args, "--no-rerere-autoupdate"); 22f9b7f3 918) strvec_push(&am.args, opts->gpg_sign_opt); builtin/receive-pack.c 22f9b7f3 782) strvec_pushf(&proc->env_array, 22f9b7f3 826) strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT"); 22f9b7f3 2202) strvec_push(&child.args, "--show-resolving-progress"); builtin/remote.c 22f9b7f3 1467) strvec_push(&fetch_argv, "-v"); builtin/repack.c 22f9b7f3 162) strvec_pushf(&cmd->args, "--window=%s", args->window); 22f9b7f3 164) strvec_pushf(&cmd->args, "--window-memory=%s", args->window_memory); 22f9b7f3 166) strvec_pushf(&cmd->args, "--depth=%s", args->depth); 22f9b7f3 168) strvec_pushf(&cmd->args, "--threads=%s", args->threads); 22f9b7f3 170) strvec_pushf(&cmd->args, "--max-pack-size=%s", args->max_pack_size); 22f9b7f3 174) strvec_pushf(&cmd->args, "--no-reuse-object"); builtin/replace.c 22f9b7f3 234) strvec_push(&cmd.args, type_name(type)); builtin/submodule--helper.c 22f9b7f3 859) strvec_push(&cpr.args, "--quiet"); 22f9b7f3 1454) strvec_push(&cpr.args, "--quiet"); 22f9b7f3 2147) strvec_push(&child->args, "--progress"); 22f9b7f3 2151) strvec_pushl(&child->args, "--prefix", suc->prefix, NULL); builtin/worktree.c 22f9b7f3 626) strvec_push(&cp.args, "--quiet"); Jeff King 47beb37b shortlog: match commit trailers with --group builtin/shortlog.c 47beb37b 243) return; Jeff King fe4a0a28 argv-array: add pop function strvec.c fe4a0a28 63) return; Jeff King f17b0b99 shortlog: de-duplicate trailer values builtin/shortlog.c f17b0b99 194) b = container_of(entry_or_key, const struct strset_item, ent); f17b0b99 195) return strcmp(a->value, b->value); Jeff King 63d24fa0 shortlog: allow multiple groups to be specified builtin/shortlog.c 63d24fa0 303) !strset_check_and_add(&dups, ident.buf)) Jeff King 01968302 fast-import: delay creating leading directories for export-marks builtin/fast-import.c 01968302 1692) failure |= error_errno("unable to create leading directories of %s", 01968302 1694) return; Jeff King ec91ffca verify_repository_format(): complain about new extensions in v0 repo setup.c ec91ffca 472) return config_error_nonbool(var); ec91ffca 517) return -1; ec91ffca 526) return -1; Jeff King fcd12db6 prefer git_pathdup to git_path in some possibly-dangerous cases builtin/fast-import.c fcd12db6 321) free(loc); Jeff King d70a9eb6 strvec: rename struct fields daemon.c d70a9eb6 495) strvec_pushv(&cld.env_array, env->v); run-command.c d70a9eb6 852) execve(argv.v[0], (char *const *) argv.v, t/helper/test-run-command.c d70a9eb6 251) arg_offset = args.nr; d70a9eb6 278) cp.argv = args.v; d70a9eb6 284) const char *arg = args.v[j + arg_offset]; d70a9eb6 301) (int)j, args.v[j + arg_offset]); Jeff King 8d2aa8df assert PARSE_OPT_NONEG in parse-options callbacks parse-options-cb.c 8d2aa8df 108) BUG_ON_OPT_NEG(unset); Jeff King b992657e argv-array: add detach function strvec.c b992657e 103) return xcalloc(1, sizeof(const char *)); Jeff King 3c078b9c fast-import: clean up pack_data pointer in end_packfile builtin/fast-import.c 3c078b9c 844) return; Jeff King ef8d7ac4 strvec: convert more callers away from argv_array name column.c ef8d7ac4 372) strvec_pushf(argv, "--width=%d", opts->width); ef8d7ac4 374) strvec_pushf(argv, "--indent=%s", opts->indent); compat/terminal.c ef8d7ac4 276) strvec_pushl(&cp.args, "infocmp", "-L", "-1", NULL); connect.c ef8d7ac4 1236) strvec_push(args, "-6"); daemon.c ef8d7ac4 490) static int upload_archive(const struct strvec *env) ef8d7ac4 493) strvec_push(&cld.args, "upload-archive"); ef8d7ac4 803) strvec_clear(&env); ef8d7ac4 924) strvec_pushf(&cld.env_array, "REMOTE_ADDR=[%s]", buf); ef8d7ac4 925) strvec_pushf(&cld.env_array, "REMOTE_PORT=%d", exec-cmd.c ef8d7ac4 342) strvec_clear(&nargv); imap-send.c ef8d7ac4 979) strvec_push(&tunnel.args, srvc->tunnel); Jeff King 957876f1 combine-diff: handle --find-object in multitree code path combine-diff.c 957876f1 1464) return 0; 957876f1 1482) free(p); Jeff King e2770979 credentials: add "cache" helper builtin/credential-cache--daemon.c e2770979 89) return 0; e2770979 113) return -1; e2770979 169) return 0; e2770979 174) if (errno != EINTR) e2770979 175) die_errno("poll failed"); e2770979 176) return 1; e2770979 186) return 1; e2770979 191) close(client); e2770979 192) return 1; e2770979 210) die_errno("unable to bind to '%s'", socket_path); e2770979 222) close(fd); e2770979 223) } e2770979 299) return 0; builtin/credential-cache.c e2770979 23) die_errno("unable to write to cache daemon"); e2770979 34) die_errno("read error from cache daemon"); e2770979 56) die_errno("unable to start cache daemon"); e2770979 59) die_errno("unable to read result code from cache daemon"); e2770979 74) die_errno("unable to relay credential"); Jeff King 6479ea4a xrealloc: do not reuse pointer freed by zero-length realloc() wrapper.c 6479ea4a 121) free(ptr); 6479ea4a 122) return xmalloc(0); Jeff King f0939a0e trailer: add interface for iterating over commit trailers trailer.c f0939a0e 1204) continue; /* not a real trailer */ Jeff King ae021d87 use skip_prefix to avoid magic numbers builtin/fast-import.c ae021d87 3337) if (!git_parse_ulong(option, &v)) Jeff King 8ec6c8d7 credential-cache: report more daemon connection errors builtin/credential-cache.c 8ec6c8d7 83) die_errno("unable to connect to cache daemon"); Jeff King 71e1b4b6 credentials: add "store" helper builtin/credential-store.c 71e1b4b6 22) die_errno("unable to open %s", fn); 71e1b4b6 62) die_errno("unable to get credential storage lock"); Jeff King c972bf4c strvec: convert remaining callers away from argv_array name midx.c c972bf4c 1441) strvec_push(&cmd.args, "--delta-islands"); pager.c c972bf4c 71) static void setup_pager_env(struct strvec *env) c972bf4c 91) strvec_push(env, argv[i]); c972bf4c 100) strvec_push(&pager_process->args, pager); c972bf4c 129) strvec_push(&pager_process.env_array, "GIT_PAGER_IN_USE"); remote-curl.c c972bf4c 1157) strvec_pushl(&args, "-v", "-v", NULL); c972bf4c 1163) strvec_push(&args, "--update-shallow"); c972bf4c 1169) strvec_pushf(&args, "--shallow-since=%s", options.deepen_since); c972bf4c 1171) strvec_pushf(&args, "--shallow-exclude=%s", c972bf4c 1174) strvec_push(&args, "--deepen-relative"); c972bf4c 1176) strvec_push(&args, "--from-promisor"); c972bf4c 1178) strvec_pushf(&args, "--filter=%s", options.filter); c972bf4c 1274) strvec_push(&child.args, "--dry-run"); c972bf4c 1302) strvec_push(&args, "--dry-run"); c972bf4c 1306) strvec_push(&args, "--signed=if-asked"); c972bf4c 1310) strvec_push(&args, "--quiet"); sequencer.c c972bf4c 3680) strvec_push(&cmd.args, opts->gpg_sign); submodule.c c972bf4c 690) strvec_pushf(&cp.args, "--src-prefix=%s%s/", c972bf4c 692) strvec_pushf(&cp.args, "--dst-prefix=%s%s/", c972bf4c 1790) strvec_push(&cp.args, "-uno"); c972bf4c 1795) strvec_push(&cp.args, "--ignored"); t/helper/test-run-command.c c972bf4c 75) strvec_pushl(&cp->args, "sh", test, NULL); c972bf4c 77) strvec_push(&cp->args, "--quiet"); c972bf4c 79) strvec_push(&cp->args, "-i"); c972bf4c 81) strvec_push(&cp->args, "-v"); c972bf4c 83) strvec_push(&cp->args, "-V"); c972bf4c 85) strvec_push(&cp->args, "-x"); c972bf4c 87) strvec_push(&cp->args, "--write-junit-xml"); c972bf4c 223) struct strvec args = STRVEC_INIT; c972bf4c 244) strvec_clear(&args); c972bf4c 246) strvec_pushl(&args, "sh", "-c", c972bf4c 249) strvec_pushl(&args, "test-tool", "run-command", c972bf4c 257) strvec_push(&args, argv[j]); c972bf4c 271) strvec_push(&args, buf); c972bf4c 304) strvec_clear(&args); c972bf4c 314) strvec_clear(&args); c972bf4c 341) strvec_pushl(&cp.args, tmp-objdir.c c972bf4c 102) strvec_pushf(env, "%s=%s%c%s", key, old, PATH_SEP, val); transport-helper.c c972bf4c 448) strvec_pushf(&fastimport->args, "--cat-blob-fd=%d", cat_blob_fd); upload-pack.c c972bf4c 309) strvec_pushf(&pack_objects.args, "--filter=%s", buf.buf); Jeff King fbff95b6 index-pack: adjust default threading cap builtin/index-pack.c fbff95b6 1855) else if (nr_threads < 6) fbff95b6 1856) nr_threads = 3; /* historic cap */ fbff95b6 1857) else if (nr_threads < 40) fbff95b6 1858) nr_threads /= 2; fbff95b6 1860) nr_threads = 20; /* hard cap */ Jeff King e885a84f drop unused argc parameters t/helper/test-submodule-nested-repo-config.c e885a84f 4) static void die_usage(const char **argv, const char *msg) e885a84f 17) die_usage(argv, "Wrong number of arguments."); e885a84f 23) die_usage(argv, "Submodule not found."); Jeff King f6d8942b strvec: fix indentation in renamed calls builtin/rebase.c f6d8942b 873) opts->git_format_patch_opt.buf); daemon.c f6d8942b 926) ntohs(sin6_addr->sin6_port)); remote-curl.c f6d8942b 1172) options.deepen_not.items[i].string); Jiang Xin 63518a57 New capability "report-status-v2" for git-push send-pack.c 63518a57 183) if (!once++) 63518a57 185) ret = -1; 63518a57 186) continue; 63518a57 223) ret = -1; 63518a57 224) break; 63518a57 241) hint->status != REF_STATUS_OK && 63518a57 242) hint->status != REF_STATUS_REMOTE_REJECT) { 63518a57 440) else if (server_supports("report-status")) transport-helper.c 63518a57 839) state->hint = find_ref_by_name(remote_refs, refname); 63518a57 895) continue; 63518a57 900) for (report = ref->report; report; report = report->next) { 63518a57 901) private = apply_refspecs(&data->rs, 63518a57 902) report->ref_name 63518a57 905) if (!private) 63518a57 906) continue; 63518a57 907) update_ref("update by helper", private, 63518a57 908) report->new_oid 63518a57 912) free(private); Jiang Xin 31e8595a receive-pack: new config receive.procReceiveRefs builtin/receive-pack.c 31e8595a 246) return config_error_nonbool(var); 31e8595a 394) return 0; 31e8595a 1911) continue; Jiang Xin 15d3af5e receive-pack: add new proc-receive hook builtin/receive-pack.c 15d3af5e 1124) return code; 15d3af5e 1132) if (use_sideband) 15d3af5e 1133) finish_async(&muxer); 15d3af5e 1134) return code; t/helper/test-proc-receive.c 15d3af5e 136) usage_msg_opt("Too many arguments.", proc_receive_usage, options); Jim Meyering 5a7b1b57 fast-import: Don't use a maybe-clobbered errno value builtin/fast-import.c 5a7b1b57 1705) int saved_errno = errno; Johan Herland a8dd2e7d fast-import: Add support for importing commit notes builtin/fast-import.c a8dd2e7d 2504) if (type < 0) a8dd2e7d 2506) if (type != OBJ_BLOB) Johannes Schindelin 40db58b8 fast-import: Fix compile warnings builtin/fast-import.c 40db58b8 1892) (unsigned long)(length - n)); Johannes Schindelin c5aa6db6 argv_array: offer to split a string by whitespace strvec.c c5aa6db6 72) to_split++; Jon Griffiths a6e5e286 credential-cache--daemon: refactor check_socket_directory builtin/credential-cache--daemon.c a6e5e286 247) die_errno("unable to create directories for '%s'", dir); a6e5e286 249) die_errno("unable to mkdir '%s'", dir); Jonathan Nieder dc01f59d fast-import: treat SIGUSR1 as a request to access objects early builtin/fast-import.c dc01f59d 430) static void checkpoint_signal(int signo) dc01f59d 432) checkpoint_requested = 1; dc01f59d 433) } Jonathan Nieder 5edde510 fast-import: filemodify after M 040000 <tree> "" crashes builtin/fast-import.c 5edde510 1495) load_tree(root); Jonathan Nieder c27e559d fast-import: leakfix for 'ls' of dirty trees builtin/fast-import.c c27e559d 3182) release_tree_content_recursive(leaf.tree); Jonathan Tan f08cbf60 index-pack: make quantum of work smaller builtin/index-pack.c f08cbf60 424) list_for_each_prev(pos, &done_head) { f08cbf60 425) struct base_data *b = list_entry(pos, struct base_data, list); f08cbf60 426) if (b->retain_data || b == retain) f08cbf60 427) continue; f08cbf60 428) if (b->data) { f08cbf60 429) free_base_data(b); f08cbf60 430) if (base_cache_used <= base_cache_limit) f08cbf60 431) return; f08cbf60 435) list_for_each_prev(pos, &work_head) { f08cbf60 436) struct base_data *b = list_entry(pos, struct base_data, list); f08cbf60 437) if (b->retain_data || b == retain) f08cbf60 438) continue; f08cbf60 439) if (b->data) { f08cbf60 440) free_base_data(b); f08cbf60 441) if (base_cache_used <= base_cache_limit) f08cbf60 442) return; f08cbf60 925) base_cache_used += c->size; f08cbf60 941) base_cache_used += c->size; Jonathan Tan ee47243d pack-objects: no fetch when allow-{any,promisor} builtin/pack-objects.c ee47243d 3065) if (!has_object(the_repository, &obj->oid, 0) && is_promisor_object(&obj->oid)) Jonathan Tan f24c30e0 wt-status: tolerate dangling marks builtin/show-branch.c f24c30e0 744) if (!dwim_ref(*av, strlen(*av), &oid, &ref, 0)) Jonathan Tan 1d8d9cb6 sha1-file: introduce no-lazy-fetch has_object() sha1-file.c 1d8d9cb6 2000) return 0; Jonathan Tan 7ca3c0ac promisor-remote: lazy-fetch objects in subprocess promisor-remote.c 7ca3c0ac 35) die_errno(_("promisor-remote: could not write to fetch subprocess")); 7ca3c0ac 37) die_errno(_("promisor-remote: could not write to fetch subprocess")); 7ca3c0ac 41) die_errno(_("promisor-remote: could not close stdin to fetch subprocess")); Jonathan Tan cbe566a0 negotiator/noop: add noop fetch negotiator negotiator/noop.c cbe566a0 6) static void known_common(struct fetch_negotiator *n, struct commit *c) cbe566a0 9) } cbe566a0 21) static int ack(struct fetch_negotiator *n, struct commit *c) Jonathan Tan 5c3b801d fetch-pack: do not lazy-fetch during ref iteration fetch-pack.c 5c3b801d 126) return NULL; Jonathan Tan e5b94213 fetch: avoid reading submodule config until needed submodule-config.c e5b94213 780) if (config->max_children) e5b94213 781) *(config->max_children) = e5b94213 782) parse_submodule_fetchjobs(var, value); e5b94213 785) if (config->recurse_submodules) e5b94213 786) *(config->recurse_submodules) = e5b94213 787) parse_fetch_recurse_submodules_arg(var, value); Junio C Hamano 6c526148 csum-file: introduce sha1file_checkpoint builtin/fast-import.c 6c526148 1157) truncate_pack(&checkpoint); Junio C Hamano e0ad9574 Merge branch 'bc/sha-256-part-3' builtin/verify-pack.c e0ad9574 22) strvec_push(argv, "--verify-stat-only"); setup.c e0ad9574 497) return config_error_nonbool(var); Junio C Hamano 6854689e Merge branch 'ar/fetch-ipversion-in-all' builtin/fetch.c 6854689e 1568) strvec_push(argv, "--ipv4"); 6854689e 1570) strvec_push(argv, "--ipv6"); Junio C Hamano ebcfb379 write_idx_file: introduce a struct to hold idx customization options builtin/fast-import.c ebcfb379 3455) if (pack_idx_opts.version > 2) Junio C Hamano 9ed104e5 ident: say whose identity is missing when giving user.name hint ident.c 9ed104e5 359) break; 9ed104e5 401) ident_env_hint(whose_ident); 9ed104e5 418) ident_env_hint(whose_ident); 9ed104e5 424) ident_env_hint(whose_ident); Junio C Hamano 55bb5c91 zlib: wrap deflate side of the API builtin/fast-import.c 55bb5c91 997) git_deflate_init(&s, pack_compression_level); 55bb5c91 1002) while (git_deflate(&s, Z_FINISH) == Z_OK) 55bb5c91 1004) git_deflate_end(&s); Junio C Hamano 76ea93cc fast-import.c: Fix big-file-threshold parsing bug builtin/fast-import.c 76ea93cc 3350) return 0; Junio C Hamano 88910c99 quote_path: give flags parameter to quote_path() builtin/clean.c 88910c99 217) quote_path(path->buf, prefix, "ed, 0); 88910c99 241) quote_path(path->buf, prefix, "ed, 0); 88910c99 1057) qname = quote_path(item->string, NULL, &buf, 0); Junio C Hamano 225a6f10 zlib: wrap deflateBound() too builtin/fast-import.c 225a6f10 1000) s.avail_out = git_deflate_bound(&s, s.avail_in); Junio C Hamano 6e6029a8 fmt-merge-msg: allow merge destination to be omitted again fmt-merge-msg.c 6e6029a8 29) return config_error_nonbool(key); Junio C Hamano 4d0cc224 fast-import: count --max-pack-size in bytes builtin/fast-import.c 4d0cc224 3338) return 0; 4d0cc224 3339) if (v < 8192) { 4d0cc224 3341) v *= 1024 * 1024; 4d0cc224 3342) } else if (v < 1024 * 1024) { 4d0cc224 3344) v = 1024 * 1024; 4d0cc224 3346) max_packsize = v; Lin Sun dbd8c09b mergetool: allow auto-merge for meld to follow the vim-diff behavior builtin/config.c dbd8c09b 99) new_type = TYPE_BOOL_OR_STR; dbd8c09b 258) int v = git_parse_maybe_bool(value_); dbd8c09b 259) if (v < 0) dbd8c09b 260) strbuf_addstr(buf, value_); dbd8c09b 262) strbuf_addstr(buf, v ? "true" : "false"); dbd8c09b 425) int v = git_parse_maybe_bool(value); dbd8c09b 426) if (v < 0) dbd8c09b 427) return xstrdup(value); dbd8c09b 429) return xstrdup(v ? "true" : "false"); Martin Ågren 8f7e3de0 wt-status: print to s->fp, not stdout wt-status.c 8f7e3de0 1859) fprintf(s->fp, " %s%c", it->string, 0); Matheus Tavares bda959c4 packfile: fix memory leak in add_delta_base_cache() packfile.c bda959c4 1487) free(base); Michael Forney ea3f7e59 revision: use repository from rev_info when parsing commits revision.c ea3f7e59 1058) if (repo_parse_commit(revs->repo, p) < 0) Michael Haggerty 9e903316 credential-cache--daemon: use tempfile module builtin/credential-cache--daemon.c 9e903316 297) delete_tempfile(&socket_file); Mike Hommey 0df32457 fast-import: do less work when given "from" matches current branch head builtin/fast-import.c 0df32457 2600) release_tree_content_recursive(b->branch_tree.tree); 0df32457 2601) b->branch_tree.tree = NULL; Miriam Rubio 7b4de74b bisect--helper: introduce new `write_in_file()` function builtin/bisect--helper.c 7b4de74b 97) return error_errno(_("cannot open file '%s' in mode '%s'"), path, mode); 7b4de74b 101) int saved_errno = errno; 7b4de74b 102) fclose(fp); 7b4de74b 103) errno = saved_errno; 7b4de74b 104) return error_errno(_("could not write to file '%s'"), path); Nguyễn Thái Ngọc Duy 26604f9f credential-cache--daemon.c: use warning_errno() builtin/credential-cache--daemon.c 26604f9f 185) warning_errno("accept failed"); 26604f9f 190) warning_errno("dup failed"); Nguyễn Thái Ngọc Duy d3b4705a sha1-file.c: remove the_repo from read_object_with_reference() builtin/fast-import.c d3b4705a 2648) char *buf = read_object_with_reference(the_repository, d3b4705a 2649) &n->oid, Nguyễn Thái Ngọc Duy 6c223e49 fast-import.c: use error_errno() builtin/fast-import.c 6c223e49 320) error_errno("can't write crash report %s", loc); 6c223e49 1698) failure |= error_errno("Unable to write marks file %s", 6c223e49 1714) failure |= error_errno("Unable to write file %s", Nicolas Pitre 3fc366bd fast-import: start using struct pack_idx_entry builtin/fast-import.c 3fc366bd 1155) e->idx.offset = 1; /* just not zero! */ Noam Postavsky 7f4d4746 credential-cache: new option to ignore sighup builtin/credential-cache--daemon.c 7f4d4746 294) signal(SIGHUP, SIG_IGN); Paul Tan cb2c2796 git-credential-store: support multiple credential files builtin/credential-store.c cb2c2796 103) return; cb2c2796 131) return; cb2c2796 170) string_list_append(&fns, file); Phillip Wood a3894aad rebase -i: support --ignore-date sequencer.c a3894aad 1448) goto out; a3894aad 1453) goto out; a3894aad 1479) goto out; Phillip Wood 7573cec5 rebase -i: support --committer-date-is-author-date sequencer.c 7573cec5 4498) return -1; 7573cec5 5395) goto cleanup; Phillip Wood ce910287 add -p: fix checking of user input add-patch.c ce910287 1508) if (permitted & ALLOW_GOTO_PREVIOUS_HUNK) ce910287 1513) if (permitted & ALLOW_GOTO_NEXT_HUNK) ce910287 1518) if (permitted & ALLOW_GOTO_PREVIOUS_UNDECIDED_HUNK) ce910287 1523) if (permitted & ALLOW_GOTO_NEXT_UNDECIDED_HUNK) Phillip Wood 75a009dc add -p: fix editing of intent-to-add paths add-patch.c 75a009dc 1398) undecided_previous = i; 75a009dc 1399) break; 75a009dc 1421) permitted |= ALLOW_GOTO_PREVIOUS_UNDECIDED_HUNK; 75a009dc 1422) strbuf_addstr(&s->buf, ",k"); 75a009dc 1484) if (file_diff->hunk_nr) { 75a009dc 1485) for (; hunk_index < file_diff->hunk_nr; hunk_index++) { 75a009dc 1486) hunk = file_diff->hunk + hunk_index; 75a009dc 1487) if (hunk->use == UNDECIDED_HUNK) 75a009dc 1488) hunk->use = USE_HUNK; 75a009dc 1490) } else if (hunk->use == UNDECIDED_HUNK) { 75a009dc 1491) hunk->use = USE_HUNK; 75a009dc 1500) } else if (hunk->use == UNDECIDED_HUNK) { 75a009dc 1501) hunk->use = SKIP_HUNK; Pierre Habouzit eec813cf fast-import was using dbuf's, replace them with strbuf's. builtin/fast-import.c eec813cf 998) s.next_in = (void *)dat->buf; eec813cf 999) s.avail_in = dat->len; Pranit Bauva 517ecb31 bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C builtin/bisect--helper.c 517ecb31 529) return res; 517ecb31 533) return error_errno(_("could not open '%s' for appending"), 517ecb31 537) return error_errno(_("failed to write to '%s'"), git_path_bisect_log()); 517ecb31 586) return BISECT_FAILED; Pranit Bauva 09535f05 bisect--helper: reimplement `bisect_autostart` shell function in C builtin/bisect--helper.c 09535f05 827) fprintf_ln(stderr, _("You need to start by \"git bisect " 09535f05 830) if (!isatty(STDIN_FILENO)) 09535f05 831) return -1; 09535f05 838) yesno = git_prompt(_("Do you want me to do it for you " 09535f05 840) res = tolower(*yesno) == 'n' ? 09535f05 841) -1 : bisect_start(terms, empty_strvec, 0); 09535f05 843) return res; Prathamesh Chavan e83e3333 submodule: port submodule subcommand 'summary' from shell to C builtin/submodule--helper.c e83e3333 1091) missing_dst = 1; e83e3333 1142) strbuf_addf(&errmsg_str, " Warn: %s doesn't contain commits %s and %s\n", e83e3333 1143) displaypath, oid_to_hex(&p->oid_src), e83e3333 1144) oid_to_hex(&p->oid_dst)); e83e3333 1149) oid_to_hex(&p->oid_dst)); e83e3333 1271) return -1; e83e3333 1275) return -1; e83e3333 1319) return 0; Randall S. Becker f64b6a1f bugreport.c: replace strbuf_write_fd with write_in_full builtin/bugreport.c f64b6a1f 178) die_errno(_("unable to write to %s"), report_path.buf); René Scharfe 24b75faf connected: use buffered I/O to talk to rev-list connected.c 24b75faf 143) if (errno != EPIPE && errno != EINVAL) 24b75faf 144) error_errno(_("failed write to rev-list")); 24b75faf 145) err = -1; René Scharfe bcd2c5ee read-cache: fix mem-pool allocation for multi-threaded index loading read-cache.c bcd2c5ee 2104) p->ce_mem_pool = xmalloc(sizeof(*istate->ce_mem_pool)); René Scharfe 2947a793 archive: add --add-file archive.c 2947a793 345) err = error_errno(_("could not read '%s'"), path); 2947a793 352) break; 2947a793 513) string_list_clear_func(&args->extra_files, 2947a793 515) return 0; 2947a793 519) return -1; René Scharfe a698d67b upload-pack: use buffered I/O to talk to rev-list upload-pack.c a698d67b 661) if (cmd_in) a698d67b 662) fclose(cmd_in); Ronnie Sahlberg 3f09ba75 fast-import.c: use a ref transaction when dumping tags builtin/fast-import.c 3f09ba75 1662) goto cleanup; 3f09ba75 1671) goto cleanup; Ronnie Sahlberg de7e86f5 fast-import.c: change update_branch to use ref transactions builtin/fast-import.c de7e86f5 1630) ref_transaction_free(transaction); de7e86f5 1632) strbuf_release(&err); de7e86f5 1633) return -1; Ryan Zoeller a0abe5e3 parse-options: add --git-completion-helper-all parse-options.c a0abe5e3 736) return show_gitcomp(options, 1); Sergey Organov d01141de diff: get rid of redundant 'dense' argument diff-lib.c d01141de 362) show_combined_diff(p, 2, revs); Shawn O. Pearce d9ee53ce Implemented automatic checkpoints within fast-import. builtin/fast-import.c d9ee53ce 990) e->pack_id = pack_id + 1; d9ee53ce 994) if (delta) { Shawn O. Pearce 820b9310 Dump all refs and marks during a checkpoint in fast-import. builtin/fast-import.c 820b9310 991) cycle_packfile(); Shawn O. Pearce 60b9004c Use atomic updates to the fast-import mark file builtin/fast-import.c 60b9004c 1700) return; 60b9004c 1706) rollback_lock_file(&mark_lock); 60b9004c 1709) return; Shawn O. Pearce 5eef828b fast-import: Stream very large blobs directly to pack builtin/fast-import.c 5eef828b 1063) die_errno("cannot truncate pack to skip duplicate"); 5eef828b 1085) cycle_packfile(); 5eef828b 1153) e->type = OBJ_BLOB; 5eef828b 1154) e->pack_id = MAX_PACK_ID; 5eef828b 1156) duplicate_count_by_type[OBJ_BLOB]++; Shawn O. Pearce b6f3481b Teach fast-import to recursively copy files/directories builtin/fast-import.c b6f3481b 720) return NULL; b6f3481b 727) b->tree = dup_tree_content(a->tree); b6f3481b 1576) return 0; b6f3481b 1582) return 0; Shawn O. Pearce afde8dd9 Fixed segfault in fast-import after growing a tree. builtin/fast-import.c afde8dd9 1424) release_tree_content_recursive(e->tree); Shawn O. Pearce 5d6f3ef6 Corrected buffer overflow during automatic checkpoint in fast-import. builtin/fast-import.c 5d6f3ef6 1001) s.next_out = out = xrealloc(out, s.avail_out); Shawn O. Pearce 63e0c8b3 Support RFC 2822 date parsing in fast-import. builtin/fast-import.c 63e0c8b3 1920) return -1; 63e0c8b3 1978) break; Shawn O. Pearce 463acbe1 Added tree and commit writing to fast-import. builtin/fast-import.c 463acbe1 640) l->next_avail = f->next_avail; 463acbe1 1227) return NULL; 463acbe1 1456) return 0; 463acbe1 2032) e = active_branches; 463acbe1 2033) active_branches = e->active_next_branch; Shawn O. Pearce bdf1c06d fast-import: Hide the pack boundary commits by default. builtin/fast-import.c bdf1c06d 891) if (t->pack_id == pack_id) Shawn O. Pearce 2f6dc35d fast-import: Fail if a non-existant commit is used for merge builtin/fast-import.c 2f6dc35d 2654) free(buf); Shawn O. Pearce 8acb3297 Generate crash reports on die in fast-import builtin/fast-import.c 8acb3297 305) fprintf(rpt, "%u", b->pack_id); 8acb3297 322) return; Shawn O. Pearce 69e74e74 Correct packfile edge output in fast-import. builtin/fast-import.c 69e74e74 2860) t->pack_id = MAX_PACK_ID; Shawn O. Pearce bb23fdfa Teach fast-import to honor pack.compression and pack.depth builtin/fast-import.c bb23fdfa 3450) if (max_depth > MAX_DEPTH) bb23fdfa 3451) max_depth = MAX_DEPTH; Stefan Beller 0df8e965 cache.h: add repository argument to oid_object_info builtin/fast-import.c 0df8e965 2502) enum object_type type = oid_object_info(the_repository, &oid, Sverre Rabbelier 9c8398f0 fast-import: add option command builtin/fast-import.c 9c8398f0 3500) usage(fast_import_usage); Sverre Rabbelier 0f6927c2 fast-import: put option parsing code in separate functions builtin/fast-import.c 0f6927c2 3284) if (max_depth > MAX_DEPTH) 0f6927c2 3286) } 0f6927c2 3309) fclose(pack_edges); 0f6927c2 3361) show_stats = 1; SZEDER Gábor 87d01c85 credential-store: don't pass strerror to die_errno() builtin/credential-store.c 87d01c85 67) die_errno("unable to write credential store"); SZEDER Gábor 17e6275f commit-graph: simplify chunk writes into loop commit-graph.c 17e6275f 1821) return -1; Tanay Abhra 536900e5 fast-import.c: replace `git_config()` with `git_config_get_*()` family builtin/fast-import.c 536900e5 3454) pack_idx_opts.version = indexversion_value; 536900e5 3456) git_die_config("pack.indexversion", 536900e5 3460) max_packsize = packsizelimit_value; Taylor Blau 809e0327 builtin/commit-graph.c: introduce '--max-new-filters=<n>' builtin/commit-graph.c 809e0327 175) *to = -1; Taylor Blau b9ea2147 list_objects_filter_options: introduce 'list_object_filter_config_name' list-objects-filter-options.c b9ea2147 23) break; b9ea2147 36) break; Taylor Blau 6dd3456a upload-pack.c: allow banning certain object filter(s) upload-pack.c 6dd3456a 1078) die_if_using_banned_filter(data); Taylor Blau 5b01a4e8 upload-pack.c: introduce 'uploadpackfilter.tree.maxDepth' upload-pack.c 5b01a4e8 1259) strbuf_release(&buf); 5b01a4e8 1260) return config_error_nonbool(var); Taylor Blau 59f0d507 bloom: encode out-of-bounds filters as non-empty bloom.c 59f0d507 294) init_truncated_large_filter(filter); Taylor Blau ab14d067 commit-graph: pass a 'struct repository *' in more places fuzz-commit-graph.c ab14d067 14) g = parse_commit_graph(the_repository, (void *)data, size); Taylor Blau 98bb7961 commit-graph: rename 'split_commit_graph_opts' commit-graph.c 98bb7961 2218) ctx->oids.alloc = opts->max_commits; Taylor Blau 312cff52 bloom: split 'get_bloom_filter()' in two bloom.c 312cff52 296) if (computed) 312cff52 297) *computed |= BLOOM_TRUNC_LARGE; Thomas Rast 0721c314 Use die_errno() instead of die() when checking syscalls builtin/fast-import.c 0721c314 793) die_errno("cannot create keep file"); 0721c314 796) die_errno("failed to write keep file");
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. The preview release for the upcoming Git 2.29 has been tagged. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * ab/mediawiki-fixes (2020-09-21) 18 commits (merged to 'next' on 2020-09-25 at 878693716e) + remote-mediawiki: use "sh" to eliminate unquoted commands + remote-mediawiki: annotate unquoted uses of run_git() + remote-mediawiki: convert to quoted run_git() invocation + remote-mediawiki: provide a list form of run_git() + remote-mediawiki tests: annotate failing tests + remote-mediawiki: fix duplicate revisions being imported + remote-mediawiki tests: use CLI installer + remote-mediawiki tests: use inline PerlIO for readability + remote-mediawiki tests: replace deprecated Perl construct + remote-mediawiki tests: use a more idiomatic dispatch table + remote-mediawiki tests: use "$dir/" instead of "$dir." + remote-mediawiki tests: change `[]` to `test` + remote-mediawiki tests: use test_cmp in tests + remote-mediawiki tests: use a 10 character password + remote-mediawiki tests: use the login/password variables + remote-mediawiki doc: don't hardcode Debian PHP versions + remote-mediawiki doc: link to MediaWiki's current version + remote-mediawiki doc: correct link to GitHub project Modernization and fixes to MediaWiki remote backend. * al/ref-filter-merged-and-no-merged (2020-09-26) 1 commit (merged to 'next' on 2020-09-29 at 748a286753) + ref-filter: plug memory leak in reach_filter() Hotfix. * au/complete-restore-s (2020-09-26) 2 commits (merged to 'next' on 2020-09-29 at 7bbf508562) + completion: complete refs after 'git restore -s' + completion: use "prev" variable instead of introducing "prevword" The command line completion (in contrib/) learned that "git restore -s <TAB>" is often followed by a refname. * cc/bisect-start-fix (2020-09-25) 1 commit (merged to 'next' on 2020-09-29 at 637011d04a) + bisect: don't use invalid oid as rev when starting "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. * ds/in-merge-bases-many-optim-bug (2020-10-02) 1 commit (merged to 'next' on 2020-10-04 at b736873ada) + commit-reach: fix in_merge_bases_many bug (this branch is used by sk/force-if-includes.) in_merge_bases_many(), a way to see if a commit is reachable from any commit in a set of commits, was totally broken when the commit-graph feature was in use, which has been corrected. * eg/mailinfo-doc-scissors (2020-09-28) 1 commit (merged to 'next' on 2020-09-29 at 4694f22fe9) + Doc: show example scissors line The explanation of the "scissors line" has been clarified. * jc/blame-ignore-fix (2020-09-24) 2 commits (merged to 'next' on 2020-09-29 at 96fbdb57fb) + blame: validate and peel the object names on the ignore list + t8013: minimum preparatory clean-up "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. * jc/fmt-merge-msg-suppress-destination (2020-09-27) 1 commit (merged to 'next' on 2020-09-29 at 2b1f8ee654) + config/fmt-merge-msg.txt: drop space in quote Docfix. * jc/sequencer-stopped-sha-simplify (2020-09-25) 1 commit (merged to 'next' on 2020-09-29 at 9af3360572) + sequencer: stop abbreviating stopped-sha file Code simplification. * jk/diff-cc-oidfind-fix (2020-09-30) 1 commit (merged to 'next' on 2020-10-04 at 637072574f) + combine-diff: handle --find-object in multitree code path "log -c --find-object=X" did not work well to find a merge that involves a change to an object X from only one parent. * jk/drop-unaligned-loads (2020-09-24) 2 commits (merged to 'next' on 2020-09-29 at 29c05387a0) + Revert "fast-export: use local array to store anonymized oid" + bswap.h: drop unaligned loads Compilation fix around type punning. * jk/format-auto-base-when-able (2020-10-01) 1 commit (merged to 'next' on 2020-10-04 at ab8f65b8c5) + format-patch: teach format.useAutoBase "whenAble" option "git format-patch" learns to take "whenAble" as a possible value for the format.useAutoBase configuration variable to become no-op when the automatically computed base does not make sense. * jk/refspecs-negative (2020-09-30) 1 commit (merged to 'next' on 2020-10-04 at 2948e90fab) + refspec: add support for negative refspecs "git fetch" and "git push" support negative refspecs. * jk/shortlog-group-by-trailer (2020-09-27) 8 commits (merged to 'next' on 2020-09-29 at 3706b06db5) + shortlog: allow multiple groups to be specified + shortlog: parse trailer idents + shortlog: rename parse_stdin_ident() + shortlog: de-duplicate trailer values + shortlog: match commit trailers with --group + trailer: add interface for iterating over commit trailers + shortlog: add grouping option + shortlog: change "author" variables to "ident" "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. * jk/unused (2020-09-30) 10 commits (merged to 'next' on 2020-10-01 at 440a7a0a7a) + dir.c: drop unused "untracked" from treat_path_fast() + sequencer: handle ignore_footer when parsing trailers + test-advise: check argument count with argc instead of argv + sparse-checkout: fill in some options boilerplate + sequencer: drop repository argument from run_git_commit() + push: drop unused repo argument to do_push() + assert PARSE_OPT_NONEG in parse-options callbacks + env--helper: write to opt->value in parseopt helper + drop unused argc parameters + convert: drop unused crlf_action from check_global_conv_flags_eol() Code cleanup. * js/cmake-vs (2020-09-30) 10 commits (merged to 'next' on 2020-10-01 at 40be8c6094) + hashmap_for_each_entry(): workaround MSVC's runtime check failure #3 + cmake (Windows): recommend using Visual Studio's built-in CMake support + cmake (Windows): initialize vcpkg/build dependencies automatically + cmake (Windows): complain when encountering an unknown compiler + cmake (Windows): let the `.dll` files be found when running the tests + cmake: quote the path accurately when editing `test-lib.sh` + cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows + cmake: ensure that the `vcpkg` packages are found on Windows + cmake: do find Git for Windows' shell interpreter + cmake: ignore files generated by CMake as run in Visual Studio Using the CMake support we added some time ago for real with Visual Studio build revealed there were lot of usability improvements possible, which have been carried out. * js/default-branch-name-part-2 (2020-09-26) 5 commits (merged to 'next' on 2020-09-30 at 3fb4047ce3) + t9902: avoid using the branch name `master` + tests: avoid variations of the `master` branch name + t3200: avoid variations of the `master` branch name + fast-export: avoid using unnecessary language in a code comment + t/test-terminal: avoid non-inclusive language Update the tests to drop word 'master' from them. * js/no-builtins-on-disk-option (2020-09-21) 3 commits (merged to 'next' on 2020-09-25 at 6b976da4d2) + ci: stop linking built-ins to the dashed versions + Optionally skip linking/copying the built-ins + msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. * jt/keep-partial-clone-filter-upon-lazy-fetch (2020-09-28) 2 commits (merged to 'next' on 2020-10-01 at 77c4c6094c) + fetch: do not override partial clone filter + promisor-remote: remove unused variable The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damage to the partial clone filter in the repository, which has been corrected. * ma/worktree-cleanups (2020-09-27) 7 commits (merged to 'next' on 2020-10-01 at 369dcfb161) + worktree: use skip_prefix to parse target + worktree: rename copy-pasted variable + worktree: update renamed variable in comment + worktree: inline `worktree_ref()` into its only caller + wt-status: introduce wt_status_state_free_buffers() + wt-status: print to s->fp, not stdout + wt-status: replace sha1 mentions with oid Code clean-up. * mr/bisect-in-c-2 (2020-09-24) 6 commits (merged to 'next' on 2020-09-29 at a15f1729d2) + bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C + bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' + bisect--helper: reimplement `bisect_autostart` shell function in C + bisect--helper: introduce new `write_in_file()` function + bisect--helper: use '-res' in 'cmd_bisect__helper' return + bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. * mt/delta-base-cache-races (2020-09-28) 2 commits (merged to 'next' on 2020-09-29 at ee2d60c077) + packfile: fix memory leak in add_delta_base_cache() + packfile: fix race condition on unpack_entry() A race that leads to an access to a free'd data was corrected in the codepath that reads pack files. * nl/credential-crlf (2020-10-03) 1 commit (merged to 'next' on 2020-10-04 at 213256c1e6) + credential: treat CR/LF as line endings in the credential protocol Loosen the parser in the receiving end of the credential protocol to allow credential helper to terminate lines with CRLF line ending, as well as LF line ending. * pb/submodule-doc-fix (2020-10-04) 1 commit (merged to 'next' on 2020-10-04 at c535486479) + gitsubmodules doc: invoke 'ls-files' with '--recurse-submodules' Doc update. * pm/gitk-update (2020-10-03) 11 commits (merged to 'next' on 2020-10-04 at fd505ccfc1) + Merge remote-tracking branch 'paulus/master' into pm/gitk-update + gitk: Resize panes correctly when reducing window size + gitk: replace tabs with spaces + gitk: fix the context menu not appearing in the presence of submodule diffs + gitk: Un-hide selection in areas with non-default background color + gitk: add diff lines background colors + gitk: be prepared to be run in a bare repository + gitk: Preserve window dimensions on exit when not using ttk themes + gitk: don't highlight files after submodules as submodules + gitk: fix branch name encoding error + gitk: rename "commit summary" to "commit reference" "gitk" update. * rs/archive-add-file (2020-09-19) 3 commits (merged to 'next' on 2020-10-04 at fffc088553) + Makefile: use git-archive --add-file + archive: add --add-file + archive: read short blobs in archive.c::write_archive_entry() "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * sn/fast-import-doc (2020-10-04) 1 commit (merged to 'next' on 2020-10-04 at fdf196b997) + fast-import: fix typo in documentation Doc update. * so/combine-diff-simplify (2020-09-29) 1 commit (merged to 'next' on 2020-09-30 at d45e33ebb0) + diff: get rid of redundant 'dense' argument Code simplification. * tb/upload-pack-filters (2020-09-27) 1 commit (merged to 'next' on 2020-09-29 at 3dde767170) + config/uploadpack.txt: fix typo in `--filter=tree:<n>` Hotfix. * td/submodule-update-quiet (2020-10-01) 1 commit (merged to 'next' on 2020-10-01 at 4ae8bee636) + submodule update: silence underlying merge/rebase with "--quiet" "git submodule update --quiet" did not squelch underlying "rebase" and "pull" commands. -------------------------------------------------- [New Topics] * mk/diff-ignore-regex (2020-10-01) 2 commits - t: add -I<regex> tests - diff: add -I<regex> that ignores matching changes "git diff" family of commands learned the "-I<regex>" option to ignore hunks whose changed lines all match the given pattern. Expecting review response. -------------------------------------------------- [Stalled] * sv/t7001-modernize (2020-09-25) 11 commits - t7001: move cleanup code from outside the tests into them - t7001: use `test` rather than `[` - t7001: use here-docs instead of echo - t7001: put each command on a separate line - t7001: use ': >' rather than 'touch' - t7001: change (cd <path> && git foo) to (git -C <path> foo) - t7001: remove whitespace after redirect operators - t7001: change the style for cd according to subshell - t7001: remove unnecessary blank lines - t7001: use TAB instead of spaces - t7001: convert tests from the old style to the current style Test script modernization. Expecting a reroll. cf. <20200925170256.11490-1-shubhunic@gmail.com> * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. Expecting a reroll. cf. <20200909222333.GH241078@camp.crustytoothpaste.net> * ar/fetch-transfer-ipversion (2020-09-16) 1 commit - config: option transfer.ipversion to set transport protocol version for network fetches Adds transfer.ipversion configuration variable. Needs more work. * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Discard for now. cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> cf. <20200911214358.acl3hy2e763begoo@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * mt/parallel-checkout-part-1 (2020-10-05) 20 commits (merged to 'next' on 2020-10-05 at 571e16d68a) + parallel-checkout: drop unused checkout state parameter (merged to 'next' on 2020-10-04 at 20438c1143) + ci: run test round with parallel-checkout enabled + parallel-checkout: add tests related to .gitattributes + parallel-checkout: add tests related to clone collisions + parallel-checkout: add tests for basic operations + checkout-index: add parallel checkout support + builtin/checkout.c: complete parallel checkout support + make_transient_cache_entry(): optionally alloc from mem_pool + parallel-checkout: support progress displaying + parallel-checkout: make it truly parallel + unpack-trees: add basic support for parallel checkout + entry: add checkout_entry_ca() which takes preloaded conv_attrs + entry: move conv_attrs lookup up to checkout_entry() + entry: extract cache_entry update from write_entry() + entry: make fstat_output() and read_blob_entry() public + entry: extract a header file for entry.c functions + convert: add conv_attrs classification + convert: add get_stream_filter_ca() variant + convert: add [async_]convert_to_working_tree_ca() variants + convert: make convert_attrs() and convert structs public Parallel checkout. Will cook in 'next'. * dl/diff-merge-base (2020-09-21) 10 commits - contrib/completion: complete `git diff --merge-base` - builtin/diff-tree: learn --merge-base - builtin/diff-index: learn --merge-base - t4068: add --merge-base tests - diff-lib: define diff_get_merge_base() - diff-lib: accept option flags in run_diff_index() - contrib/completion: extract common diff/difftool options - git-diff.txt: backtick quote command text - git-diff-index.txt: make --cached description a proper sentence - t4068: remove unnecessary >tmp "git diff A...B" learned "git diff --merge-base A B", which is a longer short-hand to say the same thing. Expecting a reroll. cf. <xmqqblhyepup.fsf@gitster.c.googlers.com> * sb/clone-origin (2020-09-30) 7 commits - clone: allow configurable default for `-o`/`--origin` - clone: read new remote name from remote_name instead of option_origin - clone: validate --origin option before use - refs: consolidate remote name validation - remote: add tests for add and rename with invalid names - clone: use more conventional config/option layering - clone: add tests for --template and some disallowed option pairs "git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. Will merge to 'next'. * sk/force-if-includes (2020-10-03) 4 commits (merged to 'next' on 2020-10-04 at 09c4c1e088) + t, doc: update tests, reference for "--force-if-includes" + push: parse and set flag for "--force-if-includes" + push: add reflog check for "--force-if-includes" + Merge branch 'ds/in-merge-bases-many-optim-bug' into sk/force-if-includes "git push --force-with-lease[=<ref>]" can easily be misused to lose commits unless the user takes good care of their own "git fetch". A new option "--force-if-includes" attempts to ensure that what is being force-pushed was created after examining the commit at the tip of the remote ref that is about to be force-replaced. Will merge to 'master'. * hn/reftable (2020-10-01) 13 commits . reftable: "test-tool dump-reftable" command. . reftable: rest of library . reftable: file level tests . reftable: read reftable files . reftable: write reftable files . reftable: a generic binary tree implementation . reftable: reading/writing blocks . reftable: (de)serialization for the polymorphic record type. . reftable: utility functions . reftable: add a barebones unittest framework . vcxproj: adjust for the reftable changes . reftable: define the public API . reftable: add LICENSE The reftable backend for the refs API. Expecting a reroll. Seems not to build for Windows folks. cf. <nycvar.QRO.7.76.6.2010021555290.50@tvgsbejvaqbjf.bet> cf. <nycvar.QRO.7.76.6.2010021557570.50@tvgsbejvaqbjf.bet> * ds/maintenance-part-3 (2020-10-05) 7 commits - maintenance: add troubleshooting guide to docs - maintenance: use default schedule if not configured - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. cf. <20201005195701.14268-1-martin.agren@gmail.com> * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. cf. <20201005212751.GH331156@google.com> * mt/grep-sparse-checkout (2020-09-10) 9 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - config: make do_git_config_sequence receive a 'struct repository' - t/helper/test-config: unify exit labels - t/helper/test-config: diagnose missing arguments - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ds/maintenance-part-2 (2020-09-25) 8 commits (merged to 'next' on 2020-10-04 at c2a46f390c) + maintenance: add incremental-repack auto condition + maintenance: auto-size incremental-repack batch + maintenance: add incremental-repack task + midx: use start_delayed_progress() + midx: enable core.multiPackIndex by default + maintenance: create auto condition for loose-objects + maintenance: add loose-objects task + maintenance: add prefetch task (this branch is used by ds/maintenance-part-3.) "git maintenance", an extended big brother of "git gc", continues to evolve. Will cook in 'next'.
An early preview release Git v2.29.0-rc0 is now available for testing at the usual places. It is comprised of 588 non-merge commits since v2.28.0, contributed by 76 people, 22 of which are new faces. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/testing/ The following public repositories all have a copy of the 'v2.29.0-rc0' tag and the 'master' branch that the tag points at: url = https://kernel.googlesource.com/pub/scm/git/git url = git://repo.or.cz/alt-git.git url = https://github.com/gitster/git New contributors whose contributions weren't in v2.28.0 are as follows. Welcome to the Git development community! Aaron Lipman, Adrian Moennich, Ákos Uzonyi, Antti Keränen, Christian Schlack, Conor Davis, Eric Huber, Evan Gates, Han Xin, Hugo Locurcio, Kyohei Kadota, Lin Sun, Nikita Leonov, Noam Yorav-Raphael, pudinha, Raymond E. Pasco, Ryan Zoeller, Samanta Navarro, Sibi Siddharthan, Simon Legner, Steve Kemp, and Theodore Dubois. Returning contributors who helped this release are as follows. Thanks for your continued support. Ævar Arnfjörð Bjarmason, Alban Gruin, Alex Henrie, Alex Riesen, Andrei Rybak, Beat Bolli, Ben Wijen, brian m. carlson, Christian Couder, Chris Torek, Danny Lin, Denton Liu, Derrick Stolee, Đoàn Trần Công Danh, Drew DeVault, Edmundo Carmona Antoranz, Elijah Newren, Emily Shaffer, Eric Sunshine, Han-Wen Nienhuys, Hariom Verma, Jacob Keller, Jeff Hostetler, Jeff King, Jiang Xin, Johannes Berg, Johannes Schindelin, Johannes Sixt, Jonathan Tan, Junio C Hamano, Kazuhiro Kato, Luke Diamand, Martin Ågren, Matheus Tavares, Matthew Rogers, Michael Forney, Michal Privoznik, Miriam Rubio, Orgad Shaneh, Patrick Steinhardt, Paul Mackerras, Philippe Blain, Phillip Wood, Pranit Bauva, Prathamesh Chavan, René Scharfe, Rohit Ashiwal, Sergey Organov, Shourya Shukla, Stefan Dotterweich, SZEDER Gábor, Taylor Blau, Thomas Guyot-Sionnest, and Роман Донченко. ---------------------------------------------------------------- Git 2.29 Release Notes (draft) ============================== Updates since v2.28 ------------------- UI, Workflows & Features * "git help log" has been enhanced by sharing more material from the documentation for the underlying "git rev-list" command. * "git for-each-ref --format=<>" learned %(contents:size). * "git merge" learned to selectively omit " into <branch>" at the end of the title of default merge message with merge.suppressDest configuration. * The component to respond to "git fetch" request is made more configurable to selectively allow or reject object filtering specification used for partial cloning. * Stop when "sendmail.*" configuration variables are defined, which could be a mistaken attempt to define "sendemail.*" variables. * The existing backends for "git mergetool" based on variants of vim have been refactored and then support for "nvim" has been added. * "git bisect" learns the "--first-parent" option to find the first breakage along the first-parent chain. * "git log --first-parent -p" showed patches only for single-parent commits on the first-parent chain; the "--first-parent" option has been made to imply "-m". Use "--no-diff-merges" to restore the previous behaviour to omit patches for merge commits. * The commit labels used to explain each side of conflicted hunks placed by the sequencer machinery have been made more readable by humans. * The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. * The recent addition of SHA-256 support is marked as experimental in the documentation. * "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. * Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. * The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. * "git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * "git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. * "format-patch --range-diff=<prev> <origin>..HEAD" has been taught not to ignore <origin> when <prev> is a single version. * "add -p" now allows editing paths that were only added in intent. * The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. * "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. * "git maintenance", a "git gc"'s big brother, has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. * "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). * "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. * The transport protocol v2 has become the default again. * The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. * The command line completion (in contrib/) learned that "git restore -s <TAB>" is often followed by a refname. * "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. * "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * "git fetch" and "git push" support negative refspecs. * "git format-patch" learns to take "whenAble" as a possible value for the format.useAutoBase configuration variable to become no-op when the automatically computed base does not make sense. * Credential helpers are now allowed to terminate lines with CRLF line ending, as well as LF line ending. Performance, Internal Implementation, Development Support etc. * The changed-path Bloom filter is improved using ideas from an independent implementation. * Updates to the changed-paths bloom filter. * The test framework has been updated so that most tests will run with predictable (artificial) timestamps. * Preliminary clean-up of the refs API in preparation for adding a new refs backend "reftable". * Dev support to limit the use of test_must_fail to only git commands. * While packing many objects in a repository with a promissor remote, lazily fetching missing objects from the promissor remote one by one may be inefficient---the code now attempts to fetch all the missing objects in batch (obviously this won't work for a lazy clone that lazily fetches tree objects as you cannot even enumerate what blobs are missing until you learn which trees are missing). * The pretend-object mechanism checks if the given object already exists in the object store before deciding to keep the data in-core, but the check would have triggered lazy fetching of such an object from a promissor remote. * The argv_array API is useful for not just managing argv but any "vector" (NULL-terminated array) of strings, and has seen adoption to a certain degree. It has been renamed to "strvec" to reduce the barrier to adoption. * The final leg of SHA-256 transition plus doc updates. Note that there is no inter-operability between SHA-1 and SHA-256 repositories yet. * CMake support to build with MSVC for Windows bypassing the Makefile. * A new helper function has_object() has been introduced to make it easier to mark object existence checks that do and don't want to trigger lazy fetches, and a few such checks are converted using it. * A no-op replacement function implemented as a C preprocessor macro does not perform as good a job as one implemented as a "static inline" function in catching errors in parameters; replace the former with the latter in <git-compat-util.h> header. * Test framework update. (merge d572f52a64 es/test-cmp-typocatcher later to maint). * Updates to "git merge" tests, in preparation for a new merge strategy backend. * midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. * The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. * A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * An unused binary has been discarded, and and a bunch of commands have been turned into into built-in. * A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. * Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. * Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. * "git index-pack" learned to resolve deltified objects with greater parallelism. * "diff-highlight" (in contrib/) had a logic to flush its output upon seeing a blank line but the way it detected a blank line was broken. Fixes since v2.28 ----------------- * "git clone --separate-git-dir=$elsewhere" used to stomp on the contents of the existing directory $elsewhere, which has been taught to fail when $elsewhere is not an empty directory. (merge dfaa209a79 bw/fail-cloning-into-non-empty later to maint). * With the base fix to 2.27 regresion, any new extensions in a v0 repository would still be silently honored, which is not quite right. Instead, complain and die loudly. (merge ec91ffca04 jk/reject-newer-extensions-in-v0 later to maint). * Fetching from a lazily cloned repository resulted at the server side in attempts to lazy fetch objects that the client side has, many of which will not be available from the third-party anyway. (merge 77aa0941ce jt/avoid-lazy-fetching-upon-have-check later to maint). * Fix to an ancient bug caused by an over-eager attempt for optimization. (merge a98f7fb366 rs/add-index-entry-optim-fix later to maint). * Pushing a ref whose name contains non-ASCII character with the "--force-with-lease" option did not work over smart HTTP protocol, which has been corrected. (merge cd85b447bf bc/push-cas-cquoted-refname later to maint). * "git mv src dst", when src is an unmerged path, errored out correctly but with an incorrect error message to claim that src is not tracked, which has been clarified. (merge 9b906af657 ct/mv-unmerged-path-error later to maint). * Fix to a regression introduced during 2.27 cycle. (merge cada7308ad en/fill-directory-exponential later to maint). * Command line completion (in contrib/) update. (merge 688b87c81b mp/complete-show-color-moved later to maint). * All "mergy" operations that internally use the merge-recursive machinery should honor the merge.renormalize configuration, but many of them didn't. * Doc cleanup around "worktree". (merge dc9c144be5 es/worktree-doc-cleanups later to maint). * The "git blame --first-parent" option was not documented, but now it is. (merge 11bc12ae1e rp/blame-first-parent-doc later to maint). * The logic to find the ref transaction hook script attempted to cache the path to the found hook without realizing that it needed to keep a copied value, as the API it used returned a transitory buffer space. This has been corrected. (merge 09b2aa30c9 ps/ref-transaction-hook later to maint). * Recent versions of "git diff-files" shows a diff between the index and the working tree for "intent-to-add" paths as a "new file" patch; "git apply --cached" should be able to take "git diff-files" and should act as an equivalent to "git add" for the path, but the command failed to do so for such a path. (merge 4c025c667e rp/apply-cached-with-i-t-a later to maint). * "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a bit was not showing the mode bits from the working tree. (merge cb0dd22b82 rp/ita-diff-modefix later to maint). * Ring buffer with size 4 used for bin-hex translation resulted in a wrong object name in the sequencer's todo output, which has been corrected. (merge 5da69c0dac ak/sequencer-fix-find-uniq-abbrev later to maint). * When given more than one target line ranges, "git blame -La,b -Lc,d" was over-eager to coalesce groups of original lines and showed incorrect results, which has been corrected. (merge c2ebaa27d6 jk/blame-coalesce-fix later to maint). * The regexp to identify the function boundary for FORTRAN programs has been updated. (merge 75c3b6b2e8 pb/userdiff-fortran-update later to maint). * A few end-user facing messages have been updated to be hash-algorithm agnostic. (merge 4279000d3e jc/object-names-are-not-sha-1 later to maint). * "unlink" emulation on MinGW has been optimized. (merge 680e0b4524 jh/mingw-unlink later to maint). * The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. (merge ccf236a23a es/init-no-separate-git-dir-in-bare later to maint). * "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. (merge ab282aa548 en/dir-nonbare-embedded later to maint). * Fix some incorrect UNLEAK() annotations. (merge 3e19816dc0 jk/unleak-fixes later to maint). * Use more buffered I/O where we used to call many small write(2)s. (merge a698d67b08 rs/more-buffered-io later to maint). * The patch-id computation did not ignore the "incomplete last line" marker like whitespaces. (merge 82a62015a7 rs/patch-id-with-incomplete-line later to maint). * Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifiers>" are the only two allowed forms, which has been corrected. (merge 2c22e102f8 hv/ref-filter-trailers-atom-parsing-fix later to maint). * Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. (merge fbff95b67f jk/index-pack-w-more-threads later to maint). * "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. (merge bfda204ade rs/checkout-no-overlay-pathspec-fix later to maint). * The description of --cached/--index options in "git apply --help" has been updated. (merge d064702be3 rp/apply-cached-doc later to maint). * Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and running "git log --ignore-missing $ZERO_OID" fell back to start digging from HEAD; it has been corrected to become a no-op, like "git log --tags=no-tag-matches-this-pattern" does. (merge 04a0e98515 jk/rev-input-given-fix later to maint). * Various callers of run_command API has been modernized. (merge afbdba391e jc/run-command-use-embedded-args later to maint). * List of options offered and accepted by "git add -i/-p" were inconsistent, which have been corrected. (merge ce910287e7 pw/add-p-allowed-options-fix later to maint). * Various callers of run_command API has been modernized. (merge afbdba391e jc/run-command-use-embedded-args later to maint). * "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. (merge 1cf3d5db9b mr/diff-hide-stat-wo-textual-change later to maint). * It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. (merge 6479ea4a8a jk/xrealloc-avoid-use-after-free later to maint). * "git status" has trouble showing where it came from by interpreting reflog entries that record certain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. * "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. (merge 85a1ec2c32 mf/submodule-summary-with-correct-repository later to maint). * Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. (merge 378fe5fc3d mt/config-fail-nongit-early later to maint). * There is a logic to estimate how many objects are in the repository, which is mean to run once per process invocation, but it ran every time the estimated value was requested. (merge 67bb65de5d jk/dont-count-existing-objects-twice later to maint). * "git remote set-head" that failed still said something that hints the operation went through, which was misleading. (merge 5a07c6c3c2 cs/don-t-pretend-a-failed-remote-set-head-succeeded later to maint). * "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. (merge 4e735c1326 ar/fetch-ipversion-in-all later to maint). * The "unshelve" subcommand of "git p4" used incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. (merge 0acbf5997f ld/p4-unshelve-fix later to maint). * "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. * Adjust sample hooks for hash algorithm other than SHA-1. (merge d8d3d632f4 dl/zero-oid-in-hooks later to maint). * "git range-diff" showed incorrect diffstat, which has been corrected. * Earlier we taught "git pull" to warn when the user does not say the histories need to be merged, rebased or accepts only fast- forwarding, but the warning triggered for those who have set the pull.ff configuration variable. (merge 54200cef86 ah/pull later to maint). * Compilation fix around type punning. (merge 176380fd11 jk/drop-unaligned-loads later to maint). * "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. (merge 610e2b9240 jc/blame-ignore-fix later to maint). * "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. (merge 73c6de06af cc/bisect-start-fix later to maint). * The explanation of the "scissors line" has been clarified. (merge 287416dba6 eg/mailinfo-doc-scissors later to maint). * A race that leads to an access to a free'd data was corrected in the codepath that reads pack files. (merge bda959c476 mt/delta-base-cache-races later to maint). * in_merge_bases_many(), a way to see if a commit is reachable from any commit in a set of commits, was totally broken when the commit-graph feature was in use, which has been corrected. (merge 8791bf1841 ds/in-merge-bases-many-optim-bug later to maint). * "git submodule update --quiet" did not squelch underlying "rebase" and "pull" commands. (merge 3ad0401e9e td/submodule-update-quiet later to maint). * The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damage to the partial clone filter in the repository, which has been corrected. * "log -c --find-object=X" did not work well to find a merge that involves a change to an object X from only one parent. (merge 957876f17d jk/diff-cc-oidfind-fix later to maint). * Other code cleanup, docfix, build fix, etc. (merge 84544f2ea3 sk/typofixes later to maint). (merge b17f411ab5 ar/help-guides-doc later to maint). (merge 98c6871fad rs/grep-simpler-parse-object-or-die-call later to maint). (merge 861c4ce141 en/typofixes later to maint). (merge 60e47f6773 sg/ci-git-path-fix-with-pyenv later to maint). (merge e2bfa50ac3 jb/doc-packfile-name later to maint). (merge 918d8ff780 es/worktree-cleanup later to maint). (merge dc156bc31f ma/t1450-quotefix later to maint). (merge 56e743426b en/merge-recursive-comment-fixes later to maint). (merge 7d23ff818f rs/bisect-oid-to-hex-fix later to maint). (merge de20baf2c9 ny/notes-doc-sample-update later to maint). (merge f649aaaf82 so/rev-parser-errormessage-fix later to maint). (merge 6103d58b7f bc/sha-256-cvs-svn-updates later to maint). (merge ac900fddb7 ma/stop-progress-null-fix later to maint). (merge e767963ab6 rs/upload-pack-sigchain-fix later to maint). (merge a831908599 rs/preserve-merges-unused-code-removal later to maint). (merge 6dfefe70a9 jb/commit-graph-doc-fix later to maint). (merge 847b37271e pb/set-url-docfix later to maint). (merge 748f733d54 mt/checkout-entry-dead-code-removal later to maint). (merge ce820cbd58 dl/subtree-docs later to maint). (merge 55fe225dde jk/leakfix later to maint). (merge ee22a29215 so/pretty-abbrev-doc later to maint). (merge 3100fd5588 jc/post-checkout-doc later to maint). (merge 17bae89476 pb/doc-external-diff-env later to maint). (merge 27ed6ccc12 jk/worktree-check-clean-leakfix later to maint). (merge 1302badd16 ea/blame-use-oideq later to maint). (merge e6d5a11fed al/t3200-back-on-a-branch later to maint). (merge 324efcf6b6 pw/add-p-leakfix later to maint). (merge 1c6ffb546b jk/add-i-fixes later to maint). (merge e40e936551 cd/commit-graph-doc later to maint). (merge 0512eabd91 jc/sequencer-stopped-sha-simplify later to maint). (merge d01141de5a so/combine-diff-simplify later to maint). (merge 3be01e5ab1 sn/fast-import-doc later to maint). ---------------------------------------------------------------- Changes since v2.28.0 are as follows: Aaron Lipman (12): t6030: modernize "git bisect run" tests rev-list: allow bisect and first-parent flags cmd_bisect__helper: defer parsing no-checkout flag bisect: introduce first-parent flag bisect: combine args passed to find_bisection() bisect: add first-parent option to documentation t3200: clean side effect of git checkout --orphan t3201: test multiple branch filter combinations Doc: cover multiple contains/no-contains filters ref-filter: allow merged and no-merged filters ref-filter: make internal reachable-filter API more precise Doc: prefer more specific file name Adrian Moennich (1): ci: fix inconsistent indentation Alban Gruin (1): t6300: fix issues related to %(contents:size) Alex Henrie (1): pull: don't warn if pull.ff has been set Alex Riesen (1): fetch: pass --ipv4 and --ipv6 options to sub-fetches Andrei Rybak (1): git-help.txt: fix mentions of option --guides Antti Keränen (1): rebase -i: fix possibly wrong onto hash in todo Beat Bolli (1): gitk: rename "commit summary" to "commit reference" Ben Wijen (1): git clone: don't clone into non-empty directory Chris Torek (1): git-mv: improve error message for conflicted file Christian Couder (4): Documentation: clarify %(contents:XXXX) doc t6300: test refs pointing to tree and blob ref-filter: add support for %(contents:size) bisect: don't use invalid oid as rev when starting Christian Schlack (1): remote: don't show success message when set-head fails Conor Davis (1): commit-graph-format.txt: fix no-parent value Danny Lin (2): contrib/subtree: fix "unsure" for --message in the document contrib/subtree: document 'push' does not take '--squash' Denton Liu (11): t3701: stop using `env` in force_color() t5324: reorder `run_with_limited_open_files test_might_fail` t7107: don't use test_must_fail() t9834: remove use of `test_might_fail p4` t9400: don't use test_must_fail with cvs test-lib-functions: restrict test_must_fail usage contrib/completion: complete options that take refs for format-patch hooks--pre-push.sample: modernize script hooks--pre-push.sample: use hash-agnostic zero OID hooks--update.sample: use hash-agnostic zero OID gitk: replace tabs with spaces Derrick Stolee (22): commit-graph: place bloom_settings in context commit-graph: change test to die on parse, not load bloom: fix logic in get_bloom_filter() commit-graph: persist existence of changed-paths revision.c: fix whitespace multi-pack-index: repack batches below --batch-size t/README: document GIT_TEST_DEFAULT_HASH commit-graph: use the "hash version" byte multi-pack-index: use hash version byte bloom/diff: properly short-circuit on max_changes maintenance: create basic maintenance runner maintenance: add --quiet option maintenance: replace run_auto_gc() maintenance: initialize task array maintenance: add commit-graph task maintenance: add --task option maintenance: take a lock on the objects directory maintenance: create maintenance.<task>.enabled config maintenance: use pointers to check --auto maintenance: add auto condition for commit-graph task maintenance: add trace2 regions for task execution commit-reach: fix in_merge_bases_many bug Drew DeVault (1): git-send-email: die if sendmail.* config is set Edmundo Carmona Antoranz (1): blame.c: replace instance of !oidcmp for oideq Elijah Newren (26): Remove doubled words in various comments hashmap: fix typo in usage docs merge-recursive: fix unclear and outright wrong comments t6038: make tests fail for the right reason t6038: remove problematic test merge: make merge.renormalize work for all uses of merge machinery checkout: support renormalization with checkout -m <paths> Collect merge-related tests to t64xx t6418: tighten delete/normalize conflict testcase t6422: fix bad check against missing file t6416, t6422: fix incorrect untracked file count t6423: fix test setup for a couple tests t6422: fix multiple errors with the mod6 test expectations t6416, t6423: clarify some comments and fix some typos t6423: add an explanation about why one of the tests does not pass t6422, t6426: be more flexible for add/add conflicts involving renames t642[23]: be more flexible for add/add conflicts involving pair renames t6425: be more flexible with rename/delete conflict messages t3000: fix some test description typos dir: avoid prematurely marking nonbare repositories as matches sequencer: avoid garbled merge machinery messages due to commit labels mem-pool: add convenience functions for strdup and strndup mem-pool: use more standard initialization and finalization mem-pool: use consistent pool variable name dir: make clear_directory() free all relevant memory dir: fix problematic API to avoid memory leaks Emily Shaffer (1): Revert "contrib: subtree: adjust test to change in fmt-merge-msg" Eric Huber (1): gitk: Preserve window dimensions on exit when not using ttk themes Eric Sunshine (22): worktree: drop pointless strbuf_release() worktree: drop unused code from get_linked_worktree() worktree: drop bogus and unnecessary path munging worktree: retire special-case normalization of main worktree path git-worktree.txt: employ fixed-width typeface consistently git-worktree.txt: consistently use term "working tree" git-worktree.txt: fix minor grammatical issues git-worktree.txt: make start of new sentence more obvious git-worktree.txt: link to man pages when citing other Git commands test_cmp: diagnose incorrect arguments init: disallow --separate-git-dir with bare repository worktree: add skeleton "repair" command worktree: teach "repair" to fix worktree back-links to main worktree worktree: teach "repair" to fix outgoing links to worktrees init: teach --separate-git-dir to repair linked worktrees init: make --separate-git-dir work from within linked worktree git-checkout.txt: document -d short option for --detach worktree: teach `add` to recognize -d as shorthand for --detach git-worktree.txt: discuss branch-based vs. throwaway worktrees diff: move show_interdiff() from its own file to diff-lib diff-lib: tighten show_interdiff()'s interface format-patch: use 'origin' as start of current-series-range when known Evan Gates (1): Doc: show example scissors line Han Xin (1): send-pack: run GPG after atomic push checking Han-Wen Nienhuys (17): lib-t6000.sh: write tag using git-update-ref t3432: use git-reflog to inspect the reflog for HEAD bisect: treat BISECT_HEAD as a pseudo ref t1400: use git rev-parse for testing PSEUDOREF existence Modify pseudo refs through ref backend storage Make HEAD a PSEUDOREF rather than PER_WORKTREE. refs: move the logic to add \t to reflog to the files backend refs: split off reading loose ref data in separate function refs: fix comment about submodule ref_stores refs: move gitdir into base ref_store refs: read FETCH_HEAD and MERGE_HEAD generically refs: make refs_ref_exists public sequencer: treat CHERRY_PICK_HEAD as a pseudo ref builtin/commit: suggest update-ref for pseudoref removal sequencer: treat REVERT_HEAD as a pseudo ref refs: move REF_LOG_ONLY to refs-internal.h refs: add GIT_TRACE_REFS debugging mechanism Hariom Verma (10): t6300: unify %(trailers) and %(contents:trailers) tests ref-filter: 'contents:trailers' show error if `:` is missing ref-filter: support different email formats ref-filter: refactor `grab_objectname()` ref-filter: modify error messages in `grab_objectname()` ref-filter: rename `objectname` related functions and fields ref-filter: add `short` modifier to 'tree' atom ref-filter: add `short` modifier to 'parent' atom pretty: refactor `format_sanitized_subject()` ref-filter: add `sanitize` option for 'subject' atom Hugo Locurcio (1): bisect: swap command-line options in documentation Jacob Keller (4): refspec: fix documentation referring to refspec_item refspec: make sure stack refspec_item variables are zeroed refspec: add support for negative refspecs format-patch: teach format.useAutoBase "whenAble" option Jeff Hostetler (1): mingw: improve performance of mingw_unlink() Jeff King (80): t6000: use test_tick consistently t9700: loosen ident timezone regex t5539: make timestamp requirements more explicit t9100: explicitly unset GIT_COMMITTER_DATE test-lib: set deterministic default author/committer date t9100: stop depending on commit timestamps verify_repository_format(): complain about new extensions in v0 repo argv-array: use size_t for count and alloc argv-array: rename to strvec strvec: rename files from argv-array to strvec quote: rename sq_dequote_to_argv_array to mention strvec strvec: convert builtin/ callers away from argv_array name strvec: convert more callers away from argv_array name strvec: convert remaining callers away from argv_array name strvec: fix indentation in renamed calls strvec: update documention to avoid argv_array strvec: drop argv_array compatibility layer log: drop "--cc implies -m" logic revision: add "--no-diff-merges" option to counteract "-m" log: enable "-m" automatically with "--first-parent" doc/git-log: move "Diff Formatting" from rev-list-options doc/git-log: drop "-r" diff option doc/git-log: move "-t" into diff-options list doc/git-log: clarify handling of merge commit diffs strvec: rename struct fields config: work around gcc-10 -Wstringop-overflow warning revision: avoid out-of-bounds read/write on empty pathspec revision: avoid leak when preparing bloom filter for "/" t5616: use test_i18ngrep for upload-pack errors sideband: mark "remote error:" prefix for translation t1416: avoid hard-coded sha1 ids t8003: check output of coalesced blame t8003: factor setup out of coalesce test blame: only coalesce lines that are adjacent in result Makefile: drop builtins from MSVC pdb list make credential helpers builtins make git-bugreport a builtin make git-fast-import a builtin drop vcs-svn experiment stop calling UNLEAK() before die() ls-remote: simplify UNLEAK() usage clear_pattern_list(): clear embedded hashmaps submodule--helper: use strbuf_release() to free strbufs checkout: fix leak of non-existent branch names config: fix leaks from git_config_get_string_const() config: drop git_config_get_string_const() config: fix leak in git_config_get_expiry_in_days() submodule--helper: fix leak of core.worktree value p5302: disable thread-count parameter tests by default p5302: count up to online-cpus for thread tests index-pack: adjust default threading cap revision: set rev_input_given in handle_revision_arg() worktree: fix leak in check_clean_worktree() xrealloc: do not reuse pointer freed by zero-length realloc() add-patch: fix inverted return code of repo_read_index() add--interactive.perl: specify --no-color explicitly packfile: actually set approximate_object_count_valid diff-highlight: correctly match blank lines for flush bswap.h: drop unaligned loads Revert "fast-export: use local array to store anonymized oid" shortlog: change "author" variables to "ident" protocol: re-enable v2 protocol by default shortlog: add grouping option trailer: add interface for iterating over commit trailers shortlog: match commit trailers with --group shortlog: de-duplicate trailer values shortlog: rename parse_stdin_ident() shortlog: parse trailer idents shortlog: allow multiple groups to be specified convert: drop unused crlf_action from check_global_conv_flags_eol() drop unused argc parameters env--helper: write to opt->value in parseopt helper assert PARSE_OPT_NONEG in parse-options callbacks push: drop unused repo argument to do_push() sequencer: drop repository argument from run_git_commit() sparse-checkout: fill in some options boilerplate test-advise: check argument count with argc instead of argv sequencer: handle ignore_footer when parsing trailers dir.c: drop unused "untracked" from treat_path_fast() combine-diff: handle --find-object in multitree code path Jiang Xin (10): transport: not report a non-head push as a branch t5411: add basic test cases for proc-receive hook receive-pack: add new proc-receive hook receive-pack: feed report options to post-receive New capability "report-status-v2" for git-push doc: add document for capability report-status-v2 receive-pack: new config receive.procReceiveRefs t5411: test updates of remote-tracking branches transport: parse report options for tracking refs doc: add documentation for the proc-receive hook Johannes Berg (2): pack-write/docs: update regarding pack naming docs: commit-graph: fix some whitespace in the diagram Johannes Schindelin (20): t3404: prepare 'short SHA-1 collision' tests for SHA-256 ci: fix indentation of the `ci-config` job ci: avoid ugly "failure" in the `ci-config` job t/test-terminal: avoid non-inclusive language fast-export: avoid using unnecessary language in a code comment t3200: avoid variations of the `master` branch name msvc: copy the correct `.pdb` files in the Makefile target `install` Optionally skip linking/copying the built-ins ci: stop linking built-ins to the dashed versions cmake: ignore files generated by CMake as run in Visual Studio tests: avoid variations of the `master` branch name t9902: avoid using the branch name `master` cmake: do find Git for Windows' shell interpreter cmake: ensure that the `vcpkg` packages are found on Windows cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows cmake: quote the path accurately when editing `test-lib.sh` cmake (Windows): let the `.dll` files be found when running the tests cmake (Windows): complain when encountering an unknown compiler cmake (Windows): initialize vcpkg/build dependencies automatically cmake (Windows): recommend using Visual Studio's built-in CMake support Johannes Sixt (1): gitk: Un-hide selection in areas with non-default background color Jonathan Tan (32): upload-pack: do not lazy-fetch "have" objects pack-objects: refactor to oid_object_info_extended pack-objects: prefetch objects to be packed sha1-file: make pretend_object_file() not prefetch sha1-file: introduce no-lazy-fetch has_object() apply: do not lazy fetch when applying binary pack-objects: no fetch when allow-{any,promisor} fsck: do not lazy fetch known non-promisor object negotiator/noop: add noop fetch negotiator fetch: allow refspecs specified through stdin fetch: avoid reading submodule config until needed fetch: only populate existing_refs if needed fetch-pack: do not lazy-fetch during ref iteration promisor-remote: lazy-fetch objects in subprocess fetch-pack: remove no_dependents code fetch-pack: in partial clone, pass --promisor Documentation: deltaBaseCacheLimit is per-thread index-pack: remove redundant parameter index-pack: unify threaded and unthreaded code index-pack: remove redundant child field index-pack: calculate {ref,ofs}_{first,last} early index-pack: make resolve_delta() assume base data (various): document from_promisor parameter fetch-pack: document only_packfile in get_pack() fetch-pack: make packfile URIs work with transfer.fsckobjects fetch: no FETCH_HEAD display if --no-write-fetch-head sha1-name: replace unsigned int with option struct refs: move dwim_ref() to header file wt-status: tolerate dangling marks index-pack: make quantum of work smaller promisor-remote: remove unused variable fetch: do not override partial clone filter Junio C Hamano (49): gitk: be prepared to be run in a bare repository reflog: cleanse messages in the refs.c layer Revert "fmt-merge-msg: stop treating `master` specially" fmt-merge-msg: allow merge destination to be omitted again First batch post 2.28 The second batch -- mostly minor typofixes Third batch Fourth batch Documentation: don't hardcode command categories twice compat-util: type-check parameters of no-op replacement functions Fifth batch Sixth batch Seventh batch messages: avoid SHA-1 in end-user facing messages Eighth batch fetch: optionally allow disabling FETCH_HEAD update Ninth batch ident: say whose identity is missing when giving user.name hint Tenth batch t3436: do not run git-merge-recursive in dashed form transport-helper: do not run git-remote-ext etc. in dashed form cvsexportcommit: do not run git programs in dashed form run_command: teach API users to use embedded 'args' more credential-cache: use child_process.args Eleventh batch doc: clarify how exit status of post-checkout hook is used Twelfth batch Thirteenth batch add -i: use the built-in version when feature.experimental is set Makefile: allow extra tweaking of distribution tarball Fourteenth batch quote_path: rename quote_path_relative() to quote_path() quote_path: give flags parameter to quote_path() quote_path: optionally allow quoting a path with SP in it quote_path: code clarification wt-status: consistently quote paths in "status --short" output quote: rename misnamed sq_lookup[] to cq_lookup[] quote: turn 'nodq' parameter into a set of flags Fifteenth batch Sixteenth batch t8013: minimum preparatory clean-up blame: validate and peel the object names on the ignore list t1506: rev-parse A..B and A...B sequencer: stop abbreviating stopped-sha file Seventeenth batch Eighteenth batch hashmap_for_each_entry(): workaround MSVC's runtime check failure #3 Nineteenth batch Git 2.29-rc0 Kazuhiro Kato (1): gitk: fix branch name encoding error Kyohei Kadota (1): Fit to Plan 9's ANSI/POSIX compatibility layer Lin Sun (1): mergetool: allow auto-merge for meld to follow the vim-diff behavior Luke Diamand (2): git-p4 unshelve: adding a commit breaks git-p4 unshelve git-p4: use HEAD~$n to find parent commit for unshelve Martin Ågren (19): dir: check pathspecs before returning `path_excluded` t1450: fix quoting of NUL byte when corrupting pack t: don't spuriously close and reopen quotes t4104: modernize and simplify quoting progress: don't dereference before checking for NULL http-protocol.txt: document SHA-256 "want"/"have" format index-format.txt: document SHA-256 index format protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256 shallow.txt: document SHA-256 shallow format Documentation: mark `--object-format=sha256` as experimental wt-status: replace sha1 mentions with oid wt-status: print to s->fp, not stdout wt-status: introduce wt_status_state_free_buffers() worktree: inline `worktree_ref()` into its only caller worktree: update renamed variable in comment worktree: rename copy-pasted variable worktree: use skip_prefix to parse target config/fmt-merge-msg.txt: drop space in quote config/uploadpack.txt: fix typo in `--filter=tree:<n>` Matheus Tavares (4): checkout_entry(): remove unreachable error() call config: complain about --worktree outside of a git repo packfile: fix race condition on unpack_entry() packfile: fix memory leak in add_delta_base_cache() Matthew Rogers (1): diff: teach --stat to ignore uninteresting modifications Michael Forney (2): revision: use repository from rev_info when parsing commits submodule: use submodule repository when preparing summary Michal Privoznik (1): completion: add show --color-moved[-ws] Miriam Rubio (4): bisect--helper: BUG() in cmd_*() on invalid subcommand bisect--helper: use '-res' in 'cmd_bisect__helper' return bisect--helper: introduce new `write_in_file()` function bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' Nikita Leonov (1): credential: treat CR/LF as line endings in the credential protocol Noam Yorav-Raphael (1): docs: improve the example that illustrates git-notes path names Orgad Shaneh (5): vcbuild: fix library name for expat with make MSVC=1 vcbuild: fix batch file name in README fetch: do not look for submodule changes in unchanged refs submodule: suppress checking for file name and ref ambiguity for object ids contrib/buildsystems: fix expat library name for generated vcxproj Patrick Steinhardt (2): refs: fix interleaving hook calls with reference-transaction hook refs: remove lookup cache for reference-transaction hook Paul Mackerras (1): gitk: Resize panes correctly when reducing window size Philippe Blain (19): git-log.txt: add links to 'rev-list' and 'diff' docs revisions.txt: describe 'rev1 rev2 ...' meaning for ranges git-rev-list.txt: fix Asciidoc syntax git-rev-list.txt: tweak wording in set operations git-rev-list.txt: move description to separate file git-log.txt: include rev-list-description.txt command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers' help: drop usage of 'common' and 'useful' for guides git.txt: add list of guides fetch, pull doc: correct description of '--set-upstream' userdiff: add tests for Fortran xfuncname regex userdiff: improve Fortran xfuncname regex git-imap-send.txt: don't duplicate 'Examples' sections git-imap-send.txt: do verify SSL certificate for gmail.com git-imap-send.txt: add note about localized Gmail folders doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more git.txt: correct stale 'GIT_EXTERNAL_DIFF' description Makefile: add support for generating JSON compilation database gitsubmodules doc: invoke 'ls-files' with '--recurse-submodules' Phillip Wood (7): add -p: use ALLOC_GROW_BY instead of ALLOW_GROW add -p: fix checking of user input am: stop exporting GIT_COMMITTER_DATE rebase -i: support --committer-date-is-author-date rebase -i: support --ignore-date add -p: fix memory leak add -p: fix editing of intent-to-add paths Pranit Bauva (2): bisect--helper: reimplement `bisect_autostart` shell function in C bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C Prathamesh Chavan (1): submodule: port submodule subcommand 'summary' from shell to C Raymond E. Pasco (6): apply: allow "new file" patches on i-t-a entries blame-options.txt: document --first-parent option apply: make i-t-a entries never match worktree t4140: test apply with i-t-a paths diff-lib: use worktree mode in diffs from i-t-a entries git-apply.txt: update descriptions of --cached, --index René Scharfe (21): read-cache: remove bogus shortcut grep: avoid using oid_to_hex() with parse_object_or_die() bisect: use oid_to_hex_r() instead of memcpy()+oid_to_hex() upload-pack: remove superfluous sigchain_pop() call rebase: remove unused function reschedule_last_action connected: use buffered I/O to talk to rev-list midx: use buffered I/O to talk to pack-objects upload-pack: use buffered I/O to talk to rev-list patch-id: ignore newline at end of file in diff_flush_patch_id() checkout, restore: make pathspec recursive read-cache: fix mem-pool allocation for multi-threaded index loading push: release strbufs used for refspec formatting refspec: add and use refspec_appendf() fast-import: use write_pack_header() midx: use hashwrite_u8() in write_midx_header() pack-bitmap-write: use hashwrite_be32() in write_hash_cache() pack-write: use hashwrite_be32() in write_idx_file() archive: read short blobs in archive.c::write_archive_entry() archive: add --add-file Makefile: use git-archive --add-file ref-filter: plug memory leak in reach_filter() Rohit Ashiwal (2): rebase -i: add --ignore-whitespace flag rebase: add --reset-author-date Ryan Zoeller (2): parse-options: add --git-completion-helper-all completion: add GIT_COMPLETION_SHOW_ALL env var SZEDER Gábor (15): tree-walk.c: don't match submodule entries for 'submod/anything' commit-graph: fix parsing the Chunk Lookup table commit-graph-format.txt: all multi-byte numbers are in network byte order commit-slab: add a function to deep free entries on the slab diff.h: drop diff_tree_oid() & friends' return value commit-graph: clean up #includes commit-graph: simplify parse_commit_graph() #1 commit-graph: simplify parse_commit_graph() #2 commit-graph: simplify write_commit_graph_file() #1 commit-graph: simplify write_commit_graph_file() #2 commit-graph: unify the signatures of all write_graph_chunk_*() functions commit-graph: simplify chunk writes into loop commit-graph: check chunk sizes after writing commit-graph: check all leading directories in changed path Bloom filters ci: use absolute PYTHON_PATH in the Linux jobs Samanta Navarro (1): fast-import: fix typo in documentation Sergey Organov (9): revision: fix die() message for "--unpacked=" revision: change "--diff-merges" option to require parameter doc/git-log: describe --diff-merges=off t/t4013: add test for --diff-merges=off pretty-options.txt: fix --no-abbrev-commit description revision: add separate field for "-m" of "diff-index -m" log_tree_diff: get rid of code duplication for first_parent_only log_tree_diff: get rid of extra check for NULL diff: get rid of redundant 'dense' argument Shourya Shukla (11): submodule: remove extra line feeds between callback struct and macro submodule: rename helper functions to avoid ambiguity t7421: introduce a test script for verifying 'summary' output t7401: modernize style t7401: use 'short' instead of 'verify' and cut in rev-parse calls t7401: change syntax of test_i18ncmp calls for clarity t7401: change indentation for enhanced readability t7401: add a NEEDSWORK submodule: eliminate unused parameters from print_submodule_summary() submodule: fix style in function definition t7421: eliminate 'grep' check in t7421.4 for mingw compatibility Sibi Siddharthan (8): Introduce CMake support for configuring Git cmake: generate the shell/perl/python scripts and templates, translations cmake: installation support for git cmake: support for testing git with ctest cmake: support for testing git when building out of the source tree cmake: support for building git on windows with mingw cmake: support for building git on windows with msvc and clang. ci: modification of main.yml to use cmake for vs-build job Simon Legner (1): remote-mediawiki: fix duplicate revisions being imported Stefan Dotterweich (1): gitk: add diff lines background colors Steve Kemp (1): comment: fix spelling mistakes inside comments Taylor Blau (18): revision: empty pathspecs should not use Bloom filters list_objects_filter_options: introduce 'list_object_filter_config_name' upload-pack.c: allow banning certain object filter(s) upload-pack.c: introduce 'uploadpackfilter.tree.maxDepth' builtin/repack.c: invalidate MIDX only when necessary midx: traverse the local MIDX first commit-graph: introduce 'get_bloom_filter_settings()' t4216: use an '&&'-chain commit-graph: pass a 'struct repository *' in more places t/helper/test-read-graph.c: prepare repo settings commit-graph: respect 'commitGraph.readChangedPaths' commit-graph.c: store maximum changed paths bloom: split 'get_bloom_filter()' in two bloom: use provided 'struct bloom_filter_settings' bloom: encode out-of-bounds filters as non-empty commit-graph: rename 'split_commit_graph_opts' builtin/commit-graph.c: introduce '--max-new-filters=<n>' commit-graph: introduce 'commitGraph.maxNewFilters' Theodore Dubois (1): submodule update: silence underlying merge/rebase with "--quiet" Thomas Guyot-Sionnest (1): diff: fix modified lines stats with --stat and --numstat brian m. carlson (48): remote-curl: make --force-with-lease work with non-ASCII ref names t: make test-bloom initialize repository t1001: use $ZERO_OID t3305: make hash agnostic t6100: make hash size independent t6101: make hash size independent t6301: make hash size independent t6500: specify test values for SHA-256 t6501: avoid hard-coded objects t7003: compute appropriate length constant t7063: make hash size independent t7201: abstract away SHA-1-specific constants t7102: abstract away SHA-1-specific constants t7400: make hash size independent t7405: make hash size independent t7506: avoid checking for SHA-1-specific constants t7508: use $ZERO_OID instead of hard-coded constant t8002: make hash size independent t8003: make hash size independent t8011: make hash size independent t9300: abstract away SHA-1-specific constants t9300: use $ZERO_OID instead of hard-coded object ID t9301: make hash size independent t9350: make hash size independent t9500: ensure that algorithm info is preserved in config t9700: make hash size independent t5308: make test work with SHA-256 t0410: mark test with SHA1 prerequisite http-fetch: set up git directory before parsing pack hashes builtin/verify-pack: implement an --object-format option bundle: add new version for use with SHA-256 setup: add support for reading extensions.objectformat repository: enable SHA-256 support by default t: add test_oid option to select hash algorithm t: allow testing different hash algorithms via environment t: make SHA1 prerequisite depend on default hash ci: run tests with SHA-256 docs: add documentation for extensions.objectFormat t: remove test_oid_init in tests git-cvsexportcommit: support Perl before 5.10.1 docs: document SHA-256 pack and indices docs: fix step in transition plan t4013: improve diff-post-processor logic po: add missing letter for French message docs: explain why squash merges are broken with long-running branches docs: explain why reverts are not always applied on merge docs: explain how to deal with files that are always modified builtin/clone: avoid failure with GIT_DEFAULT_HASH pudinha (2): mergetool--lib: improve support for vimdiff-style tool variants mergetools: add support for nvimdiff (neovim) family Ákos Uzonyi (2): completion: use "prev" variable instead of introducing "prevword" completion: complete refs after 'git restore -s' Ævar Arnfjörð Bjarmason (17): remote-mediawiki doc: correct link to GitHub project remote-mediawiki doc: link to MediaWiki's current version remote-mediawiki doc: don't hardcode Debian PHP versions remote-mediawiki tests: use the login/password variables remote-mediawiki tests: use a 10 character password remote-mediawiki tests: use test_cmp in tests remote-mediawiki tests: change `[]` to `test` remote-mediawiki tests: use "$dir/" instead of "$dir." remote-mediawiki tests: use a more idiomatic dispatch table remote-mediawiki tests: replace deprecated Perl construct remote-mediawiki tests: use inline PerlIO for readability remote-mediawiki tests: use CLI installer remote-mediawiki tests: annotate failing tests remote-mediawiki: provide a list form of run_git() remote-mediawiki: convert to quoted run_git() invocation remote-mediawiki: annotate unquoted uses of run_git() remote-mediawiki: use "sh" to eliminate unquoted commands Đoàn Trần Công Danh (1): diff: index-line: respect --abbrev in object's name Роман Донченко (2): gitk: don't highlight files after submodules as submodules gitk: fix the context menu not appearing in the presence of submodule diffs
On Wed, Sep 30, 2020 at 2:57 PM Junio C Hamano <gitster@pobox.com> wrote: > > Eric Sunshine <sunshine@sunshineco.com> writes: > > > On Wed, Sep 30, 2020 at 5:26 PM Jacob Keller <jacob.e.keller@intel.com> wrote: > >> Changes since v3 > >> * removed the ?: usage (for real this time) > >> > >> + /* Note the reversal of src and dst */ > >> + if (refspec->pattern) { > >> + const char *key = refspec->dst ?: refspec->src; > > > > Blorp. > > Woof. > > Have squashed this in. > > remote.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > I sent a v5 too.. Lol Clearly just not my day today Thanks, Jake > diff --git a/remote.c b/remote.c > index 9f8b25674e..dad3b79332 100644 > --- a/remote.c > +++ b/remote.c > @@ -750,7 +750,7 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite > > /* Note the reversal of src and dst */ > if (refspec->pattern) { > - const char *key = refspec->dst ?: refspec->src; > + const char *key = refspec->dst ? refspec->dst : refspec->src; > const char *value = refspec->src; > > if (match_name_with_pattern(key, needle, value, &expn_name))
On Wed, Sep 30, 2020 at 2:34 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Wed, Sep 30, 2020 at 5:26 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
> > Changes since v3
> > * removed the ?: usage (for real this time)
> >
> > + /* Note the reversal of src and dst */
> > + if (refspec->pattern) {
> > + const char *key = refspec->dst ?: refspec->src;
>
> Blorp.
.... I am very confused.... I made this change...
$git diff doesn't show anything...
Oh.. wooooops. git status has it as staged but not applied..
Sigh. I sent another round.
From: Jacob Keller <jacob.keller@gmail.com> Both fetch and push support pattern refspecs which allow fetching or pushing references that match a specific pattern. Because these patterns are globs, they have somewhat limited ability to express more complex situations. For example, suppose you wish to fetch all branches from a remote except for a specific one. To allow this, you must setup a set of refspecs which match only the branches you want. Because refspecs are either explicit name matches, or simple globs, many patterns cannot be expressed. Add support for a new type of refspec, referred to as "negative" refspecs. These are prefixed with a '^' and mean "exclude any ref matching this refspec". They can only have one "side" which always refers to the source. During a fetch, this refers to the name of the ref on the remote. During a push, this refers to the name of the ref on the local side. With negative refspecs, users can express more complex patterns. For example: git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant will fetch all branches on origin into remotes/origin, but will exclude fetching the branch named dontwant. Refspecs today are commutative, meaning that order doesn't expressly matter. Rather than forcing an implied order, negative refspecs will always be applied last. That is, in order to match, a ref must match at least one positive refspec, and match none of the negative refspecs. This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> --- Uuuugh, not my day. This time I actually fixed the commit instead of just staging the changes to the index... Documentation/pull-fetch-param.txt | 16 +++ builtin/fetch.c | 10 ++ refspec.c | 34 +++++- refspec.h | 14 ++- remote.c | 108 ++++++++++++++++- remote.h | 9 +- t/t5582-fetch-negative-refspec.sh | 189 +++++++++++++++++++++++++++++ 7 files changed, 367 insertions(+), 13 deletions(-) create mode 100755 t/t5582-fetch-negative-refspec.sh diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 95ea84990298..95a7390b2c78 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -30,6 +30,22 @@ The colon can be omitted when <dst> is empty. <src> is typically a ref, but it can also be a fully spelled hex object name. + +A <refspec> may contain a `*` in its <src> to indicate a simple pattern +match. Such a refspec functions like a glob that matches any ref with the +same prefix. A pattern <refspec> must have a `*` in both the <src> and +<dst>. It will map refs to the destination by replacing the `*` with the +contents matched from the source. ++ +If a refspec is prefixed by `^`, it will be interpreted as a negative +refspec. Rather than specifying which refs to fetch or which local refs to +update, such a refspec will instead specify refs to exclude. A ref will be +considered to match if it matches at least one positive refspec, and does +not match any negative refspec. Negative refspecs can be useful to restrict +the scope of a pattern refspec so that it will not include specific refs. +Negative refspecs can themselves be pattern refspecs. However, they may only +contain a <src> and do not specify a <dst>. Fully spelled out hex object +names are also not supported. ++ `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`; it requests fetching everything up to the given tag. + diff --git a/builtin/fetch.c b/builtin/fetch.c index 1b00c2bee90b..e95bf8877ddd 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -537,6 +537,16 @@ static struct ref *get_ref_map(struct remote *remote, tail = &rm->next; } + /* + * apply negative refspecs first, before we remove duplicates. This is + * necessary as negative refspecs might remove an otherwise conflicting + * duplicate. + */ + if (rs->nr) + ref_map = apply_negative_refspecs(ref_map, rs); + else + ref_map = apply_negative_refspecs(ref_map, &remote->fetch); + ref_map = ref_remove_duplicates(ref_map); for (rm = ref_map; rm; rm = rm->next) { diff --git a/refspec.c b/refspec.c index 8d0affc34a6b..8af357a0a35d 100644 --- a/refspec.c +++ b/refspec.c @@ -8,6 +8,7 @@ static struct refspec_item s_tag_refspec = { 1, 0, 0, + 0, "refs/tags/*", "refs/tags/*" }; @@ -32,10 +33,17 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet if (*lhs == '+') { item->force = 1; lhs++; + } else if (*lhs == '^') { + item->negative = 1; + lhs++; } rhs = strrchr(lhs, ':'); + /* negative refspecs only have one side */ + if (item->negative && rhs) + return 0; + /* * Before going on, special case ":" (or "+:") as a refspec * for pushing matching refs. @@ -55,7 +63,7 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet llen = (rhs ? (rhs - lhs - 1) : strlen(lhs)); if (1 <= llen && memchr(lhs, '*', llen)) { - if ((rhs && !is_glob) || (!rhs && fetch)) + if ((rhs && !is_glob) || (!rhs && !item->negative && fetch)) return 0; is_glob = 1; } else if (rhs && is_glob) { @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet item->src = xstrndup(lhs, llen); flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); + if (item->negative) { + struct object_id unused; + + /* + * Negative refspecs only have a LHS, which indicates a ref + * (or pattern of refs) to exclude from other matches. This + * can either be a simple ref, or a glob pattern. Exact sha1 + * match is not currently supported. + */ + if (!*item->src) + return 0; /* negative refspecs must not be empty */ + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) + return 0; /* negative refpsecs cannot be exact sha1 */ + else if (!check_refname_format(item->src, flags)) + ; /* valid looking ref is ok */ + else + return 0; + + /* the other rules below do not apply to negative refspecs */ + return 1; + } + if (fetch) { struct object_id unused; @@ -223,7 +253,7 @@ void refspec_ref_prefixes(const struct refspec *rs, const struct refspec_item *item = &rs->items[i]; const char *prefix = NULL; - if (item->exact_sha1) + if (item->exact_sha1 || item->negative) continue; if (rs->fetch == REFSPEC_FETCH) prefix = item->src; diff --git a/refspec.h b/refspec.h index 7569248d11b1..955183239923 100644 --- a/refspec.h +++ b/refspec.h @@ -5,12 +5,13 @@ extern const struct refspec_item *tag_refspec; /** - * A struct refspec_item holds the parsed interpretation of a refspec. If it will - * force updates (starts with a '+'), force is true. If it is a pattern - * (sides end with '*') pattern is true. src and dest are the two sides - * (including '*' characters if present); if there is only one side, it is src, - * and dst is NULL; if sides exist but are empty (i.e., the refspec either - * starts or ends with ':'), the corresponding side is "". + * A struct refspec_item holds the parsed interpretation of a refspec. If it + * will force updates (starts with a '+'), force is true. If it is a pattern + * (sides end with '*') pattern is true. If it is a negative refspec, (starts + * with '^'), negative is true. src and dest are the two sides (including '*' + * characters if present); if there is only one side, it is src, and dst is + * NULL; if sides exist but are empty (i.e., the refspec either starts or ends + * with ':'), the corresponding side is "". * * remote_find_tracking(), given a remote and a struct refspec_item with either src * or dst filled out, will fill out the other such that the result is in the @@ -22,6 +23,7 @@ struct refspec_item { unsigned pattern : 1; unsigned matching : 1; unsigned exact_sha1 : 1; + unsigned negative : 1; char *src; char *dst; diff --git a/remote.c b/remote.c index eafc14cbe759..8be67f0892b4 100644 --- a/remote.c +++ b/remote.c @@ -682,6 +682,91 @@ static int match_name_with_pattern(const char *key, const char *name, return ret; } +static int refspec_match(const struct refspec_item *refspec, + const char *name) +{ + if (refspec->pattern) + return match_name_with_pattern(refspec->src, name, NULL, NULL); + + return !strcmp(refspec->src, name); +} + +static int omit_name_by_refspec(const char *name, struct refspec *rs) +{ + int i; + + for (i = 0; i < rs->nr; i++) { + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) + return 1; + } + return 0; +} + +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) +{ + struct ref **tail; + + for (tail = &ref_map; *tail; ) { + struct ref *ref = *tail; + + if (omit_name_by_refspec(ref->name, rs)) { + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else + tail = &ref->next; + } + + return ref_map; +} + +static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query) +{ + int i, matched_negative = 0; + int find_src = !query->src; + struct string_list reversed = STRING_LIST_INIT_NODUP; + const char *needle = find_src ? query->dst : query->src; + + /* + * Check whether the queried ref matches any negative refpsec. If so, + * then we should ultimately treat this as not matching the query at + * all. + * + * Note that negative refspecs always match the source, but the query + * item uses the destination. To handle this, we apply pattern + * refspecs in reverse to figure out if the query source matches any + * of the negative refspecs. + */ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + char *expn_name; + + if (refspec->negative) + continue; + + /* Note the reversal of src and dst */ + if (refspec->pattern) { + const char *key = refspec->dst ? refspec->dst : refspec->src; + const char *value = refspec->src; + + if (match_name_with_pattern(key, needle, value, &expn_name)) + string_list_append_nodup(&reversed, expn_name); + } else { + if (!strcmp(needle, refspec->src)) + string_list_append(&reversed, refspec->src); + } + } + + for (i = 0; !matched_negative && i < reversed.nr; i++) { + if (omit_name_by_refspec(reversed.items[i].string, rs)) + matched_negative = 1; + } + + string_list_clear(&reversed, 0); + + return matched_negative; +} + static void query_refspecs_multiple(struct refspec *rs, struct refspec_item *query, struct string_list *results) @@ -692,6 +777,9 @@ static void query_refspecs_multiple(struct refspec *rs, if (find_src && !query->dst) BUG("query_refspecs_multiple: need either src or dst"); + if (query_matches_negative_refspec(rs, query)) + return; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; @@ -699,7 +787,7 @@ static void query_refspecs_multiple(struct refspec *rs, const char *needle = find_src ? query->dst : query->src; char **result = find_src ? &query->src : &query->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) @@ -720,12 +808,15 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query) if (find_src && !query->dst) BUG("query_refspecs: need either src or dst"); + if (query_matches_negative_refspec(rs, query)) + return -1; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; const char *value = find_src ? refspec->src : refspec->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) { @@ -1054,7 +1145,7 @@ static int match_explicit(struct ref *src, struct ref *dst, const char *dst_value = rs->dst; char *dst_guess; - if (rs->pattern || rs->matching) + if (rs->pattern || rs->matching || rs->negative) return 0; matched_src = matched_dst = NULL; @@ -1130,6 +1221,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, int matching_refs = -1; for (i = 0; i < rs->nr; i++) { const struct refspec_item *item = &rs->items[i]; + + if (item->negative) + continue; + if (item->matching && (matching_refs == -1 || item->force)) { matching_refs = i; @@ -1335,7 +1430,7 @@ int check_push_refs(struct ref *src, struct refspec *rs) for (i = 0; i < rs->nr; i++) { struct refspec_item *item = &rs->items[i]; - if (item->pattern || item->matching) + if (item->pattern || item->matching || item->negative) continue; ret |= match_explicit_lhs(src, item, NULL, NULL); @@ -1437,6 +1532,8 @@ int match_push_refs(struct ref *src, struct ref **dst, string_list_clear(&src_ref_index, 0); } + *dst = apply_negative_refspecs(*dst, rs); + if (errs) return -1; return 0; @@ -1806,6 +1903,9 @@ int get_fetch_map(const struct ref *remote_refs, { struct ref *ref_map, **rmp; + if (refspec->negative) + return 0; + if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { diff --git a/remote.h b/remote.h index 5e3ea5a26deb..104e75e0f74d 100644 --- a/remote.h +++ b/remote.h @@ -193,6 +193,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Remove all entries in the input list which match any negative refspec in + * the refspec list. + */ +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); + int query_refspecs(struct refspec *rs, struct refspec_item *query); char *apply_refspecs(struct refspec *rs, const char *name); @@ -205,7 +211,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, /* * Given a list of the remote refs and the specification of things to * fetch, makes a (separate) list of the refs to fetch and the local - * refs to store into. + * refs to store into. Note that negative refspecs are ignored here, and + * should be handled separately. * * *tail is the pointer to the tail pointer of the list of results * beforehand, and will be set to the tail pointer of the list of diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh new file mode 100755 index 000000000000..8c61e28fec85 --- /dev/null +++ b/t/t5582-fetch-negative-refspec.sh @@ -0,0 +1,189 @@ +#!/bin/sh +# Copyright (c) 2020, Jacob Keller. + +test_description='"git fetch" with negative refspecs. + +' + +. ./test-lib.sh + +test_expect_success setup ' + echo >file original && + git add file && + git commit -a -m original +' + +test_expect_success "clone and setup child repos" ' + git clone . one && + ( + cd one && + echo >file updated by one && + git commit -a -m "updated by one" && + git switch -c alternate && + echo >file updated again by one && + git commit -a -m "updated by one again" && + git switch master + ) && + git clone . two && + ( + cd two && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch +refs/heads/*:refs/remotes/one/* && + git config --add remote.one.fetch ^refs/heads/alternate + ) && + git clone . three +' + +test_expect_success "fetch one" ' + echo >file updated by origin && + git commit -a -m "updated by origin" && + ( + cd two && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git fetch one && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git rev-parse --verify refs/remotes/one/master && + mine=$(git rev-parse refs/remotes/one/master) && + his=$(cd ../one && git rev-parse refs/heads/master) && + test "z$mine" = "z$his" + ) +' + +test_expect_success "fetch with negative refspec on commandline" ' + echo >file updated by origin again && + git commit -a -m "updated by origin again" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative sha1 refspec fails" ' + echo >file updated by origin yet again && + git commit -a -m "updated by origin yet again" && + ( + cd three && + master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one + ) +' + +test_expect_success "fetch with negative pattern refspec" ' + echo >file updated by origin once more && + git commit -a -m "updated by origin once more" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/m* && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative pattern refspec does not expand prefix" ' + echo >file updated by origin another time && + git commit -a -m "updated by origin another time" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + echo $alternate_in_one >expect && + echo $master_in_one >>expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative refspec avoids duplicate conflict" ' + cd "$D" && + ( + cd one && + git branch dups/a && + git branch dups/b && + git branch dups/c && + git branch other/a && + git rev-parse --verify refs/heads/other/a >../expect && + git rev-parse --verify refs/heads/dups/b >>../expect && + git rev-parse --verify refs/heads/dups/c >>../expect + ) && + ( + cd three && + git fetch ../one/.git ^refs/heads/dups/a refs/heads/dups/*:refs/dups/* refs/heads/other/a:refs/dups/a && + git rev-parse --verify refs/dups/a >../actual && + git rev-parse --verify refs/dups/b >>../actual && + git rev-parse --verify refs/dups/c >>../actual + ) && + test_cmp expect actual +' + +test_expect_success "push --prune with negative refspec" ' + ( + cd two && + git branch prune/a && + git branch prune/b && + git branch prune/c && + git push ../three refs/heads/prune/* && + git branch -d prune/a && + git branch -d prune/b && + git push --prune ../three refs/heads/prune/* ^refs/heads/prune/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/prune/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "push --prune with negative refspec apply to the destination" ' + ( + cd two && + git branch ours/a && + git branch ours/b && + git branch ours/c && + git push ../three refs/heads/ours/*:refs/heads/theirs/* && + git branch -d ours/a && + git branch -d ours/b && + git push --prune ../three refs/heads/ours/*:refs/heads/theirs/* ^refs/heads/theirs/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/theirs/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch --prune with negative refspec" ' + ( + cd two && + git branch fetch/a && + git branch fetch/b && + git branch fetch/c + ) && + ( + cd three && + git fetch ../two/.git refs/heads/fetch/*:refs/heads/copied/* + ) && + ( + cd two && + git branch -d fetch/a && + git branch -d fetch/b + ) && + ( + cd three && + test_write_lines b c >expect && + git fetch -v ../two/.git --prune refs/heads/fetch/*:refs/heads/copied/* ^refs/heads/fetch/b && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/copied/ >actual && + test_cmp expect actual + ) +' + +test_done -- 2.28.0.497.g54e85e7af1ac
Eric Sunshine <sunshine@sunshineco.com> writes: > On Wed, Sep 30, 2020 at 5:26 PM Jacob Keller <jacob.e.keller@intel.com> wrote: >> Changes since v3 >> * removed the ?: usage (for real this time) >> >> + /* Note the reversal of src and dst */ >> + if (refspec->pattern) { >> + const char *key = refspec->dst ?: refspec->src; > > Blorp. Woof. Have squashed this in. remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote.c b/remote.c index 9f8b25674e..dad3b79332 100644 --- a/remote.c +++ b/remote.c @@ -750,7 +750,7 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite /* Note the reversal of src and dst */ if (refspec->pattern) { - const char *key = refspec->dst ?: refspec->src; + const char *key = refspec->dst ? refspec->dst : refspec->src; const char *value = refspec->src; if (match_name_with_pattern(key, needle, value, &expn_name))
On Wed, Sep 30, 2020 at 5:26 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
> Changes since v3
> * removed the ?: usage (for real this time)
>
> + /* Note the reversal of src and dst */
> + if (refspec->pattern) {
> + const char *key = refspec->dst ?: refspec->src;
Blorp.
From: Jacob Keller <jacob.keller@gmail.com> Both fetch and push support pattern refspecs which allow fetching or pushing references that match a specific pattern. Because these patterns are globs, they have somewhat limited ability to express more complex situations. For example, suppose you wish to fetch all branches from a remote except for a specific one. To allow this, you must setup a set of refspecs which match only the branches you want. Because refspecs are either explicit name matches, or simple globs, many patterns cannot be expressed. Add support for a new type of refspec, referred to as "negative" refspecs. These are prefixed with a '^' and mean "exclude any ref matching this refspec". They can only have one "side" which always refers to the source. During a fetch, this refers to the name of the ref on the remote. During a push, this refers to the name of the ref on the local side. With negative refspecs, users can express more complex patterns. For example: git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant will fetch all branches on origin into remotes/origin, but will exclude fetching the branch named dontwant. Refspecs today are commutative, meaning that order doesn't expressly matter. Rather than forcing an implied order, negative refspecs will always be applied last. That is, in order to match, a ref must match at least one positive refspec, and match none of the negative refspecs. This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> --- Changes since v3 * removed the ?: usage (for real this time) Documentation/pull-fetch-param.txt | 16 +++ builtin/fetch.c | 10 ++ refspec.c | 34 +++++- refspec.h | 14 ++- remote.c | 108 ++++++++++++++++- remote.h | 9 +- t/t5582-fetch-negative-refspec.sh | 189 +++++++++++++++++++++++++++++ 7 files changed, 367 insertions(+), 13 deletions(-) create mode 100755 t/t5582-fetch-negative-refspec.sh diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 95ea84990298..95a7390b2c78 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -30,6 +30,22 @@ The colon can be omitted when <dst> is empty. <src> is typically a ref, but it can also be a fully spelled hex object name. + +A <refspec> may contain a `*` in its <src> to indicate a simple pattern +match. Such a refspec functions like a glob that matches any ref with the +same prefix. A pattern <refspec> must have a `*` in both the <src> and +<dst>. It will map refs to the destination by replacing the `*` with the +contents matched from the source. ++ +If a refspec is prefixed by `^`, it will be interpreted as a negative +refspec. Rather than specifying which refs to fetch or which local refs to +update, such a refspec will instead specify refs to exclude. A ref will be +considered to match if it matches at least one positive refspec, and does +not match any negative refspec. Negative refspecs can be useful to restrict +the scope of a pattern refspec so that it will not include specific refs. +Negative refspecs can themselves be pattern refspecs. However, they may only +contain a <src> and do not specify a <dst>. Fully spelled out hex object +names are also not supported. ++ `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`; it requests fetching everything up to the given tag. + diff --git a/builtin/fetch.c b/builtin/fetch.c index 1b00c2bee90b..e95bf8877ddd 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -537,6 +537,16 @@ static struct ref *get_ref_map(struct remote *remote, tail = &rm->next; } + /* + * apply negative refspecs first, before we remove duplicates. This is + * necessary as negative refspecs might remove an otherwise conflicting + * duplicate. + */ + if (rs->nr) + ref_map = apply_negative_refspecs(ref_map, rs); + else + ref_map = apply_negative_refspecs(ref_map, &remote->fetch); + ref_map = ref_remove_duplicates(ref_map); for (rm = ref_map; rm; rm = rm->next) { diff --git a/refspec.c b/refspec.c index 8d0affc34a6b..8af357a0a35d 100644 --- a/refspec.c +++ b/refspec.c @@ -8,6 +8,7 @@ static struct refspec_item s_tag_refspec = { 1, 0, 0, + 0, "refs/tags/*", "refs/tags/*" }; @@ -32,10 +33,17 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet if (*lhs == '+') { item->force = 1; lhs++; + } else if (*lhs == '^') { + item->negative = 1; + lhs++; } rhs = strrchr(lhs, ':'); + /* negative refspecs only have one side */ + if (item->negative && rhs) + return 0; + /* * Before going on, special case ":" (or "+:") as a refspec * for pushing matching refs. @@ -55,7 +63,7 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet llen = (rhs ? (rhs - lhs - 1) : strlen(lhs)); if (1 <= llen && memchr(lhs, '*', llen)) { - if ((rhs && !is_glob) || (!rhs && fetch)) + if ((rhs && !is_glob) || (!rhs && !item->negative && fetch)) return 0; is_glob = 1; } else if (rhs && is_glob) { @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet item->src = xstrndup(lhs, llen); flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); + if (item->negative) { + struct object_id unused; + + /* + * Negative refspecs only have a LHS, which indicates a ref + * (or pattern of refs) to exclude from other matches. This + * can either be a simple ref, or a glob pattern. Exact sha1 + * match is not currently supported. + */ + if (!*item->src) + return 0; /* negative refspecs must not be empty */ + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) + return 0; /* negative refpsecs cannot be exact sha1 */ + else if (!check_refname_format(item->src, flags)) + ; /* valid looking ref is ok */ + else + return 0; + + /* the other rules below do not apply to negative refspecs */ + return 1; + } + if (fetch) { struct object_id unused; @@ -223,7 +253,7 @@ void refspec_ref_prefixes(const struct refspec *rs, const struct refspec_item *item = &rs->items[i]; const char *prefix = NULL; - if (item->exact_sha1) + if (item->exact_sha1 || item->negative) continue; if (rs->fetch == REFSPEC_FETCH) prefix = item->src; diff --git a/refspec.h b/refspec.h index 7569248d11b1..955183239923 100644 --- a/refspec.h +++ b/refspec.h @@ -5,12 +5,13 @@ extern const struct refspec_item *tag_refspec; /** - * A struct refspec_item holds the parsed interpretation of a refspec. If it will - * force updates (starts with a '+'), force is true. If it is a pattern - * (sides end with '*') pattern is true. src and dest are the two sides - * (including '*' characters if present); if there is only one side, it is src, - * and dst is NULL; if sides exist but are empty (i.e., the refspec either - * starts or ends with ':'), the corresponding side is "". + * A struct refspec_item holds the parsed interpretation of a refspec. If it + * will force updates (starts with a '+'), force is true. If it is a pattern + * (sides end with '*') pattern is true. If it is a negative refspec, (starts + * with '^'), negative is true. src and dest are the two sides (including '*' + * characters if present); if there is only one side, it is src, and dst is + * NULL; if sides exist but are empty (i.e., the refspec either starts or ends + * with ':'), the corresponding side is "". * * remote_find_tracking(), given a remote and a struct refspec_item with either src * or dst filled out, will fill out the other such that the result is in the @@ -22,6 +23,7 @@ struct refspec_item { unsigned pattern : 1; unsigned matching : 1; unsigned exact_sha1 : 1; + unsigned negative : 1; char *src; char *dst; diff --git a/remote.c b/remote.c index eafc14cbe759..26a127142344 100644 --- a/remote.c +++ b/remote.c @@ -682,6 +682,91 @@ static int match_name_with_pattern(const char *key, const char *name, return ret; } +static int refspec_match(const struct refspec_item *refspec, + const char *name) +{ + if (refspec->pattern) + return match_name_with_pattern(refspec->src, name, NULL, NULL); + + return !strcmp(refspec->src, name); +} + +static int omit_name_by_refspec(const char *name, struct refspec *rs) +{ + int i; + + for (i = 0; i < rs->nr; i++) { + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) + return 1; + } + return 0; +} + +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) +{ + struct ref **tail; + + for (tail = &ref_map; *tail; ) { + struct ref *ref = *tail; + + if (omit_name_by_refspec(ref->name, rs)) { + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else + tail = &ref->next; + } + + return ref_map; +} + +static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query) +{ + int i, matched_negative = 0; + int find_src = !query->src; + struct string_list reversed = STRING_LIST_INIT_NODUP; + const char *needle = find_src ? query->dst : query->src; + + /* + * Check whether the queried ref matches any negative refpsec. If so, + * then we should ultimately treat this as not matching the query at + * all. + * + * Note that negative refspecs always match the source, but the query + * item uses the destination. To handle this, we apply pattern + * refspecs in reverse to figure out if the query source matches any + * of the negative refspecs. + */ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + char *expn_name; + + if (refspec->negative) + continue; + + /* Note the reversal of src and dst */ + if (refspec->pattern) { + const char *key = refspec->dst ?: refspec->src; + const char *value = refspec->src; + + if (match_name_with_pattern(key, needle, value, &expn_name)) + string_list_append_nodup(&reversed, expn_name); + } else { + if (!strcmp(needle, refspec->src)) + string_list_append(&reversed, refspec->src); + } + } + + for (i = 0; !matched_negative && i < reversed.nr; i++) { + if (omit_name_by_refspec(reversed.items[i].string, rs)) + matched_negative = 1; + } + + string_list_clear(&reversed, 0); + + return matched_negative; +} + static void query_refspecs_multiple(struct refspec *rs, struct refspec_item *query, struct string_list *results) @@ -692,6 +777,9 @@ static void query_refspecs_multiple(struct refspec *rs, if (find_src && !query->dst) BUG("query_refspecs_multiple: need either src or dst"); + if (query_matches_negative_refspec(rs, query)) + return; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; @@ -699,7 +787,7 @@ static void query_refspecs_multiple(struct refspec *rs, const char *needle = find_src ? query->dst : query->src; char **result = find_src ? &query->src : &query->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) @@ -720,12 +808,15 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query) if (find_src && !query->dst) BUG("query_refspecs: need either src or dst"); + if (query_matches_negative_refspec(rs, query)) + return -1; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; const char *value = find_src ? refspec->src : refspec->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) { @@ -1054,7 +1145,7 @@ static int match_explicit(struct ref *src, struct ref *dst, const char *dst_value = rs->dst; char *dst_guess; - if (rs->pattern || rs->matching) + if (rs->pattern || rs->matching || rs->negative) return 0; matched_src = matched_dst = NULL; @@ -1130,6 +1221,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, int matching_refs = -1; for (i = 0; i < rs->nr; i++) { const struct refspec_item *item = &rs->items[i]; + + if (item->negative) + continue; + if (item->matching && (matching_refs == -1 || item->force)) { matching_refs = i; @@ -1335,7 +1430,7 @@ int check_push_refs(struct ref *src, struct refspec *rs) for (i = 0; i < rs->nr; i++) { struct refspec_item *item = &rs->items[i]; - if (item->pattern || item->matching) + if (item->pattern || item->matching || item->negative) continue; ret |= match_explicit_lhs(src, item, NULL, NULL); @@ -1437,6 +1532,8 @@ int match_push_refs(struct ref *src, struct ref **dst, string_list_clear(&src_ref_index, 0); } + *dst = apply_negative_refspecs(*dst, rs); + if (errs) return -1; return 0; @@ -1806,6 +1903,9 @@ int get_fetch_map(const struct ref *remote_refs, { struct ref *ref_map, **rmp; + if (refspec->negative) + return 0; + if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { diff --git a/remote.h b/remote.h index 5e3ea5a26deb..104e75e0f74d 100644 --- a/remote.h +++ b/remote.h @@ -193,6 +193,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Remove all entries in the input list which match any negative refspec in + * the refspec list. + */ +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); + int query_refspecs(struct refspec *rs, struct refspec_item *query); char *apply_refspecs(struct refspec *rs, const char *name); @@ -205,7 +211,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, /* * Given a list of the remote refs and the specification of things to * fetch, makes a (separate) list of the refs to fetch and the local - * refs to store into. + * refs to store into. Note that negative refspecs are ignored here, and + * should be handled separately. * * *tail is the pointer to the tail pointer of the list of results * beforehand, and will be set to the tail pointer of the list of diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh new file mode 100755 index 000000000000..8c61e28fec85 --- /dev/null +++ b/t/t5582-fetch-negative-refspec.sh @@ -0,0 +1,189 @@ +#!/bin/sh +# Copyright (c) 2020, Jacob Keller. + +test_description='"git fetch" with negative refspecs. + +' + +. ./test-lib.sh + +test_expect_success setup ' + echo >file original && + git add file && + git commit -a -m original +' + +test_expect_success "clone and setup child repos" ' + git clone . one && + ( + cd one && + echo >file updated by one && + git commit -a -m "updated by one" && + git switch -c alternate && + echo >file updated again by one && + git commit -a -m "updated by one again" && + git switch master + ) && + git clone . two && + ( + cd two && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch +refs/heads/*:refs/remotes/one/* && + git config --add remote.one.fetch ^refs/heads/alternate + ) && + git clone . three +' + +test_expect_success "fetch one" ' + echo >file updated by origin && + git commit -a -m "updated by origin" && + ( + cd two && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git fetch one && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git rev-parse --verify refs/remotes/one/master && + mine=$(git rev-parse refs/remotes/one/master) && + his=$(cd ../one && git rev-parse refs/heads/master) && + test "z$mine" = "z$his" + ) +' + +test_expect_success "fetch with negative refspec on commandline" ' + echo >file updated by origin again && + git commit -a -m "updated by origin again" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative sha1 refspec fails" ' + echo >file updated by origin yet again && + git commit -a -m "updated by origin yet again" && + ( + cd three && + master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one + ) +' + +test_expect_success "fetch with negative pattern refspec" ' + echo >file updated by origin once more && + git commit -a -m "updated by origin once more" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/m* && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative pattern refspec does not expand prefix" ' + echo >file updated by origin another time && + git commit -a -m "updated by origin another time" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + echo $alternate_in_one >expect && + echo $master_in_one >>expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative refspec avoids duplicate conflict" ' + cd "$D" && + ( + cd one && + git branch dups/a && + git branch dups/b && + git branch dups/c && + git branch other/a && + git rev-parse --verify refs/heads/other/a >../expect && + git rev-parse --verify refs/heads/dups/b >>../expect && + git rev-parse --verify refs/heads/dups/c >>../expect + ) && + ( + cd three && + git fetch ../one/.git ^refs/heads/dups/a refs/heads/dups/*:refs/dups/* refs/heads/other/a:refs/dups/a && + git rev-parse --verify refs/dups/a >../actual && + git rev-parse --verify refs/dups/b >>../actual && + git rev-parse --verify refs/dups/c >>../actual + ) && + test_cmp expect actual +' + +test_expect_success "push --prune with negative refspec" ' + ( + cd two && + git branch prune/a && + git branch prune/b && + git branch prune/c && + git push ../three refs/heads/prune/* && + git branch -d prune/a && + git branch -d prune/b && + git push --prune ../three refs/heads/prune/* ^refs/heads/prune/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/prune/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "push --prune with negative refspec apply to the destination" ' + ( + cd two && + git branch ours/a && + git branch ours/b && + git branch ours/c && + git push ../three refs/heads/ours/*:refs/heads/theirs/* && + git branch -d ours/a && + git branch -d ours/b && + git push --prune ../three refs/heads/ours/*:refs/heads/theirs/* ^refs/heads/theirs/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/theirs/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch --prune with negative refspec" ' + ( + cd two && + git branch fetch/a && + git branch fetch/b && + git branch fetch/c + ) && + ( + cd three && + git fetch ../two/.git refs/heads/fetch/*:refs/heads/copied/* + ) && + ( + cd two && + git branch -d fetch/a && + git branch -d fetch/b + ) && + ( + cd three && + test_write_lines b c >expect && + git fetch -v ../two/.git --prune refs/heads/fetch/*:refs/heads/copied/* ^refs/heads/fetch/b && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/copied/ >actual && + test_cmp expect actual + ) +' + +test_done -- 2.28.0.497.g54e85e7af1ac
On Wed, Sep 30, 2020 at 2:05 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Jacob Keller <jacob.keller@gmail.com> writes:
>
> > Ack.... I swore I fixed this... I'm not sure what happened on my end here.
>
> I do recall adding a SQUASH??? commit on top when I queued the last
> round, but I didn't do so for this round (and the patches changed
> sufficiently enough that the old squash commit no longer applies).
>
Let me send a v4 with this change built in. I remember making it, but
I suspect in the other refactors I accidentally resurrected the
version without it :(
Jacob Keller <jacob.keller@gmail.com> writes:
> Ack.... I swore I fixed this... I'm not sure what happened on my end here.
I do recall adding a SQUASH??? commit on top when I queued the last
round, but I didn't do so for this round (and the patches changed
sufficiently enough that the old squash commit no longer applies).
On Wed, Sep 30, 2020 at 5:36 AM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> Hi Jake,
>
> On Fri, 25 Sep 2020, Jacob Keller wrote:
>
> > diff --git a/remote.c b/remote.c
> > index eafc14cbe759..26a127142344 100644
> > --- a/remote.c
> > +++ b/remote.c
> > @@ -682,6 +682,91 @@ static int match_name_with_pattern(const char *key, const char *name,
> > return ret;
> > }
> >
> > +static int refspec_match(const struct refspec_item *refspec,
> > + const char *name)
> > +{
> > + if (refspec->pattern)
> > + return match_name_with_pattern(refspec->src, name, NULL, NULL);
> > +
> > + return !strcmp(refspec->src, name);
> > +}
> > +
> > +static int omit_name_by_refspec(const char *name, struct refspec *rs)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < rs->nr; i++) {
> > + if (rs->items[i].negative && refspec_match(&rs->items[i], name))
> > + return 1;
> > + }
> > + return 0;
> > +}
> > +
> > +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs)
> > +{
> > + struct ref **tail;
> > +
> > + for (tail = &ref_map; *tail; ) {
> > + struct ref *ref = *tail;
> > +
> > + if (omit_name_by_refspec(ref->name, rs)) {
> > + *tail = ref->next;
> > + free(ref->peer_ref);
> > + free(ref);
> > + } else
> > + tail = &ref->next;
> > + }
> > +
> > + return ref_map;
> > +}
> > +
> > +static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query)
> > +{
> > + int i, matched_negative = 0;
> > + int find_src = !query->src;
> > + struct string_list reversed = STRING_LIST_INIT_NODUP;
> > + const char *needle = find_src ? query->dst : query->src;
> > +
> > + /*
> > + * Check whether the queried ref matches any negative refpsec. If so,
> > + * then we should ultimately treat this as not matching the query at
> > + * all.
> > + *
> > + * Note that negative refspecs always match the source, but the query
> > + * item uses the destination. To handle this, we apply pattern
> > + * refspecs in reverse to figure out if the query source matches any
> > + * of the negative refspecs.
> > + */
> > + for (i = 0; i < rs->nr; i++) {
> > + struct refspec_item *refspec = &rs->items[i];
> > + char *expn_name;
> > +
> > + if (refspec->negative)
> > + continue;
> > +
> > + /* Note the reversal of src and dst */
> > + if (refspec->pattern) {
> > + const char *key = refspec->dst ?: refspec->src;
>
> Would you mind fixing this? This keeps getting reverted...
>
Ack.... I swore I fixed this... I'm not sure what happened on my end here.
Hi Jake, On Fri, 25 Sep 2020, Jacob Keller wrote: > diff --git a/remote.c b/remote.c > index eafc14cbe759..26a127142344 100644 > --- a/remote.c > +++ b/remote.c > @@ -682,6 +682,91 @@ static int match_name_with_pattern(const char *key, const char *name, > return ret; > } > > +static int refspec_match(const struct refspec_item *refspec, > + const char *name) > +{ > + if (refspec->pattern) > + return match_name_with_pattern(refspec->src, name, NULL, NULL); > + > + return !strcmp(refspec->src, name); > +} > + > +static int omit_name_by_refspec(const char *name, struct refspec *rs) > +{ > + int i; > + > + for (i = 0; i < rs->nr; i++) { > + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) > + return 1; > + } > + return 0; > +} > + > +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) > +{ > + struct ref **tail; > + > + for (tail = &ref_map; *tail; ) { > + struct ref *ref = *tail; > + > + if (omit_name_by_refspec(ref->name, rs)) { > + *tail = ref->next; > + free(ref->peer_ref); > + free(ref); > + } else > + tail = &ref->next; > + } > + > + return ref_map; > +} > + > +static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query) > +{ > + int i, matched_negative = 0; > + int find_src = !query->src; > + struct string_list reversed = STRING_LIST_INIT_NODUP; > + const char *needle = find_src ? query->dst : query->src; > + > + /* > + * Check whether the queried ref matches any negative refpsec. If so, > + * then we should ultimately treat this as not matching the query at > + * all. > + * > + * Note that negative refspecs always match the source, but the query > + * item uses the destination. To handle this, we apply pattern > + * refspecs in reverse to figure out if the query source matches any > + * of the negative refspecs. > + */ > + for (i = 0; i < rs->nr; i++) { > + struct refspec_item *refspec = &rs->items[i]; > + char *expn_name; > + > + if (refspec->negative) > + continue; > + > + /* Note the reversal of src and dst */ > + if (refspec->pattern) { > + const char *key = refspec->dst ?: refspec->src; Would you mind fixing this? This keeps getting reverted... -- snipsnap -- From 4aea2a58a9f6bb1cbbc7a03db63a1465f9a801da Mon Sep 17 00:00:00 2001 From: Johannes Schindelin <johannes.schindelin@gmx.de> Date: Sun, 23 Aug 2020 22:27:17 +0200 Subject: [PATCH] fixup??? refspec: add support for negative refspecs The `?:` operator is not supported e.g. by Visual C. Let's not use it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote.c b/remote.c index f7d20c059b3e..1659535c1a8d 100644 --- a/remote.c +++ b/remote.c @@ -724,7 +724,7 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite /* Note the reversal of src and dst */ if (refspec->pattern) { - const char *key = refspec->dst ?: refspec->src; + const char *key = refspec->dst ? refspec->dst : refspec->src; const char *value = refspec->src; if (match_name_with_pattern(key, needle, value, &expn_name)) -- 2.28.0.windows.1.52.gbcabfe850c5e
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. We have a topic on 'seen', sk/force-if-includes, that behaves differently when the commit-graph feature is in use (a working in_merge_bases_many() implementation is critical for the topic to work as expected). Help in debugging it is very much appreciated. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * ah/pull (2020-09-24) 1 commit (merged to 'next' on 2020-09-25 at b5ddf0cf8b) + pull: don't warn if pull.ff has been set Earlier we taught "git pull" to warn when the user does not say the histories need to be merged, rebased or accepts only fast- forwarding, but the warning triggered for those who have set the pull.ff configuration variable. * bc/clone-with-git-default-hash-fix (2020-09-22) 1 commit (merged to 'next' on 2020-09-22 at 62ea45c20e) + builtin/clone: avoid failure with GIT_DEFAULT_HASH "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. * bc/faq-misc (2020-09-20) 3 commits (merged to 'next' on 2020-09-22 at a81b728010) + docs: explain how to deal with files that are always modified + docs: explain why reverts are not always applied on merge + docs: explain why squash merges are broken with long-running branches More FAQ entries. * dl/zero-oid-in-hooks (2020-09-23) 3 commits (merged to 'next' on 2020-09-25 at 3c7d03d61a) + hooks--update.sample: use hash-agnostic zero OID + hooks--pre-push.sample: use hash-agnostic zero OID + hooks--pre-push.sample: modernize script Adjust sample hooks for hash algorithm other than SHA-1. * jc/t1506-rev-parse-leaves-range-endpoint-unpeeled (2020-09-25) 1 commit (merged to 'next' on 2020-09-25 at e5233774ba) + t1506: rev-parse A..B and A...B Test update. * jk/make-protocol-v2-the-default (2020-09-25) 1 commit (merged to 'next' on 2020-09-25 at 21a5f9e880) + protocol: re-enable v2 protocol by default The transport protocol v2 has become the default again. * tb/bloom-improvements (2020-09-18) 13 commits (merged to 'next' on 2020-09-22 at 520d531ad8) + commit-graph: introduce 'commitGraph.maxNewFilters' + builtin/commit-graph.c: introduce '--max-new-filters=<n>' + commit-graph: rename 'split_commit_graph_opts' + bloom: encode out-of-bounds filters as non-empty + bloom/diff: properly short-circuit on max_changes + bloom: use provided 'struct bloom_filter_settings' + bloom: split 'get_bloom_filter()' in two + commit-graph.c: store maximum changed paths + commit-graph: respect 'commitGraph.readChangedPaths' + t/helper/test-read-graph.c: prepare repo settings + commit-graph: pass a 'struct repository *' in more places + t4216: use an '&&'-chain + commit-graph: introduce 'get_bloom_filter_settings()' "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. * tg/range-diff-same-file-fix (2020-09-24) 1 commit (merged to 'next' on 2020-09-25 at c2078e5505) + diff: fix modified lines stats with --stat and --numstat "git range-diff" showed incorrect diffstat, which has been corrected. -------------------------------------------------- [New Topics] * al/ref-filter-merged-and-no-merged (2020-09-26) 1 commit (merged to 'next' on 2020-09-29 at 748a286753) + ref-filter: plug memory leak in reach_filter() Hotfix. Will merge to 'master'. * au/complete-restore-s (2020-09-26) 2 commits (merged to 'next' on 2020-09-29 at 7bbf508562) + completion: complete refs after 'git restore -s' + completion: use "prev" variable instead of introducing "prevword" The command line completion (in contrib/) learned that "git restore -s <TAB>" is often followed by a refname. Will merge to 'master'. * eg/mailinfo-doc-scissors (2020-09-28) 1 commit (merged to 'next' on 2020-09-29 at 4694f22fe9) + Doc: show example scissors line The explanation of the "scissors line" has been clarified. Will merge to 'master'. * jc/fmt-merge-msg-suppress-destination (2020-09-27) 1 commit (merged to 'next' on 2020-09-29 at 2b1f8ee654) + config/fmt-merge-msg.txt: drop space in quote Docfix. Will merge to 'master'. * jk/format-auto-base-when-able (2020-09-26) 1 commit - format-patch: teach format.useAutoBase "whenAble" option "git format-patch" learns to take "if-able" as a possible value for its "--base" option, and "whenAble" as a possible value for the format.useAutoBase configuration variable to become no-op when the automatically computed base does not make sense. * ma/worktree-cleanups (2020-09-27) 7 commits - worktree: use skip_prefix to parse target - worktree: rename copy-pasted variable - worktree: update renamed variable in comment - worktree: inline `worktree_ref()` into its only caller - wt-status: introduce wt_status_state_free_buffers() - wt-status: print to s->fp, not stdout - wt-status: replace sha1 mentions with oid Code clean-up. Will merge to 'next'. * mt/delta-base-cache-races (2020-09-28) 2 commits (merged to 'next' on 2020-09-29 at ee2d60c077) + packfile: fix memory leak in add_delta_base_cache() + packfile: fix race condition on unpack_entry() A race that leads to an access to a free'd data was corrected in the codepath that reads pack files. Will merge to 'master'. * nl/credential-crlf (2020-09-28) 3 commits - docs: make notes regarding credential line reading - credentials: make line reading Windows compatible - credential.c: fix credential reading with regards to CR/LF cf. <pull.710.v2.git.git.1601293224.gitgitgadget@gmail.com> * tb/upload-pack-filters (2020-09-27) 1 commit (merged to 'next' on 2020-09-29 at 3dde767170) + config/uploadpack.txt: fix typo in `--filter=tree:<n>` Hotfix. Will merge to 'master'. * so/combine-diff-simplify (2020-09-29) 1 commit - diff: get rid of redundant 'dense' argument -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Discard for now. cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> cf. <20200911214358.acl3hy2e763begoo@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * cc/bisect-start-fix (2020-09-25) 1 commit (merged to 'next' on 2020-09-29 at 637011d04a) + bisect: don't use invalid oid as rev when starting "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. Will merge to 'master'. * mt/parallel-checkout-part-1 (2020-09-22) 19 commits - ci: run test round with parallel-checkout enabled - parallel-checkout: add tests related to .gitattributes - parallel-checkout: add tests related to clone collisions - parallel-checkout: add tests for basic operations - checkout-index: add parallel checkout support - builtin/checkout.c: complete parallel checkout support - make_transient_cache_entry(): optionally alloc from mem_pool - parallel-checkout: support progress displaying - parallel-checkout: make it truly parallel - unpack-trees: add basic support for parallel checkout - entry: add checkout_entry_ca() which takes preloaded conv_attrs - entry: move conv_attrs lookup up to checkout_entry() - entry: extract cache_entry update from write_entry() - entry: make fstat_output() and read_blob_entry() public - entry: extract a header file for entry.c functions - convert: add conv_attrs classification - convert: add get_stream_filter_ca() variant - convert: add [async_]convert_to_working_tree_ca() variants - convert: make convert_attrs() and convert structs public Parallel checkout. * jk/drop-unaligned-loads (2020-09-24) 2 commits (merged to 'next' on 2020-09-29 at 29c05387a0) + Revert "fast-export: use local array to store anonymized oid" + bswap.h: drop unaligned loads Compilation fix around type punning. Will merge to 'master'. * jc/blame-ignore-fix (2020-09-24) 2 commits (merged to 'next' on 2020-09-29 at 96fbdb57fb) + blame: validate and peel the object names on the ignore list + t8013: minimum preparatory clean-up "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. Will merge to 'master'. * jk/shortlog-group-by-trailer (2020-09-27) 8 commits (merged to 'next' on 2020-09-29 at 3706b06db5) + shortlog: allow multiple groups to be specified + shortlog: parse trailer idents + shortlog: rename parse_stdin_ident() + shortlog: de-duplicate trailer values + shortlog: match commit trailers with --group + trailer: add interface for iterating over commit trailers + shortlog: add grouping option + shortlog: change "author" variables to "ident" "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. Will merge to 'master'. * js/cmake-vs (2020-09-28) 11 commits - cmake: fix typo in message when `msgfmt` was not found - hashmap_for_each_entry(): workaround MSVC's runtime check failure #3 - cmake (Windows): recommend using Visual Studio's built-in CMake support - cmake (Windows): initialize vcpkg/build dependencies automatically - cmake (Windows): complain when encountering an unknown compiler - cmake (Windows): let the `.dll` files be found when running the tests - cmake: quote the path accurately when editing `test-lib.sh` - cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows - cmake: ensure that the `vcpkg` packages are found on Windows - cmake: do find Git for Windows' shell interpreter - cmake: ignore files generated by CMake as run in Visual Studio Using the CMake support we added some time ago for real with Visual Studio build revealed there were lot of usability improvements possible, which have been carried out. Expecting a (hopefully) final reroll. cf. <nycvar.QRO.7.76.6.2009291406310.50@tvgsbejvaqbjf.bet> cf. <nycvar.QRO.7.76.6.2009291407130.50@tvgsbejvaqbjf.bet> * sv/t7001-modernize (2020-09-25) 11 commits - t7001: move cleanup code from outside the tests into them - t7001: use `test` rather than `[` - t7001: use here-docs instead of echo - t7001: put each command on a separate line - t7001: use ': >' rather than 'touch' - t7001: change (cd <path> && git foo) to (git -C <path> foo) - t7001: remove whitespace after redirect operators - t7001: change the style for cd according to subshell - t7001: remove unnecessary blank lines - t7001: use TAB instead of spaces - t7001: convert tests from the old style to the current style Test script modernization. Expecting a reroll. cf. <20200925170256.11490-1-shubhunic@gmail.com> * jc/sequencer-stopped-sha-simplify (2020-09-25) 1 commit (merged to 'next' on 2020-09-29 at 9af3360572) + sequencer: stop abbreviating stopped-sha file Code simplification. Will merge to 'master'. * rs/archive-add-file (2020-09-19) 3 commits - Makefile: use git-archive --add-file - archive: add --add-file - archive: read short blobs in archive.c::write_archive_entry() "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * js/default-branch-name-part-2 (2020-09-26) 5 commits - t9902: avoid using the branch name `master` - tests: avoid variations of the `master` branch name - t3200: avoid variations of the `master` branch name - fast-export: avoid using unnecessary language in a code comment - t/test-terminal: avoid non-inclusive language Update the tests to drop word 'master' from them * jt/keep-partial-clone-filter-upon-lazy-fetch (2020-09-28) 2 commits - fetch: do not override partial clone filter - promisor-remote: remove unused variable The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damate to the partial clone filter in the repository, which has been corrected. * dl/diff-merge-base (2020-09-21) 10 commits - contrib/completion: complete `git diff --merge-base` - builtin/diff-tree: learn --merge-base - builtin/diff-index: learn --merge-base - t4068: add --merge-base tests - diff-lib: define diff_get_merge_base() - diff-lib: accept option flags in run_diff_index() - contrib/completion: extract common diff/difftool options - git-diff.txt: backtick quote command text - git-diff-index.txt: make --cached description a proper sentence - t4068: remove unnecessary >tmp "git diff A...B" learned "git diff --merge-base A B", which is a longer short-hand to say the same thing. Expecting a reroll. cf. <xmqqblhyepup.fsf@gitster.c.googlers.com> * sb/clone-origin (2020-09-29) 7 commits - clone: allow configurable default for `-o`/`--origin` - clone: read new remote name from remote_name instead of option_origin - clone: validate --origin option before use - refs: consolidate remote name validation - remote: add tests for add and rename with invalid names - clone: use more conventional config/option layering - clone: add tests for --template and some disallowed option pairs "git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. Expecting an update. * sk/force-if-includes (2020-09-27) 4 commits - SQUASH??? name an array in singular and avoid commenting obvious - t, doc: update tests, reference for "--force-if-includes" - push: parse and set flag for "--force-if-includes" - push: add reflog check for "--force-if-includes" "git push --force-with-lease[=<ref>]" can easily be misused to lose commits unless the user takes good care of their own "git fetch". A new option "--force-if-includes" attempts to ensure that what is being force-pushed was created after examining the commit at the tip of the remote ref that is about to be force-replaced. On hold. Seems to trigger gotchas in the reachability logic in commit-graph. * ab/mediawiki-fixes (2020-09-21) 18 commits (merged to 'next' on 2020-09-25 at 878693716e) + remote-mediawiki: use "sh" to eliminate unquoted commands + remote-mediawiki: annotate unquoted uses of run_git() + remote-mediawiki: convert to quoted run_git() invocation + remote-mediawiki: provide a list form of run_git() + remote-mediawiki tests: annotate failing tests + remote-mediawiki: fix duplicate revisions being imported + remote-mediawiki tests: use CLI installer + remote-mediawiki tests: use inline PerlIO for readability + remote-mediawiki tests: replace deprecated Perl construct + remote-mediawiki tests: use a more idiomatic dispatch table + remote-mediawiki tests: use "$dir/" instead of "$dir." + remote-mediawiki tests: change `[]` to `test` + remote-mediawiki tests: use test_cmp in tests + remote-mediawiki tests: use a 10 character password + remote-mediawiki tests: use the login/password variables + remote-mediawiki doc: don't hardcode Debian PHP versions + remote-mediawiki doc: link to MediaWiki's current version + remote-mediawiki doc: correct link to GitHub project Modernization and fixes to MediaWiki remote backend. Will merge to 'master'. * ar/fetch-transfer-ipversion (2020-09-16) 1 commit - config: option transfer.ipversion to set transport protocol version for network fetches Adds transfer.ipversion configuration variable. Needs more work. * hn/reftable (2020-09-22) 14 commits - reftable: fix some sparse warnings - reftable: "test-tool dump-reftable" command. - reftable: rest of library - reftable: file level tests - reftable: read reftable files - reftable: write reftable files - reftable: a generic binary tree implementation - reftable: reading/writing blocks - reftable: (de)serialization for the polymorphic record type. - reftable: utility functions - reftable: add a barebones unittest framework - vcxproj: adjust for the reftable changes - reftable: define the public API - reftable: add LICENSE * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. Expecting a reroll. cf. <20200909222333.GH241078@camp.crustytoothpaste.net> * ds/maintenance-part-3 (2020-09-25) 7 commits - maintenance: add troubleshooting guide to docs - maintenance: recommended schedule in register/start - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. * mt/grep-sparse-checkout (2020-09-10) 9 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - config: make do_git_config_sequence receive a 'struct repository' - t/helper/test-config: unify exit labels - t/helper/test-config: diagnose missing arguments - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-09-24) 6 commits (merged to 'next' on 2020-09-29 at a15f1729d2) + bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C + bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' + bisect--helper: reimplement `bisect_autostart` shell function in C + bisect--helper: introduce new `write_in_file()` function + bisect--helper: use '-res' in 'cmd_bisect__helper' return + bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. Will merge to 'master'. * js/no-builtins-on-disk-option (2020-09-21) 3 commits (merged to 'next' on 2020-09-25 at 6b976da4d2) + ci: stop linking built-ins to the dashed versions + Optionally skip linking/copying the built-ins + msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Will merge to 'master'. * jk/refspecs-negative (2020-09-25) 1 commit - refspec: add support for negative refspecs "git fetch" and "git push" support negative refspecs. * ds/maintenance-part-2 (2020-09-25) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch is used by ds/maintenance-part-3.) "git maintenance", an extended big brother of "git gc", continues to evolve. -------------------------------------------------- [Discarded] * js/ignore-cmake-build-artifacts (2020-09-23) 1 commit . cmake: ignore generated files Running CMake based build with VS (in contrib/) from the top-level of the working tree leaves extra build crufts behind. Add patterns to .gitignore Retracted. cf. <pull.738.git.1601044118.gitgitgadget@gmail.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
> Refspecs today are commutative, meaning that order doesn't expressly
> matter. Rather than forcing an implied order, negative refspecs will
> always be applied last. That is, in order to match, a ref must match at
> least one positive refspec, and match none of the negative refspecs.
> This is similar to how negative pathspecs work.
Looked sensible. Let's move this forward.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * ds/maintenance-part-1 (2020-09-17) 11 commits (merged to 'next' on 2020-09-18 at 4c367d3cf6) + maintenance: add trace2 regions for task execution + maintenance: add auto condition for commit-graph task + maintenance: use pointers to check --auto + maintenance: create maintenance.<task>.enabled config + maintenance: take a lock on the objects directory + maintenance: add --task option + maintenance: add commit-graph task + maintenance: initialize task array + maintenance: replace run_auto_gc() + maintenance: add --quiet option + maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2 and ds/maintenance-part-3.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * hx/push-atomic-with-cert (2020-09-19) 1 commit (merged to 'next' on 2020-09-22 at 64561eea5b) + send-pack: run GPG after atomic push checking "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). * jk/diff-highlight-blank-match-fix (2020-09-21) 1 commit (merged to 'next' on 2020-09-22 at 03ac708501) + diff-highlight: correctly match blank lines for flush "diff-highlight" (in contrib/) had a logic to flush its output upon seeing a blank line but the way it detected a blank line was broken. * jx/proc-receive-hook (2020-08-27) 10 commits (merged to 'next' on 2020-09-18 at 344c89be7e) + doc: add documentation for the proc-receive hook + transport: parse report options for tracking refs + t5411: test updates of remote-tracking branches + receive-pack: new config receive.procReceiveRefs + doc: add document for capability report-status-v2 + New capability "report-status-v2" for git-push + receive-pack: feed report options to post-receive + receive-pack: add new proc-receive hook + t5411: add basic test cases for proc-receive hook + transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. * ld/p4-unshelve-fix (2020-09-19) 2 commits (merged to 'next' on 2020-09-22 at c7709a34ec) + git-p4: use HEAD~$n to find parent commit for unshelve + git-p4 unshelve: adding a commit breaks git-p4 unshelve The "unshelve" subcommand of "git p4" used incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. * rs/misc-cleanups (2020-09-19) 1 commit (merged to 'next' on 2020-09-22 at d034fbfab0) + pack-write: use hashwrite_be32() in write_idx_file() Code cleanup. -------------------------------------------------- [New Topics] * cc/bisect-start-fix (2020-09-25) 1 commit - bisect: don't use invalid oid as rev when starting "git bisect start X Y", when X and Y are not valid committish object names, should take X and Y as pathspec, but didn't. Will merge to 'next'. * dl/zero-oid-in-hooks (2020-09-23) 3 commits (merged to 'next' on 2020-09-25 at 3c7d03d61a) + hooks--update.sample: use hash-agnostic zero OID + hooks--pre-push.sample: use hash-agnostic zero OID + hooks--pre-push.sample: modernize script Adjust sample hooks for hash algorithm other than SHA-1. Will merge to 'master'. * mt/parallel-checkout-part-1 (2020-09-22) 19 commits - ci: run test round with parallel-checkout enabled - parallel-checkout: add tests related to .gitattributes - parallel-checkout: add tests related to clone collisions - parallel-checkout: add tests for basic operations - checkout-index: add parallel checkout support - builtin/checkout.c: complete parallel checkout support - make_transient_cache_entry(): optionally alloc from mem_pool - parallel-checkout: support progress displaying - parallel-checkout: make it truly parallel - unpack-trees: add basic support for parallel checkout - entry: add checkout_entry_ca() which takes preloaded conv_attrs - entry: move conv_attrs lookup up to checkout_entry() - entry: extract cache_entry update from write_entry() - entry: make fstat_output() and read_blob_entry() public - entry: extract a header file for entry.c functions - convert: add conv_attrs classification - convert: add get_stream_filter_ca() variant - convert: add [async_]convert_to_working_tree_ca() variants - convert: make convert_attrs() and convert structs public Parallel checkout. * jk/drop-unaligned-loads (2020-09-24) 2 commits - Revert "fast-export: use local array to store anonymized oid" - bswap.h: drop unaligned loads Compilation fix around type punning. Will merge to 'next'. * tg/range-diff-same-file-fix (2020-09-24) 1 commit (merged to 'next' on 2020-09-25 at c2078e5505) + diff: fix modified lines stats with --stat and --numstat "git range-diff" showed incorrect diffstat, which has been corrected. Will merge to 'master'. * ah/pull (2020-09-24) 1 commit (merged to 'next' on 2020-09-25 at b5ddf0cf8b) + pull: don't warn if pull.ff has been set Earlier we taught "git pull" to warn when the user does not say the histories need to be merged, rebased or accepts only fast- forwarding, but the warning triggered for those who have set the pull.ff configuration variable. Will merge to 'master'. * jc/blame-ignore-fix (2020-09-24) 2 commits - blame: validate and peel the object names on the ignore list - t8013: minimum preparatory clean-up "git blame --ignore-rev/--ignore-revs-file" failed to validate their input are valid revision, and failed to take into account that the user may want to give an annotated tag instead of a commit, which has been corrected. Will merge to 'next'. * jk/make-protocol-v2-the-default (2020-09-25) 1 commit (merged to 'next' on 2020-09-25 at 21a5f9e880) + protocol: re-enable v2 protocol by default The transport protocol v2 has become the default again. Will merge to 'master'. * jk/shortlog-group-by-trailer (2020-09-25) 8 commits - shortlog: allow multiple groups to be specified - shortlog: parse trailer idents - shortlog: rename parse_stdin_ident() - shortlog: de-duplicate trailer values - shortlog: match commit trailers with --group - trailer: add interface for iterating over commit trailers - shortlog: refactor committer/author grouping - shortlog: change "author" variables to "ident" "git shortlog" has been taught to group commits by the contents of the trailer lines, like "Reviewed-by:", "Coauthored-by:", etc. Will merge to 'next'. * js/cmake-vs (2020-09-25) 10 commits - hashmap_for_each_entry(): work around MSVC's run-time check failure #3 - cmake (Windows): recommend using Visual Studio's built-in CMake support - cmake (Windows): initialize vcpkg/build dependencies automatically - cmake (Windows): complain when encountering an unknown compiler - cmake (Windows): let the `.dll` files are found when running the tests - cmake: quote the path accurately when editing `test-lib.sh` - cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows - cmake: ensure that the `vcpkg` packages are found on Windows - cmake: do find Git for Windows' shell interpreter - cmake: ignore files generated by CMake as run in Visual Studio Using the CMake support we added some time ago for real with Visual Studio build revealed there were lot of usability improvements possible, which have been carried out. Expecting a reroll. cf. <CAKiG+9V=BGX4k_dM-5JzYmko0cZfYXuSxEk5-UuHZpAqaWoU_A@mail.gmail.com> cf. <CAPig+cTPi1yi7WQf_eWa+bFRJEdtULFO3yYqJh3nm=_CtEe6CQ@mail.gmail.com> cf. <xmqq8scxln10.fsf@gitster.c.googlers.com> * sv/t7001-modernize (2020-09-25) 11 commits - t7001: move cleanup code from outside the tests into them - t7001: use `test` rather than `[` - t7001: use here-docs instead of echo - t7001: put each command on a separate line - t7001: use ': >' rather than 'touch' - t7001: change (cd <path> && git foo) to (git -C <path> foo) - t7001: remove whitespace after redirect operators - t7001: change the style for cd according to subshell - t7001: remove unnecessary blank lines - t7001: use TAB instead of spaces - t7001: convert tests from the old style to the current style Test script modernization. Expecting a reroll. cf. <20200925170256.11490-1-shubhunic@gmail.com> * jc/sequencer-stopped-sha-simplify (2020-09-25) 1 commit - sequencer: stop abbreviating stopped-sha file * jc/t1506-rev-parse-leaves-range-endpoint-unpeeled (2020-09-25) 1 commit (merged to 'next' on 2020-09-25 at e5233774ba) + t1506: rev-parse A..B and A...B Test update. Will merge to 'master'. -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Discard for now. cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> cf. <20200911214358.acl3hy2e763begoo@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * rs/archive-add-file (2020-09-19) 3 commits - Makefile: use git-archive --add-file - archive: add --add-file - archive: read short blobs in archive.c::write_archive_entry() "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * js/default-branch-name-part-2 (2020-09-21) 5 commits - t9902: avoid using the branch name `master` - tests: avoid variations of the `master` branch name - t3200: avoid variations of the `master` branch name - fast-export: avoid using unnecessary language in a code comment - t/test-terminal: avoid non-inclusive language Update the tests to drop word 'master' from them * jt/keep-partial-clone-filter-upon-lazy-fetch (2020-09-21) 2 commits - fetch: do not override partial clone filter - promisor-remote: remove unused variable The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damate to the partial clone filter in the repository, which has been corrected. * dl/diff-merge-base (2020-09-21) 10 commits - contrib/completion: complete `git diff --merge-base` - builtin/diff-tree: learn --merge-base - builtin/diff-index: learn --merge-base - t4068: add --merge-base tests - diff-lib: define diff_get_merge_base() - diff-lib: accept option flags in run_diff_index() - contrib/completion: extract common diff/difftool options - git-diff.txt: backtick quote command text - git-diff-index.txt: make --cached description a proper sentence - t4068: remove unnecessary >tmp "git diff A...B" learned "git diff --merge-base A B", which is a longer short-hand to say the same thing. Expecting a reroll. cf. <xmqqblhyepup.fsf@gitster.c.googlers.com> * bc/faq-misc (2020-09-20) 3 commits (merged to 'next' on 2020-09-22 at a81b728010) + docs: explain how to deal with files that are always modified + docs: explain why reverts are not always applied on merge + docs: explain why squash merges are broken with long-running branches More FAQ entries. Will merge to 'master'. * sb/clone-origin (2020-09-11) 4 commits - clone: allow configurable default for `-o`/`--origin` - clone: validate --origin option before use - clone: call git_config before parse_options - clone: add tests for --template and some disallowed option pairs "git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. Expecting an update. * sk/force-if-includes (2020-09-23) 3 commits - t, doc: update tests, reference for "--force-if-includes" - push: parse and set flag for "--force-if-includes" - push: add reflog check for "--force-if-includes" "git push --force-with-lease[=<ref>]" can easily be misused to lose commits unless the user takes good care of their own "git fetch". A new option "--force-if-includes" attempts to ensure that what is being force-pushed was created after examining the commit at the tip of the remote ref that is about to be force-replaced. Expecting a reroll. cf. <20200923112606.GA71705@mail.clickyotomy.dev> * ab/mediawiki-fixes (2020-09-21) 18 commits (merged to 'next' on 2020-09-25 at 878693716e) + remote-mediawiki: use "sh" to eliminate unquoted commands + remote-mediawiki: annotate unquoted uses of run_git() + remote-mediawiki: convert to quoted run_git() invocation + remote-mediawiki: provide a list form of run_git() + remote-mediawiki tests: annotate failing tests + remote-mediawiki: fix duplicate revisions being imported + remote-mediawiki tests: use CLI installer + remote-mediawiki tests: use inline PerlIO for readability + remote-mediawiki tests: replace deprecated Perl construct + remote-mediawiki tests: use a more idiomatic dispatch table + remote-mediawiki tests: use "$dir/" instead of "$dir." + remote-mediawiki tests: change `[]` to `test` + remote-mediawiki tests: use test_cmp in tests + remote-mediawiki tests: use a 10 character password + remote-mediawiki tests: use the login/password variables + remote-mediawiki doc: don't hardcode Debian PHP versions + remote-mediawiki doc: link to MediaWiki's current version + remote-mediawiki doc: correct link to GitHub project Modernization and fixes to MediaWiki remote backend. Will merge to 'master'. * ar/fetch-transfer-ipversion (2020-09-16) 1 commit - config: option transfer.ipversion to set transport protocol version for network fetches Adds transfer.ipversion configuration variable. Needs more work. * bc/clone-with-git-default-hash-fix (2020-09-22) 1 commit (merged to 'next' on 2020-09-22 at 62ea45c20e) + builtin/clone: avoid failure with GIT_DEFAULT_HASH "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. Will merge to 'master'. * hn/reftable (2020-09-22) 14 commits - reftable: fix some sparse warnings - reftable: "test-tool dump-reftable" command. - reftable: rest of library - reftable: file level tests - reftable: read reftable files - reftable: write reftable files - reftable: a generic binary tree implementation - reftable: reading/writing blocks - reftable: (de)serialization for the polymorphic record type. - reftable: utility functions - reftable: add a barebones unittest framework - vcxproj: adjust for the reftable changes - reftable: define the public API - reftable: add LICENSE * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. Expecting a reroll. cf. <20200909222333.GH241078@camp.crustytoothpaste.net> * ds/maintenance-part-3 (2020-09-25) 7 commits - maintenance: add troubleshooting guide to docs - maintenance: recommended schedule in register/start - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * tb/bloom-improvements (2020-09-18) 13 commits (merged to 'next' on 2020-09-22 at 520d531ad8) + commit-graph: introduce 'commitGraph.maxNewFilters' + builtin/commit-graph.c: introduce '--max-new-filters=<n>' + commit-graph: rename 'split_commit_graph_opts' + bloom: encode out-of-bounds filters as non-empty + bloom/diff: properly short-circuit on max_changes + bloom: use provided 'struct bloom_filter_settings' + bloom: split 'get_bloom_filter()' in two + commit-graph.c: store maximum changed paths + commit-graph: respect 'commitGraph.readChangedPaths' + t/helper/test-read-graph.c: prepare repo settings + commit-graph: pass a 'struct repository *' in more places + t4216: use an '&&'-chain + commit-graph: introduce 'get_bloom_filter_settings()' "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. Will merge to 'master'. * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. * mt/grep-sparse-checkout (2020-09-10) 9 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - config: make do_git_config_sequence receive a 'struct repository' - t/helper/test-config: unify exit labels - t/helper/test-config: diagnose missing arguments - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-09-24) 6 commits - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. Will merge to 'next'. At v9. Looking good so far. * js/no-builtins-on-disk-option (2020-09-21) 3 commits (merged to 'next' on 2020-09-25 at 6b976da4d2) + ci: stop linking built-ins to the dashed versions + Optionally skip linking/copying the built-ins + msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Will merge to 'master'. * jk/refspecs-negative (2020-09-25) 1 commit - refspec: add support for negative refspecs "git fetch" and "git push" support negative refspecs. * ds/maintenance-part-2 (2020-09-25) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch is used by ds/maintenance-part-3.) "git maintenance", an extended big brother of "git gc", continues to evolve. -------------------------------------------------- [Discarded] * js/ignore-cmake-build-artifacts (2020-09-23) 1 commit . cmake: ignore generated files Running CMake based build with VS (in contrib/) from the top-level of the working tree leaves extra build crufts behind. Add patterns to .gitignore Retracted. cf. <pull.738.git.1601044118.gitgitgadget@gmail.com>
From: Jacob Keller <jacob.keller@gmail.com> Both fetch and push support pattern refspecs which allow fetching or pushing references that match a specific pattern. Because these patterns are globs, they have somewhat limited ability to express more complex situations. For example, suppose you wish to fetch all branches from a remote except for a specific one. To allow this, you must setup a set of refspecs which match only the branches you want. Because refspecs are either explicit name matches, or simple globs, many patterns cannot be expressed. Add support for a new type of refspec, referred to as "negative" refspecs. These are prefixed with a '^' and mean "exclude any ref matching this refspec". They can only have one "side" which always refers to the source. During a fetch, this refers to the name of the ref on the remote. During a push, this refers to the name of the ref on the local side. With negative refspecs, users can express more complex patterns. For example: git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant will fetch all branches on origin into remotes/origin, but will exclude fetching the branch named dontwant. Refspecs today are commutative, meaning that order doesn't expressly matter. Rather than forcing an implied order, negative refspecs will always be applied last. That is, in order to match, a ref must match at least one positive refspec, and match none of the negative refspecs. This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> --- Documentation/pull-fetch-param.txt | 16 +++ builtin/fetch.c | 10 ++ refspec.c | 34 +++++- refspec.h | 14 ++- remote.c | 108 ++++++++++++++++- remote.h | 9 +- t/t5582-fetch-negative-refspec.sh | 189 +++++++++++++++++++++++++++++ 7 files changed, 367 insertions(+), 13 deletions(-) create mode 100755 t/t5582-fetch-negative-refspec.sh diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 95ea84990298..95a7390b2c78 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -30,6 +30,22 @@ The colon can be omitted when <dst> is empty. <src> is typically a ref, but it can also be a fully spelled hex object name. + +A <refspec> may contain a `*` in its <src> to indicate a simple pattern +match. Such a refspec functions like a glob that matches any ref with the +same prefix. A pattern <refspec> must have a `*` in both the <src> and +<dst>. It will map refs to the destination by replacing the `*` with the +contents matched from the source. ++ +If a refspec is prefixed by `^`, it will be interpreted as a negative +refspec. Rather than specifying which refs to fetch or which local refs to +update, such a refspec will instead specify refs to exclude. A ref will be +considered to match if it matches at least one positive refspec, and does +not match any negative refspec. Negative refspecs can be useful to restrict +the scope of a pattern refspec so that it will not include specific refs. +Negative refspecs can themselves be pattern refspecs. However, they may only +contain a <src> and do not specify a <dst>. Fully spelled out hex object +names are also not supported. ++ `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`; it requests fetching everything up to the given tag. + diff --git a/builtin/fetch.c b/builtin/fetch.c index 1b00c2bee90b..e95bf8877ddd 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -537,6 +537,16 @@ static struct ref *get_ref_map(struct remote *remote, tail = &rm->next; } + /* + * apply negative refspecs first, before we remove duplicates. This is + * necessary as negative refspecs might remove an otherwise conflicting + * duplicate. + */ + if (rs->nr) + ref_map = apply_negative_refspecs(ref_map, rs); + else + ref_map = apply_negative_refspecs(ref_map, &remote->fetch); + ref_map = ref_remove_duplicates(ref_map); for (rm = ref_map; rm; rm = rm->next) { diff --git a/refspec.c b/refspec.c index 8d0affc34a6b..8af357a0a35d 100644 --- a/refspec.c +++ b/refspec.c @@ -8,6 +8,7 @@ static struct refspec_item s_tag_refspec = { 1, 0, 0, + 0, "refs/tags/*", "refs/tags/*" }; @@ -32,10 +33,17 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet if (*lhs == '+') { item->force = 1; lhs++; + } else if (*lhs == '^') { + item->negative = 1; + lhs++; } rhs = strrchr(lhs, ':'); + /* negative refspecs only have one side */ + if (item->negative && rhs) + return 0; + /* * Before going on, special case ":" (or "+:") as a refspec * for pushing matching refs. @@ -55,7 +63,7 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet llen = (rhs ? (rhs - lhs - 1) : strlen(lhs)); if (1 <= llen && memchr(lhs, '*', llen)) { - if ((rhs && !is_glob) || (!rhs && fetch)) + if ((rhs && !is_glob) || (!rhs && !item->negative && fetch)) return 0; is_glob = 1; } else if (rhs && is_glob) { @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet item->src = xstrndup(lhs, llen); flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); + if (item->negative) { + struct object_id unused; + + /* + * Negative refspecs only have a LHS, which indicates a ref + * (or pattern of refs) to exclude from other matches. This + * can either be a simple ref, or a glob pattern. Exact sha1 + * match is not currently supported. + */ + if (!*item->src) + return 0; /* negative refspecs must not be empty */ + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) + return 0; /* negative refpsecs cannot be exact sha1 */ + else if (!check_refname_format(item->src, flags)) + ; /* valid looking ref is ok */ + else + return 0; + + /* the other rules below do not apply to negative refspecs */ + return 1; + } + if (fetch) { struct object_id unused; @@ -223,7 +253,7 @@ void refspec_ref_prefixes(const struct refspec *rs, const struct refspec_item *item = &rs->items[i]; const char *prefix = NULL; - if (item->exact_sha1) + if (item->exact_sha1 || item->negative) continue; if (rs->fetch == REFSPEC_FETCH) prefix = item->src; diff --git a/refspec.h b/refspec.h index 7569248d11b1..955183239923 100644 --- a/refspec.h +++ b/refspec.h @@ -5,12 +5,13 @@ extern const struct refspec_item *tag_refspec; /** - * A struct refspec_item holds the parsed interpretation of a refspec. If it will - * force updates (starts with a '+'), force is true. If it is a pattern - * (sides end with '*') pattern is true. src and dest are the two sides - * (including '*' characters if present); if there is only one side, it is src, - * and dst is NULL; if sides exist but are empty (i.e., the refspec either - * starts or ends with ':'), the corresponding side is "". + * A struct refspec_item holds the parsed interpretation of a refspec. If it + * will force updates (starts with a '+'), force is true. If it is a pattern + * (sides end with '*') pattern is true. If it is a negative refspec, (starts + * with '^'), negative is true. src and dest are the two sides (including '*' + * characters if present); if there is only one side, it is src, and dst is + * NULL; if sides exist but are empty (i.e., the refspec either starts or ends + * with ':'), the corresponding side is "". * * remote_find_tracking(), given a remote and a struct refspec_item with either src * or dst filled out, will fill out the other such that the result is in the @@ -22,6 +23,7 @@ struct refspec_item { unsigned pattern : 1; unsigned matching : 1; unsigned exact_sha1 : 1; + unsigned negative : 1; char *src; char *dst; diff --git a/remote.c b/remote.c index eafc14cbe759..26a127142344 100644 --- a/remote.c +++ b/remote.c @@ -682,6 +682,91 @@ static int match_name_with_pattern(const char *key, const char *name, return ret; } +static int refspec_match(const struct refspec_item *refspec, + const char *name) +{ + if (refspec->pattern) + return match_name_with_pattern(refspec->src, name, NULL, NULL); + + return !strcmp(refspec->src, name); +} + +static int omit_name_by_refspec(const char *name, struct refspec *rs) +{ + int i; + + for (i = 0; i < rs->nr; i++) { + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) + return 1; + } + return 0; +} + +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) +{ + struct ref **tail; + + for (tail = &ref_map; *tail; ) { + struct ref *ref = *tail; + + if (omit_name_by_refspec(ref->name, rs)) { + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else + tail = &ref->next; + } + + return ref_map; +} + +static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query) +{ + int i, matched_negative = 0; + int find_src = !query->src; + struct string_list reversed = STRING_LIST_INIT_NODUP; + const char *needle = find_src ? query->dst : query->src; + + /* + * Check whether the queried ref matches any negative refpsec. If so, + * then we should ultimately treat this as not matching the query at + * all. + * + * Note that negative refspecs always match the source, but the query + * item uses the destination. To handle this, we apply pattern + * refspecs in reverse to figure out if the query source matches any + * of the negative refspecs. + */ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + char *expn_name; + + if (refspec->negative) + continue; + + /* Note the reversal of src and dst */ + if (refspec->pattern) { + const char *key = refspec->dst ?: refspec->src; + const char *value = refspec->src; + + if (match_name_with_pattern(key, needle, value, &expn_name)) + string_list_append_nodup(&reversed, expn_name); + } else { + if (!strcmp(needle, refspec->src)) + string_list_append(&reversed, refspec->src); + } + } + + for (i = 0; !matched_negative && i < reversed.nr; i++) { + if (omit_name_by_refspec(reversed.items[i].string, rs)) + matched_negative = 1; + } + + string_list_clear(&reversed, 0); + + return matched_negative; +} + static void query_refspecs_multiple(struct refspec *rs, struct refspec_item *query, struct string_list *results) @@ -692,6 +777,9 @@ static void query_refspecs_multiple(struct refspec *rs, if (find_src && !query->dst) BUG("query_refspecs_multiple: need either src or dst"); + if (query_matches_negative_refspec(rs, query)) + return; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; @@ -699,7 +787,7 @@ static void query_refspecs_multiple(struct refspec *rs, const char *needle = find_src ? query->dst : query->src; char **result = find_src ? &query->src : &query->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) @@ -720,12 +808,15 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query) if (find_src && !query->dst) BUG("query_refspecs: need either src or dst"); + if (query_matches_negative_refspec(rs, query)) + return -1; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; const char *value = find_src ? refspec->src : refspec->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) { @@ -1054,7 +1145,7 @@ static int match_explicit(struct ref *src, struct ref *dst, const char *dst_value = rs->dst; char *dst_guess; - if (rs->pattern || rs->matching) + if (rs->pattern || rs->matching || rs->negative) return 0; matched_src = matched_dst = NULL; @@ -1130,6 +1221,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, int matching_refs = -1; for (i = 0; i < rs->nr; i++) { const struct refspec_item *item = &rs->items[i]; + + if (item->negative) + continue; + if (item->matching && (matching_refs == -1 || item->force)) { matching_refs = i; @@ -1335,7 +1430,7 @@ int check_push_refs(struct ref *src, struct refspec *rs) for (i = 0; i < rs->nr; i++) { struct refspec_item *item = &rs->items[i]; - if (item->pattern || item->matching) + if (item->pattern || item->matching || item->negative) continue; ret |= match_explicit_lhs(src, item, NULL, NULL); @@ -1437,6 +1532,8 @@ int match_push_refs(struct ref *src, struct ref **dst, string_list_clear(&src_ref_index, 0); } + *dst = apply_negative_refspecs(*dst, rs); + if (errs) return -1; return 0; @@ -1806,6 +1903,9 @@ int get_fetch_map(const struct ref *remote_refs, { struct ref *ref_map, **rmp; + if (refspec->negative) + return 0; + if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { diff --git a/remote.h b/remote.h index 5e3ea5a26deb..104e75e0f74d 100644 --- a/remote.h +++ b/remote.h @@ -193,6 +193,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Remove all entries in the input list which match any negative refspec in + * the refspec list. + */ +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); + int query_refspecs(struct refspec *rs, struct refspec_item *query); char *apply_refspecs(struct refspec *rs, const char *name); @@ -205,7 +211,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, /* * Given a list of the remote refs and the specification of things to * fetch, makes a (separate) list of the refs to fetch and the local - * refs to store into. + * refs to store into. Note that negative refspecs are ignored here, and + * should be handled separately. * * *tail is the pointer to the tail pointer of the list of results * beforehand, and will be set to the tail pointer of the list of diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh new file mode 100755 index 000000000000..8c61e28fec85 --- /dev/null +++ b/t/t5582-fetch-negative-refspec.sh @@ -0,0 +1,189 @@ +#!/bin/sh +# Copyright (c) 2020, Jacob Keller. + +test_description='"git fetch" with negative refspecs. + +' + +. ./test-lib.sh + +test_expect_success setup ' + echo >file original && + git add file && + git commit -a -m original +' + +test_expect_success "clone and setup child repos" ' + git clone . one && + ( + cd one && + echo >file updated by one && + git commit -a -m "updated by one" && + git switch -c alternate && + echo >file updated again by one && + git commit -a -m "updated by one again" && + git switch master + ) && + git clone . two && + ( + cd two && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch +refs/heads/*:refs/remotes/one/* && + git config --add remote.one.fetch ^refs/heads/alternate + ) && + git clone . three +' + +test_expect_success "fetch one" ' + echo >file updated by origin && + git commit -a -m "updated by origin" && + ( + cd two && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git fetch one && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git rev-parse --verify refs/remotes/one/master && + mine=$(git rev-parse refs/remotes/one/master) && + his=$(cd ../one && git rev-parse refs/heads/master) && + test "z$mine" = "z$his" + ) +' + +test_expect_success "fetch with negative refspec on commandline" ' + echo >file updated by origin again && + git commit -a -m "updated by origin again" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative sha1 refspec fails" ' + echo >file updated by origin yet again && + git commit -a -m "updated by origin yet again" && + ( + cd three && + master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one + ) +' + +test_expect_success "fetch with negative pattern refspec" ' + echo >file updated by origin once more && + git commit -a -m "updated by origin once more" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/m* && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative pattern refspec does not expand prefix" ' + echo >file updated by origin another time && + git commit -a -m "updated by origin another time" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + master_in_one=$(cd ../one && git rev-parse refs/heads/master) && + echo $alternate_in_one >expect && + echo $master_in_one >>expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative refspec avoids duplicate conflict" ' + cd "$D" && + ( + cd one && + git branch dups/a && + git branch dups/b && + git branch dups/c && + git branch other/a && + git rev-parse --verify refs/heads/other/a >../expect && + git rev-parse --verify refs/heads/dups/b >>../expect && + git rev-parse --verify refs/heads/dups/c >>../expect + ) && + ( + cd three && + git fetch ../one/.git ^refs/heads/dups/a refs/heads/dups/*:refs/dups/* refs/heads/other/a:refs/dups/a && + git rev-parse --verify refs/dups/a >../actual && + git rev-parse --verify refs/dups/b >>../actual && + git rev-parse --verify refs/dups/c >>../actual + ) && + test_cmp expect actual +' + +test_expect_success "push --prune with negative refspec" ' + ( + cd two && + git branch prune/a && + git branch prune/b && + git branch prune/c && + git push ../three refs/heads/prune/* && + git branch -d prune/a && + git branch -d prune/b && + git push --prune ../three refs/heads/prune/* ^refs/heads/prune/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/prune/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "push --prune with negative refspec apply to the destination" ' + ( + cd two && + git branch ours/a && + git branch ours/b && + git branch ours/c && + git push ../three refs/heads/ours/*:refs/heads/theirs/* && + git branch -d ours/a && + git branch -d ours/b && + git push --prune ../three refs/heads/ours/*:refs/heads/theirs/* ^refs/heads/theirs/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/theirs/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch --prune with negative refspec" ' + ( + cd two && + git branch fetch/a && + git branch fetch/b && + git branch fetch/c + ) && + ( + cd three && + git fetch ../two/.git refs/heads/fetch/*:refs/heads/copied/* + ) && + ( + cd two && + git branch -d fetch/a && + git branch -d fetch/b + ) && + ( + cd three && + test_write_lines b c >expect && + git fetch -v ../two/.git --prune refs/heads/fetch/*:refs/heads/copied/* ^refs/heads/fetch/b && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/copied/ >actual && + test_cmp expect actual + ) +' + +test_done -- 2.28.0.497.g54e85e7af1ac
From: Jacob Keller <jacob.keller@gmail.com> This series introduces support for a new refspec concept, the negative refspec. It is a respin of a series posted at [1]. The primary motivation for negative refspecs is to allow restricting the space that a pattern patch refspec will match over. Both fetch and push support pattern refspecs which allow matching refs using a simple glob. Since these only use a single '*' which greedily matches any string, many types of matches cannot be expressed. Negative refspecs exist to allow more control over what refs get fetched or pushed when using pattern refspecs. They function in a similar manner as negative pathspecs. Suppose you want to fetch all remote branches from a repository, except for one specific branch. For example, a repository who recently renamed its primary branch to "main", but has left the older "master" name in order to avoid breaking existing workflows. You wish to only fetch "main". You do not need the "master" branch name anymore because you've updated your work flow. However, fetching both main and master can lead to some annoyance with tab completion. You could modify your remote config to explicitly fetch the set of branches you care about. However, this means any new branch added to the remote will not be fetched until you update your config, which requires manual intervention. With a negative refspec, you can simply fetch all branches *except* for refs/heads/master, i.e. git fetch refs/heads/*:refs/remotes/origin/* ^refs/heads/master Negative refspecs restrict the set of refs that are matched for a given fetch or push. For a fetch, this refers to the name of the ref on the remote. For a push this refers to the name of the local ref being pushed out. A negative refspec is indicated by prefixing the refspec with a ^. Only regular or pattern refspecs are supported. Support for sha1 identification of objects is not implemented in this patch. Additionally, negative refspecs do not expand using normal rules and thus should be the fully spelled out refspec name. [1]: https://lore.kernel.org/git/20200821215247.758978-1-jacob.e.keller@intel.com/ Range Diff since v2 1: 7650f8bdf7fd ! 1: 1ff179f8af9e refspec: add support for negative refspecs @@ Commit message This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> - Signed-off-by: Junio C Hamano <gitster@pobox.com> + + ## Documentation/pull-fetch-param.txt ## +@@ Documentation/pull-fetch-param.txt: The colon can be omitted when <dst> is empty. <src> is + typically a ref, but it can also be a fully spelled hex object + name. + + ++A <refspec> may contain a `*` in its <src> to indicate a simple pattern ++match. Such a refspec functions like a glob that matches any ref with the ++same prefix. A pattern <refspec> must have a `*` in both the <src> and ++<dst>. It will map refs to the destination by replacing the `*` with the ++contents matched from the source. +++ ++If a refspec is prefixed by `^`, it will be interpreted as a negative ++refspec. Rather than specifying which refs to fetch or which local refs to ++update, such a refspec will instead specify refs to exclude. A ref will be ++considered to match if it matches at least one positive refspec, and does ++not match any negative refspec. Negative refspecs can be useful to restrict ++the scope of a pattern refspec so that it will not include specific refs. ++Negative refspecs can themselves be pattern refspecs. However, they may only ++contain a <src> and do not specify a <dst>. Fully spelled out hex object ++names are also not supported. +++ + `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`; + it requests fetching everything up to the given tag. + + ## builtin/fetch.c ## @@ builtin/fetch.c: static struct ref *get_ref_map(struct remote *remote, @@ builtin/fetch.c: static struct ref *get_ref_map(struct remote *remote, + ref_map = ref_remove_duplicates(ref_map); - refname_hash_init(&existing_refs); + for (rm = ref_map; rm; rm = rm->next) { ## refspec.c ## @@ refspec.c: static struct refspec_item s_tag_refspec = { @@ refspec.c: static int parse_refspec(struct refspec_item *item, const char *refsp + /* + * Negative refspecs only have a LHS, which indicates a ref + * (or pattern of refs) to exclude from other matches. This -+ * can either be a simple ref, a glob pattern, or even an -+ * exact sha1 match. ++ * can either be a simple ref, or a glob pattern. Exact sha1 ++ * match is not currently supported. + */ + if (!*item->src) + return 0; /* negative refspecs must not be empty */ + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) -+ item->exact_sha1 = 1; /* ok */ ++ return 0; /* negative refpsecs cannot be exact sha1 */ + else if (!check_refname_format(item->src, flags)) + ; /* valid looking ref is ok */ + else + return 0; + -+ /* other rules for negative refspecs don't apply */ ++ /* the other rules below do not apply to negative refspecs */ + return 1; + } + @@ remote.c: static int match_name_with_pattern(const char *key, const char *name, + return ref_map; +} + - static void query_refspecs_multiple(struct refspec *rs, - struct refspec_item *query, - struct string_list *results) - { -- int i; ++static int query_matches_negative_refspec(struct refspec *rs, struct refspec_item *query) ++{ + int i, matched_negative = 0; - int find_src = !query->src; ++ int find_src = !query->src; + struct string_list reversed = STRING_LIST_INIT_NODUP; + const char *needle = find_src ? query->dst : query->src; -+ char **result = find_src ? &query->src : &query->dst; - - if (find_src && !query->dst) - BUG("query_refspecs_multiple: need either src or dst"); - ++ + /* -+ * If a ref matches any of the negative refspecs, then we should treat -+ * it as not matching this query. Note that negative refspecs apply to -+ * the source but we're checking only the destination. Reverse and -+ * capture any pattern refspecs in order to see if the source would -+ * have matched a negative refspec. ++ * Check whether the queried ref matches any negative refpsec. If so, ++ * then we should ultimately treat this as not matching the query at ++ * all. ++ * ++ * Note that negative refspecs always match the source, but the query ++ * item uses the destination. To handle this, we apply pattern ++ * refspecs in reverse to figure out if the query source matches any ++ * of the negative refspecs. + */ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; @@ remote.c: static int match_name_with_pattern(const char *key, const char *name, + + string_list_clear(&reversed, 0); + -+ if (matched_negative) ++ return matched_negative; ++} ++ + static void query_refspecs_multiple(struct refspec *rs, + struct refspec_item *query, + struct string_list *results) +@@ remote.c: static void query_refspecs_multiple(struct refspec *rs, + if (find_src && !query->dst) + BUG("query_refspecs_multiple: need either src or dst"); + ++ if (query_matches_negative_refspec(rs, query)) + return; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; - const char *value = find_src ? refspec->src : refspec->dst; -- const char *needle = find_src ? query->dst : query->src; -- char **result = find_src ? &query->src : &query->dst; +@@ remote.c: static void query_refspecs_multiple(struct refspec *rs, + const char *needle = find_src ? query->dst : query->src; + char **result = find_src ? &query->src : &query->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) -@@ remote.c: static void query_refspecs_multiple(struct refspec *rs, - - int query_refspecs(struct refspec *rs, struct refspec_item *query) - { -- int i; -+ int i, matched_negative = 0; - int find_src = !query->src; -+ struct string_list reversed = STRING_LIST_INIT_NODUP; - const char *needle = find_src ? query->dst : query->src; - char **result = find_src ? &query->src : &query->dst; - +@@ remote.c: int query_refspecs(struct refspec *rs, struct refspec_item *query) if (find_src && !query->dst) BUG("query_refspecs: need either src or dst"); -+ /* -+ * If a ref matches any of the negative refspecs, then we should treat -+ * it as not matching this query. Note that negative refspecs apply to -+ * the source but we're checking only the destination. Reverse and -+ * capture any pattern refspecs in order to see if the source would -+ * have matched a negative refspec. -+ */ -+ for (i = 0; i < rs->nr; i++) { -+ struct refspec_item *refspec = &rs->items[i]; -+ char *expn_name; -+ -+ if (refspec->negative) -+ continue; -+ -+ /* Note the reversal of src and dst */ -+ if (refspec->pattern) { -+ const char *key = refspec->dst ?: refspec->src; -+ const char *value = refspec->src; -+ -+ if (match_name_with_pattern(key, needle, value, &expn_name)) -+ string_list_append_nodup(&reversed, expn_name); -+ } else { -+ if (!strcmp(needle, refspec->src)) -+ string_list_append(&reversed, refspec->src); -+ } -+ } -+ -+ for (i = 0; !matched_negative && i < reversed.nr; i++) { -+ if (omit_name_by_refspec(reversed.items[i].string, rs)) -+ matched_negative = 1; -+ } -+ -+ string_list_clear(&reversed, 0); -+ -+ if (matched_negative) ++ if (query_matches_negative_refspec(rs, query)) + return -1; + for (i = 0; i < rs->nr; i++) { @@ t/t5582-fetch-negative-refspec.sh (new) + ) +' + ++test_expect_success "fetch with negative sha1 refspec fails" ' ++ echo >file updated by origin yet again && ++ git commit -a -m "updated by origin yet again" && ++ ( ++ cd three && ++ master_in_one=$(cd ../one && git rev-parse refs/heads/master) && ++ test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one ++ ) ++' ++ ++test_expect_success "fetch with negative pattern refspec" ' ++ echo >file updated by origin once more && ++ git commit -a -m "updated by origin once more" && ++ ( ++ cd three && ++ alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && ++ echo $alternate_in_one >expect && ++ git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/m* && ++ cut -f -1 .git/FETCH_HEAD >actual && ++ test_cmp expect actual ++ ) ++' ++ ++test_expect_success "fetch with negative pattern refspec does not expand prefix" ' ++ echo >file updated by origin another time && ++ git commit -a -m "updated by origin another time" && ++ ( ++ cd three && ++ alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && ++ master_in_one=$(cd ../one && git rev-parse refs/heads/master) && ++ echo $alternate_in_one >expect && ++ echo $master_in_one >>expect && ++ git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master && ++ cut -f -1 .git/FETCH_HEAD >actual && ++ test_cmp expect actual ++ ) ++' ++ +test_expect_success "fetch with negative refspec avoids duplicate conflict" ' + cd "$D" && + ( 2: ef767ce8f8ed < -: ------------ SQUASH??? Jacob Keller (1): refspec: add support for negative refspecs Documentation/pull-fetch-param.txt | 16 +++ builtin/fetch.c | 10 ++ refspec.c | 34 +++++- refspec.h | 14 ++- remote.c | 108 ++++++++++++++++- remote.h | 9 +- t/t5582-fetch-negative-refspec.sh | 189 +++++++++++++++++++++++++++++ 7 files changed, 367 insertions(+), 13 deletions(-) create mode 100755 t/t5582-fetch-negative-refspec.sh base-commit: e1cfff676549cdcd702cbac105468723ef2722f4 -- 2.28.0.497.g54e85e7af1ac
On Thu, Sep 17, 2020 at 5:02 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
> > @@ -1441,6 +1559,8 @@ int match_push_refs(struct ref *src, struct ref **dst,
> > string_list_clear(&src_ref_index, 0);
> > }
> >
> > + *dst = apply_negative_refspecs(*dst, rs);
> > +
> > if (errs)
> > return -1;
> > return 0;
>
> And after grabbing all the candidate refs to be updated via this
> push, we filter out the ones that match negative pattern. Can it
> also produce an error, or it can never fail (to udpate errs)?
>
It can't fail. Either refs match a negative refspec and will get
excluded, or they do not match a negative refspec and will be kept. We
already validate the negative refspecs earlier.
Thanks,
Jake
On Thu, Sep 17, 2020 at 5:02 PM Junio C Hamano <gitster@pobox.com> wrote: > > Jacob Keller <jacob.e.keller@intel.com> writes: > > > @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet > > item->src = xstrndup(lhs, llen); > > flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); > > > > + if (item->negative) { > > + struct object_id unused; > > + > > + /* > > + * Negative refspecs only have a LHS, which indicates a ref > > + * (or pattern of refs) to exclude from other matches. This > > + * can either be a simple ref, a glob pattern, or even an > > + * exact sha1 match. > > + */ > > + if (!*item->src) > > + return 0; /* negative refspecs must not be empty */ > > + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) > > + item->exact_sha1 = 1; /* ok */ > > + else if (!check_refname_format(item->src, flags)) > > + ; /* valid looking ref is ok */ > > + else > > + return 0; > > + > > + /* other rules for negative refspecs don't apply */ > > This comment confused me a bit; did you mean "other rules don't > apply to negative refspecs"? > Yea, this should be reworded. > > + return 1; > > + } > > + > > if (fetch) { > > struct object_id unused; > > > > diff --git a/remote.c b/remote.c > > index c5ed74f91c63..2f583d72c3f0 100644 > > --- a/remote.c > > +++ b/remote.c > > @@ -1058,7 +1172,7 @@ static int match_explicit(struct ref *src, struct ref *dst, > > const char *dst_value = rs->dst; > > char *dst_guess; > > > > - if (rs->pattern || rs->matching) > > + if (rs->pattern || rs->matching || rs->negative) > > return 0; > > OK. These "special" ones do not participate in explicit matching. > > > @@ -1134,6 +1248,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, > > int matching_refs = -1; > > for (i = 0; i < rs->nr; i++) { > > const struct refspec_item *item = &rs->items[i]; > > + > > + if (item->negative) > > + continue; > > + > > And a negative one does not decide if a ref being pushed will be > pushed out for real at this point. This helper is only to enumerate > the candidate refs to be pushed out; the caller makes a separate > call to apply_negative_refspecs() to cull the candidate list later. > > OK. > > > @@ -1339,7 +1457,7 @@ int check_push_refs(struct ref *src, struct refspec *rs) > > for (i = 0; i < rs->nr; i++) { > > struct refspec_item *item = &rs->items[i]; > > > > - if (item->pattern || item->matching) > > + if (item->pattern || item->matching || item->negative) > > continue; > > > > ret |= match_explicit_lhs(src, item, NULL, NULL); > > match_explicit_lhs(), like match_explicit(), are for explicit > matching and should not be called for the "special" ones. OK. > > > @@ -1441,6 +1559,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > > string_list_clear(&src_ref_index, 0); > > } > > > > + *dst = apply_negative_refspecs(*dst, rs); > > + > > if (errs) > > return -1; > > return 0; > > And after grabbing all the candidate refs to be updated via this > push, we filter out the ones that match negative pattern. Can it > also produce an error, or it can never fail (to udpate errs)? > > > @@ -1810,6 +1930,9 @@ int get_fetch_map(const struct ref *remote_refs, > > { > > struct ref *ref_map, **rmp; > > > > + if (refspec->negative) > > + return 0; > > + > > Again, the idea is to let the existing codepath to only deal with > the positive refspec elements to keep the same behaviour, and let > the caller filter the ones that match negative ones out of the > result. So we return without anything here for negative one. > Yep, that's what I went for. The only real downside here is if we forget a code path that should honor negative refspecs and doesn't, because it will "accept" the refspec list with such a negative refspec, but not do anything with it. > Nothing jumped out at me as being suspicious so far, other than that > the GNU "?<empty>:" thing needs to be fixed as pointed out by Dscho. > > Thanks.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * al/ref-filter-merged-and-no-merged (2020-09-18) 5 commits (merged to 'next' on 2020-09-18 at cc2a0039f3) + Doc: prefer more specific file name + ref-filter: make internal reachable-filter API more precise (merged to 'next' on 2020-09-16 at b04e306660) + ref-filter: allow merged and no-merged filters + Doc: cover multiple contains/no-contains filters + t3201: test multiple branch filter combinations "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. * ar/fetch-ipversion-in-all (2020-09-15) 1 commit (merged to 'next' on 2020-09-21 at 0da2438668) + fetch: pass --ipv4 and --ipv6 options to sub-fetches "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. * cd/commit-graph-doc (2020-09-15) 1 commit (merged to 'next' on 2020-09-16 at b0816b6eb0) + commit-graph-format.txt: fix no-parent value Doc update. * cs/don-t-pretend-a-failed-remote-set-head-succeeded (2020-09-17) 1 commit (merged to 'next' on 2020-09-18 at 51f73ca6dc) + remote: don't show success message when set-head fails "git remote set-head" that failed still said something that hints the operation went through, which was misleading. * dl/complete-format-patch-recent-features (2020-09-17) 1 commit (merged to 'next' on 2020-09-18 at c0ec1f7569) + contrib/completion: complete options that take refs for format-patch Update to command line completion (in contrib/) * es/format-patch-interdiff-cleanup (2020-09-08) 3 commits (merged to 'next' on 2020-09-16 at d919bb3d1f) + format-patch: use 'origin' as start of current-series-range when known + diff-lib: tighten show_interdiff()'s interface + diff: move show_interdiff() from its own file to diff-lib "format-patch --range-diff=<prev> <origin>..HEAD" has been taught not to ignore <origin> when <prev> is a single version. * hn/refs-trace-backend (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at f2e065ec17) + refs: add GIT_TRACE_REFS debugging mechanism Developer support. * jk/dont-count-existing-objects-twice (2020-09-17) 1 commit (merged to 'next' on 2020-09-18 at 73b30558b9) + packfile: actually set approximate_object_count_valid There is a logic to estimate how many objects are in the repository, which is mean to run once per process invocation, but it ran every time the estimated value was requested. * jt/threaded-index-pack (2020-09-08) 7 commits (merged to 'next' on 2020-09-16 at 8542385cc0) + index-pack: make quantum of work smaller + index-pack: make resolve_delta() assume base data + index-pack: calculate {ref,ofs}_{first,last} early + index-pack: remove redundant child field + index-pack: unify threaded and unthreaded code + index-pack: remove redundant parameter + Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. * kk/build-portability-fix (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at 63f2672632) + Fit to Plan 9's ANSI/POSIX compatibility layer Portability tweak for some shell scripts used while building. * ls/mergetool-meld-auto-merge (2020-09-16) 1 commit (merged to 'next' on 2020-09-16 at 01985a671b) + mergetool: allow auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. * os/fetch-submodule-optim (2020-09-06) 1 commit (merged to 'next' on 2020-09-16 at fa39e3f211) + fetch: do not look for submodule changes in unchanged refs Optimization around submodule handling. * pw/add-p-edit-ita-path (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at 7540ed3c0e) + add -p: fix editing of intent-to-add paths "add -p" now allows editing paths that were only added in intent. -------------------------------------------------- [New Topics] * ld/p4-unshelve-fix (2020-09-19) 2 commits (merged to 'next' on 2020-09-22 at c7709a34ec) + git-p4: use HEAD~$n to find parent commit for unshelve + git-p4 unshelve: adding a commit breaks git-p4 unshelve The "unshelve" subcommand of "git p4" used incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. Will merge to 'master'. * rs/archive-add-file (2020-09-19) 3 commits - Makefile: use git-archive --add-file - archive: add --add-file - archive: read short blobs in archive.c::write_archive_entry() "git archive" learns the "--add-file" option to include untracked files into a snapshot from a tree-ish. * jk/diff-highlight-blank-match-fix (2020-09-21) 1 commit (merged to 'next' on 2020-09-22 at 03ac708501) + diff-highlight: correctly match blank lines for flush "diff-highlight" (in contrib/) had a logic to flush its output upon seeing a blank line but the way it detected a blank line was broken. Will merge to 'master'. * js/default-branch-name-part-2 (2020-09-21) 5 commits - t9902: avoid using the branch name `master` - tests: avoid variations of the `master` branch name - t3200: avoid variations of the `master` branch name - fast-export: avoid using unnecessary language in a code comment - t/test-terminal: avoid non-inclusive language Update the tests to drop word 'master' from them * jt/keep-partial-clone-filter-upon-lazy-fetch (2020-09-21) 2 commits - fetch: do not override partial clone filter - promisor-remote: remove unused variable The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damate to the partial clone filter in the repository, which has been corrected. * rs/misc-cleanups (2020-09-19) 1 commit (merged to 'next' on 2020-09-22 at d034fbfab0) + pack-write: use hashwrite_be32() in write_idx_file() Code cleanup. Will merge to 'master'. -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Discard for now. cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> cf. <20200911214358.acl3hy2e763begoo@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * dl/diff-merge-base (2020-09-21) 10 commits - contrib/completion: complete `git diff --merge-base` - builtin/diff-tree: learn --merge-base - builtin/diff-index: learn --merge-base - t4068: add --merge-base tests - diff-lib: define diff_get_merge_base() - diff-lib: accept option flags in run_diff_index() - contrib/completion: extract common diff/difftool options - git-diff.txt: backtick quote command text - git-diff-index.txt: make --cached description a proper sentence - t4068: remove unnecessary >tmp "git diff A...B" learned "git diff --merge-base A B", which is a longer short-hand to say the same thing. * js/ignore-cmake-build-artifacts (2020-09-17) 1 commit - cmake: ignore generated files Running CMake based build with VS (in contrib/) from the top-level of the working tree leaves extra build crufts behind. Add patterns to .gitignore Expecting a resolution in a better way. cf. <xmqq7dsrnjhi.fsf@gitster.c.googlers.com> It turns out that these crufts are visible only when the CMake based build procedure is used against the best practice. A better alternative may be to prominently describe the recommended way to use the CMake-based build procedure. * hx/push-atomic-with-cert (2020-09-19) 1 commit (merged to 'next' on 2020-09-22 at 64561eea5b) + send-pack: run GPG after atomic push checking "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). Will merge to 'master'. * bc/faq-misc (2020-09-20) 3 commits (merged to 'next' on 2020-09-22 at a81b728010) + docs: explain how to deal with files that are always modified + docs: explain why reverts are not always applied on merge + docs: explain why squash merges are broken with long-running branches More FAQ entries. Will merge to 'master'. * sb/clone-origin (2020-09-11) 4 commits - clone: allow configurable default for `-o`/`--origin` - clone: validate --origin option before use - clone: call git_config before parse_options - clone: add tests for --template and some disallowed option pairs "git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. Expecting an update. * sk/force-if-includes (2020-09-19) 3 commits - t, doc: update tests, reference for "--force-if-includes" - push: parse and set flag for "--force-if-includes" - push: add reflog check for "--force-if-includes" "git push --force-with-lease[=<ref>]" can easily be misused to lose commits unless the user takes good care of their own "git fetch". A new option "--force-if-includes" attempts to ensure that what is being force-pushed was created after examining the commit at the tip of the remote ref that is about to be force-replaced. * ab/mediawiki-fixes (2020-09-21) 18 commits - remote-mediawiki: use "sh" to eliminate unquoted commands - remote-mediawiki: annotate unquoted uses of run_git() - remote-mediawiki: convert to quoted run_git() invocation - remote-mediawiki: provide a list form of run_git() - remote-mediawiki tests: annotate failing tests - remote-mediawiki: fix duplicate revisions being imported - remote-mediawiki tests: use CLI installer - remote-mediawiki tests: use inline PerlIO for readability - remote-mediawiki tests: replace deprecated Perl construct - remote-mediawiki tests: use a more idiomatic dispatch table - remote-mediawiki tests: use "$dir/" instead of "$dir." - remote-mediawiki tests: change `[]` to `test` - remote-mediawiki tests: use test_cmp in tests - remote-mediawiki tests: use a 10 character password - remote-mediawiki tests: use the login/password variables - remote-mediawiki doc: don't hardcode Debian PHP versions - remote-mediawiki doc: link to MediaWiki's current version - remote-mediawiki doc: correct link to GitHub project Modernization and fixes to MediaWiki remote backend. Will merge to 'next'. * ar/fetch-transfer-ipversion (2020-09-16) 1 commit - config: option transfer.ipversion to set transport protocol version for network fetches Adds transfer.ipversion configuration variable. Needs more work. * bc/clone-with-git-default-hash-fix (2020-09-22) 1 commit (merged to 'next' on 2020-09-22 at 62ea45c20e) + builtin/clone: avoid failure with GIT_DEFAULT_HASH "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. Will merge to 'master'. * hn/reftable (2020-09-16) 13 commits - reftable: "test-tool dump-reftable" command. - reftable: rest of library - reftable: file level tests - reftable: read reftable files - reftable: write reftable files - reftable: a generic binary tree implementation - reftable: reading/writing blocks - reftable: (de)serialization for the polymorphic record type. - reftable: utility functions - reftable: add a barebones unittest framework - vcxproj: adjust for the reftable changes - reftable: define the public API - reftable: add LICENSE * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. * ds/maintenance-part-3 (2020-09-17) 7 commits - maintenance: add troubleshooting guide to docs - maintenance: recommended schedule in register/start - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-1 and ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * tb/bloom-improvements (2020-09-18) 13 commits (merged to 'next' on 2020-09-22 at 520d531ad8) + commit-graph: introduce 'commitGraph.maxNewFilters' + builtin/commit-graph.c: introduce '--max-new-filters=<n>' + commit-graph: rename 'split_commit_graph_opts' + bloom: encode out-of-bounds filters as non-empty + bloom/diff: properly short-circuit on max_changes + bloom: use provided 'struct bloom_filter_settings' + bloom: split 'get_bloom_filter()' in two + commit-graph.c: store maximum changed paths + commit-graph: respect 'commitGraph.readChangedPaths' + t/helper/test-read-graph.c: prepare repo settings + commit-graph: pass a 'struct repository *' in more places + t4216: use an '&&'-chain + commit-graph: introduce 'get_bloom_filter_settings()' "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. Will merge to 'master'. * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. * mt/grep-sparse-checkout (2020-09-10) 9 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - config: make do_git_config_sequence receive a 'struct repository' - t/helper/test-config: unify exit labels - t/helper/test-config: diagnose missing arguments - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-08-31) 13 commits - bisect--helper: retire `--bisect-autostart` subcommand - bisect--helper: retire `--write-terms` subcommand - bisect--helper: retire `--check-expected-revs` subcommand - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C - bisect--helper: retire `--next-all` subcommand - bisect--helper: retire `--bisect-clean-state` subcommand - bisect--helper: finish porting `bisect_start()` to C - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. At v7; getting close cf. <nycvar.QRO.7.76.6.2009031403510.56@tvgsbejvaqbjf.bet> * js/no-builtins-on-disk-option (2020-09-21) 3 commits - ci: stop linking built-ins to the dashed versions - Optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Will merge to 'next'. * jk/refspecs-negative (2020-09-18) 2 commits - SQUASH??? - refspec: add support for negative refspecs "negative refspecs" Expecting a reroll. cf. <nycvar.QRO.7.76.6.2008221528170.56@tvgsbejvaqbjf.bet> cf. <xmqqzh5onea1.fsf@gitster.c.googlers.com> * jx/proc-receive-hook (2020-08-27) 10 commits (merged to 'next' on 2020-09-18 at 344c89be7e) + doc: add documentation for the proc-receive hook + transport: parse report options for tracking refs + t5411: test updates of remote-tracking branches + receive-pack: new config receive.procReceiveRefs + doc: add document for capability report-status-v2 + New capability "report-status-v2" for git-push + receive-pack: feed report options to post-receive + receive-pack: add new proc-receive hook + t5411: add basic test cases for proc-receive hook + transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Will merge to 'master'. * ds/maintenance-part-2 (2020-09-17) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch is used by ds/maintenance-part-3; uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ds/maintenance-part-1 (2020-09-17) 11 commits (merged to 'next' on 2020-09-18 at 4c367d3cf6) + maintenance: add trace2 regions for task execution + maintenance: add auto condition for commit-graph task + maintenance: use pointers to check --auto + maintenance: create maintenance.<task>.enabled config + maintenance: take a lock on the objects directory + maintenance: add --task option + maintenance: add commit-graph task + maintenance: initialize task array + maintenance: replace run_auto_gc() + maintenance: add --quiet option + maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2 and ds/maintenance-part-3.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Will merge to 'master'.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * al/t3200-back-on-a-branch (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at 833e2fc60c) + t3200: clean side effect of git checkout --orphan Test fix. * ea/blame-use-oideq (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at babefe4727) + blame.c: replace instance of !oidcmp for oideq Code cleanup. * es/wt-add-detach (2020-09-06) 3 commits (merged to 'next' on 2020-09-10 at abd83f90e7) + git-worktree.txt: discuss branch-based vs. throwaway worktrees + worktree: teach `add` to recognize -d as shorthand for --detach + git-checkout.txt: document -d short option for --detach "git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. * hn/refs-ref-log-only-bit (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at f729cb2c81) + refs: move REF_LOG_ONLY to refs-internal.h A bit of API reshuffling to make sure stuff common to all backends are not defined only in files backend. * jc/add-i-use-builtin-experimental (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at abcb7515dc) + add -i: use the built-in version when feature.experimental is set The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. * jc/dist-tarball-tweak (2020-09-09) 1 commit (merged to 'next' on 2020-09-10 at 36cbe7ee9e) + Makefile: allow extra tweaking of distribution tarball Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. * jc/quote-path-cleanup (2020-09-10) 7 commits (merged to 'next' on 2020-09-10 at 3bfde81846) + quote: turn 'nodq' parameter into a set of flags + quote: rename misnamed sq_lookup[] to cq_lookup[] + wt-status: consistently quote paths in "status --short" output + quote_path: code clarification + quote_path: optionally allow quoting a path with SP in it + quote_path: give flags parameter to quote_path() + quote_path: rename quote_path_relative() to quote_path() "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * jk/add-i-fixes (2020-09-08) 2 commits (merged to 'next' on 2020-09-09 at 46ea071a7a) + add--interactive.perl: specify --no-color explicitly + add-patch: fix inverted return code of repo_read_index() "add -i/-p" fixes. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits (merged to 'next' on 2020-09-10 at 7853fe7e12) + submodule: use submodule repository when preparing summary + revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. cf. <xmqqzh667ca4.fsf@gitster.c.googlers.com> * mt/config-fail-nongit-early (2020-09-09) 1 commit (merged to 'next' on 2020-09-10 at 6f77f65b4e) + config: complain about --worktree outside of a git repo Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. * os/collect-changed-submodules-optim (2020-09-06) 1 commit (merged to 'next' on 2020-09-10 at b6d9ed060e) + submodule: suppress checking for file name and ref ambiguity for object ids Optimization around submodule handling. * pb/clang-json-compilation-database (2020-09-06) 1 commit (merged to 'next' on 2020-09-09 at 9f5ea136f1) + Makefile: add support for generating JSON compilation database Developer support. * pw/add-p-leakfix (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at 4206d0503c) + add -p: fix memory leak Leakfix. * rs/misc-cleanups (2020-09-06) 3 commits (merged to 'next' on 2020-09-09 at 4a19ea9672) + pack-bitmap-write: use hashwrite_be32() in write_hash_cache() + midx: use hashwrite_u8() in write_midx_header() + fast-import: use write_pack_header() Misc cleanups. * rs/parallel-read-cache-fix (2020-09-06) 1 commit (merged to 'next' on 2020-09-09 at 92953a75c4) + read-cache: fix mem-pool allocation for multi-threaded index loading A follow-up fix to a topic already in 'master'. * rs/refspec-leakfix (2020-09-06) 2 commits (merged to 'next' on 2020-09-09 at 10741e90a5) + refspec: add and use refspec_appendf() + push: release strbufs used for refspec formatting Leakfix. * so/log-tree-diff-cleanup (2020-09-06) 2 commits (merged to 'next' on 2020-09-09 at f8744b8e8a) + log_tree_diff: get rid of extra check for NULL + log_tree_diff: get rid of code duplication for first_parent_only Code cleanup. -------------------------------------------------- [New Topics] * cs/don-t-pretend-a-failed-remote-set-head-succeeded (2020-09-17) 1 commit (merged to 'next' on 2020-09-18 at 51f73ca6dc) + remote: don't show success message when set-head fails "git remote set-head" that failed still said something that hints the operation went through, which was misleading. Will merge to 'master'. * dl/diff-merge-base (2020-09-17) 10 commits - contrib/completion: complete `git diff --merge-base` - builtin/diff-tree: learn --merge-base - builtin/diff-index: learn --merge-base - t4068: add --merge-base tests - diff-lib: define diff_get_merge_base() - diff-lib: accept option flags in run_diff_index() - contrib/completion: extract common diff/difftool options - git-diff.txt: backtick quote command text - git-diff-index.txt: make --cached description a proper sentence - t4068: remove unnecessary >tmp "git diff A...B" learned "git diff --merge-base A B", which is a longer short-hand to say the same thing. Expecting a reroll. cf. <20200917181303.GA108156@coredump.intra.peff.net>, <xmqqh7rws5hm.fsf@gitster.c.googlers.com>, etc. * jk/dont-count-existing-objects-twice (2020-09-17) 1 commit (merged to 'next' on 2020-09-18 at 73b30558b9) + packfile: actually set approximate_object_count_valid There is a logic to estimate how many objects are in the repository, which is mean to run once per process invocation, but it ran every time the estimated value was requested. Will merge to 'master'. * dl/complete-format-patch-recent-features (2020-09-17) 1 commit (merged to 'next' on 2020-09-18 at c0ec1f7569) + contrib/completion: complete options that take refs for format-patch Update to command line completion (in contrib/) Will merge to 'master'. * js/ignore-cmake-build-artifacts (2020-09-17) 1 commit - cmake: ignore generated files Running CMake based build with VS (in contrib/) from the top-level of the working tree leaves extra build crufts behind. Add patterns to .gitignore Expecting a resolution in a better way. cf. <xmqq7dsrnjhi.fsf@gitster.c.googlers.com> It turns out that these crufts are visible only when the CMake based build procedure is used against the best practice. A better alternative may be to prominently describe the recommended way to use the CMake-based build procedure. * hx/push-atomic-with-cert (2020-09-18) 1 commit - send-pack: run GPG after atomic push checking "git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). Expecting a reroll. cf. <xmqqft7eljkz.fsf@gitster.c.googlers.com> -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Discard for now. cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> cf. <20200911214358.acl3hy2e763begoo@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * kk/build-portability-fix (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at 63f2672632) + Fit to Plan 9's ANSI/POSIX compatibility layer Portability tweak for some shell scripts used while building. Will merge to 'master'. * al/ref-filter-merged-and-no-merged (2020-09-18) 5 commits (merged to 'next' on 2020-09-18 at cc2a0039f3) + Doc: prefer more specific file name + ref-filter: make internal reachable-filter API more precise (merged to 'next' on 2020-09-16 at b04e306660) + ref-filter: allow merged and no-merged filters + Doc: cover multiple contains/no-contains filters + t3201: test multiple branch filter combinations "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. Will merge to 'master'. * bc/faq-misc (2020-09-14) 3 commits - docs: explain how to deal with files that are always modified - docs: explain why reverts are not always applied on merge - docs: explain why squash merges are broken with long-running branches More FAQ entries. Expecting a reroll. cf. <20200913171206.GO241078@camp.crustytoothpaste.net> * sb/clone-origin (2020-09-11) 4 commits - clone: allow configurable default for `-o`/`--origin` - clone: validate --origin option before use - clone: call git_config before parse_options - clone: add tests for --template and some disallowed option pairs "git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. Expecting an update. * sk/force-if-includes (2020-09-14) 8 commits - SQUASH??? - t: add tests for "force-if-includes" - doc: add reference for "--[no-]force-if-includes" - builtin/push: add option "--[no-]force-if-includes" - transport-helper: update ref status for "force-if-includes" - send-pack: check ref status for "force-if-includes" - transport: add flag for "--[no-]force-if-includes" - remote: add reflog check for "force-if-includes" * ab/mediawiki-fixes (2020-09-16) 15 commits - remote-mediawiki tests: annotate failing tests - remote-mediawiki: fix duplicate revisions being imported - remote-mediawiki tests: use CLI installer - remote-mediawiki tests: use inline PerlIO for readability - remote-mediawiki tests: replace deprecated Perl construct - remote-mediawiki tests: use a more idiomatic dispatch table - remote-mediawiki tests: use "$dir/" instead of "$dir." - remote-mediawiki tests: change `[]` to `test` - remote-mediawiki tests: guard test_cmp with test_path_is_file - remote-mediawiki tests: use test_cmp in tests - remote-mediawiki tests: use a 10 character password - remote-mediawiki tests: use the login/password variables - remote-mediawiki doc: bump recommended PHP version to 7.3 - remote-mediawiki doc: link to MediaWiki's current version - remote-mediawiki doc: correct link to GitHub project Modernization and fixes to MediaWiki remote backend. Expecting a reroll. * ar/fetch-ipversion-in-all (2020-09-15) 1 commit - fetch: pass --ipv4 and --ipv6 options to sub-fetches "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. Will merge to 'next'. * ar/fetch-transfer-ipversion (2020-09-16) 1 commit - config: option transfer.ipversion to set transport protocol version for network fetches Adds transfer.ipversion configuration variable. Needs more work. * bc/clone-with-git-default-hash-fix (2020-09-15) 1 commit - builtin/clone: avoid failure with GIT_DEFAULT_HASH "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. Expecting a reroll. * cd/commit-graph-doc (2020-09-15) 1 commit (merged to 'next' on 2020-09-16 at b0816b6eb0) + commit-graph-format.txt: fix no-parent value Doc update. Will merge to 'master'. * hn/reftable (2020-09-16) 13 commits - reftable: "test-tool dump-reftable" command. - reftable: rest of library - reftable: file level tests - reftable: read reftable files - reftable: write reftable files - reftable: a generic binary tree implementation - reftable: reading/writing blocks - reftable: (de)serialization for the polymorphic record type. - reftable: utility functions - reftable: add a barebones unittest framework - vcxproj: adjust for the reftable changes - reftable: define the public API - reftable: add LICENSE * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. * ds/maintenance-part-3 (2020-09-17) 7 commits - maintenance: add troubleshooting guide to docs - maintenance: recommended schedule in register/start - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-1 and ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * es/format-patch-interdiff-cleanup (2020-09-08) 3 commits (merged to 'next' on 2020-09-16 at d919bb3d1f) + format-patch: use 'origin' as start of current-series-range when known + diff-lib: tighten show_interdiff()'s interface + diff: move show_interdiff() from its own file to diff-lib Code cleanup and teach "format-patch --range-diff=<prev> <origin>..HEAD" not ignore <origin> when <prev> is a single version. Will merge to 'master'. * os/fetch-submodule-optim (2020-09-06) 1 commit (merged to 'next' on 2020-09-16 at fa39e3f211) + fetch: do not look for submodule changes in unchanged refs Optimization around submodule handling. Will merge to 'master'. * pw/add-p-edit-ita-path (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at 7540ed3c0e) + add -p: fix editing of intent-to-add paths "add -p" did not allow editing paths that were only added in intent. Will merge to 'master'. * hn/refs-trace-backend (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at f2e065ec17) + refs: add GIT_TRACE_REFS debugging mechanism Developer support. Will merge to 'master'. * tb/bloom-improvements (2020-09-18) 13 commits - commit-graph: introduce 'commitGraph.maxNewFilters' - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - bloom: encode out-of-bounds filters as non-empty - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. Will merge to 'next'. * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. * ls/mergetool-meld-auto-merge (2020-09-16) 1 commit (merged to 'next' on 2020-09-16 at 01985a671b) + mergetool: allow auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Will merge to 'master'. * mt/grep-sparse-checkout (2020-09-10) 9 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - config: make do_git_config_sequence receive a 'struct repository' - t/helper/test-config: unify exit labels - t/helper/test-config: diagnose missing arguments - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-08-31) 13 commits - bisect--helper: retire `--bisect-autostart` subcommand - bisect--helper: retire `--write-terms` subcommand - bisect--helper: retire `--check-expected-revs` subcommand - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C - bisect--helper: retire `--next-all` subcommand - bisect--helper: retire `--bisect-clean-state` subcommand - bisect--helper: finish porting `bisect_start()` to C - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. At v7; getting close cf. <nycvar.QRO.7.76.6.2009031403510.56@tvgsbejvaqbjf.bet> * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Expecting a reroll to update log message for the last one. as it confused at least two reviewers. cf. <xmqqwo1baop3.fsf@gitster.c.googlers.com> cf. <20200903104537.GA27325@szeder.dev> * jt/threaded-index-pack (2020-09-08) 7 commits (merged to 'next' on 2020-09-16 at 8542385cc0) + index-pack: make quantum of work smaller + index-pack: make resolve_delta() assume base data + index-pack: calculate {ref,ofs}_{first,last} early + index-pack: remove redundant child field + index-pack: unify threaded and unthreaded code + index-pack: remove redundant parameter + Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. Will merge to 'master'. * jk/refspecs-negative (2020-09-18) 2 commits - SQUASH??? - refspec: add support for negative refspecs "negative refspecs" Expecting a reroll. cf. <nycvar.QRO.7.76.6.2008221528170.56@tvgsbejvaqbjf.bet> cf. <xmqqzh5onea1.fsf@gitster.c.googlers.com> * jx/proc-receive-hook (2020-08-27) 10 commits (merged to 'next' on 2020-09-18 at 344c89be7e) + doc: add documentation for the proc-receive hook + transport: parse report options for tracking refs + t5411: test updates of remote-tracking branches + receive-pack: new config receive.procReceiveRefs + doc: add document for capability report-status-v2 + New capability "report-status-v2" for git-push + receive-pack: feed report options to post-receive + receive-pack: add new proc-receive hook + t5411: add basic test cases for proc-receive hook + transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Will merge to 'master'. * ds/maintenance-part-2 (2020-09-17) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch is used by ds/maintenance-part-3; uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ds/maintenance-part-1 (2020-09-17) 11 commits (merged to 'next' on 2020-09-18 at 4c367d3cf6) + maintenance: add trace2 regions for task execution + maintenance: add auto condition for commit-graph task + maintenance: use pointers to check --auto + maintenance: create maintenance.<task>.enabled config + maintenance: take a lock on the objects directory + maintenance: add --task option + maintenance: add commit-graph task + maintenance: initialize task array + maintenance: replace run_auto_gc() + maintenance: add --quiet option + maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2 and ds/maintenance-part-3.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Will merge to 'master'.
Jacob Keller <jacob.e.keller@intel.com> writes: > @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet > item->src = xstrndup(lhs, llen); > flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); > > + if (item->negative) { > + struct object_id unused; > + > + /* > + * Negative refspecs only have a LHS, which indicates a ref > + * (or pattern of refs) to exclude from other matches. This > + * can either be a simple ref, a glob pattern, or even an > + * exact sha1 match. > + */ > + if (!*item->src) > + return 0; /* negative refspecs must not be empty */ > + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) > + item->exact_sha1 = 1; /* ok */ > + else if (!check_refname_format(item->src, flags)) > + ; /* valid looking ref is ok */ > + else > + return 0; > + > + /* other rules for negative refspecs don't apply */ This comment confused me a bit; did you mean "other rules don't apply to negative refspecs"? > + return 1; > + } > + > if (fetch) { > struct object_id unused; > diff --git a/remote.c b/remote.c > index c5ed74f91c63..2f583d72c3f0 100644 > --- a/remote.c > +++ b/remote.c > @@ -1058,7 +1172,7 @@ static int match_explicit(struct ref *src, struct ref *dst, > const char *dst_value = rs->dst; > char *dst_guess; > > - if (rs->pattern || rs->matching) > + if (rs->pattern || rs->matching || rs->negative) > return 0; OK. These "special" ones do not participate in explicit matching. > @@ -1134,6 +1248,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, > int matching_refs = -1; > for (i = 0; i < rs->nr; i++) { > const struct refspec_item *item = &rs->items[i]; > + > + if (item->negative) > + continue; > + And a negative one does not decide if a ref being pushed will be pushed out for real at this point. This helper is only to enumerate the candidate refs to be pushed out; the caller makes a separate call to apply_negative_refspecs() to cull the candidate list later. OK. > @@ -1339,7 +1457,7 @@ int check_push_refs(struct ref *src, struct refspec *rs) > for (i = 0; i < rs->nr; i++) { > struct refspec_item *item = &rs->items[i]; > > - if (item->pattern || item->matching) > + if (item->pattern || item->matching || item->negative) > continue; > > ret |= match_explicit_lhs(src, item, NULL, NULL); match_explicit_lhs(), like match_explicit(), are for explicit matching and should not be called for the "special" ones. OK. > @@ -1441,6 +1559,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > string_list_clear(&src_ref_index, 0); > } > > + *dst = apply_negative_refspecs(*dst, rs); > + > if (errs) > return -1; > return 0; And after grabbing all the candidate refs to be updated via this push, we filter out the ones that match negative pattern. Can it also produce an error, or it can never fail (to udpate errs)? > @@ -1810,6 +1930,9 @@ int get_fetch_map(const struct ref *remote_refs, > { > struct ref *ref_map, **rmp; > > + if (refspec->negative) > + return 0; > + Again, the idea is to let the existing codepath to only deal with the positive refspec elements to keep the same behaviour, and let the caller filter the ones that match negative ones out of the result. So we return without anything here for negative one. Nothing jumped out at me as being suspicious so far, other than that the GNU "?<empty>:" thing needs to be fixed as pointed out by Dscho. Thanks.
Jacob Keller <jacob.e.keller@intel.com> writes:
> From: Jacob Keller <jacob.keller@gmail.com>
>
> Both fetch and push support pattern refspecs which allow fetching or
> pushing references that match a specific pattern. Because these patterns
> are globs, they have somewhat limited ability to express more complex
> situations.
>
> For example, suppose you wish to fetch all branches from a remote except
> for a specific one. To allow this, you must setup a set of refspecs
> which match only the branches you want. Because refspecs are either
> explicit name matches, or simple globs, many patterns cannot be
> expressed.
>
> Add support for a new type of refspec, referred to as "negative"
> refspecs. These are prefixed with a '^' and mean "exclude any ref
> matching this refspec". They can only have one "side" which always
> refers to the source. During a fetch, this refers to the name of the ref
> on the remote. During a push, this refers to the name of the ref on the
> local side.
>
> With negative refspecs, users can express more complex patterns. For
> example:
>
> git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant
>
> will fetch all branches on origin into remotes/origin, but will exclude
> fetching the branch named dontwant.
>
> Refspecs today are commutative, meaning that order doesn't expressly
> matter. Rather than forcing an implied order, negative refspecs will
> always be applied last. That is, in order to match, a ref must match at
> least one positive refspec, and match none of the negative refspecs.
> This is similar to how negative pathspecs work.
>
> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
> ---
>
> I realize this probably needs to be broken down into multiple patches, but I
> haven't quite figured out the best way to do that. I'd like to avoid the
> case where a commit has support for parsing negative refspecs but code paths
> which use refspecs aren't handling them correctly. Thoughts?
>
> Splitting would also allow additional space for explanations of some of the
> trickier logic.
>
> I am also definitely looking for more test ideas, to help make sure we
> cover a good variety of the flows.
Anybody wants to help this move forward?
I plan to send a review with the patch in the current form, without
waiting for any splitting, later towards the weekend, though.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [New Topics] * kk/build-portability-fix (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at 63f2672632) + Fit to Plan 9's ANSI/POSIX compatibility layer Portability tweak for some shell scripts used while building. Will merge to 'master'. * al/ref-filter-merged-and-no-merged (2020-09-16) 3 commits (merged to 'next' on 2020-09-16 at b04e306660) + ref-filter: allow merged and no-merged filters + Doc: cover multiple contains/no-contains filters + t3201: test multiple branch filter combinations "git for-each-ref" and friends that list refs used to allow only one --merged or --no-merged to filter them; they learned to take combination of both kind of filtering. Will merge to 'master'. * bc/faq-misc (2020-09-14) 3 commits - docs: explain how to deal with files that are always modified - docs: explain why reverts are not always applied on merge - docs: explain why squash merges are broken with long-running branches More FAQ entries. Expecting a reroll. cf. <20200913171206.GO241078@camp.crustytoothpaste.net> * sb/clone-origin (2020-09-11) 4 commits - clone: allow configurable default for `-o`/`--origin` - clone: validate --origin option before use - clone: call git_config before parse_options - clone: add tests for --template and some disallowed option pairs "git clone" learned clone.defaultremotename configuration variable to customize what nickname to use to call the remote the repository was cloned from. Expecting an update. * sk/force-if-includes (2020-09-14) 8 commits - SQUASH??? - t: add tests for "force-if-includes" - doc: add reference for "--[no-]force-if-includes" - builtin/push: add option "--[no-]force-if-includes" - transport-helper: update ref status for "force-if-includes" - send-pack: check ref status for "force-if-includes" - transport: add flag for "--[no-]force-if-includes" - remote: add reflog check for "force-if-includes" * ab/mediawiki-fixes (2020-09-16) 15 commits - remote-mediawiki tests: annotate failing tests - remote-mediawiki: fix duplicate revisions being imported - remote-mediawiki tests: use CLI installer - remote-mediawiki tests: use inline PerlIO for readability - remote-mediawiki tests: replace deprecated Perl construct - remote-mediawiki tests: use a more idiomatic dispatch table - remote-mediawiki tests: use "$dir/" instead of "$dir." - remote-mediawiki tests: change `[]` to `test` - remote-mediawiki tests: guard test_cmp with test_path_is_file - remote-mediawiki tests: use test_cmp in tests - remote-mediawiki tests: use a 10 character password - remote-mediawiki tests: use the login/password variables - remote-mediawiki doc: bump recommended PHP version to 7.3 - remote-mediawiki doc: link to MediaWiki's current version - remote-mediawiki doc: correct link to GitHub project Modernization and fixes to MediaWiki remote backend. Will merge to 'next'. * ar/fetch-ipversion-in-all (2020-09-15) 1 commit - fetch: pass --ipv4 and --ipv6 options to sub-fetches "git fetch --all --ipv4/--ipv6" forgot to pass the protocol options to instances of the "git fetch" that talk to individual remotes, which has been corrected. * ar/fetch-transfer-ipversion (2020-09-16) 1 commit - config: option transfer.ipversion to set transport protocol version for network fetches Adds transfer.ipversion configuration variable. Needs more work. * bc/clone-with-git-default-hash-fix (2020-09-15) 1 commit - builtin/clone: avoid failure with GIT_DEFAULT_HASH "git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. Expecting a reroll. * cd/commit-graph-doc (2020-09-15) 1 commit (merged to 'next' on 2020-09-16 at b0816b6eb0) + commit-graph-format.txt: fix no-parent value Doc update. Will merge to 'master'. * hn/reftable (2020-09-16) 13 commits - reftable: "test-tool dump-reftable" command. - reftable: rest of library - reftable: file level tests - reftable: read reftable files - reftable: write reftable files - reftable: a generic binary tree implementation - reftable: reading/writing blocks - reftable: (de)serialization for the polymorphic record type. - reftable: utility functions - reftable: add a barebones unittest framework - vcxproj: adjust for the reftable changes - reftable: define the public API - reftable: add LICENSE -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Discard for now. cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> cf. <20200911214358.acl3hy2e763begoo@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * al/t3200-back-on-a-branch (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at 833e2fc60c) + t3200: clean side effect of git checkout --orphan Test fix. Will merge to 'master'. * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. * ds/maintenance-part-3 (2020-09-11) 7 commits - maintenance: add troubleshooting guide to docs - maintenance: recommended schedule in register/start - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-1 and ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * ea/blame-use-oideq (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at babefe4727) + blame.c: replace instance of !oidcmp for oideq Code cleanup. Will merge to 'master'. * es/format-patch-interdiff-cleanup (2020-09-08) 3 commits (merged to 'next' on 2020-09-16 at d919bb3d1f) + format-patch: use 'origin' as start of current-series-range when known + diff-lib: tighten show_interdiff()'s interface + diff: move show_interdiff() from its own file to diff-lib Code cleanup and teach "format-patch --range-diff=<prev> <origin>..HEAD" not ignore <origin> when <prev> is a single version. Will merge to 'master'. * es/wt-add-detach (2020-09-06) 3 commits (merged to 'next' on 2020-09-10 at abd83f90e7) + git-worktree.txt: discuss branch-based vs. throwaway worktrees + worktree: teach `add` to recognize -d as shorthand for --detach + git-checkout.txt: document -d short option for --detach "git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. Will merge to 'master'. * hn/refs-ref-log-only-bit (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at f729cb2c81) + refs: move REF_LOG_ONLY to refs-internal.h A bit of API reshuffling to make sure stuff common to all backends are not defined only in files backend. Will merge to 'master'. * jc/add-i-use-builtin-experimental (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at abcb7515dc) + add -i: use the built-in version when feature.experimental is set The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. Will merge to 'master'. * jc/quote-path-cleanup (2020-09-10) 7 commits (merged to 'next' on 2020-09-10 at 3bfde81846) + quote: turn 'nodq' parameter into a set of flags + quote: rename misnamed sq_lookup[] to cq_lookup[] + wt-status: consistently quote paths in "status --short" output + quote_path: code clarification + quote_path: optionally allow quoting a path with SP in it + quote_path: give flags parameter to quote_path() + quote_path: rename quote_path_relative() to quote_path() "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. Will merge to 'master'. * jk/add-i-fixes (2020-09-08) 2 commits (merged to 'next' on 2020-09-09 at 46ea071a7a) + add--interactive.perl: specify --no-color explicitly + add-patch: fix inverted return code of repo_read_index() "add -i/-p" fixes. Will merge to 'master'. * os/collect-changed-submodules-optim (2020-09-06) 1 commit (merged to 'next' on 2020-09-10 at b6d9ed060e) + submodule: suppress checking for file name and ref ambiguity for object ids Optimization around submodule handling. Will merge to 'master'. * os/fetch-submodule-optim (2020-09-06) 1 commit (merged to 'next' on 2020-09-16 at fa39e3f211) + fetch: do not look for submodule changes in unchanged refs Optimization around submodule handling. Will merge to 'master'. * pw/add-p-edit-ita-path (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at 7540ed3c0e) + add -p: fix editing of intent-to-add paths "add -p" did not allow editing paths that were only added in intent. Will merge to 'master'. * pw/add-p-leakfix (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at 4206d0503c) + add -p: fix memory leak Leakfix. Will merge to 'master'. * rs/misc-cleanups (2020-09-06) 3 commits (merged to 'next' on 2020-09-09 at 4a19ea9672) + pack-bitmap-write: use hashwrite_be32() in write_hash_cache() + midx: use hashwrite_u8() in write_midx_header() + fast-import: use write_pack_header() Misc cleanups. Will merge to 'master'. * rs/parallel-read-cache-fix (2020-09-06) 1 commit (merged to 'next' on 2020-09-09 at 92953a75c4) + read-cache: fix mem-pool allocation for multi-threaded index loading A follow-up fix to a topic already in 'master'. Will merge to 'master'. * rs/refspec-leakfix (2020-09-06) 2 commits (merged to 'next' on 2020-09-09 at 10741e90a5) + refspec: add and use refspec_appendf() + push: release strbufs used for refspec formatting Leakfix. Will merge to 'master'. * so/log-tree-diff-cleanup (2020-09-06) 2 commits (merged to 'next' on 2020-09-09 at f8744b8e8a) + log_tree_diff: get rid of extra check for NULL + log_tree_diff: get rid of code duplication for first_parent_only Code cleanup. Will merge to 'master'. * hn/refs-trace-backend (2020-09-09) 1 commit (merged to 'next' on 2020-09-16 at f2e065ec17) + refs: add GIT_TRACE_REFS debugging mechanism Developer support. Will merge to 'master'. * jc/dist-tarball-tweak (2020-09-09) 1 commit (merged to 'next' on 2020-09-10 at 36cbe7ee9e) + Makefile: allow extra tweaking of distribution tarball Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. Will merge to 'master'. * mt/config-fail-nongit-early (2020-09-09) 1 commit (merged to 'next' on 2020-09-10 at 6f77f65b4e) + config: complain about --worktree outside of a git repo Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. Will merge to 'master'. * tb/bloom-improvements (2020-09-16) 13 commits - commit-graph: introduce 'commitGraph.maxNewFilters' - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - bloom: encode out-of-bounds filters as non-empty - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. Will merge to 'next'. * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. * ls/mergetool-meld-auto-merge (2020-09-16) 1 commit (merged to 'next' on 2020-09-16 at 01985a671b) + mergetool: allow auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Will merge to 'master'. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits (merged to 'next' on 2020-09-10 at 7853fe7e12) + submodule: use submodule repository when preparing summary + revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Will merge to 'master'. cf. <xmqqzh667ca4.fsf@gitster.c.googlers.com> * pb/clang-json-compilation-database (2020-09-06) 1 commit (merged to 'next' on 2020-09-09 at 9f5ea136f1) + Makefile: add support for generating JSON compilation database Developer support. Will merge to 'master'. * mt/grep-sparse-checkout (2020-09-10) 9 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - config: make do_git_config_sequence receive a 'struct repository' - t/helper/test-config: unify exit labels - t/helper/test-config: diagnose missing arguments - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-08-31) 13 commits - bisect--helper: retire `--bisect-autostart` subcommand - bisect--helper: retire `--write-terms` subcommand - bisect--helper: retire `--check-expected-revs` subcommand - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C - bisect--helper: retire `--next-all` subcommand - bisect--helper: retire `--bisect-clean-state` subcommand - bisect--helper: finish porting `bisect_start()` to C - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. At v7; getting close cf. <nycvar.QRO.7.76.6.2009031403510.56@tvgsbejvaqbjf.bet> * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Expecting a reroll to update log message for the last one. as it confused at least two reviewers. cf. <xmqqwo1baop3.fsf@gitster.c.googlers.com> cf. <20200903104537.GA27325@szeder.dev> * jt/threaded-index-pack (2020-09-08) 7 commits (merged to 'next' on 2020-09-16 at 8542385cc0) + index-pack: make quantum of work smaller + index-pack: make resolve_delta() assume base data + index-pack: calculate {ref,ofs}_{first,last} early + index-pack: remove redundant child field + index-pack: unify threaded and unthreaded code + index-pack: remove redundant parameter + Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. Will merge to 'master'. * jk/refspecs-negative (2020-08-21) 1 commit - refspec: add support for negative refspecs "negative refspecs" * jx/proc-receive-hook (2020-08-27) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: feed report options to post-receive - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Will merge to 'next'. * ds/maintenance-part-2 (2020-09-06) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch is used by ds/maintenance-part-3; uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ds/maintenance-part-1 (2020-09-06) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2 and ds/maintenance-part-3.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. On hold. cf. <0b35829f-a83b-a093-2dc5-0e7d3b42fd15@gmail.com> -------------------------------------------------- [Discarded] * jc/remove-pack-redundant (2020-08-25) 1 commit . pack-redundant: gauge the usage before proposing its removal The first step to remove "git pack-redundant" by soliciting objections. Stop--we had some activity as late as last year.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * es/worktree-repair (2020-08-31) 5 commits (merged to 'next' on 2020-08-31 at 604825c5e4) + init: make --separate-git-dir work from within linked worktree + init: teach --separate-git-dir to repair linked worktrees + worktree: teach "repair" to fix outgoing links to worktrees + worktree: teach "repair" to fix worktree back-links to main worktree + worktree: add skeleton "repair" command "git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * hv/ref-filter-misc (2020-08-28) 8 commits (merged to 'next' on 2020-09-02 at 9a8bb84f20) + ref-filter: add `sanitize` option for 'subject' atom + pretty: refactor `format_sanitized_subject()` + ref-filter: add `short` modifier to 'parent' atom + ref-filter: add `short` modifier to 'tree' atom + ref-filter: rename `objectname` related functions and fields + ref-filter: modify error messages in `grab_objectname()` + ref-filter: refactor `grab_objectname()` + ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * jk/worktree-check-clean-leakfix (2020-08-27) 1 commit (merged to 'next' on 2020-08-31 at 220fc43629) + worktree: fix leak in check_clean_worktree() Leakfix. * js/ci-squelch-false-failure (2020-09-02) 2 commits (merged to 'next' on 2020-09-03 at 254f390305) + ci: avoid ugly "failure" in the `ci-config` job + ci: fix indentation of the `ci-config` job CI noise reduction. * jt/interpret-branch-name-fallback (2020-09-02) 3 commits (merged to 'next' on 2020-09-03 at 28914ab788) + wt-status: tolerate dangling marks + refs: move dwim_ref() to header file + sha1-name: replace unsigned int with option struct "git status" has trouble showing where it came from by interpreting reflog entries that recordcertain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. * os/vcbuild (2020-09-08) 3 commits (merged to 'next' on 2020-09-08 at 56551401c2) + contrib/buildsystems: fix expat library name for generated vcxproj (merged to 'next' on 2020-09-03 at 0216ec9cb9) + vcbuild: fix batch file name in README + vcbuild: fix library name for expat with make MSVC=1 Fix build procedure for MSVC. * pb/imap-send-updates (2020-08-31) 3 commits (merged to 'next' on 2020-09-02 at 899fca3919) + git-imap-send.txt: add note about localized Gmail folders + git-imap-send.txt: do verify SSL certificate for gmail.com + git-imap-send.txt: don't duplicate 'Examples' sections "git imap-send" updates. * so/separate-field-for-m-and-diff-merges (2020-08-31) 1 commit (merged to 'next' on 2020-08-31 at 8def2984ca) + revision: add separate field for "-m" of "diff-index -m" Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro (this branch is used by ss/submodule-summary-in-c-fixes.) Yet another subcommand of "git submodule" is getting rewritten in C. * ss/submodule-summary-in-c-fixes (2020-08-27) 3 commits (merged to 'next' on 2020-09-02 at 7f959811b8) + t7421: eliminate 'grep' check in t7421.4 for mingw compatibility + submodule: fix style in function definition + submodule: eliminate unused parameters from print_submodule_summary() (this branch uses ss/submodule-summary-in-c.) Fixups to a topic in 'next'. * tb/repack-clearing-midx (2020-08-28) 2 commits (merged to 'next' on 2020-08-28 at 4204c0cb5e) + midx: traverse the local MIDX first (merged to 'next' on 2020-08-27 at a465875cbb) + builtin/repack.c: invalidate MIDX only when necessary When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. -------------------------------------------------- [New Topics] * al/t3200-back-on-a-branch (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at 833e2fc60c) + t3200: clean side effect of git checkout --orphan Test fix. Will merge to 'master'. * bc/rev-parse-path-format (2020-09-08) 1 commit - rev-parse: add option for absolute or relative path formatting "git rev-parse" can be explicitly told to give output as absolute or relative path. * ds/maintenance-part-3 (2020-09-06) 6 commits - maintenance: recommended schedule in register/start - maintenance: add start/stop subcommands - maintenance: add [un]register subcommands - for-each-repo: run subcommands on configured repos - maintenance: add --schedule option and config - maintenance: optionally skip --auto process (this branch uses ds/maintenance-part-1 and ds/maintenance-part-2.) Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * ea/blame-use-oideq (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at babefe4727) + blame.c: replace instance of !oidcmp for oideq Code cleanup. Will merge to 'master'. * es/format-patch-interdiff-cleanup (2020-09-08) 3 commits - format-patch: use 'origin' as start of current-series-range when known - diff-lib: tighten show_interdiff()'s interface - diff: move show_interdiff() from its own file to diff-lib Code cleanup with a slight behaviour change when "format-patch --range-diff=<prev> origin..HEAD" gives a single revision to <prev>. Will merge to 'next'. * es/wt-add-detach (2020-09-06) 3 commits - git-worktree.txt: discuss branch-based vs. throwaway worktrees - worktree: teach `add` to recognize -d as shorthand for --detach - git-checkout.txt: document -d short option for --detach "git worktree add" learns the "--detach" option to create a new worktree without being on a branch. Will merge to 'next'. * hn/refs-ref-log-only-bit (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at f729cb2c81) + refs: move REF_LOG_ONLY to refs-internal.h A bit of API reshuffling to make sure stuff common to all backends are not defined only in files backend. Will merge to 'master'. * jc/add-i-use-builtin-experimental (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at abcb7515dc) + add -i: use the built-in version when feature.experimental is set The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. Will merge to 'master'. * jc/quote-path-cleanup (2020-09-08) 6 commits - quote: turn 'nodq' parameter into a set of flags - quote: rename misnamed sq_lookup[] to cq_lookup[] - wt-status: consistently quote paths in "status --short" output - quote_path: optionally allow quoting a path with SP in it - quote_path: give flags parameter to quote_path() - quote_path: rename quote_path_relative() to quote_path() "git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. Undecided. This is more involved than alternatives proposed by brian and Réne and I am not sure extra changes to the codebase is a net positive. cf. <20200908013013.1099937-1-sandals@crustytoothpaste.net> cf. <3a72c5f2-35cc-a865-d5f2-02706c48d8ec@web.de> * jk/add-i-fixes (2020-09-08) 2 commits (merged to 'next' on 2020-09-09 at 46ea071a7a) + add--interactive.perl: specify --no-color explicitly + add-patch: fix inverted return code of repo_read_index() "add -i/-p" fixes. Will merge to 'master'. * os/collect-changed-submodules-optim (2020-09-06) 1 commit - submodule: suppress checking for file name and ref ambiguity for object ids Optimization around submodule handling. Will merge to 'next'. * os/fetch-submodule-optim (2020-09-06) 1 commit - fetch: do not look for submodule changes in unchanged refs Optimization around submodule handling. Will merge to 'next'. * pw/add-p-edit-ita-path (2020-09-09) 1 commit - add -p: fix editing of intent-to-add paths "add -p" did not allow editing paths that were only added in intent. Will merge to 'next'. * pw/add-p-leakfix (2020-09-08) 1 commit (merged to 'next' on 2020-09-09 at 4206d0503c) + add -p: fix memory leak Leakfix. Will merge to 'master'. * rs/misc-cleanups (2020-09-06) 3 commits (merged to 'next' on 2020-09-09 at 4a19ea9672) + pack-bitmap-write: use hashwrite_be32() in write_hash_cache() + midx: use hashwrite_u8() in write_midx_header() + fast-import: use write_pack_header() Misc cleanups. Will merge to 'master'. * rs/parallel-read-cache-fix (2020-09-06) 1 commit (merged to 'next' on 2020-09-09 at 92953a75c4) + read-cache: fix mem-pool allocation for multi-threaded index loading A follow-up fix to a topic already in 'master'. Will merge to 'master'. * rs/refspec-leakfix (2020-09-06) 2 commits (merged to 'next' on 2020-09-09 at 10741e90a5) + refspec: add and use refspec_appendf() + push: release strbufs used for refspec formatting Leakfix. Will merge to 'master'. * so/log-tree-diff-cleanup (2020-09-06) 2 commits (merged to 'next' on 2020-09-09 at f8744b8e8a) + log_tree_diff: get rid of extra check for NULL + log_tree_diff: get rid of code duplication for first_parent_only Code cleanup. Will merge to 'master'. * hn/refs-trace-backend (2020-09-09) 1 commit - refs: add GIT_TRACE_REFS debugging mechanism Developer support. Will merge to 'next'. * jc/dist-tarball-tweak (2020-09-09) 1 commit - Makefile: allow extra tweaking of distribution tarball Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. Will merge to 'next'. * mt/config-fail-nongit-early (2020-09-09) 1 commit - config: complain about --worktree outside of a git repo Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. Will merge to 'next'. -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * tb/bloom-improvements (2020-09-09) 12 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - bloom: encode out-of-bounds filters as non-empty - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' "git commit-graph write" learned to limit the number of bloom filters that are computed from scratch with the --max-new-filters option. * es/config-hooks (2020-09-09) 9 commits - run_commit_hook: take strvec instead of varargs - commit: use config-based hooks - hook: replace run-command.h:find_hook - hook: add 'run' subcommand - parse-options: parse into strvec - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. * ls/mergetool-meld-auto-merge (2020-09-09) 1 commit - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Will merge to 'next'. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Will merge to 'next'. cf. <xmqqzh667ca4.fsf@gitster.c.googlers.com> * pb/clang-json-compilation-database (2020-09-06) 1 commit (merged to 'next' on 2020-09-09 at 9f5ea136f1) + Makefile: add support for generating JSON compilation database Developer support. Will merge to 'master'. * mt/grep-sparse-checkout (2020-09-02) 8 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: unify exit labels - t/helper/test-config: check argc before accessing argv - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-08-31) 13 commits - bisect--helper: retire `--bisect-autostart` subcommand - bisect--helper: retire `--write-terms` subcommand - bisect--helper: retire `--check-expected-revs` subcommand - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C - bisect--helper: retire `--next-all` subcommand - bisect--helper: retire `--bisect-clean-state` subcommand - bisect--helper: finish porting `bisect_start()` to C - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. At v7; getting close cf. <nycvar.QRO.7.76.6.2009031403510.56@tvgsbejvaqbjf.bet> * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Expecting a reroll to update log message for the last one. as it confused at least two reviewers. cf. <xmqqwo1baop3.fsf@gitster.c.googlers.com> cf. <20200903104537.GA27325@szeder.dev> * jt/threaded-index-pack (2020-09-08) 7 commits - index-pack: make quantum of work smaller - index-pack: make resolve_delta() assume base data - index-pack: calculate {ref,ofs}_{first,last} early - index-pack: remove redundant child field - index-pack: unify threaded and unthreaded code - index-pack: remove redundant parameter - Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. Will merge to 'next'. * jk/refspecs-negative (2020-08-21) 1 commit - refspec: add support for negative refspecs "negative refspecs" * jx/proc-receive-hook (2020-08-27) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: feed report options to post-receive - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Will merge to 'next'. * ds/maintenance-part-2 (2020-09-06) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch is used by ds/maintenance-part-3; uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ds/maintenance-part-1 (2020-09-06) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2 and ds/maintenance-part-3.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Will merge to 'next'. -------------------------------------------------- [Discarded] * jc/remove-pack-redundant (2020-08-25) 1 commit . pack-redundant: gauge the usage before proposing its removal The first step to remove "git pack-redundant" by soliciting objections. Stop--we had some activity as late as last year.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. It is a bit too soon since the previous edition of the "What's cooking" report, but I'd expect to be inactive tomorrow, and today happened to be the day several topics have graduated to 'master', so here it is. The "stalled" state have accumulated way too many topics to my liking. I'll probably start pinging the patch and discussion threads and see what status they are in and then start dropping truly dead ones. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * hl/bisect-doc-clarify-bad-good-ordering (2020-08-28) 1 commit (merged to 'next' on 2020-08-31 at 11ce613916) + bisect: swap command-line options in documentation Doc update. * jc/post-checkout-doc (2020-08-27) 1 commit (merged to 'next' on 2020-09-02 at bb06b5f978) + doc: clarify how exit status of post-checkout hook is used Doc update. * jc/run-command-use-embedded-args (2020-08-26) 1 commit (merged to 'next' on 2020-08-27 at c2b688e8e9) + run_command: teach API users to use embedded 'args' more Various callers of run_command API has been modernized. * jc/undash-in-tree-git-callers (2020-08-27) 3 commits (merged to 'next' on 2020-08-27 at 671fa2f87e) + credential-cache: use child_process.args + cvsexportcommit: do not run git programs in dashed form + transport-helper: do not run git-remote-ext etc. in dashed form (this branch is used by jc/war-on-dashed-git.) A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. * jk/slimmed-down (2020-08-13) 5 commits (merged to 'next' on 2020-08-27 at bc8e9450c6) + drop vcs-svn experiment + make git-fast-import a builtin + make git-bugreport a builtin + make credential helpers builtins + Makefile: drop builtins from MSVC pdb list Trim an unused binary and turn a bunch of commands into built-in. * jk/xrealloc-avoid-use-after-free (2020-09-02) 1 commit (merged to 'next' on 2020-09-02 at a1ad92fe1c) + xrealloc: do not reuse pointer freed by zero-length realloc() It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. * jt/fetch-pack-loosen-validation-with-packfile-uri (2020-08-24) 3 commits (merged to 'next' on 2020-08-27 at efd171f172) + fetch-pack: make packfile URIs work with transfer.fsckobjects + fetch-pack: document only_packfile in get_pack() + (various): document from_promisor parameter Bugfix for "git fetch" when the packfile URI capability is in use. * jt/lazy-fetch (2020-09-02) 8 commits (merged to 'next' on 2020-09-02 at 1f8cd016d4) + fetch: no FETCH_HEAD display if --no-write-fetch-head (merged to 'next' on 2020-08-27 at 85f2319ba1) + fetch-pack: remove no_dependents code + promisor-remote: lazy-fetch objects in subprocess + fetch-pack: do not lazy-fetch during ref iteration + fetch: only populate existing_refs if needed + fetch: avoid reading submodule config until needed + fetch: allow refspecs specified through stdin + negotiator/noop: add noop fetch negotiator Updates to on-demand fetching code in lazily cloned repositories. * mr/diff-hide-stat-wo-textual-change (2020-08-19) 1 commit (merged to 'next' on 2020-08-27 at b9e97254ae) + diff: teach --stat to ignore uninteresting modifications "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. * pb/doc-external-diff-env (2020-09-01) 1 commit (merged to 'next' on 2020-09-02 at a789fe3fd9) + git.txt: correct stale 'GIT_EXTERNAL_DIFF' description Doc update. * pb/doc-sequence-editor-configuration (2020-08-31) 1 commit (merged to 'next' on 2020-08-31 at 506466270c) + doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more Doc update. * pw/add-p-allowed-options-fix (2020-08-17) 2 commits (merged to 'next' on 2020-08-27 at 6cd62753f7) + add -p: fix checking of user input + add -p: use ALLOC_GROW_BY instead of ALLOW_GROW "git add -p" update. * pw/rebase-i-more-options (2020-08-26) 6 commits (merged to 'next' on 2020-08-27 at c55cfeb247) + t3436: do not run git-merge-recursive in dashed form (merged to 'next' on 2020-08-21 at ade71fd49b) + rebase: add --reset-author-date + rebase -i: support --ignore-date + rebase -i: support --committer-date-is-author-date + am: stop exporting GIT_COMMITTER_DATE + rebase -i: add --ignore-whitespace flag "git rebase -i" learns a bit more options. * so/pretty-abbrev-doc (2020-08-27) 1 commit (merged to 'next' on 2020-08-31 at d664bd0c06) + pretty-options.txt: fix --no-abbrev-commit description Documentation update for "--no-abbrev-commit". * ss/t7401-modernize (2020-08-21) 5 commits (merged to 'next' on 2020-08-27 at 516cba9c64) + t7401: add a NEEDSWORK + t7401: change indentation for enhanced readability + t7401: change syntax of test_i18ncmp calls for clarity + t7401: use 'short' instead of 'verify' and cut in rev-parse calls + t7401: modernize style Test clean-up. -------------------------------------------------- [New Topics] * js/ci-squelch-false-failure (2020-09-02) 2 commits (merged to 'next' on 2020-09-03 at 254f390305) + ci: avoid ugly "failure" in the `ci-config` job + ci: fix indentation of the `ci-config` job CI noise reduction. Will merge to 'master'. * pb/clang-json-compilation-database (2020-09-02) 1 commit - Makefile: add support for generating JSON compilation database Developer support. Waiting for a response to a sanity check. cf. <xmqq1rjkccw8.fsf@gitster.c.googlers.com> * os/vcbuild (2020-09-03) 2 commits (merged to 'next' on 2020-09-03 at 0216ec9cb9) + vcbuild: fix batch file name in README + vcbuild: fix library name for expat with make MSVC=1 Fix build procedure for MSVC. Will merge to 'master'. -------------------------------------------------- [Stalled] * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * tb/bloom-improvements (2020-08-11) 14 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - commit-graph: add large-filters bitmap chunk - commit-graph.c: sort index into commits list - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - csum-file.h: introduce 'hashwrite_be64()' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' Misc Bloom filter improvements. Expecting a reroll. It seems that the review is getting closer to result in another update. cf. <20200811220503.GC66656@syl.lan> * es/config-hooks (2020-07-30) 6 commits - hook: add 'run' subcommand - parse-options: parse into argv_array - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. Now jk/strvec is in 'master', we may want to see the topic reworked on top of it. Are there unresolved issues, or does the topic need a round of detailed review? cf. <xmqqmu3i9kvg.fsf@gitster.c.googlers.com> * ls/mergetool-meld-auto-merge (2020-07-12) 2 commits - SQUASH??? - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Expecting a reroll. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Needs tests. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * mt/grep-sparse-checkout (2020-09-02) 8 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: unify exit labels - t/helper/test-config: check argc before accessing argv - t/helper/test-config: be consistent with exit codes - t1308-config-set: avoid false positives when using test-config - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. * jt/interpret-branch-name-fallback (2020-09-02) 3 commits (merged to 'next' on 2020-09-03 at 28914ab788) + wt-status: tolerate dangling marks + refs: move dwim_ref() to header file + sha1-name: replace unsigned int with option struct "git status" has trouble showing where it came from by interpreting reflog entries that recordcertain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. Will merge to 'master'. * pb/imap-send-updates (2020-08-31) 3 commits (merged to 'next' on 2020-09-02 at 899fca3919) + git-imap-send.txt: add note about localized Gmail folders + git-imap-send.txt: do verify SSL certificate for gmail.com + git-imap-send.txt: don't duplicate 'Examples' sections "git imap-send" updates. Will merge to 'master'. * so/separate-field-for-m-and-diff-merges (2020-08-31) 1 commit (merged to 'next' on 2020-08-31 at 8def2984ca) + revision: add separate field for "-m" of "diff-index -m" Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. Will merge to 'master'. * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * mr/bisect-in-c-2 (2020-08-31) 13 commits - bisect--helper: retire `--bisect-autostart` subcommand - bisect--helper: retire `--write-terms` subcommand - bisect--helper: retire `--check-expected-revs` subcommand - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C - bisect--helper: retire `--next-all` subcommand - bisect--helper: retire `--bisect-clean-state` subcommand - bisect--helper: finish porting `bisect_start()` to C - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. At v7; getting close cf. <nycvar.QRO.7.76.6.2009031403510.56@tvgsbejvaqbjf.bet> * tb/repack-clearing-midx (2020-08-28) 2 commits (merged to 'next' on 2020-08-28 at 4204c0cb5e) + midx: traverse the local MIDX first (merged to 'next' on 2020-08-27 at a465875cbb) + builtin/repack.c: invalidate MIDX only when necessary When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. Will merge to 'master'. * es/worktree-repair (2020-08-31) 5 commits (merged to 'next' on 2020-08-31 at 604825c5e4) + init: make --separate-git-dir work from within linked worktree + init: teach --separate-git-dir to repair linked worktrees + worktree: teach "repair" to fix outgoing links to worktrees + worktree: teach "repair" to fix worktree back-links to main worktree + worktree: add skeleton "repair" command "git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. Will merge to 'master'. * jk/worktree-check-clean-leakfix (2020-08-27) 1 commit (merged to 'next' on 2020-08-31 at 220fc43629) + worktree: fix leak in check_clean_worktree() Leakfix. Will merge to 'master'. * ss/submodule-summary-in-c-fixes (2020-08-27) 3 commits (merged to 'next' on 2020-09-02 at 7f959811b8) + t7421: eliminate 'grep' check in t7421.4 for mingw compatibility + submodule: fix style in function definition + submodule: eliminate unused parameters from print_submodule_summary() (this branch uses ss/submodule-summary-in-c.) Fixups to a topic in 'next'. Will merge to 'master'. * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. Expecting a reroll to update log message for the last one. as it confused at least two reviewers. cf. <xmqqwo1baop3.fsf@gitster.c.googlers.com> cf. <20200903104537.GA27325@szeder.dev> * jt/threaded-index-pack (2020-08-27) 9 commits - builtin/index-pack.c: fix some sparse warnings - fixup! index-pack: make quantum of work smaller - index-pack: make quantum of work smaller - index-pack: make resolve_delta() assume base data - index-pack: calculate {ref,ofs}_{first,last} early - index-pack: remove redundant child field - index-pack: unify threaded and unthreaded code - index-pack: remove redundant parameter - Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. Expecting the final reroll. cf. https://colabti.org/irclogger/irclogger_log/git-devel?date=2020-08-31#l82 * hv/ref-filter-misc (2020-08-28) 8 commits (merged to 'next' on 2020-09-02 at 9a8bb84f20) + ref-filter: add `sanitize` option for 'subject' atom + pretty: refactor `format_sanitized_subject()` + ref-filter: add `short` modifier to 'parent' atom + ref-filter: add `short` modifier to 'tree' atom + ref-filter: rename `objectname` related functions and fields + ref-filter: modify error messages in `grab_objectname()` + ref-filter: refactor `grab_objectname()` + ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. Will merge to 'master'. * jk/refspecs-negative (2020-08-21) 1 commit - refspec: add support for negative refspecs "negative refspecs" * jx/proc-receive-hook (2020-08-27) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: feed report options to post-receive - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Looking good. * ds/maintenance-part-2 (2020-08-25) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro (this branch is used by ss/submodule-summary-in-c-fixes.) Yet another subcommand of "git submodule" is getting rewritten in C. Will merge to 'master'. * ds/maintenance-part-1 (2020-08-25) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Almost ready for 'next'. cf. https://colabti.org/irclogger/irclogger_log/git-devel?date=2020-08-31#l44 -------------------------------------------------- [Discarded] * jc/remove-pack-redundant (2020-08-25) 1 commit . pack-redundant: gauge the usage before proposing its removal The first step to remove "git pack-redundant" by soliciting objections. Stop--we had some activity as late as last year.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * al/bisect-first-parent (2020-08-22) 1 commit (merged to 'next' on 2020-08-24 at f95fbf45a6) + bisect: add first-parent option to documentation Finishing touches. * am/ci-wsfix (2020-08-21) 1 commit (merged to 'next' on 2020-08-24 at 8491e031f1) + ci: fix inconsistent indentation Aesthetic fix to a CI configuration file. * dd/diff-customize-index-line-abbrev (2020-08-21) 2 commits (merged to 'next' on 2020-08-24 at 74e842a2c8) + diff: index-line: respect --abbrev in object's name + t4013: improve diff-post-processor logic The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. * hn/refs-pseudorefs (2020-08-21) 4 commits (merged to 'next' on 2020-08-24 at 3579abe8ff) + sequencer: treat REVERT_HEAD as a pseudo ref + builtin/commit: suggest update-ref for pseudoref removal + sequencer: treat CHERRY_PICK_HEAD as a pseudo ref + refs: make refs_ref_exists public Accesses to two pseudorefs have been updated to properly use ref API. * hv/ref-filter-trailers-atom-parsing-fix (2020-08-21) 2 commits (merged to 'next' on 2020-08-24 at 79b27f3263) + ref-filter: 'contents:trailers' show error if `:` is missing + t6300: unify %(trailers) and %(contents:trailers) tests The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifiers>" are the only two allowed forms, which has been corrected. * jc/ident-whose-ident (2020-08-21) 1 commit (merged to 'next' on 2020-08-27 at caf5149c28) + ident: say whose identity is missing when giving user.name hint Error message update. * jk/index-pack-w-more-threads (2020-08-21) 3 commits (merged to 'next' on 2020-08-24 at 18f18a5b66) + index-pack: adjust default threading cap + p5302: count up to online-cpus for thread tests + p5302: disable thread-count parameter tests by default Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. * jk/refspecs-cleanup (2020-08-17) 2 commits (merged to 'next' on 2020-08-24 at 807a080ebf) + refspec: make sure stack refspec_item variables are zeroed + refspec: fix documentation referring to refspec_item (this branch is used by jk/refspecs-negative.) Preliminary code clean-up before introducing "negative refspec". * jk/rev-input-given-fix (2020-08-26) 1 commit (merged to 'next' on 2020-08-27 at da291a327c) + revision: set rev_input_given in handle_revision_arg() Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and running "git log --ignore-missing $ZERO_OID" fell back to start digging from HEAD; it has been corrected to become a no-op, like "git log --tags=no-tag-matches-this-pattern" does. * jt/promisor-pack-fix (2020-08-20) 1 commit (merged to 'next' on 2020-08-24 at cd26d30d8d) + fetch-pack: in partial clone, pass --promisor Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * ps/ref-transaction-hook (2020-08-25) 1 commit (merged to 'next' on 2020-08-27 at 49b3fb8349) + refs: remove lookup cache for reference-transaction hook Code simplification by removing ineffective optimization. * rp/apply-cached-doc (2020-08-20) 1 commit (merged to 'next' on 2020-08-27 at 1d610f08ea) + git-apply.txt: update descriptions of --cached, --index The description of --cached/--index options in "git apply --help" has been updated. * rs/checkout-no-overlay-pathspec-fix (2020-08-22) 1 commit (merged to 'next' on 2020-08-27 at 277e39346d) + checkout, restore: make pathspec recursive "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. -------------------------------------------------- [New Topics] * hl/bisect-doc-clarify-bad-good-ordering (2020-08-28) 1 commit (merged to 'next' on 2020-08-31 at 11ce613916) + bisect: swap command-line options in documentation Doc update. Will merge to 'master'. * jc/post-checkout-doc (2020-08-27) 1 commit - doc: clarify how exit status of post-checkout hook is used Doc update. Will merge to 'next'. * jt/interpret-branch-name-fallback (2020-08-29) 2 commits (merged to 'next' on 2020-08-31 at 01f5dc8cc0) + wt-status: tolerate dangling marks + sha1-name: replace unsigned int with option struct "git status" has trouble showing where it came from by interpreting reflog entries that recordcertain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. Will merge to 'master'. * pb/doc-sequence-editor-configuration (2020-08-31) 1 commit (merged to 'next' on 2020-08-31 at 506466270c) + doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more Doc update. Will merge to 'master'. * pb/imap-send-updates (2020-08-31) 3 commits - git-imap-send.txt: add note about localized Gmail folders - git-imap-send.txt: do verify SSL certificate for gmail.com - git-imap-send.txt: don't duplicate 'Examples' sections "git imap-send" updates. Will merge to 'next'. * so/separate-field-for-m-and-diff-merges (2020-08-31) 1 commit (merged to 'next' on 2020-08-31 at 8def2984ca) + revision: add separate field for "-m" of "diff-index -m" Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. Will merge to 'master'. * vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit - Documentation/git-send-email.txt: Mention less secure app access might need to enable. Doc update. Expecting a reroll. cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com> cf. <xmqqft85i72s.fsf@gitster.c.googlers.com> * ew/decline-core-abbrev (2020-09-01) 1 commit - core.abbrev <off|false|no> disables abbreviations Allow the configuration to specify no abbreviation regardless of the hash algorithm. Expecting a reroll. The intent is very good. * jk/xrealloc-avoid-use-after-free (2020-09-01) 1 commit - xrealloc: do not reuse pointer freed by zero-length realloc() It was possible for xrealloc() to send a non-NULL pointer that has been freed, which has been fixed. Expecting a reroll. * pb/doc-external-diff-env (2020-09-01) 1 commit - git.txt: correct stale 'GIT_EXTERNAL_DIFF' description Doc update. Will merge to 'next'. -------------------------------------------------- [Stalled] * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" (this branch uses jc/undash-in-tree-git-callers.) The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * tb/bloom-improvements (2020-08-11) 14 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - commit-graph: add large-filters bitmap chunk - commit-graph.c: sort index into commits list - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - csum-file.h: introduce 'hashwrite_be64()' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' Misc Bloom filter improvements. Expecting a reroll. It seems that the review is getting closer to result in another update. cf. <20200811220503.GC66656@syl.lan> * es/config-hooks (2020-07-30) 6 commits - hook: add 'run' subcommand - parse-options: parse into argv_array - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. Now jk/strvec is in 'master', we may want to see the topic reworked on top of it. Are there unresolved issues, or does the topic need a round of detailed review? cf. <xmqqmu3i9kvg.fsf@gitster.c.googlers.com> * mt/grep-sparse-checkout (2020-06-12) 6 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: facilitate addition of new cli options - t/helper/test-config: return exit codes consistently - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. Review needed on 4/6; otherwise looking sane. cf. <CABPp-BGdEyEeajYZj_rdxp=MyEQdszuyjVTax=hhYj3fOtRQUQ@mail.gmail.com> * ls/mergetool-meld-auto-merge (2020-07-12) 2 commits - SQUASH??? - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Expecting a reroll. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Needs tests. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * mr/bisect-in-c-2 (2020-08-31) 13 commits - bisect--helper: retire `--bisect-autostart` subcommand - bisect--helper: retire `--write-terms` subcommand - bisect--helper: retire `--check-expected-revs` subcommand - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C - bisect--helper: retire `--next-all` subcommand - bisect--helper: retire `--bisect-clean-state` subcommand - bisect--helper: finish porting `bisect_start()` to C - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' - bisect--helper: reimplement `bisect_autostart` shell function in C - bisect--helper: introduce new `write_in_file()` function - bisect--helper: use '-res' in 'cmd_bisect__helper' return - bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the "git bisect" script in C continues. * jc/undash-in-tree-git-callers (2020-08-27) 3 commits (merged to 'next' on 2020-08-27 at 671fa2f87e) + credential-cache: use child_process.args + cvsexportcommit: do not run git programs in dashed form + transport-helper: do not run git-remote-ext etc. in dashed form (this branch is used by jc/war-on-dashed-git.) A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. Will merge to 'master'. * tb/repack-clearing-midx (2020-08-28) 2 commits (merged to 'next' on 2020-08-28 at 4204c0cb5e) + midx: traverse the local MIDX first (merged to 'next' on 2020-08-27 at a465875cbb) + builtin/repack.c: invalidate MIDX only when necessary When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. Will merge to 'master'. * jc/run-command-use-embedded-args (2020-08-26) 1 commit (merged to 'next' on 2020-08-27 at c2b688e8e9) + run_command: teach API users to use embedded 'args' more Various callers of run_command API has been modernized. Will merge to 'master'. * es/worktree-repair (2020-08-31) 5 commits (merged to 'next' on 2020-08-31 at 604825c5e4) + init: make --separate-git-dir work from within linked worktree + init: teach --separate-git-dir to repair linked worktrees + worktree: teach "repair" to fix outgoing links to worktrees + worktree: teach "repair" to fix worktree back-links to main worktree + worktree: add skeleton "repair" command "git worktree repair" command to correct on-disk pointers between the repository and its secondary working trees. Will merge to 'master'. * jk/worktree-check-clean-leakfix (2020-08-27) 1 commit (merged to 'next' on 2020-08-31 at 220fc43629) + worktree: fix leak in check_clean_worktree() Leakfix. Will merge to 'master'. * so/pretty-abbrev-doc (2020-08-27) 1 commit (merged to 'next' on 2020-08-31 at d664bd0c06) + pretty-options.txt: fix --no-abbrev-commit description Documentation update for "--no-abbrev-commit". Will merge to 'master'. * ss/submodule-summary-in-c-fixes (2020-08-27) 3 commits - t7421: eliminate 'grep' check in t7421.4 for mingw compatibility - submodule: fix style in function definition - submodule: eliminate unused parameters from print_submodule_summary() (this branch uses ss/submodule-summary-in-c.) Fixups to a topic in 'next'. Will merge to 'next'. * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. cf. https://public-inbox.org/git/7vprnzt7d5.fsf@gitster.siamese.dyndns.org/ * jt/threaded-index-pack (2020-08-27) 9 commits - builtin/index-pack.c: fix some sparse warnings - fixup! index-pack: make quantum of work smaller - index-pack: make quantum of work smaller - index-pack: make resolve_delta() assume base data - index-pack: calculate {ref,ofs}_{first,last} early - index-pack: remove redundant child field - index-pack: unify threaded and unthreaded code - index-pack: remove redundant parameter - Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. Expecting the final reroll. cf. https://colabti.org/irclogger/irclogger_log/git-devel?date=2020-08-31#l82 * hv/ref-filter-misc (2020-08-28) 8 commits - ref-filter: add `sanitize` option for 'subject' atom - pretty: refactor `format_sanitized_subject()` - ref-filter: add `short` modifier to 'parent' atom - ref-filter: add `short` modifier to 'tree' atom - ref-filter: rename `objectname` related functions and fields - ref-filter: modify error messages in `grab_objectname()` - ref-filter: refactor `grab_objectname()` - ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. Will merge to 'next'. * jk/refspecs-negative (2020-08-21) 1 commit - refspec: add support for negative refspecs "negative refspecs" * jt/fetch-pack-loosen-validation-with-packfile-uri (2020-08-24) 3 commits (merged to 'next' on 2020-08-27 at efd171f172) + fetch-pack: make packfile URIs work with transfer.fsckobjects + fetch-pack: document only_packfile in get_pack() + (various): document from_promisor parameter Bugfix for "git fetch" when the packfile URI capability is in use. Will merge to 'master'. * mr/diff-hide-stat-wo-textual-change (2020-08-19) 1 commit (merged to 'next' on 2020-08-27 at b9e97254ae) + diff: teach --stat to ignore uninteresting modifications "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. Will merge to 'master'. * pw/add-p-allowed-options-fix (2020-08-17) 2 commits (merged to 'next' on 2020-08-27 at 6cd62753f7) + add -p: fix checking of user input + add -p: use ALLOC_GROW_BY instead of ALLOW_GROW "git add -p" update. Will merge to 'master'. * jt/lazy-fetch (2020-08-18) 7 commits (merged to 'next' on 2020-08-27 at 85f2319ba1) + fetch-pack: remove no_dependents code + promisor-remote: lazy-fetch objects in subprocess + fetch-pack: do not lazy-fetch during ref iteration + fetch: only populate existing_refs if needed + fetch: avoid reading submodule config until needed + fetch: allow refspecs specified through stdin + negotiator/noop: add noop fetch negotiator Updates to on-demand fetching code in lazily cloned repositories. Will merge to 'master'. * jx/proc-receive-hook (2020-08-27) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: feed report options to post-receive - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Looking good. * pw/rebase-i-more-options (2020-08-26) 6 commits (merged to 'next' on 2020-08-27 at c55cfeb247) + t3436: do not run git-merge-recursive in dashed form (merged to 'next' on 2020-08-21 at ade71fd49b) + rebase: add --reset-author-date + rebase -i: support --ignore-date + rebase -i: support --committer-date-is-author-date + am: stop exporting GIT_COMMITTER_DATE + rebase -i: add --ignore-whitespace flag "git rebase -i" learns a bit more options. Will merge to 'master'. * jk/slimmed-down (2020-08-13) 5 commits (merged to 'next' on 2020-08-27 at bc8e9450c6) + drop vcs-svn experiment + make git-fast-import a builtin + make git-bugreport a builtin + make credential helpers builtins + Makefile: drop builtins from MSVC pdb list Trim an unused binary and turn a bunch of commands into built-in. Will merge to 'master'. * ss/t7401-modernize (2020-08-21) 5 commits (merged to 'next' on 2020-08-27 at 516cba9c64) + t7401: add a NEEDSWORK + t7401: change indentation for enhanced readability + t7401: change syntax of test_i18ncmp calls for clarity + t7401: use 'short' instead of 'verify' and cut in rev-parse calls + t7401: modernize style Test clean-up. Will merge to 'master'. * ds/maintenance-part-2 (2020-08-25) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro (this branch is used by ss/submodule-summary-in-c-fixes.) Yet another subcommand of "git submodule" is getting rewritten in C. Will merge to 'master'. * ds/maintenance-part-1 (2020-08-25) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Almost ready for 'next'. cf. https://colabti.org/irclogger/irclogger_log/git-devel?date=2020-08-31#l44 -------------------------------------------------- [Discarded] * jc/remove-pack-redundant (2020-08-25) 1 commit - pack-redundant: gauge the usage before proposing its removal The first step to remove "git pack-redundant" by soliciting objections. Stop--we had some activity as late as last year.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * en/mem-pool (2020-08-18) 3 commits (merged to 'next' on 2020-08-19 at eff9ad46f0) + mem-pool: use consistent pool variable name + mem-pool: use more standard initialization and finalization + mem-pool: add convenience functions for strdup and strndup API update. * hn/refs-fetch-head-is-special (2020-08-19) 4 commits (merged to 'next' on 2020-08-21 at def233ab43) + refs: read FETCH_HEAD and MERGE_HEAD generically + refs: move gitdir into base ref_store + refs: fix comment about submodule ref_stores + refs: split off reading loose ref data in separate function (this branch is used by hn/refs-pseudorefs.) The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. * jk/leakfix (2020-08-17) 7 commits (merged to 'next' on 2020-08-21 at a8b25a2657) + submodule--helper: fix leak of core.worktree value + config: fix leak in git_config_get_expiry_in_days() + config: drop git_config_get_string_const() + config: fix leaks from git_config_get_string_const() + checkout: fix leak of non-existent branch names + submodule--helper: use strbuf_release() to free strbufs + clear_pattern_list(): clear embedded hashmaps Code clean-up. * rz/complete-more-options (2020-08-19) 2 commits (merged to 'next' on 2020-08-21 at ba8f4c8cb1) + completion: add GIT_COMPLETION_SHOW_ALL env var + parse-options: add --git-completion-helper-all Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. -------------------------------------------------- [New Topics] * jc/remove-pack-redundant (2020-08-25) 1 commit - pack-redundant: gauge the usage before proposing its removal The first step to remove "git pack-redundant" by soliciting objections. * ps/ref-transaction-hook (2020-08-25) 1 commit (merged to 'next' on 2020-08-27 at 49b3fb8349) + refs: remove lookup cache for reference-transaction hook Code simplification by removing ineffective optimization. Will merge to 'master'. * jc/undash-in-tree-git-callers (2020-08-27) 3 commits (merged to 'next' on 2020-08-27 at 671fa2f87e) + credential-cache: use child_process.args + cvsexportcommit: do not run git programs in dashed form + transport-helper: do not run git-remote-ext etc. in dashed form (this branch is used by jc/war-on-dashed-git.) A handful of places in in-tree code still relied on being able to execute the git subcommands, especially built-ins, in "git-foo" form, which have been corrected. Will merge to 'master'. * jc/war-on-dashed-git (2020-08-27) 1 commit - git: catch an attempt to run "git-foo" (this branch uses jc/undash-in-tree-git-callers.) The first step to remove on-disk binaries for built-in subcommands by soliciting objections. On hold for now. * jk/rev-input-given-fix (2020-08-26) 1 commit (merged to 'next' on 2020-08-27 at da291a327c) + revision: set rev_input_given in handle_revision_arg() Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and running "git log --ignore-missing $ZERO_OID" fell back to start digging from HEAD; it has been corrected to become a no-op, like "git log --tags=no-tag-matches-this-pattern" does. Will merge to 'master'. * tb/repack-clearing-midx (2020-08-26) 1 commit (merged to 'next' on 2020-08-27 at a465875cbb) + builtin/repack.c: invalidate MIDX only when necessary When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. Will merge to 'master'. * jc/run-command-use-embedded-args (2020-08-26) 1 commit (merged to 'next' on 2020-08-27 at c2b688e8e9) + run_command: teach API users to use embedded 'args' more Various callers of run_command API has been modernized. Will merge to 'master'. * es/worktree-repair (2020-08-27) 5 commits - init: make --separate-git-dir work from within linked worktree - init: teach --separate-git-dir to repair linked worktrees - worktree: teach "repair" to fix outgoing links to worktrees - worktree: teach "repair" to fix worktree back-links to main worktree - worktree: add skeleton "repair" command "git worktree repair" command to correct on-disk pointers between the repository and its secondary working trees. Expecting a reroll. * jk/worktree-check-clean-leakfix (2020-08-27) 1 commit - worktree: fix leak in check_clean_worktree() Leakfix. Will merge to 'next'. * so/pretty-abbrev-doc (2020-08-27) 1 commit - pretty-options.txt: fix --no-abbrev-commit description Documentation update for "--no-abbrev-commit". Will merge to 'next'. * ss/submodule-summary-in-c-fixes (2020-08-27) 3 commits - t7421: eliminate 'grep' check in t7421.4 for mingw compatibility - submodule: fix style in function definition - submodule: eliminate unused parameters from print_submodule_summary() (this branch uses ss/submodule-summary-in-c.) Fixups to a topic in 'next'. Will merge to 'next'. -------------------------------------------------- [Stalled] * tb/bloom-improvements (2020-08-11) 14 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - commit-graph: add large-filters bitmap chunk - commit-graph.c: sort index into commits list - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - csum-file.h: introduce 'hashwrite_be64()' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' Misc Bloom filter improvements. Expecting a reroll. It seems that the review is getting closer to result in another update. cf. <20200811220503.GC66656@syl.lan> * es/config-hooks (2020-07-30) 6 commits - hook: add 'run' subcommand - parse-options: parse into argv_array - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. Now jk/strvec is in 'master', we may want to see the topic reworked on top of it. Are there unresolved issues, or does the topic need a round of detailed review? cf. <xmqqmu3i9kvg.fsf@gitster.c.googlers.com> * mt/grep-sparse-checkout (2020-06-12) 6 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: facilitate addition of new cli options - t/helper/test-config: return exit codes consistently - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. Review needed on 4/6; otherwise looking sane. cf. <CABPp-BGdEyEeajYZj_rdxp=MyEQdszuyjVTax=hhYj3fOtRQUQ@mail.gmail.com> * ls/mergetool-meld-auto-merge (2020-07-12) 2 commits - SQUASH??? - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Expecting a reroll. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Needs tests. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> * mr/bisect-in-c-2 (2020-07-17) 14 commits . SQUASH??? do not add new users of git_path_bisect_head() . bisect--helper: retire `--bisect-autostart` subcommand . bisect--helper: retire `--write-terms` subcommand . bisect--helper: retire `--check-expected-revs` subcommand . bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C . bisect--helper: retire `--next-all` subcommand . bisect--helper: retire `--bisect-clean-state` subcommand . bisect--helper: finish porting `bisect_start()` to C . bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C . bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' . bisect--helper: reimplement `bisect_autostart` shell function in C . bisect--helper: introduce new `write_in_file()` function . bisect--helper: use '-res' in 'cmd_bisect__helper' return . bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the remainder of "git bisect" script in C continues. Needs more work. Ejected out of 'seen'; al/bisect-first-parent topic has a bit of textual conflict with this topic. * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * jk/refspecs-cleanup (2020-08-17) 2 commits (merged to 'next' on 2020-08-24 at 807a080ebf) + refspec: make sure stack refspec_item variables are zeroed + refspec: fix documentation referring to refspec_item (this branch is used by jk/refspecs-negative.) Preliminary code clean-up before introducing "negative refspec". Will merge to 'master'. * rs/checkout-no-overlay-pathspec-fix (2020-08-22) 1 commit (merged to 'next' on 2020-08-27 at 277e39346d) + checkout, restore: make pathspec recursive "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. Will merge to 'master'. * al/bisect-first-parent (2020-08-22) 1 commit (merged to 'next' on 2020-08-24 at f95fbf45a6) + bisect: add first-parent option to documentation Finishing touches. Will merge to 'master'. * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. cf. https://public-inbox.org/git/7vprnzt7d5.fsf@gitster.siamese.dyndns.org/ * jt/threaded-index-pack (2020-08-27) 9 commits - builtin/index-pack.c: fix some sparse warnings - fixup! index-pack: make quantum of work smaller - index-pack: make quantum of work smaller - index-pack: make resolve_delta() assume base data - index-pack: calculate {ref,ofs}_{first,last} early - index-pack: remove redundant child field - index-pack: unify threaded and unthreaded code - index-pack: remove redundant parameter - Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. * hn/refs-pseudorefs (2020-08-21) 4 commits (merged to 'next' on 2020-08-24 at 3579abe8ff) + sequencer: treat REVERT_HEAD as a pseudo ref + builtin/commit: suggest update-ref for pseudoref removal + sequencer: treat CHERRY_PICK_HEAD as a pseudo ref + refs: make refs_ref_exists public Accesses to two pseudorefs have been updated to properly use ref API. Will merge to 'master'. * jt/promisor-pack-fix (2020-08-20) 1 commit (merged to 'next' on 2020-08-24 at cd26d30d8d) + fetch-pack: in partial clone, pass --promisor Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. Will merge to 'master'. * hv/ref-filter-trailers-atom-parsing-fix (2020-08-21) 2 commits (merged to 'next' on 2020-08-24 at 79b27f3263) + ref-filter: 'contents:trailers' show error if `:` is missing + t6300: unify %(trailers) and %(contents:trailers) tests The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifers>" are the only two allowed forms, which has been corrected. Will merge to 'master'. * jc/ident-whose-ident (2020-08-21) 1 commit (merged to 'next' on 2020-08-27 at caf5149c28) + ident: say whose identity is missing when giving user.name hint Error message update. Will merge to 'master'. * jk/index-pack-w-more-threads (2020-08-21) 3 commits (merged to 'next' on 2020-08-24 at 18f18a5b66) + index-pack: adjust default threading cap + p5302: count up to online-cpus for thread tests + p5302: disable thread-count parameter tests by default Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. Will merge to 'master'. * rp/apply-cached-doc (2020-08-20) 1 commit (merged to 'next' on 2020-08-27 at 1d610f08ea) + git-apply.txt: update descriptions of --cached, --index The description of --cached/--index options in "git apply --help" has been updated. Will merge to 'master'. * dd/diff-customize-index-line-abbrev (2020-08-21) 2 commits (merged to 'next' on 2020-08-24 at 74e842a2c8) + diff: index-line: respect --abbrev in object's name + t4013: improve diff-post-processor logic The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. Will merge to 'master'. * hv/ref-filter-misc (2020-08-17) 9 commits (merged to 'next' on 2020-08-27 at c015fa6b0f) + ref-filter: add `sanitize` option for 'subject' atom + format-support: move `format_sanitized_subject()` from pretty + pretty: refactor `format_sanitized_subject()` + ref-filter: add `short` modifier to 'parent' atom + ref-filter: add `short` modifier to 'tree' atom + ref-filter: rename `objectname` related functions and fields + ref-filter: modify error messages in `grab_objectname()` + ref-filter: refactor `grab_objectname()` + ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. Will merge to 'master'. * jk/refspecs-negative (2020-08-21) 1 commit - refspec: add support for negative refspecs (this branch uses jk/refspecs-cleanup.) "negative refspecs" * jt/fetch-pack-loosen-validation-with-packfile-uri (2020-08-24) 3 commits (merged to 'next' on 2020-08-27 at efd171f172) + fetch-pack: make packfile URIs work with transfer.fsckobjects + fetch-pack: document only_packfile in get_pack() + (various): document from_promisor parameter Bugfix for "git fetch" when the packfile URI capability is in use. Will merge to 'master'. * mr/diff-hide-stat-wo-textual-change (2020-08-19) 1 commit (merged to 'next' on 2020-08-27 at b9e97254ae) + diff: teach --stat to ignore uninteresting modifications "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. Will merge to 'master'. * pw/add-p-allowed-options-fix (2020-08-17) 2 commits (merged to 'next' on 2020-08-27 at 6cd62753f7) + add -p: fix checking of user input + add -p: use ALLOC_GROW_BY instead of ALLOW_GROW "git add -p" update. Will merge to 'master'. * jt/lazy-fetch (2020-08-18) 7 commits (merged to 'next' on 2020-08-27 at 85f2319ba1) + fetch-pack: remove no_dependents code + promisor-remote: lazy-fetch objects in subprocess + fetch-pack: do not lazy-fetch during ref iteration + fetch: only populate existing_refs if needed + fetch: avoid reading submodule config until needed + fetch: allow refspecs specified through stdin + negotiator/noop: add noop fetch negotiator Updates to on-demand fetching code in lazily cloned repositories. Will merge to 'master'. * jx/proc-receive-hook (2020-08-27) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: feed report options to post-receive - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Looking good. * pw/rebase-i-more-options (2020-08-26) 6 commits (merged to 'next' on 2020-08-27 at c55cfeb247) + t3436: do not run git-merge-recursive in dashed form (merged to 'next' on 2020-08-21 at ade71fd49b) + rebase: add --reset-author-date + rebase -i: support --ignore-date + rebase -i: support --committer-date-is-author-date + am: stop exporting GIT_COMMITTER_DATE + rebase -i: add --ignore-whitespace flag "git rebase -i" learns a bit more options. Will merge to 'master'. * jk/slimmed-down (2020-08-13) 5 commits (merged to 'next' on 2020-08-27 at bc8e9450c6) + drop vcs-svn experiment + make git-fast-import a builtin + make git-bugreport a builtin + make credential helpers builtins + Makefile: drop builtins from MSVC pdb list Trim an unused binary and turn a bunch of commands into built-in. Will merge to 'master'. * ss/t7401-modernize (2020-08-21) 5 commits (merged to 'next' on 2020-08-27 at 516cba9c64) + t7401: add a NEEDSWORK + t7401: change indentation for enhanced readability + t7401: change syntax of test_i18ncmp calls for clarity + t7401: use 'short' instead of 'verify' and cut in rev-parse calls + t7401: modernize style Test clean-up. Will merge to 'master'. * ds/maintenance-part-2 (2020-08-25) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro (this branch is used by ss/submodule-summary-in-c-fixes.) Yet another subcommand of "git submodule" is getting rewritten in C. Looking good. * am/ci-wsfix (2020-08-21) 1 commit (merged to 'next' on 2020-08-24 at 8491e031f1) + ci: fix inconsistent indentation Aesthetic fix to a CI configuration file. Will merge to 'master'. * ds/maintenance-part-1 (2020-08-25) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Comments?
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * dl/subtree-docs (2020-08-18) 2 commits (merged to 'next' on 2020-08-19 at e1a8ea9d46) + contrib/subtree: document 'push' does not take '--squash' + contrib/subtree: fix "unsure" for --message in the document Doc updates for subtree (in contrib/) * ds/midx-repack-to-batch-size (2020-08-11) 1 commit (merged to 'next' on 2020-08-17 at eee94634aa) + multi-pack-index: repack batches below --batch-size The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. * en/dir-clear (2020-08-18) 2 commits (merged to 'next' on 2020-08-19 at 18c5b69293) + dir: fix problematic API to avoid memory leaks + dir: make clear_directory() free all relevant memory Leakfix with code clean-up. * en/dir-nonbare-embedded (2020-08-12) 2 commits (merged to 'next' on 2020-08-17 at ab180b7fcb) + dir: avoid prematurely marking nonbare repositories as matches + t3000: fix some test description typos "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. * es/init-no-separate-git-dir-in-bare (2020-08-10) 1 commit (merged to 'next' on 2020-08-17 at 80498c8659) + init: disallow --separate-git-dir with bare repository The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. * jc/no-update-fetch-head (2020-08-18) 1 commit (merged to 'next' on 2020-08-19 at 68e1374ed6) + fetch: optionally allow disabling FETCH_HEAD update (this branch is used by ds/maintenance-part-1, ds/maintenance-part-2 and jt/lazy-fetch.) "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. * jk/unleak-fixes (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at f9bd296b25) + ls-remote: simplify UNLEAK() usage + stop calling UNLEAK() before die() Fix some incorrect UNLEAK() annotations. * ma/doc-sha-256-is-experimental (2020-08-17) 1 commit (merged to 'next' on 2020-08-19 at 9ccf6c399c) + Documentation: mark `--object-format=sha256` as experimental The recent addition of SHA-256 support is marked as experimental in the documentation. * mt/checkout-entry-dead-code-removal (2020-08-18) 1 commit (merged to 'next' on 2020-08-19 at 58866e5299) + checkout_entry(): remove unreachable error() call Code clean-up. * rs/more-buffered-io (2020-08-17) 3 commits (merged to 'next' on 2020-08-19 at 6d23a23bb2) + upload-pack: use buffered I/O to talk to rev-list + midx: use buffered I/O to talk to pack-objects + connected: use buffered I/O to talk to rev-list Use more buffered I/O where we used to call many small write(2)s. * rs/patch-id-with-incomplete-line (2020-08-18) 1 commit (merged to 'next' on 2020-08-19 at 72961d48d0) + patch-id: ignore newline at end of file in diff_flush_patch_id() The patch-id computation did not ignore the "incomplete last line" marker like whitespaces. -------------------------------------------------- [New Topics] * jk/refspecs-cleanup (2020-08-17) 2 commits (merged to 'next' on 2020-08-24 at 807a080ebf) + refspec: make sure stack refspec_item variables are zeroed + refspec: fix documentation referring to refspec_item (this branch is used by jk/refspecs-negative.) Preliminary code clean-up before introducing "negative refspec". Will merge to 'master'. * rs/checkout-no-overlay-pathspec-fix (2020-08-22) 1 commit - checkout, restore: make pathspec recursive "git restore/checkout --no-overlay" with wildcarded pathspec mistakenly removed matching paths in subdirectories, which has been corrected. Will merge to 'next'. * al/bisect-first-parent (2020-08-22) 1 commit (merged to 'next' on 2020-08-24 at f95fbf45a6) + bisect: add first-parent option to documentation Finishing touches. Will merge to 'master'. * js/no-builtins-on-disk-option (2020-08-24) 3 commits - ci: stop linking built-ins to the dashed versions - install: optionally skip linking/copying the built-ins - msvc: copy the correct `.pdb` files in the Makefile target `install` The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. cf. https://public-inbox.org/git/7vprnzt7d5.fsf@gitster.siamese.dyndns.org/ * jt/threaded-index-pack (2020-08-24) 8 commits - fixup! index-pack: make quantum of work smaller - index-pack: make quantum of work smaller - index-pack: make resolve_delta() assume base data - index-pack: calculate {ref,ofs}_{first,last} early - index-pack: remove redundant child field - index-pack: unify threaded and unthreaded code - index-pack: remove redundant parameter - Documentation: deltaBaseCacheLimit is per-thread "git index-pack" learned to resolve deltified objects with greater parallelism. -------------------------------------------------- [Stalled] * mt/grep-sparse-checkout (2020-06-12) 6 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: facilitate addition of new cli options - t/helper/test-config: return exit codes consistently - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. Review needed on 4/6; otherwise looking sane. cf. <CABPp-BGdEyEeajYZj_rdxp=MyEQdszuyjVTax=hhYj3fOtRQUQ@mail.gmail.com> * ls/mergetool-meld-auto-merge (2020-07-12) 2 commits - SQUASH??? - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Expecting a reroll. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Needs tests. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> * mr/bisect-in-c-2 (2020-07-17) 14 commits . SQUASH??? do not add new users of git_path_bisect_head() . bisect--helper: retire `--bisect-autostart` subcommand . bisect--helper: retire `--write-terms` subcommand . bisect--helper: retire `--check-expected-revs` subcommand . bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C . bisect--helper: retire `--next-all` subcommand . bisect--helper: retire `--bisect-clean-state` subcommand . bisect--helper: finish porting `bisect_start()` to C . bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C . bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' . bisect--helper: reimplement `bisect_autostart` shell function in C . bisect--helper: introduce new `write_in_file()` function . bisect--helper: use '-res' in 'cmd_bisect__helper' return . bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the remainder of "git bisect" script in C continues. Needs more work. Ejected out of 'seen'; al/bisect-first-parent topic has a bit of textual conflict with this topic. * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * hn/refs-pseudorefs (2020-08-21) 4 commits (merged to 'next' on 2020-08-24 at 3579abe8ff) + sequencer: treat REVERT_HEAD as a pseudo ref + builtin/commit: suggest update-ref for pseudoref removal + sequencer: treat CHERRY_PICK_HEAD as a pseudo ref + refs: make refs_ref_exists public (this branch uses hn/refs-fetch-head-is-special.) Accesses to two pseudorefs have been updated to properly use ref API. Will merge to 'master'. * rz/complete-more-options (2020-08-19) 2 commits (merged to 'next' on 2020-08-21 at ba8f4c8cb1) + completion: add GIT_COMPLETION_SHOW_ALL env var + parse-options: add --git-completion-helper-all Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. Will merge to 'master'. * jt/promisor-pack-fix (2020-08-20) 1 commit (merged to 'next' on 2020-08-24 at cd26d30d8d) + fetch-pack: in partial clone, pass --promisor Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. Will merge to 'master'. * hv/ref-filter-trailers-atom-parsing-fix (2020-08-21) 2 commits (merged to 'next' on 2020-08-24 at 79b27f3263) + ref-filter: 'contents:trailers' show error if `:` is missing + t6300: unify %(trailers) and %(contents:trailers) tests The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifers>" are the only two allowed forms, which has been corrected. Will merge to 'master'. * jc/ident-whose-ident (2020-08-21) 1 commit - ident: say whose identity is missing when giving user.name hint Error message update. Will merge to 'next'. * jk/index-pack-w-more-threads (2020-08-21) 3 commits (merged to 'next' on 2020-08-24 at 18f18a5b66) + index-pack: adjust default threading cap + p5302: count up to online-cpus for thread tests + p5302: disable thread-count parameter tests by default Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. Will merge to 'master'. * rp/apply-cached-doc (2020-08-20) 1 commit - git-apply.txt: update descriptions of --cached, --index The description of --cached/--index options in "git apply --help" has been updated. Will merge to 'next'. * dd/diff-customize-index-line-abbrev (2020-08-21) 2 commits (merged to 'next' on 2020-08-24 at 74e842a2c8) + diff: index-line: respect --abbrev in object's name + t4013: improve diff-post-processor logic The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. Will merge to 'master'. * hn/refs-fetch-head-is-special (2020-08-19) 4 commits (merged to 'next' on 2020-08-21 at def233ab43) + refs: read FETCH_HEAD and MERGE_HEAD generically + refs: move gitdir into base ref_store + refs: fix comment about submodule ref_stores + refs: split off reading loose ref data in separate function (this branch is used by hn/refs-pseudorefs.) The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. Will merge to 'master'. * hv/ref-filter-misc (2020-08-17) 9 commits - ref-filter: add `sanitize` option for 'subject' atom - format-support: move `format_sanitized_subject()` from pretty - pretty: refactor `format_sanitized_subject()` - ref-filter: add `short` modifier to 'parent' atom - ref-filter: add `short` modifier to 'tree' atom - ref-filter: rename `objectname` related functions and fields - ref-filter: modify error messages in `grab_objectname()` - ref-filter: refactor `grab_objectname()` - ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. Will merge to 'next'. * jk/leakfix (2020-08-17) 7 commits (merged to 'next' on 2020-08-21 at a8b25a2657) + submodule--helper: fix leak of core.worktree value + config: fix leak in git_config_get_expiry_in_days() + config: drop git_config_get_string_const() + config: fix leaks from git_config_get_string_const() + checkout: fix leak of non-existent branch names + submodule--helper: use strbuf_release() to free strbufs + clear_pattern_list(): clear embedded hashmaps Code clean-up. Will merge to 'master'. * jk/refspecs-negative (2020-08-21) 1 commit - refspec: add support for negative refspecs (this branch uses jk/refspecs-cleanup.) "negative refspecs" * jt/fetch-pack-loosen-validation-with-packfile-uri (2020-08-14) 1 commit - fetch-pack: make packfile URIs work with transfer.fsckobjects Bugfix for "git fetch" when the packfile URI capability is in use. Need to pick up a reroll. * mr/diff-hide-stat-wo-textual-change (2020-08-19) 1 commit - diff: teach --stat to ignore uninteresting modifications "git diff --stat -w" showed 0-line changes for paths whose changes were only whitespaces, which was not intuitive. We now omit such paths from the stat output. Will merge to 'next'. * pw/add-p-allowed-options-fix (2020-08-17) 2 commits - add -p: fix checking of user input - add -p: use ALLOC_GROW_BY instead of ALLOW_GROW "git add -p" update. Will merge to 'next'. * en/mem-pool (2020-08-18) 3 commits (merged to 'next' on 2020-08-19 at eff9ad46f0) + mem-pool: use consistent pool variable name + mem-pool: use more standard initialization and finalization + mem-pool: add convenience functions for strdup and strndup API update. Will merge to 'master'. * jt/lazy-fetch (2020-08-18) 7 commits - fetch-pack: remove no_dependents code - promisor-remote: lazy-fetch objects in subprocess - fetch-pack: do not lazy-fetch during ref iteration - fetch: only populate existing_refs if needed - fetch: avoid reading submodule config until needed - fetch: allow refspecs specified through stdin - negotiator/noop: add noop fetch negotiator Updates to on-demand fetching code in lazily cloned repositories. Will merge to 'next'. * jx/proc-receive-hook (2020-08-24) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: feed report options to post-receive - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. * pw/rebase-i-more-options (2020-08-19) 5 commits (merged to 'next' on 2020-08-21 at ade71fd49b) + rebase: add --reset-author-date + rebase -i: support --ignore-date + rebase -i: support --committer-date-is-author-date + am: stop exporting GIT_COMMITTER_DATE + rebase -i: add --ignore-whitespace flag "git rebase -i" learns a bit more options. Will merge to 'master'. * tb/bloom-improvements (2020-08-11) 14 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - commit-graph: add large-filters bitmap chunk - commit-graph.c: sort index into commits list - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - csum-file.h: introduce 'hashwrite_be64()' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' Misc Bloom filter improvements. Expecting a reroll. It seems that the review is getting closer to result in another update. cf. <20200811220503.GC66656@syl.lan> * jk/slimmed-down (2020-08-13) 5 commits - drop vcs-svn experiment - make git-fast-import a builtin - make git-bugreport a builtin - make credential helpers builtins - Makefile: drop builtins from MSVC pdb list Trim an unused binary and turn a bunch of commands into built-in. Will merge to 'next'. * ss/t7401-modernize (2020-08-21) 5 commits - t7401: add a NEEDSWORK - t7401: change indentation for enhanced readability - t7401: change syntax of test_i18ncmp calls for clarity - t7401: use 'short' instead of 'verify' and cut in rev-parse calls - t7401: modernize style Test clean-up. Will merge to 'next'. * ds/maintenance-part-2 (2020-08-18) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch uses ds/maintenance-part-1.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro Yet another subcommand of "git submodule" is getting rewritten in C. Will merge to 'master'. * am/ci-wsfix (2020-08-21) 1 commit (merged to 'next' on 2020-08-24 at 8491e031f1) + ci: fix inconsistent indentation Aesthetic fix to a CI configuration file. Will merge to 'master'. * ds/maintenance-part-1 (2020-08-18) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. Comments? * es/config-hooks (2020-07-30) 6 commits - hook: add 'run' subcommand - parse-options: parse into argv_array - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. Now jk/strvec is in 'master', we may want to see the topic reworked on top of it. Are there unresolved issues, or does the topic need a round of detailed review? cf. <xmqqmu3i9kvg.fsf@gitster.c.googlers.com> -------------------------------------------------- [Discarded] * rs/fast-export-anon-simplify (2020-08-13) 1 commit . fast-export: factor out print_oid() Code simplification. Retracted. cf. <6e2d4472-8293-4f10-0ba6-82ae83f7a465@web.de> * mt/hash-to-hex-thread-safety (2020-06-26) 2 commits . hex: make hash_to_hex_algop() and friends thread-safe . compat/win32/pthread: add pthread_once() hash_to_hex() used a set of rotating static buffers, which was not safe to use in a threaded environment. This has been made safer by using thread-local storage. Retracted. cf. <CAHd-oW7Wd8oSaMhPFeRcEeKTJ-k_hC7b6e28efhXT5LFu1E_Uw@mail.gmail.com>
On Mon, Aug 24, 2020 at 10:55 AM Junio C Hamano <gitster@pobox.com> wrote: > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > The `?:` operator is not supported e.g. by Visual C. Let's not use it. > > Thanks. IIRC that was GNU extension? > Yea, probably. From wikipedia, [1], "In GNU C and C++ (that is: in C and C++ with GCC extensions), the second operand of the ternary operator is optional. This has been the case since at least GCC 2.95.3 (March 2001), and seems to the original elvis operator." Thanks, Jake [1] https://en.wikipedia.org/wiki/Elvis_operator
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> The `?:` operator is not supported e.g. by Visual C. Let's not use it.
Thanks. IIRC that was GNU extension?
On Sun, Aug 23, 2020 at 1:29 PM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote: > > Hi Jake, > > On Fri, 21 Aug 2020, Jacob Keller wrote: > > > static void query_refspecs_multiple(struct refspec *rs, > > struct refspec_item *query, > > struct string_list *results) > > { > > - int i; > > + int i, matched_negative = 0; > > int find_src = !query->src; > > + struct string_list reversed = STRING_LIST_INIT_NODUP; > > + const char *needle = find_src ? query->dst : query->src; > > + char **result = find_src ? &query->src : &query->dst; > > > > if (find_src && !query->dst) > > BUG("query_refspecs_multiple: need either src or dst"); > > > > + /* > > + * If a ref matches any of the negative refspecs, then we should treat > > + * it as not matching this query. Note that negative refspecs apply to > > + * the source but we're checking only the destination. Reverse and > > + * capture any pattern refspecs in order to see if the source would > > + * have matched a negative refspec. > > + */ > > + for (i = 0; i < rs->nr; i++) { > > + struct refspec_item *refspec = &rs->items[i]; > > + char *expn_name; > > + > > + if (refspec->negative) > > + continue; > > + > > + /* Note the reversal of src and dst */ > > + if (refspec->pattern) { > > + const char *key = refspec->dst ?: refspec->src; > > This breaks at least with Visual C. I need this to unbreak the build: > The provided fixup! looks good to me. I'll pull it in when making the next revision. Thanks, Jake > -- snipsnap -- > Subject: [PATCH] fixup! refspec: add support for negative refspecs > > The `?:` operator is not supported e.g. by Visual C. Let's not use it. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > remote.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/remote.c b/remote.c > index 940622e0ba88..8e081863c06d 100644 > --- a/remote.c > +++ b/remote.c > @@ -731,7 +731,7 @@ static void query_refspecs_multiple(struct refspec *rs, > > /* Note the reversal of src and dst */ > if (refspec->pattern) { > - const char *key = refspec->dst ?: refspec->src; > + const char *key = refspec->dst ? refspec->dst : refspec->src; > const char *value = refspec->src; > > if (match_name_with_pattern(key, needle, value, &expn_name)) > @@ -795,7 +795,7 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query) > > /* Note the reversal of src and dst */ > if (refspec->pattern) { > - const char *key = refspec->dst ?: refspec->src; > + const char *key = refspec->dst ? refspec->dst : refspec->src; > const char *value = refspec->src; > > if (match_name_with_pattern(key, needle, value, &expn_name)) > -- > 2.28.0.windows.1 >
Hi Jake, On Fri, 21 Aug 2020, Jacob Keller wrote: > static void query_refspecs_multiple(struct refspec *rs, > struct refspec_item *query, > struct string_list *results) > { > - int i; > + int i, matched_negative = 0; > int find_src = !query->src; > + struct string_list reversed = STRING_LIST_INIT_NODUP; > + const char *needle = find_src ? query->dst : query->src; > + char **result = find_src ? &query->src : &query->dst; > > if (find_src && !query->dst) > BUG("query_refspecs_multiple: need either src or dst"); > > + /* > + * If a ref matches any of the negative refspecs, then we should treat > + * it as not matching this query. Note that negative refspecs apply to > + * the source but we're checking only the destination. Reverse and > + * capture any pattern refspecs in order to see if the source would > + * have matched a negative refspec. > + */ > + for (i = 0; i < rs->nr; i++) { > + struct refspec_item *refspec = &rs->items[i]; > + char *expn_name; > + > + if (refspec->negative) > + continue; > + > + /* Note the reversal of src and dst */ > + if (refspec->pattern) { > + const char *key = refspec->dst ?: refspec->src; This breaks at least with Visual C. I need this to unbreak the build: -- snipsnap -- Subject: [PATCH] fixup! refspec: add support for negative refspecs The `?:` operator is not supported e.g. by Visual C. Let's not use it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- remote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remote.c b/remote.c index 940622e0ba88..8e081863c06d 100644 --- a/remote.c +++ b/remote.c @@ -731,7 +731,7 @@ static void query_refspecs_multiple(struct refspec *rs, /* Note the reversal of src and dst */ if (refspec->pattern) { - const char *key = refspec->dst ?: refspec->src; + const char *key = refspec->dst ? refspec->dst : refspec->src; const char *value = refspec->src; if (match_name_with_pattern(key, needle, value, &expn_name)) @@ -795,7 +795,7 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query) /* Note the reversal of src and dst */ if (refspec->pattern) { - const char *key = refspec->dst ?: refspec->src; + const char *key = refspec->dst ? refspec->dst : refspec->src; const char *value = refspec->src; if (match_name_with_pattern(key, needle, value, &expn_name)) -- 2.28.0.windows.1
From: Jacob Keller <jacob.keller@gmail.com> Both fetch and push support pattern refspecs which allow fetching or pushing references that match a specific pattern. Because these patterns are globs, they have somewhat limited ability to express more complex situations. For example, suppose you wish to fetch all branches from a remote except for a specific one. To allow this, you must setup a set of refspecs which match only the branches you want. Because refspecs are either explicit name matches, or simple globs, many patterns cannot be expressed. Add support for a new type of refspec, referred to as "negative" refspecs. These are prefixed with a '^' and mean "exclude any ref matching this refspec". They can only have one "side" which always refers to the source. During a fetch, this refers to the name of the ref on the remote. During a push, this refers to the name of the ref on the local side. With negative refspecs, users can express more complex patterns. For example: git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant will fetch all branches on origin into remotes/origin, but will exclude fetching the branch named dontwant. Refspecs today are commutative, meaning that order doesn't expressly matter. Rather than forcing an implied order, negative refspecs will always be applied last. That is, in order to match, a ref must match at least one positive refspec, and match none of the negative refspecs. This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> --- I realize this probably needs to be broken down into multiple patches, but I haven't quite figured out the best way to do that. I'd like to avoid the case where a commit has support for parsing negative refspecs but code paths which use refspecs aren't handling them correctly. Thoughts? Splitting would also allow additional space for explanations of some of the trickier logic. I am also definitely looking for more test ideas, to help make sure we cover a good variety of the flows. builtin/fetch.c | 10 ++ refspec.c | 34 ++++++- refspec.h | 14 +-- remote.c | 139 +++++++++++++++++++++++++-- remote.h | 9 +- t/t5582-fetch-negative-refspec.sh | 151 ++++++++++++++++++++++++++++++ 6 files changed, 340 insertions(+), 17 deletions(-) create mode 100755 t/t5582-fetch-negative-refspec.sh diff --git a/builtin/fetch.c b/builtin/fetch.c index c49f0e975203..310699eb7e45 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -530,6 +530,16 @@ static struct ref *get_ref_map(struct remote *remote, tail = &rm->next; } + /* + * apply negative refspecs first, before we remove duplicates. This is + * necessary as negative refspecs might remove an otherwise conflicting + * duplicate. + */ + if (rs->nr) + ref_map = apply_negative_refspecs(ref_map, rs); + else + ref_map = apply_negative_refspecs(ref_map, &remote->fetch); + ref_map = ref_remove_duplicates(ref_map); refname_hash_init(&existing_refs); diff --git a/refspec.c b/refspec.c index f10ef284cef9..25755b83c5f2 100644 --- a/refspec.c +++ b/refspec.c @@ -8,6 +8,7 @@ static struct refspec_item s_tag_refspec = { 1, 0, 0, + 0, "refs/tags/*", "refs/tags/*" }; @@ -32,10 +33,17 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet if (*lhs == '+') { item->force = 1; lhs++; + } else if (*lhs == '^') { + item->negative = 1; + lhs++; } rhs = strrchr(lhs, ':'); + /* negative refspecs only have one side */ + if (item->negative && rhs) + return 0; + /* * Before going on, special case ":" (or "+:") as a refspec * for pushing matching refs. @@ -55,7 +63,7 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet llen = (rhs ? (rhs - lhs - 1) : strlen(lhs)); if (1 <= llen && memchr(lhs, '*', llen)) { - if ((rhs && !is_glob) || (!rhs && fetch)) + if ((rhs && !is_glob) || (!rhs && !item->negative && fetch)) return 0; is_glob = 1; } else if (rhs && is_glob) { @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet item->src = xstrndup(lhs, llen); flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); + if (item->negative) { + struct object_id unused; + + /* + * Negative refspecs only have a LHS, which indicates a ref + * (or pattern of refs) to exclude from other matches. This + * can either be a simple ref, a glob pattern, or even an + * exact sha1 match. + */ + if (!*item->src) + return 0; /* negative refspecs must not be empty */ + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) + item->exact_sha1 = 1; /* ok */ + else if (!check_refname_format(item->src, flags)) + ; /* valid looking ref is ok */ + else + return 0; + + /* other rules for negative refspecs don't apply */ + return 1; + } + if (fetch) { struct object_id unused; @@ -209,7 +239,7 @@ void refspec_ref_prefixes(const struct refspec *rs, const struct refspec_item *item = &rs->items[i]; const char *prefix = NULL; - if (item->exact_sha1) + if (item->exact_sha1 || item->negative) continue; if (rs->fetch == REFSPEC_FETCH) prefix = item->src; diff --git a/refspec.h b/refspec.h index 8d654e3a3ac4..e5bf6d25d0f7 100644 --- a/refspec.h +++ b/refspec.h @@ -5,12 +5,13 @@ extern const struct refspec_item *tag_refspec; /** - * A struct refspec_item holds the parsed interpretation of a refspec. If it will - * force updates (starts with a '+'), force is true. If it is a pattern - * (sides end with '*') pattern is true. src and dest are the two sides - * (including '*' characters if present); if there is only one side, it is src, - * and dst is NULL; if sides exist but are empty (i.e., the refspec either - * starts or ends with ':'), the corresponding side is "". + * A struct refspec_item holds the parsed interpretation of a refspec. If it + * will force updates (starts with a '+'), force is true. If it is a pattern + * (sides end with '*') pattern is true. If it is a negative refspec, (starts + * with '^'), negative is true. src and dest are the two sides (including '*' + * characters if present); if there is only one side, it is src, and dst is + * NULL; if sides exist but are empty (i.e., the refspec either starts or ends + * with ':'), the corresponding side is "". * * remote_find_tracking(), given a remote and a struct refspec_item with either src * or dst filled out, will fill out the other such that the result is in the @@ -22,6 +23,7 @@ struct refspec_item { unsigned pattern : 1; unsigned matching : 1; unsigned exact_sha1 : 1; + unsigned negative : 1; char *src; char *dst; diff --git a/remote.c b/remote.c index c5ed74f91c63..2f583d72c3f0 100644 --- a/remote.c +++ b/remote.c @@ -686,24 +686,100 @@ static int match_name_with_pattern(const char *key, const char *name, return ret; } +static int refspec_match(const struct refspec_item *refspec, + const char *name) +{ + if (refspec->pattern) + return match_name_with_pattern(refspec->src, name, NULL, NULL); + + return !strcmp(refspec->src, name); +} + +static int omit_name_by_refspec(const char *name, struct refspec *rs) +{ + int i; + + for (i = 0; i < rs->nr; i++) { + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) + return 1; + } + return 0; +} + +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) +{ + struct ref **tail; + + for (tail = &ref_map; *tail; ) { + struct ref *ref = *tail; + + if (omit_name_by_refspec(ref->name, rs)) { + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else + tail = &ref->next; + } + + return ref_map; +} + static void query_refspecs_multiple(struct refspec *rs, struct refspec_item *query, struct string_list *results) { - int i; + int i, matched_negative = 0; int find_src = !query->src; + struct string_list reversed = STRING_LIST_INIT_NODUP; + const char *needle = find_src ? query->dst : query->src; + char **result = find_src ? &query->src : &query->dst; if (find_src && !query->dst) BUG("query_refspecs_multiple: need either src or dst"); + /* + * If a ref matches any of the negative refspecs, then we should treat + * it as not matching this query. Note that negative refspecs apply to + * the source but we're checking only the destination. Reverse and + * capture any pattern refspecs in order to see if the source would + * have matched a negative refspec. + */ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + char *expn_name; + + if (refspec->negative) + continue; + + /* Note the reversal of src and dst */ + if (refspec->pattern) { + const char *key = refspec->dst ?: refspec->src; + const char *value = refspec->src; + + if (match_name_with_pattern(key, needle, value, &expn_name)) + string_list_append_nodup(&reversed, expn_name); + } else { + if (!strcmp(needle, refspec->src)) + string_list_append(&reversed, refspec->src); + } + } + + for (i = 0; !matched_negative && i < reversed.nr; i++) { + if (omit_name_by_refspec(reversed.items[i].string, rs)) + matched_negative = 1; + } + + string_list_clear(&reversed, 0); + + if (matched_negative) + return; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; const char *value = find_src ? refspec->src : refspec->dst; - const char *needle = find_src ? query->dst : query->src; - char **result = find_src ? &query->src : &query->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) @@ -716,20 +792,58 @@ static void query_refspecs_multiple(struct refspec *rs, int query_refspecs(struct refspec *rs, struct refspec_item *query) { - int i; + int i, matched_negative = 0; int find_src = !query->src; + struct string_list reversed = STRING_LIST_INIT_NODUP; const char *needle = find_src ? query->dst : query->src; char **result = find_src ? &query->src : &query->dst; if (find_src && !query->dst) BUG("query_refspecs: need either src or dst"); + /* + * If a ref matches any of the negative refspecs, then we should treat + * it as not matching this query. Note that negative refspecs apply to + * the source but we're checking only the destination. Reverse and + * capture any pattern refspecs in order to see if the source would + * have matched a negative refspec. + */ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + char *expn_name; + + if (refspec->negative) + continue; + + /* Note the reversal of src and dst */ + if (refspec->pattern) { + const char *key = refspec->dst ?: refspec->src; + const char *value = refspec->src; + + if (match_name_with_pattern(key, needle, value, &expn_name)) + string_list_append_nodup(&reversed, expn_name); + } else { + if (!strcmp(needle, refspec->src)) + string_list_append(&reversed, refspec->src); + } + } + + for (i = 0; !matched_negative && i < reversed.nr; i++) { + if (omit_name_by_refspec(reversed.items[i].string, rs)) + matched_negative = 1; + } + + string_list_clear(&reversed, 0); + + if (matched_negative) + return -1; + for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i]; const char *key = find_src ? refspec->dst : refspec->src; const char *value = find_src ? refspec->src : refspec->dst; - if (!refspec->dst) + if (!refspec->dst || refspec->negative) continue; if (refspec->pattern) { if (match_name_with_pattern(key, needle, value, result)) { @@ -1058,7 +1172,7 @@ static int match_explicit(struct ref *src, struct ref *dst, const char *dst_value = rs->dst; char *dst_guess; - if (rs->pattern || rs->matching) + if (rs->pattern || rs->matching || rs->negative) return 0; matched_src = matched_dst = NULL; @@ -1134,6 +1248,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, int matching_refs = -1; for (i = 0; i < rs->nr; i++) { const struct refspec_item *item = &rs->items[i]; + + if (item->negative) + continue; + if (item->matching && (matching_refs == -1 || item->force)) { matching_refs = i; @@ -1339,7 +1457,7 @@ int check_push_refs(struct ref *src, struct refspec *rs) for (i = 0; i < rs->nr; i++) { struct refspec_item *item = &rs->items[i]; - if (item->pattern || item->matching) + if (item->pattern || item->matching || item->negative) continue; ret |= match_explicit_lhs(src, item, NULL, NULL); @@ -1441,6 +1559,8 @@ int match_push_refs(struct ref *src, struct ref **dst, string_list_clear(&src_ref_index, 0); } + *dst = apply_negative_refspecs(*dst, rs); + if (errs) return -1; return 0; @@ -1810,6 +1930,9 @@ int get_fetch_map(const struct ref *remote_refs, { struct ref *ref_map, **rmp; + if (refspec->negative) + return 0; + if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { diff --git a/remote.h b/remote.h index 5e3ea5a26deb..104e75e0f74d 100644 --- a/remote.h +++ b/remote.h @@ -193,6 +193,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Remove all entries in the input list which match any negative refspec in + * the refspec list. + */ +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); + int query_refspecs(struct refspec *rs, struct refspec_item *query); char *apply_refspecs(struct refspec *rs, const char *name); @@ -205,7 +211,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, /* * Given a list of the remote refs and the specification of things to * fetch, makes a (separate) list of the refs to fetch and the local - * refs to store into. + * refs to store into. Note that negative refspecs are ignored here, and + * should be handled separately. * * *tail is the pointer to the tail pointer of the list of results * beforehand, and will be set to the tail pointer of the list of diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh new file mode 100755 index 000000000000..83d08e513413 --- /dev/null +++ b/t/t5582-fetch-negative-refspec.sh @@ -0,0 +1,151 @@ +#!/bin/sh +# Copyright (c) 2020, Jacob Keller. + +test_description='"git fetch" with negative refspecs. + +' + +. ./test-lib.sh + +test_expect_success setup ' + echo >file original && + git add file && + git commit -a -m original +' + +test_expect_success "clone and setup child repos" ' + git clone . one && + ( + cd one && + echo >file updated by one && + git commit -a -m "updated by one" && + git switch -c alternate && + echo >file updated again by one && + git commit -a -m "updated by one again" && + git switch master + ) && + git clone . two && + ( + cd two && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch +refs/heads/*:refs/remotes/one/* && + git config --add remote.one.fetch ^refs/heads/alternate + ) && + git clone . three +' + +test_expect_success "fetch one" ' + echo >file updated by origin && + git commit -a -m "updated by origin" && + ( + cd two && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git fetch one && + test_must_fail git rev-parse --verify refs/remotes/one/alternate && + git rev-parse --verify refs/remotes/one/master && + mine=$(git rev-parse refs/remotes/one/master) && + his=$(cd ../one && git rev-parse refs/heads/master) && + test "z$mine" = "z$his" + ) +' + +test_expect_success "fetch with negative refspec on commandline" ' + echo >file updated by origin again && + git commit -a -m "updated by origin again" && + ( + cd three && + alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && + echo $alternate_in_one >expect && + git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master && + cut -f -1 .git/FETCH_HEAD >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch with negative refspec avoids duplicate conflict" ' + cd "$D" && + ( + cd one && + git branch dups/a && + git branch dups/b && + git branch dups/c && + git branch other/a && + git rev-parse --verify refs/heads/other/a >../expect && + git rev-parse --verify refs/heads/dups/b >>../expect && + git rev-parse --verify refs/heads/dups/c >>../expect + ) && + ( + cd three && + git fetch ../one/.git ^refs/heads/dups/a refs/heads/dups/*:refs/dups/* refs/heads/other/a:refs/dups/a && + git rev-parse --verify refs/dups/a >../actual && + git rev-parse --verify refs/dups/b >>../actual && + git rev-parse --verify refs/dups/c >>../actual + ) && + test_cmp expect actual +' + +test_expect_success "push --prune with negative refspec" ' + ( + cd two && + git branch prune/a && + git branch prune/b && + git branch prune/c && + git push ../three refs/heads/prune/* && + git branch -d prune/a && + git branch -d prune/b && + git push --prune ../three refs/heads/prune/* ^refs/heads/prune/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/prune/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "push --prune with negative refspec apply to the destination" ' + ( + cd two && + git branch ours/a && + git branch ours/b && + git branch ours/c && + git push ../three refs/heads/ours/*:refs/heads/theirs/* && + git branch -d ours/a && + git branch -d ours/b && + git push --prune ../three refs/heads/ours/*:refs/heads/theirs/* ^refs/heads/theirs/b + ) && + ( + cd three && + test_write_lines b c >expect && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/theirs/ >actual && + test_cmp expect actual + ) +' + +test_expect_success "fetch --prune with negative refspec" ' + ( + cd two && + git branch fetch/a && + git branch fetch/b && + git branch fetch/c + ) && + ( + cd three && + git fetch ../two/.git refs/heads/fetch/*:refs/heads/copied/* + ) && + ( + cd two && + git branch -d fetch/a && + git branch -d fetch/b + ) && + ( + cd three && + test_write_lines b c >expect && + git fetch -v ../two/.git --prune refs/heads/fetch/*:refs/heads/copied/* ^refs/heads/fetch/b && + git for-each-ref --format="%(refname:lstrip=3)" refs/heads/copied/ >actual && + test_cmp expect actual + ) +' + +test_done -- 2.28.0.218.ge27853923b9d.dirty
From: Jacob Keller <jacob.keller@gmail.com> This series introduces support for negative refspecs. It builds on top of a couple of minor refspec cleanups which I posted at [1]. The primary motivator for negative refspecs is to allow additional control over refspec patterns. Today, both fetch and push support refspecs with patterns. This allows expressing a fetch of simple globs. Because refspec patterns are simple and not regular expressions, it is not possible to express some cases that a user might wish. Suppose you want to fetch all remote branches *except* for a specific one. For example, a repository which has renamed its primary branch to "main" but has left the older branch "master" in order to avoid breaking existing workflows. You wish to have only main, but not master, in your local copy. To do this, you could modify your remote config to explicitly list every branch you want to fetch except for the refs/heads/master. If there are many branches, this would be tedious. Further, it requires manual intervention for each new branch. With negative refspecs, you can simply fetch refs/heads/*:refs/remotes/origin/* along with ^refs/heads/master and git will now exclude that branch from the fetch. [1]: https://lore.kernel.org/git/20200821214820.757222-1-jacob.e.keller@intel.com/T/#t Range diff since v1: 1: 6a53c459e868 ! 1: 04cdd0313529 refspec: add support for negative refspecs @@ Commit message This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> - Signed-off-by: Junio C Hamano <gitster@pobox.com> ## builtin/fetch.c ## @@ builtin/fetch.c: static struct ref *get_ref_map(struct remote *remote, tail = &rm->next; } -+ /* apply any negative refspecs now to prune the list of refs */ -+ ref_map = apply_negative_refspecs(ref_map, rs); ++ /* ++ * apply negative refspecs first, before we remove duplicates. This is ++ * necessary as negative refspecs might remove an otherwise conflicting ++ * duplicate. ++ */ ++ if (rs->nr) ++ ref_map = apply_negative_refspecs(ref_map, rs); ++ else ++ ref_map = apply_negative_refspecs(ref_map, &remote->fetch); + ref_map = ref_remove_duplicates(ref_map); @@ refspec.c: static int parse_refspec(struct refspec_item *item, const char *refsp * Before going on, special case ":" (or "+:") as a refspec * for pushing matching refs. @@ refspec.c: static int parse_refspec(struct refspec_item *item, const char *refspec, int fet + + llen = (rhs ? (rhs - lhs - 1) : strlen(lhs)); + if (1 <= llen && memchr(lhs, '*', llen)) { +- if ((rhs && !is_glob) || (!rhs && fetch)) ++ if ((rhs && !is_glob) || (!rhs && !item->negative && fetch)) + return 0; + is_glob = 1; + } else if (rhs && is_glob) { +@@ refspec.c: static int parse_refspec(struct refspec_item *item, const char *refspec, int fet item->src = xstrndup(lhs, llen); flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); @@ refspec.c: static int parse_refspec(struct refspec_item *item, const char *refsp if (fetch) { struct object_id unused; +@@ refspec.c: void refspec_ref_prefixes(const struct refspec *rs, + const struct refspec_item *item = &rs->items[i]; + const char *prefix = NULL; + +- if (item->exact_sha1) ++ if (item->exact_sha1 || item->negative) + continue; + if (rs->fetch == REFSPEC_FETCH) + prefix = item->src; ## refspec.h ## @@ @@ refspec.h: struct refspec_item { char *dst; ## remote.c ## -@@ remote.c: static int match_explicit(struct ref *src, struct ref *dst, - const char *dst_value = rs->dst; - char *dst_guess; - -- if (rs->pattern || rs->matching) -+ if (rs->pattern || rs->matching || rs->negative) - return 0; - - matched_src = matched_dst = NULL; -@@ remote.c: static char *get_ref_match(const struct refspec *rs, const struct ref *ref, - int matching_refs = -1; - for (i = 0; i < rs->nr; i++) { - const struct refspec_item *item = &rs->items[i]; -+ -+ if (item->negative) -+ continue; -+ - if (item->matching && - (matching_refs == -1 || item->force)) { - matching_refs = i; -@@ remote.c: int match_push_refs(struct ref *src, struct ref **dst, - string_list_clear(&src_ref_index, 0); - } - -+ *dst = apply_negative_refspecs(*dst, rs); -+ - if (errs) - return -1; - return 0; -@@ remote.c: int get_fetch_map(const struct ref *remote_refs, - { - struct ref *ref_map, **rmp; - -+ if (refspec->negative) -+ return 0; -+ - if (refspec->pattern) { - ref_map = get_expanded_map(remote_refs, refspec); - } else { -@@ remote.c: int get_fetch_map(const struct ref *remote_refs, - return 0; +@@ remote.c: static int match_name_with_pattern(const char *key, const char *name, + return ret; } +static int refspec_match(const struct refspec_item *refspec, @@ remote.c: int get_fetch_map(const struct ref *remote_refs, + return ref_map; +} + - int resolve_remote_symref(struct ref *ref, struct ref *list) + static void query_refspecs_multiple(struct refspec *rs, + struct refspec_item *query, + struct string_list *results) { - if (!ref->symref) +- int i; ++ int i, matched_negative = 0; + int find_src = !query->src; ++ struct string_list reversed = STRING_LIST_INIT_NODUP; ++ const char *needle = find_src ? query->dst : query->src; ++ char **result = find_src ? &query->src : &query->dst; + + if (find_src && !query->dst) + BUG("query_refspecs_multiple: need either src or dst"); + ++ /* ++ * If a ref matches any of the negative refspecs, then we should treat ++ * it as not matching this query. Note that negative refspecs apply to ++ * the source but we're checking only the destination. Reverse and ++ * capture any pattern refspecs in order to see if the source would ++ * have matched a negative refspec. ++ */ ++ for (i = 0; i < rs->nr; i++) { ++ struct refspec_item *refspec = &rs->items[i]; ++ char *expn_name; ++ ++ if (refspec->negative) ++ continue; ++ ++ /* Note the reversal of src and dst */ ++ if (refspec->pattern) { ++ const char *key = refspec->dst ?: refspec->src; ++ const char *value = refspec->src; ++ ++ if (match_name_with_pattern(key, needle, value, &expn_name)) ++ string_list_append_nodup(&reversed, expn_name); ++ } else { ++ if (!strcmp(needle, refspec->src)) ++ string_list_append(&reversed, refspec->src); ++ } ++ } ++ ++ for (i = 0; !matched_negative && i < reversed.nr; i++) { ++ if (omit_name_by_refspec(reversed.items[i].string, rs)) ++ matched_negative = 1; ++ } ++ ++ string_list_clear(&reversed, 0); ++ ++ if (matched_negative) ++ return; ++ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + const char *key = find_src ? refspec->dst : refspec->src; + const char *value = find_src ? refspec->src : refspec->dst; +- const char *needle = find_src ? query->dst : query->src; +- char **result = find_src ? &query->src : &query->dst; + +- if (!refspec->dst) ++ if (!refspec->dst || refspec->negative) + continue; + if (refspec->pattern) { + if (match_name_with_pattern(key, needle, value, result)) +@@ remote.c: static void query_refspecs_multiple(struct refspec *rs, + + int query_refspecs(struct refspec *rs, struct refspec_item *query) + { +- int i; ++ int i, matched_negative = 0; + int find_src = !query->src; ++ struct string_list reversed = STRING_LIST_INIT_NODUP; + const char *needle = find_src ? query->dst : query->src; + char **result = find_src ? &query->src : &query->dst; + + if (find_src && !query->dst) + BUG("query_refspecs: need either src or dst"); + ++ /* ++ * If a ref matches any of the negative refspecs, then we should treat ++ * it as not matching this query. Note that negative refspecs apply to ++ * the source but we're checking only the destination. Reverse and ++ * capture any pattern refspecs in order to see if the source would ++ * have matched a negative refspec. ++ */ ++ for (i = 0; i < rs->nr; i++) { ++ struct refspec_item *refspec = &rs->items[i]; ++ char *expn_name; ++ ++ if (refspec->negative) ++ continue; ++ ++ /* Note the reversal of src and dst */ ++ if (refspec->pattern) { ++ const char *key = refspec->dst ?: refspec->src; ++ const char *value = refspec->src; ++ ++ if (match_name_with_pattern(key, needle, value, &expn_name)) ++ string_list_append_nodup(&reversed, expn_name); ++ } else { ++ if (!strcmp(needle, refspec->src)) ++ string_list_append(&reversed, refspec->src); ++ } ++ } ++ ++ for (i = 0; !matched_negative && i < reversed.nr; i++) { ++ if (omit_name_by_refspec(reversed.items[i].string, rs)) ++ matched_negative = 1; ++ } ++ ++ string_list_clear(&reversed, 0); ++ ++ if (matched_negative) ++ return -1; ++ + for (i = 0; i < rs->nr; i++) { + struct refspec_item *refspec = &rs->items[i]; + const char *key = find_src ? refspec->dst : refspec->src; + const char *value = find_src ? refspec->src : refspec->dst; + +- if (!refspec->dst) ++ if (!refspec->dst || refspec->negative) + continue; + if (refspec->pattern) { + if (match_name_with_pattern(key, needle, value, result)) { +@@ remote.c: static int match_explicit(struct ref *src, struct ref *dst, + const char *dst_value = rs->dst; + char *dst_guess; + +- if (rs->pattern || rs->matching) ++ if (rs->pattern || rs->matching || rs->negative) + return 0; + + matched_src = matched_dst = NULL; +@@ remote.c: static char *get_ref_match(const struct refspec *rs, const struct ref *ref, + int matching_refs = -1; + for (i = 0; i < rs->nr; i++) { + const struct refspec_item *item = &rs->items[i]; ++ ++ if (item->negative) ++ continue; ++ + if (item->matching && + (matching_refs == -1 || item->force)) { + matching_refs = i; +@@ remote.c: int check_push_refs(struct ref *src, struct refspec *rs) + for (i = 0; i < rs->nr; i++) { + struct refspec_item *item = &rs->items[i]; + +- if (item->pattern || item->matching) ++ if (item->pattern || item->matching || item->negative) + continue; + + ret |= match_explicit_lhs(src, item, NULL, NULL); +@@ remote.c: int match_push_refs(struct ref *src, struct ref **dst, + string_list_clear(&src_ref_index, 0); + } + ++ *dst = apply_negative_refspecs(*dst, rs); ++ + if (errs) + return -1; + return 0; +@@ remote.c: int get_fetch_map(const struct ref *remote_refs, + { + struct ref *ref_map, **rmp; + ++ if (refspec->negative) ++ return 0; ++ + if (refspec->pattern) { + ref_map = get_expanded_map(remote_refs, refspec); + } else { ## remote.h ## @@ remote.h: int resolve_remote_symref(struct ref *ref, struct ref *list); @@ remote.h: void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, * * *tail is the pointer to the tail pointer of the list of results * beforehand, and will be set to the tail pointer of the list of + + ## t/t5582-fetch-negative-refspec.sh (new) ## +@@ ++#!/bin/sh ++# Copyright (c) 2020, Jacob Keller. ++ ++test_description='"git fetch" with negative refspecs. ++ ++' ++ ++. ./test-lib.sh ++ ++test_expect_success setup ' ++ echo >file original && ++ git add file && ++ git commit -a -m original ++' ++ ++test_expect_success "clone and setup child repos" ' ++ git clone . one && ++ ( ++ cd one && ++ echo >file updated by one && ++ git commit -a -m "updated by one" && ++ git switch -c alternate && ++ echo >file updated again by one && ++ git commit -a -m "updated by one again" && ++ git switch master ++ ) && ++ git clone . two && ++ ( ++ cd two && ++ git config branch.master.remote one && ++ git config remote.one.url ../one/.git/ && ++ git config remote.one.fetch +refs/heads/*:refs/remotes/one/* && ++ git config --add remote.one.fetch ^refs/heads/alternate ++ ) && ++ git clone . three ++' ++ ++test_expect_success "fetch one" ' ++ echo >file updated by origin && ++ git commit -a -m "updated by origin" && ++ ( ++ cd two && ++ test_must_fail git rev-parse --verify refs/remotes/one/alternate && ++ git fetch one && ++ test_must_fail git rev-parse --verify refs/remotes/one/alternate && ++ git rev-parse --verify refs/remotes/one/master && ++ mine=$(git rev-parse refs/remotes/one/master) && ++ his=$(cd ../one && git rev-parse refs/heads/master) && ++ test "z$mine" = "z$his" ++ ) ++' ++ ++test_expect_success "fetch with negative refspec on commandline" ' ++ echo >file updated by origin again && ++ git commit -a -m "updated by origin again" && ++ ( ++ cd three && ++ alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) && ++ echo $alternate_in_one >expect && ++ git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master && ++ cut -f -1 .git/FETCH_HEAD >actual && ++ test_cmp expect actual ++ ) ++' ++ ++test_expect_success "fetch with negative refspec avoids duplicate conflict" ' ++ cd "$D" && ++ ( ++ cd one && ++ git branch dups/a && ++ git branch dups/b && ++ git branch dups/c && ++ git branch other/a && ++ git rev-parse --verify refs/heads/other/a >../expect && ++ git rev-parse --verify refs/heads/dups/b >>../expect && ++ git rev-parse --verify refs/heads/dups/c >>../expect ++ ) && ++ ( ++ cd three && ++ git fetch ../one/.git ^refs/heads/dups/a refs/heads/dups/*:refs/dups/* refs/heads/other/a:refs/dups/a && ++ git rev-parse --verify refs/dups/a >../actual && ++ git rev-parse --verify refs/dups/b >>../actual && ++ git rev-parse --verify refs/dups/c >>../actual ++ ) && ++ test_cmp expect actual ++' ++ ++test_expect_success "push --prune with negative refspec" ' ++ ( ++ cd two && ++ git branch prune/a && ++ git branch prune/b && ++ git branch prune/c && ++ git push ../three refs/heads/prune/* && ++ git branch -d prune/a && ++ git branch -d prune/b && ++ git push --prune ../three refs/heads/prune/* ^refs/heads/prune/b ++ ) && ++ ( ++ cd three && ++ test_write_lines b c >expect && ++ git for-each-ref --format="%(refname:lstrip=3)" refs/heads/prune/ >actual && ++ test_cmp expect actual ++ ) ++' ++ ++test_expect_success "push --prune with negative refspec apply to the destination" ' ++ ( ++ cd two && ++ git branch ours/a && ++ git branch ours/b && ++ git branch ours/c && ++ git push ../three refs/heads/ours/*:refs/heads/theirs/* && ++ git branch -d ours/a && ++ git branch -d ours/b && ++ git push --prune ../three refs/heads/ours/*:refs/heads/theirs/* ^refs/heads/theirs/b ++ ) && ++ ( ++ cd three && ++ test_write_lines b c >expect && ++ git for-each-ref --format="%(refname:lstrip=3)" refs/heads/theirs/ >actual && ++ test_cmp expect actual ++ ) ++' ++ ++test_expect_success "fetch --prune with negative refspec" ' ++ ( ++ cd two && ++ git branch fetch/a && ++ git branch fetch/b && ++ git branch fetch/c ++ ) && ++ ( ++ cd three && ++ git fetch ../two/.git refs/heads/fetch/*:refs/heads/copied/* ++ ) && ++ ( ++ cd two && ++ git branch -d fetch/a && ++ git branch -d fetch/b ++ ) && ++ ( ++ cd three && ++ test_write_lines b c >expect && ++ git fetch -v ../two/.git --prune refs/heads/fetch/*:refs/heads/copied/* ^refs/heads/fetch/b && ++ git for-each-ref --format="%(refname:lstrip=3)" refs/heads/copied/ >actual && ++ test_cmp expect actual ++ ) ++' ++ ++test_done Jacob Keller (1): refspec: add support for negative refspecs builtin/fetch.c | 10 ++ refspec.c | 34 ++++++- refspec.h | 14 +-- remote.c | 139 +++++++++++++++++++++++++-- remote.h | 9 +- t/t5582-fetch-negative-refspec.sh | 151 ++++++++++++++++++++++++++++++ 6 files changed, 340 insertions(+), 17 deletions(-) create mode 100755 t/t5582-fetch-negative-refspec.sh base-commit: 3a7f6cbded99451cc61ac8b03d3451d13e532055 -- 2.28.0.218.ge27853923b9d.dirty
From: Jacob Keller <jacob.keller@gmail.com> While preparing some patches for implementing support for negative refspecs, I found a couple of minor nits. The first patch fixes the documentation in refspec.h to refer to the correct structures. The second patch cleans up a potential issue with refspec_item structures that weren't initialized properly. While nothing breaks today, future extensions to refspec_item would break if the structure wasn't properly initialized to zero. Jacob Keller (2): refspec: fix documentation referring to refspec_item refspec: make sure stack refspec_item variables are zeroed builtin/remote.c | 1 + refspec.h | 27 ++++++++++++++------------- transport.c | 1 + 3 files changed, 16 insertions(+), 13 deletions(-) base-commit: 878e727637ec5815ccb3301eb994a54df95b21b8 -- 2.28.0.218.ge27853923b9d.dirty
Jacob Keller <jacob.keller@gmail.com> writes:
> On Mon, Aug 17, 2020 at 9:18 AM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> Jacob Keller <jacob.e.keller@intel.com> writes:
>>
>> > From: Jacob Keller <jacob.keller@gmail.com>
>> >
>> > In commit d27eb356bf25 ("remote: move doc to remote.h and refspec.h")
>> > the documentation for the refspec structure was moved into refspec.h
>> >
>> > This documentation refers to elements of the refspec_item, not the
>> > struct refspec. Move the documentation slightly in order to align it
>> > with the structure it is actually referring to.
>>
>> Makes sense to me.
>>
>
> Hi Junio,
>
> I'm thinking I should send the first two patches a separate
> preparatory series while I follow up with a v2 of the RFC of negative
> refspecs
>
> Does that seem reasonable?
>
> Thanks,
> Jake
Sure; thanks.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * ak/sequencer-fix-find-uniq-abbrev (2020-08-13) 1 commit (merged to 'next' on 2020-08-17 at 6ce0f1d111) + rebase -i: fix possibly wrong onto hash in todo Ring buffer with size 4 used for bin-hex translation resulted in a wrong object name in the sequencer's todo output, which has been corrected. * bc/sha-256-doc-updates (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at 7154a0ce3c) + docs: fix step in transition plan + docs: document SHA-256 pack and indices Further update of docs to adjust to the recent SHA-256 work. * ds/sha256-leftover-bits (2020-08-17) 3 commits (merged to 'next' on 2020-08-17 at a8e6f9f3f4) + multi-pack-index: use hash version byte + commit-graph: use the "hash version" byte + t/README: document GIT_TEST_DEFAULT_HASH midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. * en/merge-tests (2020-08-10) 11 commits (merged to 'next' on 2020-08-13 at eab952350b) + t6425: be more flexible with rename/delete conflict messages + t642[23]: be more flexible for add/add conflicts involving pair renames + t6422, t6426: be more flexible for add/add conflicts involving renames + t6423: add an explanation about why one of the tests does not pass + t6416, t6423: clarify some comments and fix some typos + t6422: fix multiple errors with the mod6 test expectations + t6423: fix test setup for a couple tests + t6416, t6422: fix incorrect untracked file count + t6422: fix bad check against missing file + t6418: tighten delete/normalize conflict testcase + Collect merge-related tests to t64xx Updates to "git merge" tests, in preparation for a new merge strategy backend. * en/sequencer-merge-labels (2020-08-14) 1 commit (merged to 'next' on 2020-08-17 at 2010e329ed) + sequencer: avoid garbled merge machinery messages due to commit labels The commit labels used to explain each side of conflicted hunks placed by the sequencer machinery have been made more readable by humans. * jb/commit-graph-doc-fix (2020-08-13) 1 commit (merged to 'next' on 2020-08-17 at d83ee98955) + docs: commit-graph: fix some whitespace in the diagram Docfix. * jc/object-names-are-not-sha-1 (2020-08-14) 1 commit (merged to 'next' on 2020-08-17 at 400fe9e831) + messages: avoid SHA-1 in end-user facing messages A few end-user facing messages have been updated to be hash-algorithm agnostic. * jh/mingw-unlink (2020-08-17) 1 commit (merged to 'next' on 2020-08-17 at fb53a3d1a1) + mingw: improve performance of mingw_unlink() "unlink" emulation on MinGW has been optimized. * jk/blame-coalesce-fix (2020-08-13) 3 commits (merged to 'next' on 2020-08-17 at 122c701ec7) + blame: only coalesce lines that are adjacent in result + t8003: factor setup out of coalesce test + t8003: check output of coalesced blame When given more than one target line ranges, "git blame -La,b -Lc,d" was over-eager to coalesce groups of original lines and showed incorrect results, which has been corrected. * ma/sha-256-docs (2020-08-17) 4 commits (merged to 'next' on 2020-08-17 at 6861142a20) + shallow.txt: document SHA-256 shallow format + protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256 + index-format.txt: document SHA-256 index format + http-protocol.txt: document SHA-256 "want"/"have" format Further update of docs to adjust to the recent SHA-256 work. * pb/set-url-docfix (2020-08-13) 1 commit (merged to 'next' on 2020-08-17 at 19b56c6ebb) + fetch, pull doc: correct description of '--set-upstream' Doc fix. * pb/userdiff-fortran-update (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at 534af3f35a) + userdiff: improve Fortran xfuncname regex + userdiff: add tests for Fortran xfuncname regex The regexp to identify the function boundary for FORTRAN programs has been updated. * rp/ita-diff-modefix (2020-08-09) 1 commit (merged to 'next' on 2020-08-17 at c03a9cfb6e) + diff-lib: use worktree mode in diffs from i-t-a entries "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a bit was not showing the mode bits from the working tree. * rs/preserve-merges-unused-code-removal (2020-08-12) 1 commit (merged to 'next' on 2020-08-17 at b96393455c) + rebase: remove unused function reschedule_last_action Code clean-up. * rs/upload-pack-sigchain-fix (2020-08-11) 1 commit (merged to 'next' on 2020-08-17 at 997473f309) + upload-pack: remove superfluous sigchain_pop() call Code clean-up. -------------------------------------------------- [New Topics] * en/dir-clear (2020-08-18) 2 commits (merged to 'next' on 2020-08-19 at 18c5b69293) + dir: fix problematic API to avoid memory leaks + dir: make clear_directory() free all relevant memory Leakfix with code clean-up. Will merge to 'master'. * hn/refs-pseudorefs (2020-08-21) 4 commits - sequencer: treat REVERT_HEAD as a pseudo ref - builtin/commit: suggest update-ref for pseudoref removal - sequencer: treat CHERRY_PICK_HEAD as a pseudo ref - refs: make refs_ref_exists public (this branch uses hn/refs-fetch-head-is-special.) Accesses to two pseudorefs have been updated to properly use ref API. Will merge to 'next'. * rs/patch-id-with-incomplete-line (2020-08-18) 1 commit (merged to 'next' on 2020-08-19 at 72961d48d0) + patch-id: ignore newline at end of file in diff_flush_patch_id() The patch-id computation did not ignore the "incomplete last line" marker like whitespaces. Will merge to 'master'. * rz/complete-more-options (2020-08-19) 2 commits (merged to 'next' on 2020-08-21 at ba8f4c8cb1) + completion: add GIT_COMPLETION_SHOW_ALL env var + parse-options: add --git-completion-helper-all Command line completion (in contrib/) usually omits redundant, deprecated and/or dangerous options from its output; it learned to optionally include all of them. Will merge to 'master'. * jt/promisor-pack-fix (2020-08-20) 1 commit - fetch-pack: in partial clone, pass --promisor Updates into a lazy/partial clone with a submodule did not work well with transfer.fsckobjects set. * hv/ref-filter-trailers-atom-parsing-fix (2020-08-21) 2 commits - ref-filter: 'contents:trailers' show error if `:` is missing - t6300: unify %(trailers) and %(contents:trailers) tests The parser for "git for-each-ref --format=..." was too loose when parsing the "%(trailers...)" atom, and forgot that "trailers" and "trailers:<modifers>" are the only two allowed forms, which has been corrected. Will merge to 'next'. * jc/ident-whose-ident (2020-08-21) 1 commit - ident: say whose identity is missing when giving user.name hint Error message update. * jk/index-pack-w-more-threads (2020-08-21) 3 commits - index-pack: adjust default threading cap - p5302: count up to online-cpus for thread tests - p5302: disable thread-count parameter tests by default Long ago, we decided to use 3 threads by default when running the index-pack task in parallel, which has been adjusted a bit upwards. Will merge to 'next'. * rp/apply-cached-doc (2020-08-20) 1 commit - git-apply.txt: update descriptions of --cached, --index The description of --cached/--index options in "git apply --help" has been updated. -------------------------------------------------- [Stalled] * mt/grep-sparse-checkout (2020-06-12) 6 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: facilitate addition of new cli options - t/helper/test-config: return exit codes consistently - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. Review needed on 4/6; otherwise looking sane. cf. <CABPp-BGdEyEeajYZj_rdxp=MyEQdszuyjVTax=hhYj3fOtRQUQ@mail.gmail.com> * ls/mergetool-meld-auto-merge (2020-07-12) 2 commits - SQUASH??? - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Expecting a reroll. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Needs tests. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> * mr/bisect-in-c-2 (2020-07-17) 14 commits . SQUASH??? do not add new users of git_path_bisect_head() . bisect--helper: retire `--bisect-autostart` subcommand . bisect--helper: retire `--write-terms` subcommand . bisect--helper: retire `--check-expected-revs` subcommand . bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C . bisect--helper: retire `--next-all` subcommand . bisect--helper: retire `--bisect-clean-state` subcommand . bisect--helper: finish porting `bisect_start()` to C . bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C . bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' . bisect--helper: reimplement `bisect_autostart` shell function in C . bisect--helper: introduce new `write_in_file()` function . bisect--helper: use '-res' in 'cmd_bisect__helper' return . bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the remainder of "git bisect" script in C continues. Needs more work. Ejected out of 'seen'; al/bisect-first-parent topic has a bit of textual conflict with this topic. * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * dd/diff-customize-index-line-abbrev (2020-08-21) 2 commits - diff: index-line: respect --abbrev in object's name - t4013: improve diff-post-processor logic The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. Will merge to 'next'. * hn/refs-fetch-head-is-special (2020-08-19) 4 commits (merged to 'next' on 2020-08-21 at def233ab43) + refs: read FETCH_HEAD and MERGE_HEAD generically + refs: move gitdir into base ref_store + refs: fix comment about submodule ref_stores + refs: split off reading loose ref data in separate function (this branch is used by hn/refs-pseudorefs.) The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. Will merge to 'master'. * hv/ref-filter-misc (2020-08-17) 9 commits - ref-filter: add `sanitize` option for 'subject' atom - format-support: move `format_sanitized_subject()` from pretty - pretty: refactor `format_sanitized_subject()` - ref-filter: add `short` modifier to 'parent' atom - ref-filter: add `short` modifier to 'tree' atom - ref-filter: rename `objectname` related functions and fields - ref-filter: modify error messages in `grab_objectname()` - ref-filter: refactor `grab_objectname()` - ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * jk/leakfix (2020-08-17) 7 commits (merged to 'next' on 2020-08-21 at a8b25a2657) + submodule--helper: fix leak of core.worktree value + config: fix leak in git_config_get_expiry_in_days() + config: drop git_config_get_string_const() + config: fix leaks from git_config_get_string_const() + checkout: fix leak of non-existent branch names + submodule--helper: use strbuf_release() to free strbufs + clear_pattern_list(): clear embedded hashmaps Code clean-up. Will merge to 'master'. * jk/refspecs-negative (2020-08-17) 3 commits - refspec: add support for negative refspecs - refspec: make sure stack refspec_item variables are zeroed - refspec: fix documentation referring to refspec_item "negative refspecs" * jt/fetch-pack-loosen-validation-with-packfile-uri (2020-08-14) 1 commit - fetch-pack: make packfile URIs work with transfer.fsckobjects Bugfix for "git fetch" when the packfile URI capability is in use. Need to pick up a reroll. * mr/diff-hide-stat-wo-textual-change (2020-08-19) 1 commit - diff: teach --stat to ignore uninteresting modifications Looking good. * pw/add-p-allowed-options-fix (2020-08-17) 2 commits - add -p: fix checking of user input - add -p: use ALLOC_GROW_BY instead of ALLOW_GROW "git add -p" update. Doubts? cf. <pull.702.git.1597670589.gitgitgadget@gmail.com> cf. <744e464f-6378-ef68-01c1-3b8bf63c54a4@gmail.com> * dl/subtree-docs (2020-08-18) 2 commits (merged to 'next' on 2020-08-19 at e1a8ea9d46) + contrib/subtree: document 'push' does not take '--squash' + contrib/subtree: fix "unsure" for --message in the document Doc updates for subtree (in contrib/) Will merge to 'master'. * en/mem-pool (2020-08-18) 3 commits (merged to 'next' on 2020-08-19 at eff9ad46f0) + mem-pool: use consistent pool variable name + mem-pool: use more standard initialization and finalization + mem-pool: add convenience functions for strdup and strndup API update. Will merge to 'master'. * jc/no-update-fetch-head (2020-08-18) 1 commit (merged to 'next' on 2020-08-19 at 68e1374ed6) + fetch: optionally allow disabling FETCH_HEAD update (this branch is used by ds/maintenance-part-1, ds/maintenance-part-2 and jt/lazy-fetch.) "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. Will merge to 'master'. * jt/lazy-fetch (2020-08-18) 7 commits - fetch-pack: remove no_dependents code - promisor-remote: lazy-fetch objects in subprocess - fetch-pack: do not lazy-fetch during ref iteration - fetch: only populate existing_refs if needed - fetch: avoid reading submodule config until needed - fetch: allow refspecs specified through stdin - negotiator/noop: add noop fetch negotiator (this branch uses jc/no-update-fetch-head; is tangled with ds/maintenance-part-1 and ds/maintenance-part-2.) Updates to on-demand fetching code in lazily cloned repositories. * mt/checkout-entry-dead-code-removal (2020-08-18) 1 commit (merged to 'next' on 2020-08-19 at 58866e5299) + checkout_entry(): remove unreachable error() call Code clean-up. Will merge to 'master'. * jx/proc-receive-hook (2020-08-17) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - receive-pack: feed report options to post-receive - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Needs review. * pw/rebase-i-more-options (2020-08-19) 5 commits (merged to 'next' on 2020-08-21 at ade71fd49b) + rebase: add --reset-author-date + rebase -i: support --ignore-date + rebase -i: support --committer-date-is-author-date + am: stop exporting GIT_COMMITTER_DATE + rebase -i: add --ignore-whitespace flag "git rebase -i" learns a bit more options. Will merge to 'master'. * rs/more-buffered-io (2020-08-17) 3 commits (merged to 'next' on 2020-08-19 at 6d23a23bb2) + upload-pack: use buffered I/O to talk to rev-list + midx: use buffered I/O to talk to pack-objects + connected: use buffered I/O to talk to rev-list Use more buffered I/O where we used to call many small write(2)s. Will merge to 'master'. * ds/midx-repack-to-batch-size (2020-08-11) 1 commit (merged to 'next' on 2020-08-17 at eee94634aa) + multi-pack-index: repack batches below --batch-size The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. Will merge to 'master'. * tb/bloom-improvements (2020-08-11) 14 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - commit-graph: add large-filters bitmap chunk - commit-graph.c: sort index into commits list - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - csum-file.h: introduce 'hashwrite_be64()' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' Misc Bloom filter improvements. Expecting a reroll. It seems that the review is getting closer to result in another update. cf. <20200811220503.GC66656@syl.lan> * en/dir-nonbare-embedded (2020-08-12) 2 commits (merged to 'next' on 2020-08-17 at ab180b7fcb) + dir: avoid prematurely marking nonbare repositories as matches + t3000: fix some test description typos "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. Will merge to 'master'. * jk/slimmed-down (2020-08-13) 5 commits - drop vcs-svn experiment - make git-fast-import a builtin - make git-bugreport a builtin - make credential helpers builtins - Makefile: drop builtins from MSVC pdb list Trim an unused binary and turn a bunch of commands into built-in. In general this is a good thing to do, modulo 'bugreport'. * jk/unleak-fixes (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at f9bd296b25) + ls-remote: simplify UNLEAK() usage + stop calling UNLEAK() before die() Fix some incorrect UNLEAK() annotations. Will merge to 'master'. * ss/t7401-modernize (2020-08-21) 5 commits - t7401: add a NEEDSWORK - t7401: change indentation for enhanced readability - t7401: change syntax of test_i18ncmp calls for clarity - t7401: use 'short' instead of 'verify' and cut in rev-parse calls - t7401: modernize style Test clean-up. Looking good. * ds/maintenance-part-2 (2020-08-18) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch uses ds/maintenance-part-1 and jc/no-update-fetch-head; is tangled with jt/lazy-fetch.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ma/doc-sha-256-is-experimental (2020-08-17) 1 commit (merged to 'next' on 2020-08-19 at 9ccf6c399c) + Documentation: mark `--object-format=sha256` as experimental The recent addition of SHA-256 support is marked as experimental in the documentation. Will merge to 'master'. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro Yet another subcommand of "git submodule" is getting rewritten in C. Will merge to 'master'. * am/ci-wsfix (2020-08-21) 1 commit - ci: fix inconsistent indentation Aesthetic fix to a CI configuration file. Will merge to 'next'. * es/init-no-separate-git-dir-in-bare (2020-08-10) 1 commit (merged to 'next' on 2020-08-17 at 80498c8659) + init: disallow --separate-git-dir with bare repository The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. Will merge to 'master'. * ds/maintenance-part-1 (2020-08-18) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2; uses jc/no-update-fetch-head; is tangled with jt/lazy-fetch.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * es/config-hooks (2020-07-30) 6 commits - hook: add 'run' subcommand - parse-options: parse into argv_array - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. Now jk/strvec is in 'master', we may want to see the topic reworked on top of it. Are there unresolved issues, or does the topic need a round of detailed review? cf. <xmqqmu3i9kvg.fsf@gitster.c.googlers.com> -------------------------------------------------- [Discarded] * rs/fast-export-anon-simplify (2020-08-13) 1 commit . fast-export: factor out print_oid() Code simplification. Retracted. cf. <6e2d4472-8293-4f10-0ba6-82ae83f7a465@web.de> * mt/hash-to-hex-thread-safety (2020-06-26) 2 commits . hex: make hash_to_hex_algop() and friends thread-safe . compat/win32/pthread: add pthread_once() hash_to_hex() used a set of rotating static buffers, which was not safe to use in a threaded environment. This has been made safer by using thread-local storage. Retracted. cf. <CAHd-oW7Wd8oSaMhPFeRcEeKTJ-k_hC7b6e28efhXT5LFu1E_Uw@mail.gmail.com>
On Mon, Aug 17, 2020 at 9:18 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
> > From: Jacob Keller <jacob.keller@gmail.com>
> >
> > In commit d27eb356bf25 ("remote: move doc to remote.h and refspec.h")
> > the documentation for the refspec structure was moved into refspec.h
> >
> > This documentation refers to elements of the refspec_item, not the
> > struct refspec. Move the documentation slightly in order to align it
> > with the structure it is actually referring to.
>
> Makes sense to me.
>
Hi Junio,
I'm thinking I should send the first two patches a separate
preparatory series while I follow up with a v2 of the RFC of negative
refspecs
Does that seem reasonable?
Thanks,
Jake
On Fri, Aug 21, 2020 at 11:21:19AM -0700, Jacob Keller wrote:
> > I also tried adding a test for fetch --prune, but that ultimately
> > calls query_refspecs_multiple and query_refspecs. I need to figure out
> > how negative refspecs need to interact with that function still.
>
> So there's an interesting problem here... query_refspecs_multiple
> takes only the destination name, which makes the "get_stale_heads" not
> work properly, since for fetch we want to apply the refspec to the
> remote sides "source".
Hmm. So if I understand it, that function is asking about _local_ refs,
and wondering "if we were to fetch using these refspecs, would we write
to this ref". We know that negative refspecs can't impact the mapping of
remote to local.
But I guess the case you are about is:
git fetch --prune refs/heads/*:refs/remotes/origin/* ^refs/heads/foo
where we need to realize that the local refs/remotes/origin/foo needs to
be saved. I think that should be possible by reverse-applying the
transformations from any positive refspecs, and then seeing if they
match any negative ones. I don't know how much support the existing code
will give you for that, though.
-Peff
On Fri, Aug 21, 2020 at 10:26 AM Jacob Keller <jacob.keller@gmail.com> wrote:
>
> On Fri, Aug 21, 2020 at 10:16 AM Jacob Keller <jacob.keller@gmail.com> wrote:
> >
> > On Tue, Aug 18, 2020 at 10:41 AM Jeff King <peff@peff.net> wrote:
> > > Hmm. I think the behavior we'd want is something like:
> > >
> > > # make sure the other side has three refs
> > > git branch prune/one HEAD
> > > git branch prune/two HEAD
> > > git branch prune/three HEAD
> > > git push dst.git refs/heads/prune/*
> > >
> > > # now drop two of ours, which are eligible for pruning
> > > git branch -d prune/one
> > > git branch -d prune/two
> > >
> > > # push with pruning, omitting "two"
> > > git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two
> > >
> > > # we should leave "two" but still deleted "one"
> > > test_write_lines one three >expect
> > > git -C dst.git for-each-ref --format='%(refname:lstrip=3)' refs/heads/prune/ >actual
> > > test_cmp expect actual
> > >
> > > I.e., the negative refspec shrinks the space we're considering pruning.
> > > And we'd probably want a similar test for "fetch --prune".
> > >
> > > I just tried that, though, and got an interesting result. The push
> > > actually complains:
> > >
> > > $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two
> > > error: src refspec refs/heads/prune/two does not match any
> > > error: failed to push some refs to 'dst.git'
> > >
> > > For negative refspecs, would we want to loosen the "must-exist" check?
> > > Or really, is this getting into the "are we negative on the src or dst"
> > > thing you brought up earlier? Especially with --prune, what I really
> > > want to say is "do not touch the remote refs/heads/two".
> > >
> > > We can get work around it by using a wildcard:
> > >
> > > $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two*
> > > To dst.git
> > > - [deleted] prune/one
> > >
> > > So it works as I'd expect already with your patch. But I do wonder if
> > > there are corner cases around the src/dst thing that might not behave
> > > sensibly.
> > >
> >
> > Hmm. So this raises a good point. I added a variation of this test
> > where I used separate names for the source and destination. It looks
> > like with the current implementation, negative refspecs always apply
> > to the destination.
>
> I also tried adding a test for fetch --prune, but that ultimately
> calls query_refspecs_multiple and query_refspecs. I need to figure out
> how negative refspecs need to interact with that function still.
So there's an interesting problem here... query_refspecs_multiple
takes only the destination name, which makes the "get_stale_heads" not
work properly, since for fetch we want to apply the refspec to the
remote sides "source".
On Fri, Aug 21, 2020 at 10:16 AM Jacob Keller <jacob.keller@gmail.com> wrote:
>
> On Tue, Aug 18, 2020 at 10:41 AM Jeff King <peff@peff.net> wrote:
> > Hmm. I think the behavior we'd want is something like:
> >
> > # make sure the other side has three refs
> > git branch prune/one HEAD
> > git branch prune/two HEAD
> > git branch prune/three HEAD
> > git push dst.git refs/heads/prune/*
> >
> > # now drop two of ours, which are eligible for pruning
> > git branch -d prune/one
> > git branch -d prune/two
> >
> > # push with pruning, omitting "two"
> > git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two
> >
> > # we should leave "two" but still deleted "one"
> > test_write_lines one three >expect
> > git -C dst.git for-each-ref --format='%(refname:lstrip=3)' refs/heads/prune/ >actual
> > test_cmp expect actual
> >
> > I.e., the negative refspec shrinks the space we're considering pruning.
> > And we'd probably want a similar test for "fetch --prune".
> >
> > I just tried that, though, and got an interesting result. The push
> > actually complains:
> >
> > $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two
> > error: src refspec refs/heads/prune/two does not match any
> > error: failed to push some refs to 'dst.git'
> >
> > For negative refspecs, would we want to loosen the "must-exist" check?
> > Or really, is this getting into the "are we negative on the src or dst"
> > thing you brought up earlier? Especially with --prune, what I really
> > want to say is "do not touch the remote refs/heads/two".
> >
> > We can get work around it by using a wildcard:
> >
> > $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two*
> > To dst.git
> > - [deleted] prune/one
> >
> > So it works as I'd expect already with your patch. But I do wonder if
> > there are corner cases around the src/dst thing that might not behave
> > sensibly.
> >
>
> Hmm. So this raises a good point. I added a variation of this test
> where I used separate names for the source and destination. It looks
> like with the current implementation, negative refspecs always apply
> to the destination.
I also tried adding a test for fetch --prune, but that ultimately
calls query_refspecs_multiple and query_refspecs. I need to figure out
how negative refspecs need to interact with that function still.
On Tue, Aug 18, 2020 at 10:41 AM Jeff King <peff@peff.net> wrote:
> Hmm. I think the behavior we'd want is something like:
>
> # make sure the other side has three refs
> git branch prune/one HEAD
> git branch prune/two HEAD
> git branch prune/three HEAD
> git push dst.git refs/heads/prune/*
>
> # now drop two of ours, which are eligible for pruning
> git branch -d prune/one
> git branch -d prune/two
>
> # push with pruning, omitting "two"
> git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two
>
> # we should leave "two" but still deleted "one"
> test_write_lines one three >expect
> git -C dst.git for-each-ref --format='%(refname:lstrip=3)' refs/heads/prune/ >actual
> test_cmp expect actual
>
> I.e., the negative refspec shrinks the space we're considering pruning.
> And we'd probably want a similar test for "fetch --prune".
>
> I just tried that, though, and got an interesting result. The push
> actually complains:
>
> $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two
> error: src refspec refs/heads/prune/two does not match any
> error: failed to push some refs to 'dst.git'
>
> For negative refspecs, would we want to loosen the "must-exist" check?
> Or really, is this getting into the "are we negative on the src or dst"
> thing you brought up earlier? Especially with --prune, what I really
> want to say is "do not touch the remote refs/heads/two".
>
> We can get work around it by using a wildcard:
>
> $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two*
> To dst.git
> - [deleted] prune/one
>
> So it works as I'd expect already with your patch. But I do wonder if
> there are corner cases around the src/dst thing that might not behave
> sensibly.
>
Hmm. So this raises a good point. I added a variation of this test
where I used separate names for the source and destination. It looks
like with the current implementation, negative refspecs always apply
to the destination.
Jeff King <peff@peff.net> writes:
> Yes, I'd agree we should be applying the negative refspecs first, and
> then de-duping / looking for collisions. Which I think is what the patch
> is doing currently.
Good to see that we thought this through. The reasoning deserves to
be recorded somewhere (perhaps a comment just before making the call
to apply the negative refspec).
Thanks.
On Fri, Aug 21, 2020 at 9:19 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Jeff King <peff@peff.net> writes:
>
> > Yes, I'd agree we should be applying the negative refspecs first, and
> > then de-duping / looking for collisions. Which I think is what the patch
> > is doing currently.
>
> Good to see that we thought this through. The reasoning deserves to
> be recorded somewhere (perhaps a comment just before making the call
> to apply the negative refspec).
>
> Thanks.
I am hoping to add a test case for this as well!
On Thu, Aug 20, 2020 at 04:59:53PM -0700, Jacob Keller wrote: > > The relevant commit is 2467a4fa03 (Remove duplicate ref matches in > > fetch, 2007-10-08), I think. We may end up with multiple refspecs > > requesting a particular ref. E.g.: > > > > git fetch origin refs/heads/master refs/heads/* > > > > I don't think the order should matter. If we apply negative refspecs > > first, then we'd either remove both copies or leave both untouched (and > > if the latter, then de-dup to a single). If we apply negative refspecs > > after de-duping, then we'd either remove the single or leave it in > > place. But the result is the same either way. > > I'm not sure this is quite true in the case where destinations are > supplied. Suppose this case: Oh, you're right. I was too focused on the de-duping of identical refs, but this is also handling colliding destinations. > git fetch refs/heads/*:refs/remotes/origin/* > refs/other/mybranch:refs/remotes/origin/mybranch > > This would ofcourse error out due to de-duping where we determine that > both would fetch to the same place.. however if you also added a > negative refspec: > > git fetch refs/heads/*:refs/remotes/origin/* > refs/other/mybranch:refs/remotes/origin/mybranch ^refs/heads/mybranch > > then shouldn't this work? meaning we should de-dupe only after we > apply negative refspecs in this case? Yes, I'd agree we should be applying the negative refspecs first, and then de-duping / looking for collisions. Which I think is what the patch is doing currently. -Peff
On Tue, Aug 18, 2020 at 10:41 AM Jeff King <peff@peff.net> wrote: > > On Mon, Aug 17, 2020 at 05:04:00PM -0700, Jacob Keller wrote: > > > > > + /* apply any negative refspecs now to prune the list of refs */ > > > > + ref_map = apply_negative_refspecs(ref_map, rs); > > > > + > > > > ref_map = ref_remove_duplicates(ref_map); > > > > > > How was the ordering here decided? Should it result the same set if > > > negative ones are excluded after duplicates are removed? > > > > Good question. This was what was done in peff's original patch. I need > > to understand a bit more about what ref_remove_duplicates does to > > really figure this out. > > The relevant commit is 2467a4fa03 (Remove duplicate ref matches in > fetch, 2007-10-08), I think. We may end up with multiple refspecs > requesting a particular ref. E.g.: > > git fetch origin refs/heads/master refs/heads/* > > I don't think the order should matter. If we apply negative refspecs > first, then we'd either remove both copies or leave both untouched (and > if the latter, then de-dup to a single). If we apply negative refspecs > after de-duping, then we'd either remove the single or leave it in > place. But the result is the same either way. I'm not sure this is quite true in the case where destinations are supplied. Suppose this case: git fetch refs/heads/*:refs/remotes/origin/* refs/other/mybranch:refs/remotes/origin/mybranch This would ofcourse error out due to de-duping where we determine that both would fetch to the same place.. however if you also added a negative refspec: git fetch refs/heads/*:refs/remotes/origin/* refs/other/mybranch:refs/remotes/origin/mybranch ^refs/heads/mybranch then shouldn't this work? meaning we should de-dupe only after we apply negative refspecs in this case? > > > > > @@ -1441,6 +1445,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > > > > string_list_clear(&src_ref_index, 0); > > > > } > > > > > > > > + *dst = apply_negative_refspecs(*dst, rs); > > > > + > > > > > > The block of code whose tail is shown in the pre-context has > > > prepared "delete these refs because we no longer have them" to the > > > other side under MATCH_REFS_PRUNE but that was done based on the > > > *dst list before we applied the negative refspec. Is the ordering > > > of these two correct, or should we filter the dst list with negative > > > ones and use the resulting one in pruning operation? > > > > I think we need to swap the order here. I'll take a closer look. > > Hmm. I think the behavior we'd want is something like: > > # make sure the other side has three refs > git branch prune/one HEAD > git branch prune/two HEAD > git branch prune/three HEAD > git push dst.git refs/heads/prune/* > > # now drop two of ours, which are eligible for pruning > git branch -d prune/one > git branch -d prune/two > > # push with pruning, omitting "two" > git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two > > # we should leave "two" but still deleted "one" > test_write_lines one three >expect > git -C dst.git for-each-ref --format='%(refname:lstrip=3)' refs/heads/prune/ >actual > test_cmp expect actual > > I.e., the negative refspec shrinks the space we're considering pruning. > And we'd probably want a similar test for "fetch --prune". > > I just tried that, though, and got an interesting result. The push > actually complains: > > $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two > error: src refspec refs/heads/prune/two does not match any > error: failed to push some refs to 'dst.git' > > For negative refspecs, would we want to loosen the "must-exist" check? > Or really, is this getting into the "are we negative on the src or dst" > thing you brought up earlier? Especially with --prune, what I really > want to say is "do not touch the remote refs/heads/two". > Hmmm.. For regular push the negative refspec applies to the source. For prune though we only provide a destination.. > We can get work around it by using a wildcard: > > $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two* > To dst.git > - [deleted] prune/one > > So it works as I'd expect already with your patch. But I do wonder if > there are corner cases around the src/dst thing that might not behave > sensibly. > Right, there's some interesting questions here still. > -Peff I'll be adding this as a test! Thanks, Jake
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'seen' (formerly 'pu'---proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -------------------------------------------------- [Graduated to 'master'] * al/bisect-first-parent (2020-08-07) 5 commits (merged to 'next' on 2020-08-11 at b232f7ca17) + bisect: combine args passed to find_bisection() + bisect: introduce first-parent flag + cmd_bisect__helper: defer parsing no-checkout flag + rev-list: allow bisect and first-parent flags + t6030: modernize "git bisect run" tests "git bisect" learns the "--first-parent" option to find the first breakage along the first-parent chain. * dd/send-email-config (2020-07-23) 1 commit (merged to 'next' on 2020-08-11 at aaf9f3a301) + git-send-email: die if sendmail.* config is set Stop when "sendmail.*" configuration variables are defined, which could be a mistaken attempt to define "sendemail.*" variables. * es/test-cmp-typocatcher (2020-08-09) 1 commit (merged to 'next' on 2020-08-11 at ee5557b170) + test_cmp: diagnose incorrect arguments Test framework update. * hn/reftable-prep-part-2 (2020-07-27) 3 commits (merged to 'next' on 2020-08-11 at 43ac0bc60a) + Make HEAD a PSEUDOREF rather than PER_WORKTREE. + Modify pseudo refs through ref backend storage + t1400: use git rev-parse for testing PSEUDOREF existence Further preliminary change to refs API. * jc/noop-with-static-inline (2020-08-06) 1 commit (merged to 'next' on 2020-08-11 at 8a63ff648e) + compat-util: type-check parameters of no-op replacement functions A no-op replacement function implemented as a C preprocessor macro does not perform as good a job as one implemented as a "static inline" function in catching errors in parameters; replace the former with the latter in <git-compat-util.h> header. * jk/log-fp-implies-m (2020-07-29) 7 commits (merged to 'next' on 2020-08-03 at 39fefa6b82) + doc/git-log: clarify handling of merge commit diffs + doc/git-log: move "-t" into diff-options list + doc/git-log: drop "-r" diff option + doc/git-log: move "Diff Formatting" from rev-list-options + log: enable "-m" automatically with "--first-parent" + revision: add "--no-diff-merges" option to counteract "-m" + log: drop "--cc implies -m" logic (this branch is used by so/log-diff-merges-opt.) Originally merged to 'next' on 2020-08-01 "git log --first-parent -p" showed patches only for single-parent commits on the first-parent chain; the "--first-parent" option has been made to imply "-m". Use "--no-diff-merges" to restore the previous behaviour to omit patches for merge commits. Will merge to 'master' together with 'so/log-diff-merges-opt' * jk/sideband-error-l10n (2020-08-07) 1 commit (merged to 'next' on 2020-08-11 at 27dbe05a65) + sideband: mark "remote error:" prefix for translation Mark error message for i18n. * ma/stop-progress-null-fix (2020-08-10) 1 commit (merged to 'next' on 2020-08-13 at 8bdec5209f) + progress: don't dereference before checking for NULL NULL dereference fix. * pd/mergetool-nvimdiff (2020-07-29) 2 commits (merged to 'next' on 2020-08-11 at 947ce686d0) + mergetools: add support for nvimdiff (neovim) family + mergetool--lib: improve support for vimdiff-style tool variants The existing backends for "git mergetool" based on variants of vim have been refactored and then support for "nvim" has been added. * ps/ref-transaction-hook (2020-08-11) 2 commits (merged to 'next' on 2020-08-11 at 311c045810) + t1416: avoid hard-coded sha1 ids (merged to 'next' on 2020-08-10 at d8ad7cc8f6) + refs: fix interleaving hook calls with reference-transaction hook The logic to find the ref transaction hook script attempted to cache the path to the found hook without realizing that it needed to keep a copied value, as the API it used returned a transitory buffer space. This has been corrected. to be followed by a removal of the caching feature, which does not seem to help even as a negative cache. * rp/apply-cached-with-i-t-a (2020-08-09) 3 commits (merged to 'next' on 2020-08-11 at c28eaa6a0e) + t4140: test apply with i-t-a paths + apply: make i-t-a entries never match worktree + apply: allow "new file" patches on i-t-a entries Recent versions of "git diff-files" shows a diff between the index and the working tree for "intent-to-add" paths as a "new file" patch; "git apply --cached" should be able to take "git diff-files" and should act as an equivalent to "git add" for the path, but the command failed to do so for such a path. * so/log-diff-merges-opt (2020-08-11) 3 commits (merged to 'next' on 2020-08-11 at 99e070bdca) + t/t4013: add test for --diff-merges=off + doc/git-log: describe --diff-merges=off + revision: change "--diff-merges" option to require parameter (this branch uses jk/log-fp-implies-m.) Earlier, to countermand the implicit "-m" option when the "--first-parent" option is used with "git log", we added the "--[no-]diff-merges" option in the jk/log-fp-implies-m topic. To leave the door open to allow the "--diff-merges" option to take values that instructs how patches for merge commits should be computed (e.g. "cc"? "-p against first parent?"), redefine "--diff-merges" to take non-optional value, and implement "off" that means the same thing as "--no-diff-merges". Will merge to 'master' together with 'jk/lo-implies-m'. -------------------------------------------------- [New Topics] * bc/sha-256-doc-updates (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at 7154a0ce3c) + docs: fix step in transition plan + docs: document SHA-256 pack and indices Further update of docs to adjust to the recent SHA-256 work. Will merge to 'master'. * ma/sha-256-docs (2020-08-17) 4 commits (merged to 'next' on 2020-08-17 at 6861142a20) + shallow.txt: document SHA-256 shallow format + protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256 + index-format.txt: document SHA-256 index format + http-protocol.txt: document SHA-256 "want"/"have" format Further update of docs to adjust to the recent SHA-256 work. Will merge to 'master'. * dd/diff-customize-index-line-abbrev (2020-08-13) 2 commits - diff: index-line: respect --abbrev in object's name - revision: differentiate if --no-abbrev asked explicitly The output from the "diff" family of the commands had abbreviated object names of blobs involved in the patch, but its length was not affected by the --abbrev option. Now it is. The first patch is unneeded. * ds/sha256-leftover-bits (2020-08-17) 3 commits (merged to 'next' on 2020-08-17 at a8e6f9f3f4) + multi-pack-index: use hash version byte + commit-graph: use the "hash version" byte + t/README: document GIT_TEST_DEFAULT_HASH midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. Will merge to 'master'. * hn/refs-fetch-head-is-special (2020-08-17) 4 commits - refs: read FETCH_HEAD generically - refs: move gitdir into base ref_store - refs: fix comment about submodule ref_stores - Split off reading loose ref data in separate function (this branch is used by hn/refs-pseudorefs.) The FETCH_HEAD is now always read from the filesystem regardless of the ref backend in use, as its format is much richer than the normal refs, and written directly by "git fetch" as a plain file.. * hv/ref-filter-misc (2020-08-17) 9 commits - ref-filter: add `sanitize` option for 'subject' atom - format-support: move `format_sanitized_subject()` from pretty - pretty: refactor `format_sanitized_subject()` - ref-filter: add `short` modifier to 'parent' atom - ref-filter: add `short` modifier to 'tree' atom - ref-filter: rename `objectname` related functions and fields - ref-filter: modify error messages in `grab_objectname()` - ref-filter: refactor `grab_objectname()` - ref-filter: support different email formats The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * jc/object-names-are-not-sha-1 (2020-08-14) 1 commit (merged to 'next' on 2020-08-17 at 400fe9e831) + messages: avoid SHA-1 in end-user facing messages A few end-user facing messages have been update to be hash-algorithm agnostic. Will merge to 'master'. * jh/mingw-unlink (2020-08-17) 1 commit (merged to 'next' on 2020-08-17 at fb53a3d1a1) + mingw: improve performance of mingw_unlink() "unlink" emulation on MinGW has been optimized. Will merge to 'master'. * jk/leakfix (2020-08-17) 7 commits - submodule--helper: fix leak of core.worktree value - config: fix leak in git_config_get_expiry_in_days() - config: drop git_config_get_string_const() - config: fix leaks from git_config_get_string_const() - checkout: fix leak of non-existent branch names - submodule--helper: use strbuf_release() to free strbufs - clear_pattern_list(): clear embedded hashmaps Code clean-up. Will merge to 'next'. * jk/refspecs-negative (2020-08-17) 3 commits - refspec: add support for negative refspecs - refspec: make sure stack refspec_item variables are zeroed - refspec: fix documentation referring to refspec_item "negative refspecs" * jt/fetch-pack-loosen-validation-with-packfile-uri (2020-08-14) 1 commit - fetch-pack: make packfile URIs work with transfer.fsckobjects Bugfix for "git fetch" when the packfile URI capability is in use. Need to pick up a reroll. * mr/diff-hide-stat-wo-textual-change (2020-08-17) 1 commit - diff: teach --stat to ignore uninteresting modifications Expecting a reroll. * pw/add-p-allowed-options-fix (2020-08-17) 2 commits - add -p: fix checking of user input - add -p: use ALLOC_GROW_BY instead of ALLOW_GROW "git add -p" update. Doubts? cf. <pull.702.git.1597670589.gitgitgadget@gmail.com> * dl/subtree-docs (2020-08-18) 2 commits - contrib/subtree: document 'push' does not take '--squash' - contrib/subtree: fix "unsure" for --message in the document Doc updates for subtree (in contrib/) Will merge to 'next'. * en/mem-pool (2020-08-18) 3 commits - mem-pool: use consistent pool variable name - mem-pool: use more standard initialization and finalization - mem-pool: add convenience functions for strdup and strndup API update. Will merge to 'next'. * jc/no-update-fetch-head (2020-08-18) 1 commit - fetch: optionally allow disabling FETCH_HEAD update (this branch is used by ds/maintenance-part-1, ds/maintenance-part-2 and jt/lazy-fetch.) "git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. Will merge to 'next'. * jt/lazy-fetch (2020-08-18) 7 commits - fetch-pack: remove no_dependents code - promisor-remote: lazy-fetch objects in subprocess - fetch-pack: do not lazy-fetch during ref iteration - fetch: only populate existing_refs if needed - fetch: avoid reading submodule config until needed - fetch: allow refspecs specified through stdin - negotiator/noop: add noop fetch negotiator (this branch uses jc/no-update-fetch-head; is tangled with ds/maintenance-part-1 and ds/maintenance-part-2.) Updates to on-demand fetching code in lazily cloned repositories. * mt/checkout-entry-dead-code-removal (2020-08-18) 1 commit - checkout_entry(): remove unreachable error() call Code clean-up. Will merge to 'next'. -------------------------------------------------- [Stalled] * mt/grep-sparse-checkout (2020-06-12) 6 commits - config: add setting to ignore sparsity patterns in some cmds - grep: honor sparse checkout patterns - config: correctly read worktree configs in submodules - t/helper/test-config: facilitate addition of new cli options - t/helper/test-config: return exit codes consistently - doc: grep: unify info on configuration variables "git grep" has been tweaked to be limited to the sparse checkout paths. Review needed on 4/6; otherwise looking sane. cf. <CABPp-BGdEyEeajYZj_rdxp=MyEQdszuyjVTax=hhYj3fOtRQUQ@mail.gmail.com> * ls/mergetool-meld-auto-merge (2020-07-12) 2 commits - SQUASH??? - Support auto-merge for meld to follow the vim-diff behavior The 'meld' backend of the "git mergetool" learned to give the underlying 'meld' the '--auto-merge' option, which would help reduce the amount of text that requires manual merging. Expecting a reroll. * mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits - submodule: use submodule repository when preparing summary - revision: use repository from rev_info when parsing commits "git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. Needs tests. * dr/push-remoteref-fix (2020-04-23) 1 commit - remote.c: fix handling of %(push:remoteref) The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). Expecting a reroll. cf. <20200416152145.wp2zeibxmuyas6y6@feanor> * mr/bisect-in-c-2 (2020-07-17) 14 commits . SQUASH??? do not add new users of git_path_bisect_head() . bisect--helper: retire `--bisect-autostart` subcommand . bisect--helper: retire `--write-terms` subcommand . bisect--helper: retire `--check-expected-revs` subcommand . bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C . bisect--helper: retire `--next-all` subcommand . bisect--helper: retire `--bisect-clean-state` subcommand . bisect--helper: finish porting `bisect_start()` to C . bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C . bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' . bisect--helper: reimplement `bisect_autostart` shell function in C . bisect--helper: introduce new `write_in_file()` function . bisect--helper: use '-res' in 'cmd_bisect__helper' return . bisect--helper: BUG() in cmd_*() on invalid subcommand Rewrite of the remainder of "git bisect" script in C continues. Needs more work. Ejected out of 'seen'; al/bisect-first-parent topic has a bit of textual conflict with this topic. * mk/use-size-t-in-zlib (2018-10-15) 1 commit - zlib.c: use size_t for size The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". -------------------------------------------------- [Cooking] * jx/proc-receive-hook (2020-08-17) 10 commits - doc: add documentation for the proc-receive hook - transport: parse report options for tracking refs - t5411: test updates of remote-tracking branches - receive-pack: new config receive.procReceiveRefs - receive-pack: feed report options to post-receive - doc: add document for capability report-status-v2 - New capability "report-status-v2" for git-push - receive-pack: add new proc-receive hook - t5411: add basic test cases for proc-receive hook - transport: not report a non-head push as a branch "git receive-pack" that accepts requests by "git push" learned to outsource most of the ref updates to the new "proc-receive" hook. Needs review. * pw/rebase-i-more-options (2020-08-17) 5 commits - rebase: add --reset-author-date - rebase -i: support --ignore-date - rebase -i: support --committer-date-is-author-date - am: stop exporting GIT_COMMITTER_DATE - rebase -i: add --ignore-whitespace flag "git rebase -i" learns a bit more options. Waiting for a (hopefully final) review. * rs/more-buffered-io (2020-08-17) 3 commits - upload-pack: use buffered I/O to talk to rev-list - midx: use buffered I/O to talk to pack-objects - connected: use buffered I/O to talk to rev-list Use more buffered I/O where we used to call many small write(2)s. Will merge to 'next'. * en/merge-tests (2020-08-10) 11 commits (merged to 'next' on 2020-08-13 at eab952350b) + t6425: be more flexible with rename/delete conflict messages + t642[23]: be more flexible for add/add conflicts involving pair renames + t6422, t6426: be more flexible for add/add conflicts involving renames + t6423: add an explanation about why one of the tests does not pass + t6416, t6423: clarify some comments and fix some typos + t6422: fix multiple errors with the mod6 test expectations + t6423: fix test setup for a couple tests + t6416, t6422: fix incorrect untracked file count + t6422: fix bad check against missing file + t6418: tighten delete/normalize conflict testcase + Collect merge-related tests to t64xx Updates to "git merge" tests, in preparation for a new merge strategy backend. Will merge to 'master'. * ds/midx-repack-to-batch-size (2020-08-11) 1 commit (merged to 'next' on 2020-08-17 at eee94634aa) + multi-pack-index: repack batches below --batch-size The "--batch-size" option of "git multi-pack-index repack" command is now used to specify that very small packfiles are collected into one until the total size roughly exceeds it. Will merge to 'master'. * rs/upload-pack-sigchain-fix (2020-08-11) 1 commit (merged to 'next' on 2020-08-17 at 997473f309) + upload-pack: remove superfluous sigchain_pop() call Code clean-up. Will merge to 'master'. * tb/bloom-improvements (2020-08-11) 14 commits - builtin/commit-graph.c: introduce '--max-new-filters=<n>' - commit-graph: rename 'split_commit_graph_opts' - commit-graph: add large-filters bitmap chunk - commit-graph.c: sort index into commits list - bloom/diff: properly short-circuit on max_changes - bloom: use provided 'struct bloom_filter_settings' - csum-file.h: introduce 'hashwrite_be64()' - bloom: split 'get_bloom_filter()' in two - commit-graph.c: store maximum changed paths - commit-graph: respect 'commitGraph.readChangedPaths' - t/helper/test-read-graph.c: prepare repo settings - commit-graph: pass a 'struct repository *' in more places - t4216: use an '&&'-chain - commit-graph: introduce 'get_bloom_filter_settings()' Misc Bloom filter improvements. Expecting a reroll. It seems that the review is getting closer to result in another update. cf. <20200811220503.GC66656@syl.lan> * ak/sequencer-fix-find-uniq-abbrev (2020-08-13) 1 commit (merged to 'next' on 2020-08-17 at 6ce0f1d111) + rebase -i: fix possibly wrong onto hash in todo Ring buffer with size 4 used for bin-hex translation resulted in a wrong object name in the sequencer's todo output, which has been corrected. Will merge to 'master'. * en/dir-nonbare-embedded (2020-08-12) 2 commits (merged to 'next' on 2020-08-17 at ab180b7fcb) + dir: avoid prematurely marking nonbare repositories as matches + t3000: fix some test description typos "ls-files -o" mishandled the top-level directory of another git working tree that hangs in the current git working tree. Will merge to 'master'. * en/sequencer-merge-labels (2020-08-14) 1 commit (merged to 'next' on 2020-08-17 at 2010e329ed) + sequencer: avoid garbled merge machinery messages due to commit labels The commit labels used to explain each side of conflicted hunks placed by the sequencer machinery have been made more readable by humans. Will merge to 'master'. * jb/commit-graph-doc-fix (2020-08-13) 1 commit (merged to 'next' on 2020-08-17 at d83ee98955) + docs: commit-graph: fix some whitespace in the diagram Docfix. Will merge to 'master'. * jk/blame-coalesce-fix (2020-08-13) 3 commits (merged to 'next' on 2020-08-17 at 122c701ec7) + blame: only coalesce lines that are adjacent in result + t8003: factor setup out of coalesce test + t8003: check output of coalesced blame When given more than one target line ranges, "git blame -La,b -Lc,d" was over-eager to coalesce groups of original lines and showed incorrect results, which has been corrected. Will merge to 'master'. * jk/slimmed-down (2020-08-13) 5 commits - drop vcs-svn experiment - make git-fast-import a builtin - make git-bugreport a builtin - make credential helpers builtins - Makefile: drop builtins from MSVC pdb list Trim an unused binary and turn a bunch of commands into built-in. In general this is a good thing to do, modulo 'bugreport'. * jk/unleak-fixes (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at f9bd296b25) + ls-remote: simplify UNLEAK() usage + stop calling UNLEAK() before die() Fix some incorrect UNLEAK() annotations. Will merge to 'master'. * pb/set-url-docfix (2020-08-13) 1 commit (merged to 'next' on 2020-08-17 at 19b56c6ebb) + fetch, pull doc: correct description of '--set-upstream' Doc fix. Will merge to 'master'. * pb/userdiff-fortran-update (2020-08-13) 2 commits (merged to 'next' on 2020-08-17 at 534af3f35a) + userdiff: improve Fortran xfuncname regex + userdiff: add tests for Fortran xfuncname regex The regexp to identify the function boundary for FORTRAN programs has been updated. Will merge to 'master'. * rs/preserve-merges-unused-code-removal (2020-08-12) 1 commit (merged to 'next' on 2020-08-17 at b96393455c) + rebase: remove unused function reschedule_last_action Code clean-up. Will merge to 'master'. * ss/t7401-modernize (2020-08-12) 4 commits - t7401: add a NEEDSWORK - t7401: change indentation for enhanced readability - t7401: change test_i18ncmp syntax for clarity - t7401: modernize style Test clean-up. Expecting a reroll. cf. <c70f7bb5d1289f5318da7b99e41cf5828a451174.camel@gmail.com> Almost there, it seems. * ds/maintenance-part-2 (2020-08-18) 8 commits - maintenance: add incremental-repack auto condition - maintenance: auto-size incremental-repack batch - maintenance: add incremental-repack task - midx: use start_delayed_progress() - midx: enable core.multiPackIndex by default - maintenance: create auto condition for loose-objects - maintenance: add loose-objects task - maintenance: add prefetch task (this branch uses ds/maintenance-part-1 and jc/no-update-fetch-head; is tangled with jt/lazy-fetch.) "git maintenance", an extended big brother of "git gc", continues to evolve. * ma/doc-sha-256-is-experimental (2020-08-17) 1 commit - Documentation: mark `--object-format=sha256` as experimental The recent addition of SHA-256 support is marked as experimental in the documentation. Will merge to 'next'. * ss/submodule-summary-in-c (2020-08-12) 4 commits (merged to 'next' on 2020-08-17 at 9bc352cb70) + submodule: port submodule subcommand 'summary' from shell to C + t7421: introduce a test script for verifying 'summary' output + submodule: rename helper functions to avoid ambiguity + submodule: remove extra line feeds between callback struct and macro Yet another subcommand of "git submodule" is getting rewritten in C. Will merge to 'master'. * am/ci-wsfix (2020-08-10) 1 commit - ci: fix inconsistent indentation Aesthetic fix to a CI configuration file. Waiting for a reroll. It needs a better log message. * es/init-no-separate-git-dir-in-bare (2020-08-10) 1 commit (merged to 'next' on 2020-08-17 at 80498c8659) + init: disallow --separate-git-dir with bare repository The purpose of "git init --separate-git-dir" is to initialize a new project with the repository separate from the working tree, or, in the case of an existing project, to move the repository (the .git/ directory) out of the working tree. It does not make sense to use --separate-git-dir with a bare repository for which there is no working tree, so disallow its use with bare repositories. Will merge to 'master'. * rp/ita-diff-modefix (2020-08-09) 1 commit (merged to 'next' on 2020-08-17 at c03a9cfb6e) + diff-lib: use worktree mode in diffs from i-t-a entries "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a bit was not showing the mode bits from the working tree. Will merge to 'master'. * ds/maintenance-part-1 (2020-08-18) 11 commits - maintenance: add trace2 regions for task execution - maintenance: add auto condition for commit-graph task - maintenance: use pointers to check --auto - maintenance: create maintenance.<task>.enabled config - maintenance: take a lock on the objects directory - maintenance: add --task option - maintenance: add commit-graph task - maintenance: initialize task array - maintenance: replace run_auto_gc() - maintenance: add --quiet option - maintenance: create basic maintenance runner (this branch is used by ds/maintenance-part-2; uses jc/no-update-fetch-head; is tangled with jt/lazy-fetch.) A "git gc"'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning. * es/config-hooks (2020-07-30) 6 commits - hook: add 'run' subcommand - parse-options: parse into argv_array - hook: add --porcelain to list command - hook: add list command - hook: scaffolding for git-hook subcommand - doc: propose hooks managed by the config The "hooks defined in config" topic. Expecting a reroll. Now jk/strvec is in 'master', we may want to see the topic reworked on top of it. Are there unresolved issues, or does the topic need a round of detailed review? cf. <xmqqmu3i9kvg.fsf@gitster.c.googlers.com> -------------------------------------------------- [Discarded] * rs/fast-export-anon-simplify (2020-08-13) 1 commit . fast-export: factor out print_oid() Code simplification. Retracted. cf. <6e2d4472-8293-4f10-0ba6-82ae83f7a465@web.de> * mt/hash-to-hex-thread-safety (2020-06-26) 2 commits . hex: make hash_to_hex_algop() and friends thread-safe . compat/win32/pthread: add pthread_once() hash_to_hex() used a set of rotating static buffers, which was not safe to use in a threaded environment. This has been made safer by using thread-local storage. Retracted. cf. <CAHd-oW7Wd8oSaMhPFeRcEeKTJ-k_hC7b6e28efhXT5LFu1E_Uw@mail.gmail.com>
On Mon, Aug 17, 2020 at 05:04:00PM -0700, Jacob Keller wrote: > > > + /* apply any negative refspecs now to prune the list of refs */ > > > + ref_map = apply_negative_refspecs(ref_map, rs); > > > + > > > ref_map = ref_remove_duplicates(ref_map); > > > > How was the ordering here decided? Should it result the same set if > > negative ones are excluded after duplicates are removed? > > Good question. This was what was done in peff's original patch. I need > to understand a bit more about what ref_remove_duplicates does to > really figure this out. The relevant commit is 2467a4fa03 (Remove duplicate ref matches in fetch, 2007-10-08), I think. We may end up with multiple refspecs requesting a particular ref. E.g.: git fetch origin refs/heads/master refs/heads/* I don't think the order should matter. If we apply negative refspecs first, then we'd either remove both copies or leave both untouched (and if the latter, then de-dup to a single). If we apply negative refspecs after de-duping, then we'd either remove the single or leave it in place. But the result is the same either way. > > > @@ -1441,6 +1445,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > > > string_list_clear(&src_ref_index, 0); > > > } > > > > > > + *dst = apply_negative_refspecs(*dst, rs); > > > + > > > > The block of code whose tail is shown in the pre-context has > > prepared "delete these refs because we no longer have them" to the > > other side under MATCH_REFS_PRUNE but that was done based on the > > *dst list before we applied the negative refspec. Is the ordering > > of these two correct, or should we filter the dst list with negative > > ones and use the resulting one in pruning operation? > > I think we need to swap the order here. I'll take a closer look. Hmm. I think the behavior we'd want is something like: # make sure the other side has three refs git branch prune/one HEAD git branch prune/two HEAD git branch prune/three HEAD git push dst.git refs/heads/prune/* # now drop two of ours, which are eligible for pruning git branch -d prune/one git branch -d prune/two # push with pruning, omitting "two" git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two # we should leave "two" but still deleted "one" test_write_lines one three >expect git -C dst.git for-each-ref --format='%(refname:lstrip=3)' refs/heads/prune/ >actual test_cmp expect actual I.e., the negative refspec shrinks the space we're considering pruning. And we'd probably want a similar test for "fetch --prune". I just tried that, though, and got an interesting result. The push actually complains: $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two error: src refspec refs/heads/prune/two does not match any error: failed to push some refs to 'dst.git' For negative refspecs, would we want to loosen the "must-exist" check? Or really, is this getting into the "are we negative on the src or dst" thing you brought up earlier? Especially with --prune, what I really want to say is "do not touch the remote refs/heads/two". We can get work around it by using a wildcard: $ git push --prune dst.git refs/heads/prune/* ^refs/heads/prune/two* To dst.git - [deleted] prune/one So it works as I'd expect already with your patch. But I do wonder if there are corner cases around the src/dst thing that might not behave sensibly. -Peff
On Mon, Aug 17, 2020 at 4:43 PM Junio C Hamano <gitster@pobox.com> wrote: > > Jacob Keller <jacob.e.keller@intel.com> writes: > > > Refspecs today are commutative, meaning that order doesn't expressly > > matter. Rather than forcing an implied order, negative refspecs will > > always be applied last. That is, in order to match, a ref must match at > > least one positive refspec, and match none of the negative refspecs. > > This is similar to how negative pathspecs work. > > Yes, enumerate what positive ones match and then exclude what > negative ones match from the result is a time-tested pattern our > users know how things work. > > > @@ -530,6 +530,9 @@ static struct ref *get_ref_map(struct remote *remote, > > tail = &rm->next; > > } > > > > + /* apply any negative refspecs now to prune the list of refs */ > > + ref_map = apply_negative_refspecs(ref_map, rs); > > + > > ref_map = ref_remove_duplicates(ref_map); > > How was the ordering here decided? Should it result the same set if > negative ones are excluded after duplicates are removed? > Good question. This was what was done in peff's original patch. I need to understand a bit more about what ref_remove_duplicates does to really figure this out. > > @@ -1441,6 +1445,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > > string_list_clear(&src_ref_index, 0); > > } > > > > + *dst = apply_negative_refspecs(*dst, rs); > > + > > The block of code whose tail is shown in the pre-context has > prepared "delete these refs because we no longer have them" to the > other side under MATCH_REFS_PRUNE but that was done based on the > *dst list before we applied the negative refspec. Is the ordering > of these two correct, or should we filter the dst list with negative > ones and use the resulting one in pruning operation? > I think we need to swap the order here. I'll take a closer look. > > + if (item->negative) { > > + struct object_id unused; > > + > > + /* > > + * Negative refspecs only have a LHS, which indicates a ref > > + * (or pattern of refs) to exclude from other matches. This > > + * can either be a simple ref, a glob pattern, or even an > > + * exact sha1 match. > > + */ > > "a ref (or pattern of refs)" is clarified with the next sentence > anyway, so let's not say it, e.g. > > ... only have a LHS, which indicates what to exclude from > other matches. > Sure. There's also a slight bug here because in "fetch" mode, standalone LHS-only refs cannot be globs, and I need to fix that too. Thanks, Jake
Jacob Keller <jacob.e.keller@intel.com> writes: > Refspecs today are commutative, meaning that order doesn't expressly > matter. Rather than forcing an implied order, negative refspecs will > always be applied last. That is, in order to match, a ref must match at > least one positive refspec, and match none of the negative refspecs. > This is similar to how negative pathspecs work. Yes, enumerate what positive ones match and then exclude what negative ones match from the result is a time-tested pattern our users know how things work. > @@ -530,6 +530,9 @@ static struct ref *get_ref_map(struct remote *remote, > tail = &rm->next; > } > > + /* apply any negative refspecs now to prune the list of refs */ > + ref_map = apply_negative_refspecs(ref_map, rs); > + > ref_map = ref_remove_duplicates(ref_map); How was the ordering here decided? Should it result the same set if negative ones are excluded after duplicates are removed? > @@ -1441,6 +1445,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > string_list_clear(&src_ref_index, 0); > } > > + *dst = apply_negative_refspecs(*dst, rs); > + The block of code whose tail is shown in the pre-context has prepared "delete these refs because we no longer have them" to the other side under MATCH_REFS_PRUNE but that was done based on the *dst list before we applied the negative refspec. Is the ordering of these two correct, or should we filter the dst list with negative ones and use the resulting one in pruning operation? > + if (item->negative) { > + struct object_id unused; > + > + /* > + * Negative refspecs only have a LHS, which indicates a ref > + * (or pattern of refs) to exclude from other matches. This > + * can either be a simple ref, a glob pattern, or even an > + * exact sha1 match. > + */ "a ref (or pattern of refs)" is clarified with the next sentence anyway, so let's not say it, e.g. ... only have a LHS, which indicates what to exclude from other matches.
On Fri, Aug 14, 2020 at 5:25 PM Jacob Keller <jacob.e.keller@intel.com> wrote: > > From: Jacob Keller <jacob.keller@gmail.com> > > Both fetch and push support pattern refspecs which allow fetching or > pushing references that match a specific pattern. Because these patterns > are globs, they have somewhat limited ability to express more complex > situations. > > For example, suppose you wish to fetch all branches from a remote except > for a specific one. To allow this, you must setup a set of refspecs > which match only the branches you want. Because refspecs are either > explicit name matches, or simple globs, many patterns cannot be > expressed. > > Add support for a new type of refspec, referred to as "negative" > refspecs. These are prefixed with a '^' and mean "exclude any ref > matching this refspec". They can only have one "side" which always > refers to the source. During a fetch, this refers to the name of the ref > on the remote. During a push, this refers to the name of the ref on the > local side. > > With negative refspecs, users can express more complex patterns. For > example: > > git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant > > will fetch all branches on origin into remotes/origin, but will exclude > fetching the branch named dontwant. > > Refspecs today are commutative, meaning that order doesn't expressly > matter. Rather than forcing an implied order, negative refspecs will > always be applied last. That is, in order to match, a ref must match at > least one positive refspec, and match none of the negative refspecs. > This is similar to how negative pathspecs work. > > Signed-off-by: Jacob Keller <jacob.keller@gmail.com> > --- > builtin/fetch.c | 3 +++ > refspec.c | 30 ++++++++++++++++++++++++++++++ > refspec.h | 14 ++++++++------ > remote.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- > remote.h | 9 ++++++++- > 5 files changed, 97 insertions(+), 8 deletions(-) > > diff --git a/builtin/fetch.c b/builtin/fetch.c > index c49f0e975203..930214626b54 100644 > --- a/builtin/fetch.c > +++ b/builtin/fetch.c > @@ -530,6 +530,9 @@ static struct ref *get_ref_map(struct remote *remote, > tail = &rm->next; > } > > + /* apply any negative refspecs now to prune the list of refs */ > + ref_map = apply_negative_refspecs(ref_map, rs); > + So there is a slight bug here: we need to determine whether to use the remote->fetch rs or the commandline rs. This only prunes the refs using commandline negative refspecs, but if you're using the values configured in the remote they won't get pruned. I am not sure the best way to handle this, since I don't really like a check on the lines of "if (rs->nr) { /* use rs */ } else { /* use remote->fetch */ }.. > ref_map = ref_remove_duplicates(ref_map); > > refname_hash_init(&existing_refs); > diff --git a/refspec.c b/refspec.c > index f10ef284cef9..feed20aca961 100644 > --- a/refspec.c > +++ b/refspec.c > @@ -8,6 +8,7 @@ static struct refspec_item s_tag_refspec = { > 1, > 0, > 0, > + 0, > "refs/tags/*", > "refs/tags/*" > }; > @@ -32,10 +33,17 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet > if (*lhs == '+') { > item->force = 1; > lhs++; > + } else if (*lhs == '^') { > + item->negative = 1; > + lhs++; > } > > rhs = strrchr(lhs, ':'); > > + /* negative refspecs only have one side */ > + if (item->negative && rhs) > + return 0; > + > /* > * Before going on, special case ":" (or "+:") as a refspec > * for pushing matching refs. > @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet > item->src = xstrndup(lhs, llen); > flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); > > + if (item->negative) { > + struct object_id unused; > + > + /* > + * Negative refspecs only have a LHS, which indicates a ref > + * (or pattern of refs) to exclude from other matches. This > + * can either be a simple ref, a glob pattern, or even an > + * exact sha1 match. > + */ > + if (!*item->src) > + return 0; /* negative refspecs must not be empty */ > + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) > + item->exact_sha1 = 1; /* ok */ > + else if (!check_refname_format(item->src, flags)) > + ; /* valid looking ref is ok */ > + else > + return 0; > + > + /* other rules for negative refspecs don't apply */ > + return 1; > + } > + > if (fetch) { > struct object_id unused; > > diff --git a/refspec.h b/refspec.h > index 8d654e3a3ac4..e5bf6d25d0f7 100644 > --- a/refspec.h > +++ b/refspec.h > @@ -5,12 +5,13 @@ > extern const struct refspec_item *tag_refspec; > > /** > - * A struct refspec_item holds the parsed interpretation of a refspec. If it will > - * force updates (starts with a '+'), force is true. If it is a pattern > - * (sides end with '*') pattern is true. src and dest are the two sides > - * (including '*' characters if present); if there is only one side, it is src, > - * and dst is NULL; if sides exist but are empty (i.e., the refspec either > - * starts or ends with ':'), the corresponding side is "". > + * A struct refspec_item holds the parsed interpretation of a refspec. If it > + * will force updates (starts with a '+'), force is true. If it is a pattern > + * (sides end with '*') pattern is true. If it is a negative refspec, (starts > + * with '^'), negative is true. src and dest are the two sides (including '*' > + * characters if present); if there is only one side, it is src, and dst is > + * NULL; if sides exist but are empty (i.e., the refspec either starts or ends > + * with ':'), the corresponding side is "". > * > * remote_find_tracking(), given a remote and a struct refspec_item with either src > * or dst filled out, will fill out the other such that the result is in the > @@ -22,6 +23,7 @@ struct refspec_item { > unsigned pattern : 1; > unsigned matching : 1; > unsigned exact_sha1 : 1; > + unsigned negative : 1; > > char *src; > char *dst; > diff --git a/remote.c b/remote.c > index c5ed74f91c63..6a41d1028221 100644 > --- a/remote.c > +++ b/remote.c > @@ -1058,7 +1058,7 @@ static int match_explicit(struct ref *src, struct ref *dst, > const char *dst_value = rs->dst; > char *dst_guess; > > - if (rs->pattern || rs->matching) > + if (rs->pattern || rs->matching || rs->negative) > return 0; > > matched_src = matched_dst = NULL; > @@ -1134,6 +1134,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, > int matching_refs = -1; > for (i = 0; i < rs->nr; i++) { > const struct refspec_item *item = &rs->items[i]; > + > + if (item->negative) > + continue; > + > if (item->matching && > (matching_refs == -1 || item->force)) { > matching_refs = i; > @@ -1441,6 +1445,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > string_list_clear(&src_ref_index, 0); > } > > + *dst = apply_negative_refspecs(*dst, rs); > + > if (errs) > return -1; > return 0; > @@ -1810,6 +1816,9 @@ int get_fetch_map(const struct ref *remote_refs, > { > struct ref *ref_map, **rmp; > > + if (refspec->negative) > + return 0; > + > if (refspec->pattern) { > ref_map = get_expanded_map(remote_refs, refspec); > } else { > @@ -1853,6 +1862,44 @@ int get_fetch_map(const struct ref *remote_refs, > return 0; > } > > +static int refspec_match(const struct refspec_item *refspec, > + const char *name) > +{ > + if (refspec->pattern) > + return match_name_with_pattern(refspec->src, name, NULL, NULL); > + > + return !strcmp(refspec->src, name); > +} > + > +static int omit_name_by_refspec(const char *name, struct refspec *rs) > +{ > + int i; > + > + for (i = 0; i < rs->nr; i++) { > + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) > + return 1; > + } > + return 0; > +} > + > +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) > +{ > + struct ref **tail; > + > + for (tail = &ref_map; *tail; ) { > + struct ref *ref = *tail; > + > + if (omit_name_by_refspec(ref->name, rs)) { > + *tail = ref->next; > + free(ref->peer_ref); > + free(ref); > + } else > + tail = &ref->next; > + } > + > + return ref_map; > +} > + > int resolve_remote_symref(struct ref *ref, struct ref *list) > { > if (!ref->symref) > diff --git a/remote.h b/remote.h > index 5e3ea5a26deb..104e75e0f74d 100644 > --- a/remote.h > +++ b/remote.h > @@ -193,6 +193,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); > */ > struct ref *ref_remove_duplicates(struct ref *ref_map); > > +/* > + * Remove all entries in the input list which match any negative refspec in > + * the refspec list. > + */ > +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); > + > int query_refspecs(struct refspec *rs, struct refspec_item *query); > char *apply_refspecs(struct refspec *rs, const char *name); > > @@ -205,7 +211,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, > /* > * Given a list of the remote refs and the specification of things to > * fetch, makes a (separate) list of the refs to fetch and the local > - * refs to store into. > + * refs to store into. Note that negative refspecs are ignored here, and > + * should be handled separately. > * > * *tail is the pointer to the tail pointer of the list of results > * beforehand, and will be set to the tail pointer of the list of > -- > 2.28.0.163.g6104cc2f0b60 >
On Fri, Aug 14, 2020 at 5:28 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
>
> From: Jacob Keller <jacob.keller@gmail.com>
>
> This is more or less just a port of what Peff already had published a few
> years ago at https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/
>
> I cleaned some things up and made sure the tests pass, but haven't yet added
> any new tests.
>
> I think the overal design makes sense: applying positive first and then
> negative. This appears to be how negative pathspecs work at least as far as
> I could tell with a few trials.
>
> The first two patches are cleanup/fixups that I think could go separately if
> everyone agrees. The third is the meat of the idea, and where most of the
> work needs to be done.
>
> Jacob Keller (3):
> refspec: fix documentation referring to refspec_item
> refspec: make sure stack refspec_item variables are zeroed
> refspec: add support for negative refspecs
>
> builtin/fetch.c | 3 +++
> builtin/remote.c | 1 +
> refspec.c | 30 +++++++++++++++++++++++++++++
> refspec.h | 29 +++++++++++++++-------------
> remote.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-
> remote.h | 9 ++++++++-
> transport.c | 1 +
> 7 files changed, 107 insertions(+), 15 deletions(-)
>
>
> base-commit: 878e727637ec5815ccb3301eb994a54df95b21b8
> --
> 2.28.0.163.g6104cc2f0b60
>
This probably doesn't have the right reply headers, because I forgot
to send the cover letter along with the patches and realized it after
I hit send. Sorry!
Thanks,
Jake
From: Jacob Keller <jacob.keller@gmail.com> This is more or less just a port of what Peff already had published a few years ago at https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/ I cleaned some things up and made sure the tests pass, but haven't yet added any new tests. I think the overal design makes sense: applying positive first and then negative. This appears to be how negative pathspecs work at least as far as I could tell with a few trials. The first two patches are cleanup/fixups that I think could go separately if everyone agrees. The third is the meat of the idea, and where most of the work needs to be done. Jacob Keller (3): refspec: fix documentation referring to refspec_item refspec: make sure stack refspec_item variables are zeroed refspec: add support for negative refspecs builtin/fetch.c | 3 +++ builtin/remote.c | 1 + refspec.c | 30 +++++++++++++++++++++++++++++ refspec.h | 29 +++++++++++++++------------- remote.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++- remote.h | 9 ++++++++- transport.c | 1 + 7 files changed, 107 insertions(+), 15 deletions(-) base-commit: 878e727637ec5815ccb3301eb994a54df95b21b8 -- 2.28.0.163.g6104cc2f0b60
From: Jacob Keller <jacob.keller@gmail.com> Both fetch and push support pattern refspecs which allow fetching or pushing references that match a specific pattern. Because these patterns are globs, they have somewhat limited ability to express more complex situations. For example, suppose you wish to fetch all branches from a remote except for a specific one. To allow this, you must setup a set of refspecs which match only the branches you want. Because refspecs are either explicit name matches, or simple globs, many patterns cannot be expressed. Add support for a new type of refspec, referred to as "negative" refspecs. These are prefixed with a '^' and mean "exclude any ref matching this refspec". They can only have one "side" which always refers to the source. During a fetch, this refers to the name of the ref on the remote. During a push, this refers to the name of the ref on the local side. With negative refspecs, users can express more complex patterns. For example: git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant will fetch all branches on origin into remotes/origin, but will exclude fetching the branch named dontwant. Refspecs today are commutative, meaning that order doesn't expressly matter. Rather than forcing an implied order, negative refspecs will always be applied last. That is, in order to match, a ref must match at least one positive refspec, and match none of the negative refspecs. This is similar to how negative pathspecs work. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> --- builtin/fetch.c | 3 +++ refspec.c | 30 ++++++++++++++++++++++++++++++ refspec.h | 14 ++++++++------ remote.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- remote.h | 9 ++++++++- 5 files changed, 97 insertions(+), 8 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index c49f0e975203..930214626b54 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -530,6 +530,9 @@ static struct ref *get_ref_map(struct remote *remote, tail = &rm->next; } + /* apply any negative refspecs now to prune the list of refs */ + ref_map = apply_negative_refspecs(ref_map, rs); + ref_map = ref_remove_duplicates(ref_map); refname_hash_init(&existing_refs); diff --git a/refspec.c b/refspec.c index f10ef284cef9..feed20aca961 100644 --- a/refspec.c +++ b/refspec.c @@ -8,6 +8,7 @@ static struct refspec_item s_tag_refspec = { 1, 0, 0, + 0, "refs/tags/*", "refs/tags/*" }; @@ -32,10 +33,17 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet if (*lhs == '+') { item->force = 1; lhs++; + } else if (*lhs == '^') { + item->negative = 1; + lhs++; } rhs = strrchr(lhs, ':'); + /* negative refspecs only have one side */ + if (item->negative && rhs) + return 0; + /* * Before going on, special case ":" (or "+:") as a refspec * for pushing matching refs. @@ -66,6 +74,28 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet item->src = xstrndup(lhs, llen); flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0); + if (item->negative) { + struct object_id unused; + + /* + * Negative refspecs only have a LHS, which indicates a ref + * (or pattern of refs) to exclude from other matches. This + * can either be a simple ref, a glob pattern, or even an + * exact sha1 match. + */ + if (!*item->src) + return 0; /* negative refspecs must not be empty */ + else if (llen == the_hash_algo->hexsz && !get_oid_hex(item->src, &unused)) + item->exact_sha1 = 1; /* ok */ + else if (!check_refname_format(item->src, flags)) + ; /* valid looking ref is ok */ + else + return 0; + + /* other rules for negative refspecs don't apply */ + return 1; + } + if (fetch) { struct object_id unused; diff --git a/refspec.h b/refspec.h index 8d654e3a3ac4..e5bf6d25d0f7 100644 --- a/refspec.h +++ b/refspec.h @@ -5,12 +5,13 @@ extern const struct refspec_item *tag_refspec; /** - * A struct refspec_item holds the parsed interpretation of a refspec. If it will - * force updates (starts with a '+'), force is true. If it is a pattern - * (sides end with '*') pattern is true. src and dest are the two sides - * (including '*' characters if present); if there is only one side, it is src, - * and dst is NULL; if sides exist but are empty (i.e., the refspec either - * starts or ends with ':'), the corresponding side is "". + * A struct refspec_item holds the parsed interpretation of a refspec. If it + * will force updates (starts with a '+'), force is true. If it is a pattern + * (sides end with '*') pattern is true. If it is a negative refspec, (starts + * with '^'), negative is true. src and dest are the two sides (including '*' + * characters if present); if there is only one side, it is src, and dst is + * NULL; if sides exist but are empty (i.e., the refspec either starts or ends + * with ':'), the corresponding side is "". * * remote_find_tracking(), given a remote and a struct refspec_item with either src * or dst filled out, will fill out the other such that the result is in the @@ -22,6 +23,7 @@ struct refspec_item { unsigned pattern : 1; unsigned matching : 1; unsigned exact_sha1 : 1; + unsigned negative : 1; char *src; char *dst; diff --git a/remote.c b/remote.c index c5ed74f91c63..6a41d1028221 100644 --- a/remote.c +++ b/remote.c @@ -1058,7 +1058,7 @@ static int match_explicit(struct ref *src, struct ref *dst, const char *dst_value = rs->dst; char *dst_guess; - if (rs->pattern || rs->matching) + if (rs->pattern || rs->matching || rs->negative) return 0; matched_src = matched_dst = NULL; @@ -1134,6 +1134,10 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref, int matching_refs = -1; for (i = 0; i < rs->nr; i++) { const struct refspec_item *item = &rs->items[i]; + + if (item->negative) + continue; + if (item->matching && (matching_refs == -1 || item->force)) { matching_refs = i; @@ -1441,6 +1445,8 @@ int match_push_refs(struct ref *src, struct ref **dst, string_list_clear(&src_ref_index, 0); } + *dst = apply_negative_refspecs(*dst, rs); + if (errs) return -1; return 0; @@ -1810,6 +1816,9 @@ int get_fetch_map(const struct ref *remote_refs, { struct ref *ref_map, **rmp; + if (refspec->negative) + return 0; + if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { @@ -1853,6 +1862,44 @@ int get_fetch_map(const struct ref *remote_refs, return 0; } +static int refspec_match(const struct refspec_item *refspec, + const char *name) +{ + if (refspec->pattern) + return match_name_with_pattern(refspec->src, name, NULL, NULL); + + return !strcmp(refspec->src, name); +} + +static int omit_name_by_refspec(const char *name, struct refspec *rs) +{ + int i; + + for (i = 0; i < rs->nr; i++) { + if (rs->items[i].negative && refspec_match(&rs->items[i], name)) + return 1; + } + return 0; +} + +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs) +{ + struct ref **tail; + + for (tail = &ref_map; *tail; ) { + struct ref *ref = *tail; + + if (omit_name_by_refspec(ref->name, rs)) { + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else + tail = &ref->next; + } + + return ref_map; +} + int resolve_remote_symref(struct ref *ref, struct ref *list) { if (!ref->symref) diff --git a/remote.h b/remote.h index 5e3ea5a26deb..104e75e0f74d 100644 --- a/remote.h +++ b/remote.h @@ -193,6 +193,12 @@ int resolve_remote_symref(struct ref *ref, struct ref *list); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +/* + * Remove all entries in the input list which match any negative refspec in + * the refspec list. + */ +struct ref *apply_negative_refspecs(struct ref *ref_map, struct refspec *rs); + int query_refspecs(struct refspec *rs, struct refspec_item *query); char *apply_refspecs(struct refspec *rs, const char *name); @@ -205,7 +211,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, /* * Given a list of the remote refs and the specification of things to * fetch, makes a (separate) list of the refs to fetch and the local - * refs to store into. + * refs to store into. Note that negative refspecs are ignored here, and + * should be handled separately. * * *tail is the pointer to the tail pointer of the list of results * beforehand, and will be set to the tail pointer of the list of -- 2.28.0.163.g6104cc2f0b60
On Wed, Aug 12, 2020 at 03:04:09PM -0700, Jacob Keller wrote: > I dug up the patch and have applied it to master. One concern I have > is how do we tell what side the negative refspec applies to? It seems > like we'd need to be able to distinguish whether it applies to the > refname on the remote, or the refname on the local branch. The patch > as-is assumes that negative refspecs only ever have "src".. I guess > for fetch that means the name of the ref on the remote, and for push > that means the name of the ref on the local end? Yeah, unlike a normal refspec that can have both a src and dst, there really is only one "side" to a negative refspec, because it is not going anywhere. So selecting by src makes the most sense to me. We could also allow selecting by dst, like: git fetch origin refs/heads/*:refs/remotes/origin/* \ ^refs/heads/foo \ (1) omit remote foo branch; implies src ^refs/heads/bar: \ (2) omit remote bar branch by explicit src ^:refs/remotes/origin/baz (3) omit remote baz branch by explicit dst I probably wouldn't bother with (2) or (3) unless somebody really wants them. We can do (1) now and then extend later without loss of compatibility. Another thing to think about is how to handle overlap. E.g., in: ^refs/heads/foo refs/heads/*:refs/remotes/origin/* should: 1. The first take precedence over the second because we apply positive, then negative? 2. Or should it be first over second because the first is specific and the second is a wildcard? 3. Or should it be second over first because later refspecs override earlier? I don't have a real preference, and I think there are many self-consistent schemes you could come up with. But it probably makes sense to think it through so that we don't get stuck supporting a half-baked behavior later. > I was trying to modify the patch to add support to the push code flows > so that it was more complete and could be submitted. I'll be sending > what I have as an RFC soon. Sounds good. Thanks for picking this up! -Peff
On Tue, Aug 4, 2020 at 11:37 PM Jeff King <peff@peff.net> wrote:
>
> On Tue, Aug 04, 2020 at 02:53:30PM -0700, Jacob Keller wrote:
>
> > This results in the annoying completion behavior where:
> >
> > $git checkout ma<TAB>
> > main
> > master
> >
> > Essentially, because both main and master have similar names, tab
> > completion requires remembering to type one additional character than
> > I am used to.
>
> Heh, I didn't think anybody considered that implication so far; the fact
> that they were similar names has generally been considered a positive. I
> agree it would be annoying.
>
> > I'd like to be able to customize my pull so that I either (a) exclude
> > the reference when performing a fetch, or (b) exclude the reference
> > when tab completing.
>
> Not quite (b), but if you:
>
> - delete any local "master" branch, if you haven't already
>
> - set $GIT_COMPLETION_CHECKOUT_NO_GUESS to "1"
>
> then it shouldn't complete "master". The second is necessary because
> we'd try to complete the magic "git checkout master" that auto-creates
> the branch from the remote version.
>
> > something like adding a remote.<name>.excludeRefs which would allow
> > specifying a set of references to exclude from matching the refspec..
> >
> > I realize I could customize the refspec to list the set of things I
> > want, but then I would miss any potential future branches until I
> > updated my remote config again.
>
> This is definitely a reasonable thing to want, and it has come up off
> and on over the years. One search term for the list archive is "negative
> refspecs", though it turns up a lot of useless hits when the two words
> are not directly adjacent.
>
> This old thread might be worth reading:
>
> https://lore.kernel.org/git/20140124090104.GA396@x4/
>
> and there is even a patch in there:
>
> https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/
>
> but I didn't go over it carefully enough to know whether it is utter
> trash, or something that could be used as a starting point.
>
> -Peff
I dug up the patch and have applied it to master. One concern I have
is how do we tell what side the negative refspec applies to? It seems
like we'd need to be able to distinguish whether it applies to the
refname on the remote, or the refname on the local branch. The patch
as-is assumes that negative refspecs only ever have "src".. I guess
for fetch that means the name of the ref on the remote, and for push
that means the name of the ref on the local end?
I was trying to modify the patch to add support to the push code flows
so that it was more complete and could be submitted. I'll be sending
what I have as an RFC soon.
Thanks,
Jake
Philippe Blain <levraiphilippeblain@gmail.com> wrote: > > Le 5 août 2020 à 02:37, Jeff King <peff@peff.net> a écrit : > > This is definitely a reasonable thing to want, and it has come up off > > and on over the years. One search term for the list archive is "negative > > refspecs", though it turns up a lot of useless hits when the two words > > are not directly adjacent. > > I tried searching "negative refspecs" (*with* the double quotes) and I get 20 results so it > seems to work. Although interestingly it doesn't find this message you wrote I'm responding to > because "negative" and "refspec" are on separate lines... I'm CC-ing Eric in case he knows more > about this limitation. Initially I thought it was phrase searching being disabled on lore (Xapian 1.2, "chert" backend). However, I just tried on lore and it shows Jeff's message from 2020-08-05 6:37 UTC: https://lore.kernel.org/git/?q=%22negative+refspecs%22 So maybe it was a delay due to Xapian's MVCC mechanism; but that shouldn't be HOURS off (maybe minutes at most), assuming you tried to search shortly before you sent the message I'm replying to at 22:12 UTC... My v1 instance at public-inbox.org (which uses Xapian 1.4 and the "glass" backend) shows it, too: https://public-inbox.org/git/?q=%22negative+refspecs%22 You could also try NEAR and ADJ (I don't have much experience with those): https://xapian.org/docs/queryparser.html
Hi Peff,
> Le 5 août 2020 à 02:37, Jeff King <peff@peff.net> a écrit :
>
> On Tue, Aug 04, 2020 at 02:53:30PM -0700, Jacob Keller wrote:
>
>> something like adding a remote.<name>.excludeRefs which would allow
>> specifying a set of references to exclude from matching the refspec..
>>
>> I realize I could customize the refspec to list the set of things I
>> want, but then I would miss any potential future branches until I
>> updated my remote config again.
>
> This is definitely a reasonable thing to want, and it has come up off
> and on over the years. One search term for the list archive is "negative
> refspecs", though it turns up a lot of useless hits when the two words
> are not directly adjacent.
I tried searching "negative refspecs" (*with* the double quotes) and I get 20 results so it
seems to work. Although interestingly it doesn't find this message you wrote I'm responding to
because "negative" and "refspec" are on separate lines... I'm CC-ing Eric in case he knows more
about this limitation.
Philippe.
On Wed, Aug 5, 2020 at 9:22 AM Junio C Hamano <gitster@pobox.com> wrote: > > Jeff King <peff@peff.net> writes: > > >> Essentially, because both main and master have similar names, tab > >> completion requires remembering to type one additional character than > >> I am used to. > > > > Heh, I didn't think anybody considered that implication so far; the fact > > that they were similar names has generally been considered a positive. I > > agree it would be annoying. > > FWIW, I've been saying that 'maint' will become harder to type all > along ever since I heard 'main'. > > https://lore.kernel.org/git/xmqqtuz9tq30.fsf@gitster.c.googlers.com/ > Right. I'm generally for the name change, and I like having the remote honor the old name as a compatibility at least for some duration. > > This is definitely a reasonable thing to want, and it has come up off > > and on over the years. One search term for the list archive is "negative > > refspecs", though it turns up a lot of useless hits when the two words > > are not directly adjacent. > > > > This old thread might be worth reading: > > > > https://lore.kernel.org/git/20140124090104.GA396@x4/ > > > > and there is even a patch in there: > > > > https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/ > > > > but I didn't go over it carefully enough to know whether it is utter > > trash, or something that could be used as a starting point. > > I think the idea is interesting. I sometimes find negative > pathspecs quite useful, and I suspect negative refspecs would also > be. I've found negative pathspecs incredibly useful in some contexts, (with my only issue being to remember that if you specify a negative pathspec, you must also specify a positive one i.e. "." or something) I think I'll try to revive that one patch Peff pointed out and then see if it makes sense or needs to be redone.
On Tue, Aug 4, 2020 at 11:37 PM Jeff King <peff@peff.net> wrote: > > On Tue, Aug 04, 2020 at 02:53:30PM -0700, Jacob Keller wrote: > > > This results in the annoying completion behavior where: > > > > $git checkout ma<TAB> > > main > > master > > > > Essentially, because both main and master have similar names, tab > > completion requires remembering to type one additional character than > > I am used to. > > Heh, I didn't think anybody considered that implication so far; the fact > that they were similar names has generally been considered a positive. I > agree it would be annoying. > > > I'd like to be able to customize my pull so that I either (a) exclude > > the reference when performing a fetch, or (b) exclude the reference > > when tab completing. > > Not quite (b), but if you: > > - delete any local "master" branch, if you haven't already > > - set $GIT_COMPLETION_CHECKOUT_NO_GUESS to "1" > > then it shouldn't complete "master". The second is necessary because > we'd try to complete the magic "git checkout master" that auto-creates > the branch from the remote version. > I don't like this approach because I like having the guessing options available in most repositories. > > something like adding a remote.<name>.excludeRefs which would allow > > specifying a set of references to exclude from matching the refspec.. > > > > I realize I could customize the refspec to list the set of things I > > want, but then I would miss any potential future branches until I > > updated my remote config again. > > This is definitely a reasonable thing to want, and it has come up off > and on over the years. One search term for the list archive is "negative > refspecs", though it turns up a lot of useless hits when the two words > are not directly adjacent. > > This old thread might be worth reading: > > https://lore.kernel.org/git/20140124090104.GA396@x4/ > > and there is even a patch in there: > > https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/ > > but I didn't go over it carefully enough to know whether it is utter > trash, or something that could be used as a starting point. > Thanks, it looks like this is at least sensible. > -Peff
Jeff King <peff@peff.net> writes: >> Essentially, because both main and master have similar names, tab >> completion requires remembering to type one additional character than >> I am used to. > > Heh, I didn't think anybody considered that implication so far; the fact > that they were similar names has generally been considered a positive. I > agree it would be annoying. FWIW, I've been saying that 'maint' will become harder to type all along ever since I heard 'main'. https://lore.kernel.org/git/xmqqtuz9tq30.fsf@gitster.c.googlers.com/ > This is definitely a reasonable thing to want, and it has come up off > and on over the years. One search term for the list archive is "negative > refspecs", though it turns up a lot of useless hits when the two words > are not directly adjacent. > > This old thread might be worth reading: > > https://lore.kernel.org/git/20140124090104.GA396@x4/ > > and there is even a patch in there: > > https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/ > > but I didn't go over it carefully enough to know whether it is utter > trash, or something that could be used as a starting point. I think the idea is interesting. I sometimes find negative pathspecs quite useful, and I suspect negative refspecs would also be.
On Tue, Aug 04, 2020 at 02:53:30PM -0700, Jacob Keller wrote: > This results in the annoying completion behavior where: > > $git checkout ma<TAB> > main > master > > Essentially, because both main and master have similar names, tab > completion requires remembering to type one additional character than > I am used to. Heh, I didn't think anybody considered that implication so far; the fact that they were similar names has generally been considered a positive. I agree it would be annoying. > I'd like to be able to customize my pull so that I either (a) exclude > the reference when performing a fetch, or (b) exclude the reference > when tab completing. Not quite (b), but if you: - delete any local "master" branch, if you haven't already - set $GIT_COMPLETION_CHECKOUT_NO_GUESS to "1" then it shouldn't complete "master". The second is necessary because we'd try to complete the magic "git checkout master" that auto-creates the branch from the remote version. > something like adding a remote.<name>.excludeRefs which would allow > specifying a set of references to exclude from matching the refspec.. > > I realize I could customize the refspec to list the set of things I > want, but then I would miss any potential future branches until I > updated my remote config again. This is definitely a reasonable thing to want, and it has come up off and on over the years. One search term for the list archive is "negative refspecs", though it turns up a lot of useless hits when the two words are not directly adjacent. This old thread might be worth reading: https://lore.kernel.org/git/20140124090104.GA396@x4/ and there is even a patch in there: https://lore.kernel.org/git/20140125013433.GA22336@sigill.intra.peff.net/ but I didn't go over it carefully enough to know whether it is utter trash, or something that could be used as a starting point. -Peff
On Mon, Oct 21, 2019 at 11:48:40AM +0900, Junio C Hamano wrote: > > +`git clone` can use any bundle created without negative refspecs > > +(e.g., `new`, but not `old..new`). > > To be consistent with the phrasing of this particular document we > saw earlier, you would have said "without basis", but I think the > use of `basis` did not spread beyond "git bundle" documentation. > > If we were writing "git bundle" and its documentation from scratch > using more modern lingo, we probably would say "negative revisions" > here. Note that the word `refspec` has no place in the context of > this sentence; they are to specify the mapping of refs between the > repository in which transferred objects originate and the repository > that accept the objects. Also note that `basis` discussed in 'git > bundle' is a bit wider concept than `negative revisions`, so mere > mechanical replacements would not be sufficient as a preliminary > modernization/prepation step for this patch. Sorry, this one is my fault. I said "negative revisions" in my earlier mail[1], but somehow while writing example text my brain turned into "refspecs", which is obviously nonsense. It should be "revisions". I don't mind using "basis" either; it's not commonly used outside of this page, but I think it does succinctly represent what we're trying to say here. [1] https://public-inbox.org/git/20191016210957.GA28981@sigill.intra.peff.net/ > > +If you want to match `git clone --mirror`, which would include your > > +refs such as `refs/remotes/*`, use `--all`. > > +If you want to provide the same set of refs that a clone directly > > +from the source repository would get, use `--branches --tags` for > > +the `<git-rev-list-args>`. > > This is not wrong per-se, but may lead to confusion. The readers > must be able to learn: > > - "git clone --mirror full.bndl dst/" from a full bundle created > with "git bundle create full.bndl --all" can mimic creation of a > full mirror of the original. > > - "git clone full.bndl dst/" from such a bundle does *not* result > in creation of a mirror. > > - "git clone slim.bndl dst/" from a minimum bundle created wth "git > bundle create slim.bndl --branches --tags" would be sufficient to > obtain the same result as the above. > > - "git clone --mirror slim.bndl dst/" from such a minimum bundle > cannot mimic creation of a full mirror of the original. > > I am not sure the second point is conveyed well with the new > paragraph. That is, "--all" must be used if the resulting bundle is > meant to be usable to "--mirror" clone from, but it can still be > used to clone normally. If you do not intend to mirror-clone from, > there is not much point in using "--all" to record extra refs. I hoped maybe it would be obvious how the second and fourth cases would behave, but maybe it is better to spell it out. Maybe it would be better to talk about what the sender does, and then what the receiver can do with the result. Something like: If you create a bundle using `--all` for `<git-rev-list-args>`, a recipient can clone the result using `git clone` or `git clone --mirror` and get the same result they would by cloning directly from the source repository. If you instead create it with `--branches --tags`, the resulting bundle may be smaller, and a non-mirror clone will behave the same (but a `clone --mirror` will obviously not receive any refs outside of the branches and tags). That could probably be tightened up a bit. -Peff
Philip Oakley <philipoakley@iee.email> writes: > @@ -20,11 +20,14 @@ DESCRIPTION > Some workflows require that one or more branches of development on one > machine be replicated on another machine, but the two machines cannot > be directly connected, and therefore the interactive Git protocols (git, > +ssh, http) cannot be used. > + > +The 'git bundle' command packages objects and references in an archive > +at the originating machine, which can then be imported into another > +repository using 'git fetch', 'git pull', or 'git clone', > +after moving the archive by some means (e.g., by sneakernet). > + > +As no > direct connection between the repositories exists, the user must specify a > basis for the bundle that is held by the destination repository: the > bundle assumes that all objects in the basis are already in the Notice that we use the term `basis` here. It is referring to the bottom end(s) of the commit graph. > +`git clone` can use any bundle created without negative refspecs > +(e.g., `new`, but not `old..new`). To be consistent with the phrasing of this particular document we saw earlier, you would have said "without basis", but I think the use of `basis` did not spread beyond "git bundle" documentation. If we were writing "git bundle" and its documentation from scratch using more modern lingo, we probably would say "negative revisions" here. Note that the word `refspec` has no place in the context of this sentence; they are to specify the mapping of refs between the repository in which transferred objects originate and the repository that accept the objects. Also note that `basis` discussed in 'git bundle' is a bit wider concept than `negative revisions`, so mere mechanical replacements would not be sufficient as a preliminary modernization/prepation step for this patch. > +If you want to match `git clone --mirror`, which would include your > +refs such as `refs/remotes/*`, use `--all`. > +If you want to provide the same set of refs that a clone directly > +from the source repository would get, use `--branches --tags` for > +the `<git-rev-list-args>`. This is not wrong per-se, but may lead to confusion. The readers must be able to learn: - "git clone --mirror full.bndl dst/" from a full bundle created with "git bundle create full.bndl --all" can mimic creation of a full mirror of the original. - "git clone full.bndl dst/" from such a bundle does *not* result in creation of a mirror. - "git clone slim.bndl dst/" from a minimum bundle created wth "git bundle create slim.bndl --branches --tags" would be sufficient to obtain the same result as the above. - "git clone --mirror slim.bndl dst/" from such a minimum bundle cannot mimic creation of a full mirror of the original. I am not sure the second point is conveyed well with the new paragraph. That is, "--all" must be used if the resulting bundle is meant to be usable to "--mirror" clone from, but it can still be used to clone normally. If you do not intend to mirror-clone from, there is not much point in using "--all" to record extra refs. Not having the new paragraph does not convey anything at all, so it definitely is an improvement, though ;-) Thanks.
Improve the command description, including paragraph spacing. Git URLs can accept bundle files for fetch, pull and clone, include in that section. Include git clone in the bundle usage description. Correct the quoting of <git-rev-list-args>. Detail the <git-rev-list-args> options for cloning a complete repo. Signed-off-by: Philip Oakley <philipoakley@iee.email> --- The new paragraph uses the more modern back-ticks while elsewhere the quote style is matched locally. I finally chose the `would include your refs ..` to clarify the --mirror option. --- Documentation/git-bundle.txt | 23 +++++++++++++++++------ Documentation/urls.txt | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 7d6c9dcd17..545940022b 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -20,11 +20,14 @@ DESCRIPTION Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive Git protocols (git, -ssh, http) cannot be used. This command provides support for -'git fetch' and 'git pull' to operate by packaging objects and references -in an archive at the originating machine, then importing those into -another repository using 'git fetch' and 'git pull' -after moving the archive by some means (e.g., by sneakernet). As no +ssh, http) cannot be used. + +The 'git bundle' command packages objects and references in an archive +at the originating machine, which can then be imported into another +repository using 'git fetch', 'git pull', or 'git clone', +after moving the archive by some means (e.g., by sneakernet). + +As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the @@ -35,7 +38,7 @@ OPTIONS create <file>:: Used to create a bundle named 'file'. This requires the - 'git-rev-list-args' arguments to define the bundle contents. + '<git-rev-list-args>' arguments to define the bundle contents. verify <file>:: Used to check that a bundle file is valid and will apply @@ -92,6 +95,14 @@ It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. +`git clone` can use any bundle created without negative refspecs +(e.g., `new`, but not `old..new`). +If you want to match `git clone --mirror`, which would include your +refs such as `refs/remotes/*`, use `--all`. +If you want to provide the same set of refs that a clone directly +from the source repository would get, use `--branches --tags` for +the `<git-rev-list-args>`. + EXAMPLES -------- diff --git a/Documentation/urls.txt b/Documentation/urls.txt index bc354fe2dc..1c229d7581 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies --local option. endif::git-clone[] +'git clone', 'git fetch' and 'git pull', but not 'git push', will also +accept a suitable bundle file. See linkgit:git-bundle[1]. + When Git doesn't know how to handle a certain transport protocol, it attempts to use the 'remote-<transport>' remote helper, if one exists. To explicitly request a remote helper, the following syntax -- 2.23.0.windows.1.21.g947f504ebe8.dirty
On 20/10/2019 02:10, Jeff King wrote:
> On Fri, Oct 18, 2019 at 09:30:52PM +0100, Philip Oakley wrote:
>
>> +`git clone` can use any bundle created without negative refspecs
>> +(e.g., `new`, but not `old..new`).
>> +If you want to match `git clone --mirror`, which would clone other
>> +refs such as `refs/remotes/*`, use `--all`.
>> +If you want to provide the same set of refs that a clone directly
>> +from the source repository would get, use `--branches --tags` for
>> +the `<git-rev-list-args>`.
> Since you swapped the order here of "--mirror" versus non-mirror, saying
> "other refs such as..." in the first part is confusing. We haven't
> introduced the thing they're "other" from.
>
> Maybe say "clone all refs (including ones which would be omitted by a
> non-mirror clone, like refs/remotes/*)" or something?
>
> Other than that, this version looks OK to me.
>
I had deliberately swapped the order because of the classic human
fallibility of only remembering the beginning and end parts, so I'd
buried' the --mirror/--all option, leaving that important bit to the end.
I'll probably simply just drop the word "other" (or maybe "include cloning")
Philip
On Fri, Oct 18, 2019 at 09:30:52PM +0100, Philip Oakley wrote:
> +`git clone` can use any bundle created without negative refspecs
> +(e.g., `new`, but not `old..new`).
> +If you want to match `git clone --mirror`, which would clone other
> +refs such as `refs/remotes/*`, use `--all`.
> +If you want to provide the same set of refs that a clone directly
> +from the source repository would get, use `--branches --tags` for
> +the `<git-rev-list-args>`.
Since you swapped the order here of "--mirror" versus non-mirror, saying
"other refs such as..." in the first part is confusing. We haven't
introduced the thing they're "other" from.
Maybe say "clone all refs (including ones which would be omitted by a
non-mirror clone, like refs/remotes/*)" or something?
Other than that, this version looks OK to me.
-Peff
Improve the command description, including paragraph spacing. Git URLs can accept bundle files for fetch, pull and clone, include in that section. Include git clone in the bundle usage description. Correct the quoting of <git-rev-list-args>. Detail the <git-rev-list-args> options for cloning a complete repo. Signed-off-by: Philip Oakley <philipoakley@iee.email> --- The new paragraph uses the more modern back-ticks while elsewhere the quote style is matched locally. Author email address corrected. Thanks to Pratyush for the reminder. --- Documentation/git-bundle.txt | 23 +++++++++++++++++------ Documentation/urls.txt | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 7d6c9dcd17..a441a13d58 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -20,11 +20,14 @@ DESCRIPTION Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive Git protocols (git, -ssh, http) cannot be used. This command provides support for -'git fetch' and 'git pull' to operate by packaging objects and references -in an archive at the originating machine, then importing those into -another repository using 'git fetch' and 'git pull' -after moving the archive by some means (e.g., by sneakernet). As no +ssh, http) cannot be used. + +The 'git bundle' command packages objects and references in an archive +at the originating machine, which can then be imported into another +repository using 'git fetch', 'git pull', or 'git clone', +after moving the archive by some means (e.g., by sneakernet). + +As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the @@ -35,7 +38,7 @@ OPTIONS create <file>:: Used to create a bundle named 'file'. This requires the - 'git-rev-list-args' arguments to define the bundle contents. + '<git-rev-list-args>' arguments to define the bundle contents. verify <file>:: Used to check that a bundle file is valid and will apply @@ -92,6 +95,14 @@ It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. +`git clone` can use any bundle created without negative refspecs +(e.g., `new`, but not `old..new`). +If you want to match `git clone --mirror`, which would clone other +refs such as `refs/remotes/*`, use `--all`. +If you want to provide the same set of refs that a clone directly +from the source repository would get, use `--branches --tags` for +the `<git-rev-list-args>`. + EXAMPLES -------- diff --git a/Documentation/urls.txt b/Documentation/urls.txt index bc354fe2dc..1c229d7581 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies --local option. endif::git-clone[] +'git clone', 'git fetch' and 'git pull', but not 'git push', will also +accept a suitable bundle file. See linkgit:git-bundle[1]. + When Git doesn't know how to handle a certain transport protocol, it attempts to use the 'remote-<transport>' remote helper, if one exists. To explicitly request a remote helper, the following syntax -- 2.23.0.windows.1.21.g947f504ebe8.dirty
From: Philip Oakley <philipoakley@iee.org> Improve the command description, including paragraph spacing. Git URLs can accept bundle files for fetch, pull and clone, include in that section. Include git clone in the bundle usage description. Correct the quoting of <git-rev-list-args>. Detail the <git-rev-list-args> options for cloning a complete repo. Signed-off-by: Philip Oakley <philipoakley@iee.email> --- The new paragraph uses the more modern back-ticks while elsewhere the quote style is matched locally. Includes peff's suggestions. --- Documentation/git-bundle.txt | 23 +++++++++++++++++------ Documentation/urls.txt | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 7d6c9dcd17..a441a13d58 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -20,11 +20,14 @@ DESCRIPTION Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive Git protocols (git, -ssh, http) cannot be used. This command provides support for -'git fetch' and 'git pull' to operate by packaging objects and references -in an archive at the originating machine, then importing those into -another repository using 'git fetch' and 'git pull' -after moving the archive by some means (e.g., by sneakernet). As no +ssh, http) cannot be used. + +The 'git bundle' command packages objects and references in an archive +at the originating machine, which can then be imported into another +repository using 'git fetch', 'git pull', or 'git clone', +after moving the archive by some means (e.g., by sneakernet). + +As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the @@ -35,7 +38,7 @@ OPTIONS create <file>:: Used to create a bundle named 'file'. This requires the - 'git-rev-list-args' arguments to define the bundle contents. + '<git-rev-list-args>' arguments to define the bundle contents. verify <file>:: Used to check that a bundle file is valid and will apply @@ -92,6 +95,14 @@ It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination. +`git clone` can use any bundle created without negative refspecs +(e.g., `new`, but not `old..new`). +If you want to match `git clone --mirror`, which would clone other +refs such as `refs/remotes/*`, use `--all`. +If you want to provide the same set of refs that a clone directly +from the source repository would get, use `--branches --tags` for +the `<git-rev-list-args>`. + EXAMPLES -------- diff --git a/Documentation/urls.txt b/Documentation/urls.txt index bc354fe2dc..1c229d7581 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies --local option. endif::git-clone[] +'git clone', 'git fetch' and 'git pull', but not 'git push', will also +accept a suitable bundle file. See linkgit:git-bundle[1]. + When Git doesn't know how to handle a certain transport protocol, it attempts to use the 'remote-<transport>' remote helper, if one exists. To explicitly request a remote helper, the following syntax -- 2.23.0.windows.1.21.g947f504ebe8.dirty
On Wed, Oct 16, 2019 at 10:57:37AM +0100, Philip Oakley wrote: > From: Philip Oakley <philipoakley@iee.org> > > Git URLs can accept bundle files for fetch, pull and clone, include > in that section. Include git clone in the bundle usage description. > Correct the quoting of <git-rev-list-args>. > Detail the <git-rev-list-args> options for cloning a complete repo. Thanks for picking this up again. :) A few minor comments: > diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt > index 7d6c9dcd17..0498e4895d 100644 > --- a/Documentation/git-bundle.txt > +++ b/Documentation/git-bundle.txt > @@ -21,9 +21,9 @@ Some workflows require that one or more branches of development on one > machine be replicated on another machine, but the two machines cannot > be directly connected, and therefore the interactive Git protocols (git, > ssh, http) cannot be used. This command provides support for > -'git fetch' and 'git pull' to operate by packaging objects and references > +'git fetch' and 'git pull' and 'git clone', to operate by packaging objects and references Maybe: 'git fetch', 'git pull', and 'git clone' ? Given the repetition below, though: > in an archive at the originating machine, then importing those into > -another repository using 'git fetch' and 'git pull' > +another repository using 'git fetch' and 'git pull' or 'git clone', I wonder if we could rephrase this in a less awkward way. Perhaps: The 'git bundle' command packages objects and references in an archive at the originating machine, which can then be imported into another repository using 'git fetch', 'git pull', or 'git clone'. > @@ -35,7 +35,7 @@ OPTIONS > > create <file>:: > Used to create a bundle named 'file'. This requires the > - 'git-rev-list-args' arguments to define the bundle contents. > + '<git-rev-list-args>' arguments to define the bundle contents. This hunk makes sense. I'd probably use backticks here instead of single-quotes, but I think we're pretty inconsistent across the documentation about this. It probably makes sense to match the existing text. > @@ -92,6 +92,10 @@ It is okay to err on the side of caution, causing the bundle file > to contain objects already in the destination, as these are ignored > when unpacking at the destination. > > +To create a bundle for 'git clone', use `--branches --tags` for > +the <git-rev-list-args>. The (inappropriate) use of `--all` would include > +refs from refs/remotes/* hierarchy in the resulting bundle. Should <git-rev-list-args> be in quotes or backticks? Any bundle created without a negative revision would be appropriate for a clone. Maybe we could spell that out in more detail, like: Any bundle created without negative refspecs (e.g., `new` but not `old..new`) can be used on the receiving side with `git clone`. If you want to provide the same set of refs that a clone directly from the source repository would get, use `--branches --tags`. If you want to match `git clone --mirror`, which would clone other refs such as `refs/remotes/*`, use `--all`. > diff --git a/Documentation/urls.txt b/Documentation/urls.txt > index bc354fe2dc..1c229d7581 100644 > --- a/Documentation/urls.txt > +++ b/Documentation/urls.txt > @@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies > --local option. > endif::git-clone[] > > +'git clone', 'git fetch' and 'git pull', but not 'git push', will also > +accept a suitable bundle file. See linkgit:git-bundle[1]. This makes sense to mention here. It's a little funny because the user would see this included in "man git-clone" or whatever, but I don't think it hurts to just be exhaustive rather than trying to tailor it to each individual manpage. -Peff
This Saturday I'm going to be attending a Git hackday held by Bloomberg in New York. The participants will be eager C coders who have experience using git, but not contributing to it. As somebody who has read The Mythical Man Month, I don't expect huge productivity, but I'm hoping to do some bug triage and fixes, and maybe get some people involved who might join the community. I'm hoping some of the folks will have features _they_ want to work on, and I can help get them started. But I'd like to have a list of potential projects to direct people towards as a backup. On a similar note, the GSoC application deadline is Feb 14th. I am happy to be admin again and put together the application, but we will need an idea page. I'll set up a page to collect them, but in the meantime, please dump any ideas/discussion in this thread. Below is a list of features / bugs that I am taking to the hackday. The bug list was collected by grepping the mailing list for items without responses. They haven't been triaged at all, so I'm sure some of them are "not a bug" or "won't fix". But the triage process is part of what we'll be doing on Saturday. I don't think the list below and the potential GSoC list really have any overlap, as the project scales are completely different. But I'd be happy to take suggestions for either. --- features: - negative refspecs http://thread.gmane.org/gmane.comp.version-control.git/240997/focus=241019 - optionally remove tempfiles on failed pack-objects (especially when we get ENOSPC) http://article.gmane.org/gmane.comp.version-control.git/241466 - previewing "git pull" http://article.gmane.org/gmane.comp.version-control.git/236732 bugs: - branch.*.merge interpreted too strictly by tracking logic http://article.gmane.org/gmane.comp.version-control.git/241582 - relative core.worktree is resolved from symlink and not its target http://article.gmane.org/gmane.comp.version-control.git/241519 - Branch rename breaks local downstream branches http://article.gmane.org/gmane.comp.version-control.git/241228 - git clone on out-of-space device causes incorrect errors http://article.gmane.org/gmane.comp.version-control.git/241206 - commit-msg hook and merges http://article.gmane.org/gmane.comp.version-control.git/241203 - inconsistent include behaviour for core.sharedRepository http://article.gmane.org/gmane.comp.version-control.git/241277 - Rebase options '--whitespace=fix' and '--keep-empty' are incompatible http://article.gmane.org/gmane.comp.version-control.git/238055 - git stash doesn't use --index as default http://article.gmane.org/gmane.comp.version-control.git/235892 - git describe --contains --abbrev=0 <sha1> doesn't work as expected http://article.gmane.org/gmane.comp.version-control.git/236707 - using git commit-tree with "-F -" adds trailing newlines http://article.gmane.org/gmane.comp.version-control.git/236583 - Pull and fetch don't honor `--progress` flag http://thread.gmane.org/gmane.comp.version-control.git/236257/focus=236262 - Unexpected outputs of git pull on stdout v.s. stderr http://article.gmane.org/gmane.comp.version-control.git/235716 - MERGE_HEAD lost with git checkout master http://article.gmane.org/gmane.comp.version-control.git/233806 - git stash doesn't always save work dir as-is: bug? http://article.gmane.org/gmane.comp.version-control.git/234153 - Well-past commit dates unsupported http://article.gmane.org/gmane.comp.version-control.git/236827 - we do not handle integer overflow in commit/author timestamps [no reference, but something I have noticed; we should probably return a sentinel "0" rather than a random overflow value, and we should probably detect and warn in git-fsck] - git stash does not work when directory is replaced by a symlink to itself http://article.gmane.org/gmane.comp.version-control.git/236798 - rebase not recovering gracefully from repack error http://article.gmane.org/gmane.comp.version-control.git/234261 - (broken ?) output of "git diff --color-word" http://article.gmane.org/gmane.comp.version-control.git/237370 - git filter-branch does not make tree replacements permanent http://article.gmane.org/gmane.comp.version-control.git/220931 - 'git show' gives duplicate errors for ambiguous args http://article.gmane.org/gmane.comp.version-control.git/205023 - (git commit --patch --message $MESSAGE) disallows hunk editing http://article.gmane.org/gmane.comp.version-control.git/208213 - filter-branch --parent-filter in bare repository http://article.gmane.org/gmane.comp.version-control.git/203619 insanely hard bugs: - shallow clones over http http://article.gmane.org/gmane.comp.version-control.git/223682
On Fri, Jan 24, 2014 at 01:08:42PM -0800, Junio C Hamano wrote: > Not really. You do not have to view it as "'not refs/heads/foo' is > affecting the previous '+refs/heads/*:refs/remotes/origin/*'". > > You can think of two refspecs "refs/heads/foo refs/heads/bar" are > both affecting the "end result"; so far we only had a single way for > multiple refspecs to affect the end result and that was a "union". > Introducing "subtract" as another mode of combining is not too bad, > I would think, at the conceptual level. OK, I buy that line of reasoning. I assume that ordering should not matter (that is, we would apply all positive refspecs, and then subtract all negative refspecs). I took a quick look at the refspec code, and how bad it would be to implement this feature. It's rather a bit of a mess. It looks like there are three separate code paths to apply refspecs: - fetch uses get_ref_map, which calls get_fetch_map for each refspec; each refspec than expands into 0, 1, or multiple refs (if it's a pattern). You can mention a ref multiple times on the LHS of a refspec, and it may be fetched multiple times. After we have the whole list, we detect duplicate destinations, and either drop the duplicates (if all sources are the same) or complain (if there are different sources). - push uses match_push_refs, which calls get_ref_match for each ref (not refspec). So the loop is inside-out from fetch, and it looks like we do weird things with multiple matches. We seem to handle multiple explicit matches like: $ git push --dry-run tmp master:foo master:bar To tmp * [new branch] master -> foo * [new branch] master -> bar but we don't seem to do the same for pattern matches: $ git push --dry-run tmp refs/heads/*:refs/foo/* \ refs/heads/*:refs/bar/* To tmp * [new branch] master -> refs/foo/master we just take the first match, even though the two did not conflict. I doubt this comes up that much, but I do not see any reason this should not be doing the same as fetch: apply all refspecs to come up with a complete list, then cull duplicates. - @{upstream} uses apply_refspecs to convert a single name. This is also used by transport-helper's fetch_with_import and push_with_import. Which makes me think they do not handle overlapping refspecs at all, unlike the builtin counterparts. There is also query_refspecs, which underlies apply_refspecs. I'm not even sure I understand all of the uses there. The patch below implements negative refspecs for fetch, but does nothing for push and apply_refspecs (in fact, it probably makes them worse, because they've learned to parse negative refspecs, but not handle them properly). The helpers in the patch could probably be used to build support for the other code paths, but it really seems like there could stand to be some refactoring. I'm not sure if I have the time/stomach for it at the moment. But I'll post this here anyway in case somebody else is interested. > I tend to agree that "refs/heads/foo:" is being too cute and may be > confusing, at least if it will be the only way to express this in > the end-user-facing UI. Even some people were confused enough on a > very sensible "push nothing to ref means deletion" to make us add > another explicit way, "push --delete", to ask for the same thing. Agreed. I went with "^refs/heads/master" in the patch below, but I am open to other suggestions. --- diff --git a/builtin/fetch.c b/builtin/fetch.c index 025bc3e..47f25e9 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -363,6 +363,8 @@ static struct ref *get_ref_map(struct transport *transport, tail = &rm->next; } + ref_map = apply_negative_refspecs(ref_map, refspecs, refspec_count); + return ref_remove_duplicates(ref_map); } diff --git a/remote.c b/remote.c index a89efab..b7b20de 100644 --- a/remote.c +++ b/remote.c @@ -16,6 +16,7 @@ static struct refspec s_tag_refspec = { 1, 0, 0, + 0, "refs/tags/*", "refs/tags/*" }; @@ -533,8 +534,14 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp rs[i].force = 1; lhs++; } + else if (*lhs == '^') { + rs[i].negative = 1; + lhs++; + } rhs = strrchr(lhs, ':'); + if (rs[i].negative && rhs) + goto invalid; /* * Before going on, special case ":" (or "+:") as a refspec @@ -1663,6 +1670,9 @@ int get_fetch_map(const struct ref *remote_refs, { struct ref *ref_map, **rmp; + if (refspec->negative) + return 0; + if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); } else { @@ -1705,6 +1715,48 @@ int get_fetch_map(const struct ref *remote_refs, return 0; } +static int refspec_match(const struct refspec *refspec, + const char *name) +{ + if (refspec->pattern) + return match_name_with_pattern(refspec->src, name, NULL, NULL); + + return !strcmp(refspec->src, name); +} + +static int omit_name_by_refspec(const char *name, + const struct refspec *refspecs, + int nr_refspec) +{ + int i; + + for (i = 0; i < nr_refspec; i++) { + if (refspecs[i].negative && refspec_match(&refspecs[i], name)) + return 1; + } + return 0; +} + +struct ref *apply_negative_refspecs(struct ref *ref_map, + const struct refspec *refspecs, + int nr_refspec) +{ + struct ref **tail; + + for (tail = &ref_map; *tail; ) { + struct ref *ref = *tail; + + if (omit_name_by_refspec(ref->name, refspecs, nr_refspec)) { + *tail = ref->next; + free(ref->peer_ref); + free(ref); + } else + tail = &ref->next; + } + + return ref_map; +} + int resolve_remote_symref(struct ref *ref, struct ref *list) { if (!ref->symref) diff --git a/remote.h b/remote.h index fb7647f..534d365 100644 --- a/remote.h +++ b/remote.h @@ -67,6 +67,7 @@ struct refspec { unsigned pattern : 1; unsigned matching : 1; unsigned exact_sha1 : 1; + unsigned negative : 1; char *src; char *dst; @@ -157,6 +158,10 @@ int ref_newer(const unsigned char *new_sha1, const unsigned char *old_sha1); */ struct ref *ref_remove_duplicates(struct ref *ref_map); +struct ref *apply_negative_refspecs(struct ref *ref_map, + const struct refspec *refspecs, + int nr_refspecs); + int valid_fetch_refspec(const char *refspec); struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
On Tue, Feb 22, 2011 at 16:27, Jeff King <peff@peff.net> wrote:
> On Tue, Feb 22, 2011 at 02:09:14AM -0800, Jakub Narebski wrote:
> refspec. But I stand by my statement; if this feature is something we
> want, it should be purely about listing tags. I don't want to get into
> weird tag-specific config affecting the what we push. If somebody wants
> negative refspecs, that can be a separate patch.
I am not sure whether what is discussed now is really solving my
problem best. Maybe I rephrase again the problem I have:
I just want to make sure that certain commits are not garbage
collected. And the artefacts I create to ensure that should not
pollute the namespace of developer-created tags/branches. Is creating
a tag and then hiding it again really the best solution for that?
Here is some background: there is a tool developed in our company
which helps teams to release their git-controlled products. The
release tool gets as input just a commit ID. Whenever the release tool
has succesfully done his work on a product it wants to make sure the
this commit will never be garbage collected. Even not if month's later
the product owner resets all their branches making the released
commits beeing unreachable. And since some projects may run a lot of
attempts until they finally released some stuff we don't to have our
tags namespace to
be polluted with too many attempt-to-release tags.
On Tue, Feb 22, 2011 at 02:09:14AM -0800, Jakub Narebski wrote: > > I think changing the config name to tag.list-ignore would make it more > > obvious what is going on. If you don't want to push certain tags, I > > think refspecs are the way to do that, and this should be a purely local > > display thing. > > You meant `tag.listIgnore`, weren't you? No hyphens in config > variable names. Sure. > About refspecs: we currently do not support negative refspecs, do we? > (IIRC there was proposal to use '!' or '-' as prefix for them). So we > can't currently exclude refs/tags/private/* while including > refs/tags/v*? Yeah, I think you might be stuck enumerating the tags you want via refspec. But I stand by my statement; if this feature is something we want, it should be purely about listing tags. I don't want to get into weird tag-specific config affecting the what we push. If somebody wants negative refspecs, that can be a separate patch. But like I said before, I am lukewarm on the patch in the first place. -Peff
Jeff King <peff@peff.net> writes: > On Tue, Feb 22, 2011 at 12:09:37AM -0800, Junio C Hamano wrote: > > > > # tell git to ignore boring stuff > > > git config tag.ignore 'boring/*' > > > git config --add tag.ignore 'more-boring/*' > > > > Hmph, isn't that what "grep -v" was invented for? > > Heh. Yeah, but I think the point is that you will want to do this _every > time_, so it saves typing. I guess you could make an alias. Or even more > hack-ish, a custom tag.pager that filters the results. ;) [...] > > Also it is unclear if the boring tags will or will not be propagated (or > > should or should not be, for that matter) to outer world when you do "git > > push --tags" with your "ignore". Most likely some people do want to see > > them hidden (e.g. when publishing), and some others do want to be pushed > > (e.g. when backing the repository up). > > I think changing the config name to tag.list-ignore would make it more > obvious what is going on. If you don't want to push certain tags, I > think refspecs are the way to do that, and this should be a purely local > display thing. You meant `tag.listIgnore`, weren't you? No hyphens in config variable names. About refspecs: we currently do not support negative refspecs, do we? (IIRC there was proposal to use '!' or '-' as prefix for them). So we can't currently exclude refs/tags/private/* while including refs/tags/v*? -- Jakub Narebski Poland ShadeHawk on #git