summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-07-27t/Makefile: don't remove test-results in "clean-except-prove-cache"Ævar Arnfjörð Bjarmason3-3/+3
When "make test" is run with the default of "DEFAULT_TEST_TARGET=test" we'll leave the "test-results" directory in-place, but don't do so for the "prove" target. The reason for this is that when 28d836c8158 (test: allow running the tests under "prove", 2010-10-14) allowed for running the tests under "prove" there was no point in leaving the "test-results" in place. The "prove" target provides its own summary, so we don't need to run "aggregate-results", which is the reason we have "test-results" in the first place. See 2d84e9fb6d2 (Modify test-lib.sh to output stats to t/test-results/*, 2008-06-08). But in a subsequent commit test-lib.sh will start emitting reports of memory leaks in test-results/*, and it will be useful to analyze these after the fact. This wouldn't be a problem as failing tests will halt the removal of the files (we'll never reach "clean-except-prove-cache" from the "prove" target), but will be subsequently as we'll want to report a successful run, but might still have e.g. logs of known memory leaks in test-results/*. So let's stop removing this, it's sufficient that "make clean" removes it, and that "pre-clean" (which both "test" and "prove" depend on) will remove it, i.e. we'll never have a stale "test-results" because of this change. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27test-lib: add a SANITIZE=leak logging modeÆvar Arnfjörð Bjarmason2-1/+34
Add the ability to run the test suite under a new "GIT_TEST_SANITIZE_LEAK_LOG=true" mode, when true we'll log the leaks we find an a new "test-results/<test-name>.leak" directory. That new path is consistent with the existing "test-results/<test-name>.<type>" results, except that those are all files, not directories. We also set "log_exe_name=1" to include the name of the executable in the filename. This gives us files like "trace.git.<pid>" instead of the default of "trace.<pid>". I.e. we'll be able to distinguish "git" leaks from "test-tool", "git-daemon" etc. We then set "dedup_token_length" to non-zero ("0" is the default) to succinctly log a token we can de-duplicate these stacktraces on. The string is simply a one-line stack-trace with only function names up to N frames, which we limit at "9999" as a shorthand for "infinite" (there appears to be no way to say "no limit"). With these combined we can now easily get e.g. the top 10 leaks in the test suite grouped by full stacktrace: grep -o -P -h '(?<=DEDUP_TOKEN: ).*' test-results/*.leak/trace.git.* | sort | uniq -c | sort -nr | head -n 10 Or add "grep -E -o '[^-]+'" to that to group by functions instead of stack traces: grep -o -P -h '(?<=DEDUP_TOKEN: ).*' test-results/*.leak/trace.git.* | grep -E -o '[^-]+' | sort | uniq -c | sort -nr | head -n 20 This new mode requires git to be compiled with SANITIZE=leak, rather than explaining that in the documentation let's make it self-documenting by bailing out if the user asks for this without git having been compiled with SANITIZE=leak, as we do with GIT_TEST_PASSING_SANITIZE_LEAK=true. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27t/README: reword the "GIT_TEST_PASSING_SANITIZE_LEAK" descriptionÆvar Arnfjörð Bjarmason2-7/+4
Reword the documentation added in 956d2e4639b (tests: add a test mode for SANITIZE=leak, run it in CI, 2021-09-23) for brevity. The comment added in the same commit was also misleading: We skip certain tests if SANITIZE=leak and GIT_TEST_PASSING_SANITIZE_LEAK=true, not if we're compiled with SANITIZE=leak. Let's just remove the comment, the control flow here is obvious enough that the code can speak for itself. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27test-lib: add a --invert-exit-code switchÆvar Arnfjörð Bjarmason2-2/+115
Add the ability to have those tests that fail return 0, and those tests that succeed return 1. This is useful e.g. to run "--stress" tests on tests that fail 99% of the time on some setup, i.e. to smoke out the flaky run which yielded success. In a subsequent commit a new SANITIZE=leak mode will make use of this. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27test-lib: fix GIT_EXIT_OK logic errors, use BAIL_OUTÆvar Arnfjörð Bjarmason1-10/+6
Change various "exit 1" checks that happened after our "die" handler had been set up to use BAIL_OUT instead. See 234383cd401 (test-lib.sh: use "Bail out!" syntax on bad SANITIZE=leak use, 2021-10-14) for the benefits of the BAIL_OUT function. The previous use of "error" here was not a logic error, but the "exit" without "GIT_EXIT_OK" would emit the "FATAL: Unexpected exit with code $code" message on top of the error we wanted to emit. Since we'd also like to stop "prove" in its tracks here, the right thing to do is to emit a "Bail out!" message. Let's also move the "GIT_EXIT_OK=t" assignments to just above the "exit [01]" in "test_done". It's not OK if we exit in e.g. finalize_test_output. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27test-lib: don't set GIT_EXIT_OK before calling test_atexit_handlerÆvar Arnfjörð Bjarmason1-2/+2
Change the control flow in test_done so that we'll set GIT_EXIT_OK=t after we call test_atexit_handler(). This seems to have been a mistake in 900721e15c4 (test-lib: introduce 'test_atexit', 2019-03-13). It doesn't make sense to allow our "atexit" handling to call "exit" without us emitting the errors we'll emit without GIT_EXIT_OK=t being set. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27test-lib: use $1, not $@ in test_known_broken_{ok,failure}_Ævar Arnfjörð Bjarmason1-4/+4
Clarify that these two functions never take N arguments, they'll only ever receive one. They've needlessly used $@ over $1 since 41ac414ea2b (Sane use of test_expect_failure, 2008-02-01). In the future we might want to pass the test source to these, but now that's not the case. This preparatory change helps to clarify a follow-up change. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27Sync with 'maint'Junio C Hamano2-22/+47
2022-07-27Downmerge a handful of fixes for 2.37.x maintenance trackJunio C Hamano2-1/+48
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27Merge branch 'tk/rev-parse-doc-clarify-at-u' into maintJunio C Hamano1-9/+6
Doc update. source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com> * tk/rev-parse-doc-clarify-at-u: rev-parse: documentation adjustment - mention remote tracking with @{u}
2022-07-27Merge branch 'll/ls-files-tests-update' into maintJunio C Hamano5-71/+132
Test update. source: <pull.1269.v6.git.1656863349926.gitgitgadget@gmail.com> * ll/ls-files-tests-update: ls-files: update test style
2022-07-27Merge branch 'ds/t5510-brokequote' into maintJunio C Hamano1-1/+5
Test fix. source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com> * ds/t5510-brokequote: t5510: replace 'origin' with URL more carefully
2022-07-27Merge branch 'tb/pack-objects-remove-pahole-comment' into maintJunio C Hamano1-10/+0
Comment fix. source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com> * tb/pack-objects-remove-pahole-comment: pack-objects.h: remove outdated pahole results
2022-07-27Merge branch 'en/t6429-test-must-be-empty-fix' into maintJunio C Hamano1-1/+1
A test fix. source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com> * en/t6429-test-must-be-empty-fix: t6429: fix use of non-existent function
2022-07-27Merge branch 'ds/vscode-settings' into maintJunio C Hamano1-2/+6
* ds/vscode-settings: vscode: improve tab size and wrapping
2022-07-27Merge branch 'cr/setup-bug-typo' into maintJunio C Hamano1-1/+1
Typofix in a BUG() message. source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com> * cr/setup-bug-typo: setup: fix function name in a BUG() message
2022-07-27Merge branch 'pb/diff-doc-raw-format' into maintJunio C Hamano2-6/+6
Update "git diff/log --raw" format documentation. source: <pull.1259.git.1655123383.gitgitgadget@gmail.com> * pb/diff-doc-raw-format: 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
2022-07-27Merge branch 'jk/revisions-doc-markup-fix' into maintJunio C Hamano1-1/+1
Documentation mark-up fix. source: <YrOmsA04FZae89be@coredump.intra.peff.net> * jk/revisions-doc-markup-fix: revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis
2022-07-27Merge branch 'rs/combine-diff-with-incompatible-options' into maintJunio C Hamano1-0/+7
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> * rs/combine-diff-with-incompatible-options: combine-diff: abort if --output is given combine-diff: abort if --ignore-matching-lines is given
2022-07-27Merge branch 'ac/bitmap-format-doc' into maintJunio C Hamano2-77/+89
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> * ac/bitmap-format-doc: 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
2022-07-27Merge branch 'ab/test-quoting-fix' into maintJunio C Hamano5-7/+8
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> * ab/test-quoting-fix: 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
2022-07-27Merge branch 'ro/mktree-allow-missing-fix' into maintJunio C Hamano1-2/+9
"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> * ro/mktree-allow-missing-fix: mktree: do not check type of remote objects
2022-07-27Merge branch 'dr/i18n-die-warn-error-usage' into maintJunio C Hamano1-4/+4
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> * dr/i18n-die-warn-error-usage: i18n: mark message helpers prefix for translation
2022-07-27Merge branch 'ds/git-rebase-doc-markup' into maintJunio C Hamano1-120/+122
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/git-rebase-doc-markup: git-rebase.txt: use back-ticks consistently
2022-07-27Merge branch 'gg/worktree-from-the-above' into maintJunio C Hamano2-7/+293
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. source: <20220616234433.225-1-gg.oss@outlook.com> source: <20220616231956.154-1-gg.oss@outlook.com> * gg/worktree-from-the-above: dir: minor refactoring / clean-up dir: traverse into repository
2022-07-27Merge branch 'fr/vimdiff-layout-fix' into maintJunio C Hamano1-18/+18
Recent update to vimdiff layout code has been made more robust against different end-user vim settings. source: <20220708181024.45839-1-greenfoo@u92.eu> * fr/vimdiff-layout-fix: vimdiff: make layout engine more robust against user vim settings
2022-07-27Merge branch 'en/merge-dual-dir-renames-fix' into maintJunio C Hamano2-26/+153
Fixes a long-standing corner case bug around directory renames in the merge-ort strategy. source: <pull.1268.v4.git.1656984823.gitgitgadget@gmail.com> * en/merge-dual-dir-renames-fix: 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
2022-07-27Merge branch 'jk/diff-files-cleanup-fix' into maintJunio C Hamano1-1/+1
An earlier attempt to plug leaks placed a clean-up label to jump to at a bogus place, which as been corrected. source: <Ys0c0ePxPOqZ/5ck@coredump.intra.peff.net> * jk/diff-files-cleanup-fix: diff-files: move misplaced cleanup label
2022-07-27Merge branch 'js/vimdiff-quotepath-fix' into maintJunio C Hamano1-4/+35
Variable quoting fix in the vimdiff driver of "git mergetool" source: <pull.1287.v2.git.1657809063728.gitgitgadget@gmail.com> * js/vimdiff-quotepath-fix: mergetool(vimdiff): allow paths to contain spaces again
2022-07-27Merge branch 'js/shortlog-sort-stably' into maintJunio C Hamano1-1/+1
"git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. source: <pull.1290.git.1657813429221.gitgitgadget@gmail.com> * js/shortlog-sort-stably: shortlog: use a stable sort
2022-07-27Merge branch 'js/ci-github-workflow-markup' into maintJunio C Hamano1-5/+5
A fix for a regression in test framework. source: <pull.1288.git.1657789234416.gitgitgadget@gmail.com> * js/ci-github-workflow-markup: tests: fix incorrect --write-junit-xml code
2022-07-27The seventh batchJunio C Hamano1-0/+29
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27Merge branch 'mb/p4-utf16-crlf'Junio C Hamano1-1/+1
"git p4" working on UTF-16 files on Windows did not implement CRLF-to-LF conversion correctly, which has been corrected. * mb/p4-utf16-crlf: git-p4: fix CR LF handling for utf16 files
2022-07-27Merge branch 'mb/p4-fixes'Junio C Hamano1-6/+3
Fix a few issues in "git p4". * mb/p4-fixes: git-p4: fix error handling in P4Unshelve.renameBranch() git-p4: fix typo in P4Submit.applyCommit()
2022-07-27Merge branch 'ds/win-syslog-compiler-fix'Junio C Hamano1-3/+4
Workaround for a false positive compiler warning. * ds/win-syslog-compiler-fix: compat/win32: correct for incorrect compiler warning
2022-07-27Merge branch 'ld/osx-keychain-usage-fix'Junio C Hamano1-1/+1
Workaround for a compiler warning against use of die() in osx-keychain (in contrib/). * ld/osx-keychain-usage-fix: osx-keychain: fix compiler warning
2022-07-27Merge branch 'vd/scalar-doc'Junio C Hamano3-87/+131
Doc update. * vd/scalar-doc: scalar: convert README.md into a technical design doc scalar: reword command documentation to clarify purpose
2022-07-27Merge branch 'ds/doc-wo-whitelist'Junio C Hamano11-40/+39
Avoid "white/black-list" in documentation and code comments. * ds/doc-wo-whitelist: transport.c: avoid "whitelist" t: avoid "whitelist" git.txt: remove redundant language git-cvsserver: clarify directory list daemon: clarify directory arguments
2022-07-27Merge branch 'mb/config-document-include'Junio C Hamano3-0/+21
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. * mb/config-document-include: config.txt: document include, includeIf
2022-07-27Merge branch 'sg/index-format-doc-update'Junio C Hamano1-2/+0
Docfix. * sg/index-format-doc-update: index-format.txt: remove outdated list of supported extensions
2022-07-27Merge branch 'ma/sparse-checkout-cone-doc-fix'Junio C Hamano1-2/+2
Docfix. * ma/sparse-checkout-cone-doc-fix: config/core.txt: fix minor issues for `core.sparseCheckoutCone`
2022-07-27Merge branch 'ma/t4200-update'Junio C Hamano1-3/+0
Test fix. * ma/t4200-update: t4200: drop irrelevant code
2022-07-27Merge branch 'tl/pack-bitmap-error-messages'Junio C Hamano1-45/+58
Tweak various messages that come from the pack-bitmap codepaths. * tl/pack-bitmap-error-messages: pack-bitmap.c: continue looping when first MIDX bitmap is found pack-bitmap.c: using error() instead of silently returning -1 pack-bitmap.c: do not ignore error when opening a bitmap file pack-bitmap.c: rename "idx_name" to "bitmap_name" pack-bitmap.c: mark more strings for translations pack-bitmap.c: fix formatting of error messages
2022-07-27Merge branch 'ab/squelch-empty-fsync-traces'Junio C Hamano3-9/+42
Omit fsync-related trace2 entries when their values are all zero. * ab/squelch-empty-fsync-traces: trace2: only include "fsync" events if we git_fsync()
2022-07-27Merge branch 'js/commit-graph-parsing-without-repo-settings'Junio C Hamano5-10/+33
API tweak to make it easier to run fuzz testing on commit-graph parser. * js/commit-graph-parsing-without-repo-settings: commit-graph: pass repo_settings instead of repository
2022-07-27cmake: support local installations of gitCarlo Marcelo Arenas Belón1-1/+1
At least in systems where the user is local and not an administrator git will install in a subdirectory of %APPDATALOCAL%, so it makes sense to also look there for the shell needed by the cmake integration with Visual Studio. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-27write_midx_bitmap(): drop unused refs_snapshot parameterJeff King1-2/+1
The refactoring in 90b2bb710d (midx: extract bitmap write setup, 2022-07-19) hoisted our call to find_commits_for_midx_bitmap() into the caller, which means we no longer need to see the refs_snapshot at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-26config.c: NULL check when reading protected configGlen Choo1-3/+8
In read_protected_config(), check whether each file name is NULL before attempting to read it, and add a BUG() call to git_config_from_file_with_options() to make this error easier to catch in the future. The NULL checks mirror what do_git_config_sequence() does (which read_protected_config() is modeled after). Without these NULL checks, multiple tests fail with "make SANITIZE=address", e.g. in the final test of t4010, xdg_config is NULL causing us to call fopen(NULL). Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-26fetch-pack: write effective filter to trace2Jonathan Tan1-14/+26
Administrators of a managed Git environment (like the one at $DAYJOB) might want to quantify the performance change of fetches with and without filters from the client's point of view, and also detect if a server does not support it. Therefore, log the filter information being sent to the server whenever a fetch (or clone) occurs. Note that this is not necessarily the same as what's specified on the CLI, because during a fetch, the configured filter is used whenever a filter is not specified on the CLI. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-07-26gitweb: remove title shortening heuristicsJulien Rouhaud1-17/+0
Those heuristics are way outdated and too specific to the kernel project to be useful outside of kernel.org. Since kernel.org doesn't use gitweb anymore and at least one project complained about incorrect behavior, entirely remove them. Signed-off-by: Julien Rouhaud <julien.rouhaud@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>