summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-09commit-graph: respect 'commitGraph.readChangedPaths'Libravatar Taylor Blau6-3/+17
Git uses the 'core.commitGraph' configuration value to control whether or not the commit graph is used when parsing commits or performing a traversal. Now that commit-graphs can also contain a section for changed-path Bloom filters, administrators that already have commit-graphs may find it convenient to use those graphs without relying on their changed-path Bloom filters. This can happen, for example, during a staged roll-out, or in the event of an incident. Introduce 'commitGraph.readChangedPaths' to control whether or not Bloom filters are read. Note that this configuration is independent from both: - 'core.commitGraph', to allow flexibility in using all parts of a commit-graph _except_ for its Bloom filters. - The '--changed-paths' option for 'git commit-graph write', to allow reading and writing Bloom filters to be controlled independently. When the variable is set, pretend as if no Bloom data was specified at all. This avoids adding additional special-casing outside of the commit-graph internals. Suggested-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09t/helper/test-read-graph.c: prepare repo settingsLibravatar Taylor Blau1-1/+2
The read-graph test-tool is used by a number of the commit-graph test to assert various properties about a commit-graph. Previously, this program never ran 'prepare_repo_settings()'. There was no need to do so, since none of the commit-graph machinery is affected by the repo settings. In the next patch, the commit-graph machinery's behavior will become dependent on the repo settings, and so loading them before running the rest of the test tool is critical. As such, teach the test tool to call 'prepare_repo_settings()'. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09commit-graph: pass a 'struct repository *' in more placesLibravatar Taylor Blau4-12/+18
In a future commit, some commit-graph internals will want access to 'r->settings', but we only have the 'struct object_directory *' corresponding to that repository. Add an additional parameter to pass the repository around in more places. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09t4216: use an '&&'-chainLibravatar Taylor Blau1-1/+1
In a759bfa9ee (t4216: add end to end tests for git log with Bloom filters, 2020-04-06), a 'rm' invocation was added without a corresponding '&&' chain. When 'trace.perf' already exists, everything works fine. However, the function can be executed without 'trace.perf' on disk (eg., when the subset of tests run is altered with '--run'), and so the bare 'rm' complains about a missing file. To remove some noise from the test log, invoke 'rm' with '-f', at which point it is sensible to place the 'rm -f' in an '&&'-chain, which is both (1) our usual style, and (2) avoids a broken chain in the future if more commands are added at the beginning of the function. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09commit-graph: introduce 'get_bloom_filter_settings()'Libravatar Taylor Blau7-12/+40
Many places in the code often need a pointer to the commit-graph's 'struct bloom_filter_settings', in which case they often take the value from the top-most commit-graph. In the non-split case, this works as expected. In the split case, however, things get a little tricky. Not all layers in a chain of incremental commit-graphs are required to themselves have Bloom data, and so whether or not some part of the code uses Bloom filters depends entirely on whether or not the top-most level of the commit-graph chain has Bloom filters. This has been the behavior since Bloom filters were introduced, and has been codified into the tests since a759bfa9ee (t4216: add end to end tests for git log with Bloom filters, 2020-04-06). In fact, t4216.130 requires that Bloom filters are not used in exactly the case described earlier. There is no reason that this needs to be the case, since it is perfectly valid for commits in an earlier layer to have Bloom filters when commits in a newer layer do not. Since Bloom settings are guaranteed in practice to be the same for any layer in a chain that has Bloom data, it is sufficient to traverse the '->base_graph' pointer until either (1) a non-null 'struct bloom_filter_settings *' is found, or (2) until we are at the root of the commit-graph chain. Introduce a 'get_bloom_filter_settings()' function that does just this, and use it instead of purely dereferencing the top-most graph's '->bloom_filter_settings' pointer. While we're at it, add an additional test in t5324 to guard against code in the commit-graph writing machinery that doesn't correctly handle a NULL 'struct bloom_filter *'. Co-authored-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-04Fourth batchLibravatar Junio C Hamano1-1/+15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-04Merge branch 'jt/pretend-object-never-come-from-elsewhere'Libravatar Junio C Hamano2-1/+13
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. * jt/pretend-object-never-come-from-elsewhere: sha1-file: make pretend_object_file() not prefetch
2020-08-04Merge branch 'jt/pack-objects-prefetch-in-batch'Libravatar Junio C Hamano2-4/+72
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). * jt/pack-objects-prefetch-in-batch: pack-objects: prefetch objects to be packed pack-objects: refactor to oid_object_info_extended
2020-08-04Merge branch 'mp/complete-show-color-moved'Libravatar Junio C Hamano1-0/+8
Command line completion (in contrib/) update. * mp/complete-show-color-moved: completion: add show --color-moved[-ws]
2020-08-01Third batchLibravatar Junio C Hamano1-0/+4
A couple of brown-paper-bag fixes, plus the other "The branch 'master' no longer is special" fix. Now we are ready to rewind 'next'.
2020-08-01Merge branch 'cc/pretty-contents-size' into masterLibravatar Junio C Hamano1-2/+2
Brown-paper-bag fix. * cc/pretty-contents-size: t6300: fix issues related to %(contents:size)
2020-08-01Merge branch 'hn/reftable' into masterLibravatar Junio C Hamano2-2/+3
Brown-paper-bag fix. * hn/reftable: refs: move the logic to add \t to reflog to the files backend
2020-08-01Merge branch 'jc/fmt-merge-msg-suppress-destination' into masterLibravatar Junio C Hamano30-94/+159
"git merge" learned to selectively omit " into <branch>" at the end of the title of default merge message with merge.suppressDest configuration. * jc/fmt-merge-msg-suppress-destination: fmt-merge-msg: allow merge destination to be omitted again Revert "fmt-merge-msg: stop treating `master` specially"
2020-07-31t6300: fix issues related to %(contents:size)Libravatar Alban Gruin1-2/+2
b6839fda68 (ref-filter: add support for %(contents:size), 2020-07-16) added a new format for ref-filter, and added a function to generate tests for this new feature in t6300. Unfortunately, it tries to run `test_expect_sucess' instead of `test_expect_success', and writes $expect to `expected', but tries to read `expect'. Those two issues were probably unnoticed because the script only printed errors, but did not crash. This fixes these issues. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-31refs: move the logic to add \t to reflog to the files backendLibravatar Han-Wen Nienhuys2-2/+3
523fa69c (reflog: cleanse messages in the refs.c layer, 2020-07-10) centralized reflog normalizaton. However, the normalizaton added a leading "\t" to the message. This is an artifact of the reflog storage format in the files backend, so it should be added there. Routines that parse back the reflog (such as grab_nth_branch_switch) expect the "\t" to not be in the message, so without this fix, git with reftable cannot process the "@{-1}" syntax. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30The second batch -- mostly minor typofixesLibravatar Junio C Hamano1-0/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30Merge branch 'jb/doc-packfile-name' into masterLibravatar Junio C Hamano2-5/+4
Doc update. * jb/doc-packfile-name: pack-write/docs: update regarding pack naming
2020-07-30Merge branch 'sg/ci-git-path-fix-with-pyenv' into masterLibravatar Junio C Hamano1-2/+2
CI fixup---tests of Python scripts didn't use the version of Git that is being tested. * sg/ci-git-path-fix-with-pyenv: ci: use absolute PYTHON_PATH in the Linux jobs
2020-07-30Merge branch 'en/typofixes' into masterLibravatar Junio C Hamano6-6/+6
* en/typofixes: hashmap: fix typo in usage docs Remove doubled words in various comments
2020-07-30Merge branch 'rs/grep-simpler-parse-object-or-die-call' into masterLibravatar Junio C Hamano1-1/+1
* rs/grep-simpler-parse-object-or-die-call: grep: avoid using oid_to_hex() with parse_object_or_die()
2020-07-30Merge branch 'ar/help-guides-doc' into masterLibravatar Junio C Hamano1-2/+2
* ar/help-guides-doc: git-help.txt: fix mentions of option --guides
2020-07-30Merge branch 'sk/typofixes' into masterLibravatar Junio C Hamano4-4/+4
* sk/typofixes: comment: fix spelling mistakes inside comments
2020-07-30First batch post 2.28Libravatar Junio C Hamano2-1/+68
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30Merge branch 'en/fill-directory-exponential' into masterLibravatar Junio C Hamano2-2/+27
Fix to a regression introduced during 2.27 cycle. * en/fill-directory-exponential: dir: check pathspecs before returning `path_excluded`
2020-07-30Merge branch 'ct/mv-unmerged-path-error' into masterLibravatar Junio C Hamano2-2/+22
"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. * ct/mv-unmerged-path-error: git-mv: improve error message for conflicted file
2020-07-30Merge branch 'bc/push-cas-cquoted-refname' into masterLibravatar Junio C Hamano2-1/+20
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. * bc/push-cas-cquoted-refname: remote-curl: make --force-with-lease work with non-ASCII ref names
2020-07-30Merge branch 'cc/pretty-contents-size' into masterLibravatar Junio C Hamano3-7/+65
"git for-each-ref --format=<>" learned %(contents:size). * cc/pretty-contents-size: ref-filter: add support for %(contents:size) t6300: test refs pointing to tree and blob Documentation: clarify %(contents:XXXX) doc
2020-07-30Merge branch 'rs/add-index-entry-optim-fix' into masterLibravatar Junio C Hamano1-14/+0
Fix to an ancient bug caused by an over-eager attempt for optimization. * rs/add-index-entry-optim-fix: read-cache: remove bogus shortcut
2020-07-30Merge branch 'jt/avoid-lazy-fetching-upon-have-check' into masterLibravatar Junio C Hamano2-2/+42
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. * jt/avoid-lazy-fetching-upon-have-check: upload-pack: do not lazy-fetch "have" objects
2020-07-30Merge branch 'dl/test-must-fail-fixes-6' into masterLibravatar Junio C Hamano7-7/+86
Dev support to limit the use of test_must_fail to only git commands. * dl/test-must-fail-fixes-6: test-lib-functions: restrict test_must_fail usage t9400: don't use test_must_fail with cvs t9834: remove use of `test_might_fail p4` t7107: don't use test_must_fail() t5324: reorder `run_with_limited_open_files test_might_fail` t3701: stop using `env` in force_color()
2020-07-30Merge branch 'jk/reject-newer-extensions-in-v0' into masterLibravatar Junio C Hamano3-16/+85
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. * jk/reject-newer-extensions-in-v0: verify_repository_format(): complain about new extensions in v0 repo
2020-07-30Merge branch 'hn/reftable' into masterLibravatar Junio C Hamano7-26/+51
Preliminary clean-up of the refs API in preparation for adding a new refs backend "reftable". * hn/reftable: reflog: cleanse messages in the refs.c layer bisect: treat BISECT_HEAD as a pseudo ref t3432: use git-reflog to inspect the reflog for HEAD lib-t6000.sh: write tag using git-update-ref
2020-07-30Merge branch 'bw/fail-cloning-into-non-empty' into masterLibravatar Junio C Hamano2-3/+13
"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. * bw/fail-cloning-into-non-empty: git clone: don't clone into non-empty directory
2020-07-30Merge branch 'pb/log-rev-list-doc' into masterLibravatar Junio C Hamano4-40/+71
"git help log" has been enhanced by sharing more material from the documentation for the underlying "git rev-list" command. * pb/log-rev-list-doc: git-log.txt: include rev-list-description.txt git-rev-list.txt: move description to separate file git-rev-list.txt: tweak wording in set operations git-rev-list.txt: fix Asciidoc syntax revisions.txt: describe 'rev1 rev2 ...' meaning for ranges git-log.txt: add links to 'rev-list' and 'diff' docs
2020-07-30Merge branch 'jk/tests-timestamp-fix' into masterLibravatar Junio C Hamano5-8/+17
The test framework has been updated so that most tests will run with predictable (artificial) timestamps. * jk/tests-timestamp-fix: t9100: stop depending on commit timestamps test-lib: set deterministic default author/committer date t9100: explicitly unset GIT_COMMITTER_DATE t5539: make timestamp requirements more explicit t9700: loosen ident timezone regex t6000: use test_tick consistently
2020-07-30Merge branch 'ds/commit-graph-bloom-updates' into masterLibravatar Junio C Hamano9-74/+217
Updates to the changed-paths bloom filter. * ds/commit-graph-bloom-updates: commit-graph: check all leading directories in changed path Bloom filters revision: empty pathspecs should not use Bloom filters revision.c: fix whitespace commit-graph: check chunk sizes after writing commit-graph: simplify chunk writes into loop commit-graph: unify the signatures of all write_graph_chunk_*() functions commit-graph: persist existence of changed-paths bloom: fix logic in get_bloom_filter() commit-graph: change test to die on parse, not load commit-graph: place bloom_settings in context
2020-07-30Merge branch 'sg/commit-graph-cleanups' into masterLibravatar Junio C Hamano13-108/+117
The changed-path Bloom filter is improved using ideas from an independent implementation. * sg/commit-graph-cleanups: commit-graph: simplify write_commit_graph_file() #2 commit-graph: simplify write_commit_graph_file() #1 commit-graph: simplify parse_commit_graph() #2 commit-graph: simplify parse_commit_graph() #1 commit-graph: clean up #includes diff.h: drop diff_tree_oid() & friends' return value commit-slab: add a function to deep free entries on the slab commit-graph-format.txt: all multi-byte numbers are in network byte order commit-graph: fix parsing the Chunk Lookup table tree-walk.c: don't match submodule entries for 'submod/anything'
2020-07-30fmt-merge-msg: allow merge destination to be omitted againLibravatar Junio C Hamano3-4/+66
In Git 2.28, we stopped special casing 'master' when producing the default merge message by just removing the code to squelch "into 'master'" at the end of the message. Introduce multi-valued merge.suppressDest configuration variable that gives a set of globs to match against the name of the branch into which the merge is being made, to let users specify for which branch fmt-merge-msg's output should be shortened. When it is not set, 'master' is used as the sole value of the variable by default. The above move mostly reverts the pre-2.28 default in repositories that have no relevant configuration. Add a few tests to protect the behaviour with the new configuration variable from future regression. Helped-by: Linus Torvalds <torvalds@linux-foundation.org> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30Revert "fmt-merge-msg: stop treating `master` specially"Libravatar Junio C Hamano29-94/+97
This reverts commit 489947cee5095b168cbac111ff7bd1eadbbd90dd, which stopped treating merges into the 'master' branch as special when preparing the default merge message. As the goal was not to have any single branch designated as special, it solved it by leaving the "into <branchname>" at the end of the title of the default merge message for any and all branches. An obvious and easy alternative to treat everybody equally could have been to remove it for every branch, but that involves loss of information. We'll introduce a new mechanism to let end-users specify merges into which branches would omit the "into <branchname>" from the title of the default merge message, and make the mechanism, when unconfigured, treat the traditional 'master' special again, so all the changes to the tests we made earlier will become unnecessary, as these tests will be run without configuring the said new mechanism. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-29comment: fix spelling mistakes inside commentsLibravatar Steve Kemp4-4/+4
This commit fixes a couple of minor spelling mistakes inside comments. Signed-off-by: Steve Kemp <steve@steve.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-29git-help.txt: fix mentions of option --guidesLibravatar Andrei Rybak1-2/+2
Fix typos introduced in commit a133737b80 ("doc: include --guide option description for "git help"", 2013-04-02). Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-28grep: avoid using oid_to_hex() with parse_object_or_die()Libravatar René Scharfe1-1/+1
parse_object_or_die() is passed an object ID and a name to show if the object cannot be parsed. If the name is NULL then it shows the hexadecimal object ID. Use that feature instead of preparing and passing the hexadecimal representation to the function proactively. That's shorter and a bit more efficient. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-28hashmap: fix typo in usage docsLibravatar Elijah Newren1-1/+1
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-28Remove doubled words in various commentsLibravatar Elijah Newren5-5/+5
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-26Git 2.28Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-26Merge tag 'l10n-2.28.0-rnd1' of https://www.github.com/git-l10n/git-po into ↵Libravatar Junio C Hamano11-11813/+14504
master l10n-2.28.0-rnd1 * tag 'l10n-2.28.0-rnd1' of https://www.github.com/git-l10n/git-po: l10n: es: 2.28.0 round 1 l10n: de.po: Update German translation for Git v2.28.0 l10n: de.po: fix grammar l10n: zh_CN: for git v2.28.0 l10n round 1 l10n: zh_TW.po: v2.28.0 round 1 (0 untranslated) l10n: vi.po: correct "ident line" translation l10n: vi.po(4931t): Updated translation for v2.28.0 l10n: fr v2.28.0 round 1 l10n: sv.po: Update Swedish translation (4931t0f0u) l10n: it.po: update the Italian translation for Git 2.28.0 round 1 l10n: tr: v2.28.0 round 1 l10n: git.pot: v2.28.0 round 1 (70 new, 14 removed) l10n: Update Catalan translation
2020-07-27Merge branch 'master' of github.com:Softcatala/git-poLibravatar Jiang Xin1-426/+428
* 'master' of github.com:Softcatala/git-po: l10n: Update Catalan translation
2020-07-26l10n: es: 2.28.0 round 1Libravatar Christopher Diaz Riveros1-1219/+1509
Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
2020-07-24Merge branch 'ps/ref-transaction-hook' into masterLibravatar Junio C Hamano1-2/+2
A new hook. * ps/ref-transaction-hook: githooks.txt: use correct "reference-transaction" hook name
2020-07-24githooks.txt: use correct "reference-transaction" hook nameLibravatar Bojun Chen1-2/+2
The "reference transaction" hook was introduced in commit 6754159767 (refs: implement reference transaction hook, 2020-06-19). The name of the hook is declared as "reference-transaction" in "refs.c" and testcases, but the name declared in "githooks.txt" is different. Signed-off-by: Bojun Chen <bojun.cbj@alibaba-inc.com> Reviewed-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>