summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-23Second batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-23Merge branch 'jc/archive-add-file-normalize-mode'Junio C Hamano
"git archive --add-file=<path>" picked up the raw permission bits from the path and propagated to zip output in some cases, without normalization, which has been corrected (tar output did not have this issue). * jc/archive-add-file-normalize-mode: archive: do not let on-disk mode leak to zip archives
2022-05-23Merge branch 'ab/valgrind-fixes'Junio C Hamano
A bit of test framework fixes with a few fixes to issues found by valgrind. * ab/valgrind-fixes: commit-graph.c: don't assume that stat() succeeds object-file: fix a unpack_loose_header() regression in 3b6a8db3b03 log test: skip a failing mkstemp() test under valgrind tests: using custom GIT_EXEC_PATH breaks --valgrind tests
2022-05-23Merge branch 'ab/commit-plug-leaks'Junio C Hamano
Leakfix in the top-level called-once function. * ab/commit-plug-leaks: commit: fix "author_ident" leak
2022-05-20First batch for 2.37Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-20Merge branch 'cb/ci-make-p4-optional'Junio C Hamano
macOS CI jobs have been occasionally flaky due to tentative version skew between perforce and the homebrew packager. Instead of failing the whole CI job, just let it skip the p4 tests when this happens. * cb/ci-make-p4-optional: ci: use https, not http to download binaries from perforce.com ci: reintroduce prevention from perforce being quarantined in macOS ci: avoid brew for installing perforce ci: make failure to find perforce more user friendly
2022-05-20Merge branch 'tk/p4-metadata-coding-strategies'Junio C Hamano
"git p4" updates. * tk/p4-metadata-coding-strategies: git-p4: improve encoding handling to support inconsistent encodings
2022-05-20Merge branch 'ep/equals-null-cocci'Junio C Hamano
Merges up ep/maint-equals-null-cocci to the current codebase. * ep/equals-null-cocci: tree-wide: apply equals-null.cocci
2022-05-20Merge branch 'ep/maint-equals-null-cocci'Junio C Hamano
Introduce and apply coccinelle rule to discourage an explicit comparison between a pointer and NULL, and applies the clean-up to the maintenance track. * ep/maint-equals-null-cocci: tree-wide: apply equals-null.cocci tree-wide: apply equals-null.cocci contrib/coccinnelle: add equals-null.cocci
2022-05-20Merge branch 'ds/sparse-colon-path'Junio C Hamano
"git show :<path>" learned to work better with the sparse-index feature. * ds/sparse-colon-path: rev-parse: integrate with sparse index object-name: diagnose trees in index properly object-name: reject trees found in the index show: integrate with the sparse index t1092: add compatibility tests for 'git show'
2022-05-20Merge branch 'vd/sparse-stash'Junio C Hamano
Teach "git stash" to work better with sparse index entries. * vd/sparse-stash: unpack-trees: preserve index sparsity stash: apply stash using 'merge_ort_nonrecursive()' read-cache: set sparsity when index is new sparse-index: expose 'is_sparse_index_allowed()' stash: integrate with sparse index stash: expand sparse-checkout compatibility testing
2022-05-20Merge branch 'cd/bisect-messages-from-pre-flight-states'Junio C Hamano
"git bisect" was too silent before it is ready to start computing the actual bisection, which has been corrected. * cd/bisect-messages-from-pre-flight-states: bisect: output bisect setup status in bisect log bisect: output state before we are ready to compute bisection
2022-05-20Merge branch 'jc/update-ozlabs-url'Junio C Hamano
* jc/update-ozlabs-url: SubmittingPatches: use more stable git.ozlabs.org URL
2022-05-20Merge branch 'gc/pull-recurse-submodules'Junio C Hamano
"git pull" without "--recurse-submodules=<arg>" made submodule.recurse take precedence over fetch.recurseSubmodules by mistake, which has been corrected. * gc/pull-recurse-submodules: pull: do not let submodule.recurse override fetch.recurseSubmodules
2022-05-20Merge branch 'mg/detect-compiler-in-c-locale'Junio C Hamano
Build procedure fixup. * mg/detect-compiler-in-c-locale: detect-compiler: make detection independent of locale
2022-05-20Merge branch 'js/trace2-doc-fixes'Junio C Hamano
Trace2 documentation updates. * js/trace2-doc-fixes: trace2 docs: add missing full stop trace2 docs: clarify what `varargs` is all about trace2 docs: fix a JSON formatted example trace2 docs: surround more terms in backticks trace2 docs: "printf" is not an English word trace2 docs: a couple of grammar fixes
2022-05-20Merge branch 'mv/log-since-as-filter'Junio C Hamano
"git log --since=X" will stop traversal upon seeing a commit that is older than X, but there may be commits behind it that is younger than X when the commit was created with a faulty clock. A new option is added to keep digging without stopping, and instead filter out commits with timestamp older than X. * mv/log-since-as-filter: log: "--since-as-filter" option is a non-terminating "--since" variant
2022-05-20Merge branch 'rs/external-diff-tempfile'Junio C Hamano
The temporary files fed to external diff command are now generated inside a new temporary directory under the same basename. * rs/external-diff-tempfile: diff: use mks_tempfile_dt() tempfile: add mks_tempfile_dt()
2022-05-20Merge branch 'kf/p4-multiple-remotes'Junio C Hamano
"git p4" update. * kf/p4-multiple-remotes: git-p4: fix issue with multiple perforce remotes
2022-05-20Merge branch 'tk/p4-with-explicity-sync'Junio C Hamano
"git p4" update. * tk/p4-with-explicity-sync: git-p4: support explicit sync of arbitrary existing git-p4 refs
2022-05-20Merge branch 'tk/p4-utf8-bom'Junio C Hamano
"git p4" update. * tk/p4-utf8-bom: git-p4: preserve utf8 BOM when importing from p4 to git
2022-05-20Merge branch 'cg/vscode-with-gdb'Junio C Hamano
VS code configuration updates. * cg/vscode-with-gdb: contrib/vscode/: debugging with VS Code and gdb
2022-05-20Merge branch 'sa/t1011-use-helpers'Junio C Hamano
A GSoC practice. * sa/t1011-use-helpers: t1011: replace test -f with test_path_is_file
2022-05-20Merge branch 'km/t3501-use-test-helpers'Junio C Hamano
Test script updates. * km/t3501-use-test-helpers: t3501: remove test -f and stop ignoring git <cmd> exit code
2022-05-20Merge branch 'pb/submodule-recurse-mode-enum'Junio C Hamano
Small code clean-up. * pb/submodule-recurse-mode-enum: submodule.h: use a named enum for RECURSE_SUBMODULES_*
2022-05-20Merge branch 'ah/convert-warning-message'Junio C Hamano
Update a few end-user facing messages around eol conversion. * ah/convert-warning-message: convert: clarify line ending conversion warning
2022-05-20Merge branch 'gf/unused-includes'Junio C Hamano
Remove unused includes. * gf/unused-includes: apply.c: remove unnecessary include serve.c: remove unnecessary include
2022-05-20Merge branch 'gf/shorthand-version-and-help'Junio C Hamano
"git -v" and "git -h" are now understood as "git --version" and "git --help". * gf/shorthand-version-and-help: cli: add -v and -h shorthands
2022-05-20Merge branch 'rs/t7812-pcre2-ws-bug-test'Junio C Hamano
A test to ensure workaround for an earlier pcre2 bug does work. * rs/t7812-pcre2-ws-bug-test: t7812: test PCRE2 whitespace bug
2022-05-20Merge branch 'ds/do-not-call-bug-on-bad-refs'Junio C Hamano
Code clean-up. * ds/do-not-call-bug-on-bad-refs: clone: die() instead of BUG() on bad refs
2022-05-20Merge branch 'sg/safe-directory-tests-and-docs'Junio C Hamano
New tests for the safe.directory mechanism. * sg/safe-directory-tests-and-docs: safe.directory: document and check that it's ignored in the environment t0033-safe-directory: check when 'safe.directory' is ignored t0033-safe-directory: check the error message without matching the trash dir
2022-05-12commit: fix "author_ident" leakJunio C Hamano
Since 4c28e4ada03 (commit: die before asking to edit the log message, 2010-12-20), we have been "leaking" the "author_ident" when prepare_to_commit() fails. Instead of returning from right there, introduce an exit status variable and jump to the clean-up label at the end. Instead of explicitly releasing the resource with strbuf_release(), mark the variable with UNLEAK() at the end, together with two other variables that are already marked as such. If this were in a utility function that is called number of times, but these are different, we should explicitly release resources that grow proportionally to the size of the problem being solved, but cmd_commit() is like main() and there is no point in spending extra cycles to release individual pieces of resource at the end, just before process exit will clean everything for us for free anyway. This fixes a leak demonstrated by e.g. "t3505-cherry-pick-empty.sh", but unfortunately we cannot mark it or other affected tests as passing now with "TEST_PASSES_SANITIZE_LEAK=true" as we'll need to fix many other memory leaks before doing so. Incidentally there are two tests that always passes the leak checker with or without this change. Mark them as such. This is based on an earlier patch by Ævar, but takes a different approach that is more maintainable. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12ci: use https, not http to download binaries from perforce.comÆvar Arnfjörð Bjarmason
Since 522354d70f4 (Add Travis CI support, 2015-11-27) the CI has used http://filehost.perforce.com/perforce/ to download binaries from filehost.perforce.com, they were then moved to this script in 657343a602e (travis-ci: move Travis CI code into dedicated scripts, 2017-09-10). Let's use https instead for good measure. I don't think we need to worry about the DNS or network between the GitHub CI and perforce.com being MitM'd, but using https gives us extra validation of the payload at least, and is one less thing to worry about when checking where else we rely on non-TLS'd http connections. Also, use the same download site at perforce.com for Linux and macOS tarballs for consistency. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12ci: reintroduce prevention from perforce being quarantined in macOSCarlo Marcelo Arenas Belón
5ed9fc3fc86 (ci: prevent `perforce` from being quarantined, 2020-02-27) introduces this prevention for brew, but brew has been removed in a previous commit, so reintroduce an equivalent option to avoid a possible regression. This doesn't affect github actions (as configure now) and is therefore done silently to avoid any possible scary irrelevant messages. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12ci: avoid brew for installing perforceCarlo Marcelo Arenas Belón
Perfoce's cask in brew is meant[1] to be used only by humans, so replace its use from the CI with a scripted binary download which is less likely to fail, as it is done in Linux. Kept the logic together so it will be less likely to break when moved around as on the fly code changes in this area are settled, at which point it will also feasable to ammend it to avoid some of the hardcoded values by using similar variables to the ones Linux does. In that same line, a POSIX sh syntax is used instead of the similar one used in Linux in preparation for an unrelated future change that might change the shell currently configured for it. This change reintroduces the risk that the installed binaries might not work because of being quarantined that was fixed with 5ed9fc3fc86 (ci: prevent `perforce` from being quarantined, 2020-02-27) but fixing that now was also punted for simplicity and since the affected cloud provider is scheduled to be retired with an on the fly change, but should be addressed if that other change is not integrated further. The discussion on the need to keep 2 radically different versions of the binaries to be tested with Linux vs macOS or how to upgrade to newer versions now that brew won't do that automatically for us has been punted for now as well. On that line the now obsolete comment about it in lib.sh was originally being updated by this change but created conflicts as it is moved around by other on the fly changes, so will be addressed independently as well. [1] https://github.com/Homebrew/homebrew-cask/pull/122347#discussion_r856026584 Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12ci: make failure to find perforce more user friendlyCarlo Marcelo Arenas Belón
In preparation for a future change that will make perforce installation optional in macOS, make sure that the check for it is done without triggering scary looking errors and add a user friendly message instead. All other existing uses of 'type <cmd>' in our shell scripts that check the availability of a command <cmd> send both standard output and error stream to /dev/null to squelch "<cmd> not found" diagnostic output, but this script left the standard error stream shown. Redirect it just like everybody else to squelch this error message that we fully expect to see. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12commit-graph.c: don't assume that stat() succeedsÆvar Arnfjörð Bjarmason
Fix code added in 8d84097f965 (commit-graph: expire commit-graph files, 2019-06-18) to check the return value of the stat() system call. Not doing so caused us to use uninitialized memory in the "Bloom generation is limited by --max-new-filters" test in t4216-log-bloom.sh: + rm -f trace.event + pwd + GIT_TRACE2_EVENT=[...]/t/trash directory.t4216-log-bloom/limits/trace.event git commit-graph write --reachable --split=replace --changed-paths --max-new-filters=2 ==24835== Syscall param utimensat(times[0].tv_sec) points to uninitialised byte(s) ==24835== at 0x499E65A: __utimensat64_helper (utimensat.c:34) ==24835== by 0x4999142: utime (utime.c:36) ==24835== by 0x552BE0: mark_commit_graphs (commit-graph.c:2213) ==24835== by 0x550822: write_commit_graph (commit-graph.c:2424) ==24835== by 0x54E3A0: write_commit_graph_reachable (commit-graph.c:1681) ==24835== by 0x4374BB: graph_write (commit-graph.c:269) ==24835== by 0x436F7D: cmd_commit_graph (commit-graph.c:326) ==24835== by 0x407B9A: run_builtin (git.c:465) ==24835== by 0x406651: handle_builtin (git.c:719) ==24835== by 0x407575: run_argv (git.c:786) ==24835== by 0x406410: cmd_main (git.c:917) ==24835== by 0x511F09: main (common-main.c:56) ==24835== Address 0x1ffeffde70 is on thread 1's stack ==24835== in frame #1, created by utime (utime.c:25) ==24835== Uninitialised value was created by a stack allocation ==24835== at 0x552B50: mark_commit_graphs (commit-graph.c:2201) ==24835== [...] error: last command exited with $?=126 not ok 137 - Bloom generation is limited by --max-new-filters This would happen as we stat'd the non-existing ".git/objects/info/commit-graph" file. Let's fix mark_commit_graphs() to check the stat()'s return value, and while we're at it fix another case added in the same commit to do the same. The caller in expire_commit_graphs() would have been less likely to run into this, as it's operating on files it just got from readdir(), but it could still happen due to a race with e.g. a concurrent "rm -rf" of the commit-graph files. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12object-file: fix a unpack_loose_header() regression in 3b6a8db3b03Ævar Arnfjörð Bjarmason
Fix a regression in my 3b6a8db3b03 (object-file.c: use "enum" return type for unpack_loose_header(), 2021-10-01) revealed both by running the test suite with --valgrind, and with the amended "git fsck" test. In practice this regression in v2.34.0 caused us to claim that we couldn't parse the header, as opposed to not being able to unpack it. Before the change in the C code the test_cmp added here would emit: -error: unable to unpack header of ./objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +error: unable to parse header of ./objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 I.e. we'd proceed to call parse_loose_header() on the uninitialized "hdr" value, and it would have been very unlikely for that uninitialized memory to be a valid git object. The other callers of unpack_loose_header() were already checking the enum values exhaustively. See 3b6a8db3b03 and 5848fb11acd (object-file.c: return ULHR_TOO_LONG on "header too long", 2021-10-01). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12log test: skip a failing mkstemp() test under valgrindÆvar Arnfjörð Bjarmason
Skip a test added in f1e3df31699 (t: increase test coverage of signature verification output, 2020-03-04) when running under valgrind. Due to valgrind's interception of mkstemp() this test will fail with: + pwd + TMPDIR=[...]/t/trash directory.t4202-log/bogus git log --show-signature -n1 plain-fail ==7696== VG_(mkstemp): failed to create temp file: [...]/t/trash directory.t4202-log/bogus/valgrind_proc_7696_cmdline_d545ddcf [... 10 more similar lines omitted ..] valgrind: Startup or configuration error: valgrind: Can't create client cmdline file in [...]/t/trash directory.t4202-log/bogus/valgrind_proc_7696_cmdline_6e542d1d valgrind: Unable to start up properly. Giving up. error: last command exited with $?=1 Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12tests: using custom GIT_EXEC_PATH breaks --valgrind testsÆvar Arnfjörð Bjarmason
Fix a regression in b7d11a0f5d2 (tests: exercise the RUNTIME_PREFIX feature, 2021-07-24) where tests that want to set up and test a "git" wrapper in $PATH conflicted with the t/bin/valgrind wrapper(s) doing the same. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-12archive: do not let on-disk mode leak to zip archivesJunio C Hamano
When the "--add-file" option is used to add the contents from an untracked file to the archive, the permission mode bits for these files are sent to the archive-backend specific "write_entry()" method as-is. We normalize the mode bits for tracked files way before we pass them to the write_entry() method; we should do the same here. This is not strictly needed for "tar" archive-backend, as it has its own code to further clean them up, but "zip" archive-backend is not so well prepared. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-11pull: do not let submodule.recurse override fetch.recurseSubmodulesGlen Choo
Fix a bug in "git pull" where `submodule.recurse` is preferred over `fetch.recurseSubmodules` when performing a fetch (Documentation/config/fetch.txt says that `fetch.recurseSubmodules` should be preferred.). Do this by passing the value of the "--recurse-submodules" CLI option to the underlying fetch, instead of passing a value that combines the CLI option and config variables. In other words, this bug occurred because builtin/pull.c is conflating two similar-sounding, but different concepts: - Whether "git pull" itself should care about submodules e.g. whether it should update the submodule worktrees after performing a merge. - The value of "--recurse-submodules" to pass to the underlying "git fetch". Thus, when `submodule.recurse` is set, the underlying "git fetch" gets invoked with "--recurse-submodules[=value]", overriding the value of `fetch.recurseSubmodules`. An alternative (and more obvious) approach to fix the bug would be to teach "git pull" to understand `fetch.recurseSubmodules`, but the proposed solution works better because: - We don't maintain two identical config-parsing implementions in "git pull" and "git fetch". - It works better with other commands invoked by "git pull" e.g. "git merge" won't accidentally respect `fetch.recurseSubmodules`. Reported-by: Huang Zou <huang.zou@schrodinger.com> Helped-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-11second 0th batch of topics from the previous cycleJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-11Merge branch 'rs/commit-summary-wo-break-rewrite'Junio C Hamano
The commit summary shown after making a commit is matched to what is given in "git status" not to use the break-rewrite heuristics. * rs/commit-summary-wo-break-rewrite: commit, sequencer: turn off break_opt for commit summary
2022-05-11Merge branch 'pw/test-malloc-with-sanitize-address'Junio C Hamano
Avoid problems from interaction between malloc_check and address sanitizer. * pw/test-malloc-with-sanitize-address: tests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK
2022-05-11Merge branch 'ea/rebase-code-simplify'Junio C Hamano
Code clean-up. * ea/rebase-code-simplify: rebase: simplify an assignment of options.type in cmd_rebase
2022-05-11Merge branch 'kt/commit-graph-plug-fp-leak-on-error'Junio C Hamano
Fix a leak of FILE * in an error codepath. * kt/commit-graph-plug-fp-leak-on-error: commit-graph: close file before returning NULL
2022-05-11Merge branch 'ah/rebase-keep-base-fix'Junio C Hamano
"git rebase --keep-base <upstream> <branch-to-rebase>" computed the commit to rebase onto incorrectly, which has been corrected. * ah/rebase-keep-base-fix: rebase: use correct base for --keep-base when a branch is given
2022-05-11bisect: output bisect setup status in bisect logChris Down
This allows seeing the current intermediate status without adding a new good or bad commit: $ git bisect log | tail -1 # status: waiting for bad commit, 1 good commit known Signed-off-by: Chris Down <chris@chrisdown.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-11bisect: output state before we are ready to compute bisectionChris Down
Commit 73c6de06aff8 ("bisect: don't use invalid oid as rev when starting") changes the behaviour of `git bisect` to consider invalid oids as pathspecs again, as in the old shell implementation. While that behaviour may be desirable, it can also cause confusion. For example, while bisecting in a particular repo I encountered this: $ git bisect start d93ff48803f0 v6.3 $ ...which led to me sitting for a few moments, wondering why there's no printout stating the first rev to check. It turns out that the tag was actually "6.3", not "v6.3", and thus the bisect was still silently started with only a bad rev, because d93ff48803f0 was a valid oid and "v6.3" was silently considered to be a pathspec. While this behaviour may be desirable, it can be confusing, especially with different repo conventions either using or not using "v" before release names, or when a branch name or tag is simply misspelled on the command line. In order to avoid situations like this, make it more clear what we're waiting for: $ git bisect start d93ff48803f0 v6.3 status: waiting for good commit(s), bad commit known We already have good output once the bisect process has begun in earnest, so we don't need to do anything more there. Signed-off-by: Chris Down <chris@chrisdown.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>