aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2022-12-20line-range: fix infinite loop bug with '$' regexLars Kellogg-Stedman2-3/+26
When the -L argument to "git log" is passed the zero-width regular expression "$" (as in "-L :$:line-range.c"), this results in an infinite loop in find_funcname_matching_regexp(). Modify find_funcname_matching_regexp to correctly match the entire line instead of the zero-width match at eol and update the loop condition to prevent an infinite loop in the event of other undiscovered corner cases. The primary change is that we pre-decrement the beginning-of-line marker ('bol') before comparing it to '\n'. In the case of '$', where we match the '\n' at the end of the line and start the loop with bol == eol, this ensures that bol will find the beginning of the line on which the match occurred. Originally reported in <https://stackoverflow.com/q/74690545/147356>. Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-11Git 2.38.2v2.38.2Junio C Hamano2-1/+8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-10ci: use a newer `github-script` versionJohannes Schindelin1-3/+3
The old version we currently use runs in node.js v12.x, which is being deprecated in GitHub Actions. The new version uses node.js v16.x. Incidentally, this also avoids the warning about the deprecated `::set-output::` workflow command because the newer version of the `github-script` Action uses the recommended new way to specify outputs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-12-10Merge branch 'jx/ci-ubuntu-fix' into maint-2.38Junio C Hamano3-17/+13
Adjust the GitHub CI to newer ubuntu release. * jx/ci-ubuntu-fix: ci: install python on ubuntu ci: use the same version of p4 on both Linux and macOS ci: remove the pipe after "p4 -V" to catch errors github-actions: run gcc-8 on ubuntu-20.04 image
2022-12-10Merge branch 'js/ci-use-newer-up-down-artifact' into maint-2.38Junio C Hamano1-8/+14
CI fix. * js/ci-use-newer-up-down-artifact: ci: avoid using deprecated {up,down}load-artifacts Action
2022-12-10Merge branch 'ab/ci-use-macos-12' into maint-2.38Junio C Hamano3-4/+4
CI fix. * ab/ci-use-macos-12: CI: upgrade to macos-12, and pin OSX version
2022-12-10Merge branch 'ab/ci-retire-set-output' into maint-2.38Junio C Hamano2-3/+3
CI fix. * ab/ci-retire-set-output: CI: migrate away from deprecated "set-output" syntax
2022-12-10Merge branch 'ab/ci-musl-bash-fix' into maint-2.38Junio C Hamano1-6/+2
CI fix. * ab/ci-musl-bash-fix: CI: don't explicitly pick "bash" shell outside of Windows, fix regression
2022-12-10Merge branch 'od/ci-use-checkout-v3-when-applicable' into maint-2.38Junio C Hamano1-7/+10
Update GitHub CI to use actions/checkout@v3; use of the older checkout@v2 gets annoying deprecation notices. * od/ci-use-checkout-v3-when-applicable: ci(main): upgrade actions/checkout to v3
2022-12-09rebase --update-refs: avoid unintended ref deletionVictoria Dye2-3/+113
In b3b1a21d1a5 (sequencer: rewrite update-refs as user edits todo list, 2022-07-19), the 'todo_list_filter_update_refs()' step was added to handle the removal of 'update-ref' lines from a 'rebase-todo'. Specifically, it removes potential ref updates from the "update refs state" if a ref does not have a corresponding 'update-ref' line. However, because 'write_update_refs_state()' will not update the state if the 'refs_to_oids' list was empty, removing *all* 'update-ref' lines will result in the state remaining unchanged from how it was initialized (with all refs' "after" OID being null). Then, when the ref update is applied, all refs will be updated to null and consequently deleted. To fix this, delete the 'update-refs' state file when 'refs_to_oids' is empty. Additionally, add a tests covering "all update-ref lines removed" cases. Reported-by: herr.kaste <herr.kaste@gmail.com> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Helped-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-12-08CI: migrate away from deprecated "set-output" syntaxÆvar Arnfjörð Bjarmason2-3/+3
As noted in [1] and the warnings the CI itself is spewing echoing outputs to stdout is deprecated, and they should be written to "$GITHUB_OUTPUT" instead. 1. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-08ci: avoid using deprecated {up,down}load-artifacts ActionJohannes Schindelin1-8/+14
The deprecated versions of these Actions still use node.js 12 whereas workflows will need to use node.js 16 to avoid problems going forward. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-08CI: don't explicitly pick "bash" shell outside of Windows, fix regressionÆvar Arnfjörð Bjarmason1-6/+2
When the "js/ci-github-workflow-markup" topic was originally merged in [1] it included a change to get rid of the "ci/print-test-failures.sh" step[2]. This was then brought back in [3] as part of a fix-up patches on top[4]. The problem was that [3] was not a revert of the relevant parts of [2], but rather copy/pasted the "ci/print-test-failures.sh" step that was present for the Windows job to all "ci/print-test-failures.sh" steps. The Windows steps specified "shell: bash", but the non-Windows ones did not. This broke the "ci/print/test-failures.sh" step for the "linux-musl" job, where we don't have a "bash" shell, just a "/bin/sh" (a "dash"). This breakage was reported at the time[5], but hadn't been fixed. It would be sufficient to change this only for "linux-musl", but let's change this for both "regular" and "dockerized" to omit the "shell" line entirely, as we did before [2]. Let's also change undo the "name" change that [3] made while copy/pasting the "print test failures" step for the Windows job. These steps are now the same as they were before [2], except that the "if" includes the "env.FAILED_TEST_ARTIFACTS" test. 1. fc5a070f591 (Merge branch 'js/ci-github-workflow-markup', 2022-06-07) 2. 08dccc8fc1f (ci: make it easier to find failed tests' logs in the GitHub workflow, 2022-05-21) 3. 5aeb145780f (ci(github): bring back the 'print test failures' step, 2022-06-08) 4. d0d96b8280f (Merge branch 'js/ci-github-workflow-markup', 2022-06-17) 5. https://lore.kernel.org/git/220725.86sfmpneqp.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-07CI: upgrade to macos-12, and pin OSX versionÆvar Arnfjörð Bjarmason3-4/+4
Per [1] and the warnings our CI is emitting GitHub is phasing in "macos-12" as their "macos-latest". As with [2], let's pin our image to a specific version so that we're not having it swept from under us, and our upgrade cycle can be more predictable than whenever GitHub changes their images. 1. https://github.com/actions/runner-images/issues/6384 2. 0178420b9ca (github-actions: run gcc-8 on ubuntu-20.04 image, 2022-11-25) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-06ci(main): upgrade actions/checkout to v3Oscar Dominguez1-7/+10
To be up to date with actions/checkout opens the door to use the latest features if necessary and get the latest security patches. This also avoids a couple of deprecation warnings in the CI runs. Note: The `actions/checkout` Action has been known to be broken in i686 containers as of v2, therefore we keep forcing it to v1 there. See actions/runner#2115 for more details. Signed-off-by: Oscar Dominguez <dominguez.celada@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-11-27ci: install python on ubuntuJiang Xin2-5/+5
Python is missing from the default ubuntu-22.04 runner image, which prevents git-p4 from working. To install python on ubuntu, we need to provide the correct package names: * On Ubuntu 18.04 (bionic), "/usr/bin/python2" is provided by the "python" package, and "/usr/bin/python3" is provided by the "python3" package. * On Ubuntu 20.04 (focal) and above, "/usr/bin/python2" is provided by the "python2" package which has a different name from bionic, and "/usr/bin/python3" is provided by "python3". Since the "ubuntu-latest" runner image has a higher version, its safe to use "python2" or "python3" package name. Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-11-27ci: use the same version of p4 on both Linux and macOSJiang Xin2-3/+2
There would be a segmentation fault when running p4 v16.2 on ubuntu 22.04 which is the latest version of ubuntu runner image for github actions. By checking each version from [1], p4d version 21.1 and above can work properly on ubuntu 22.04. But version 22.x will break some p4 test cases. So p4 version 21.x is exactly the version we can use. With this update, the versions of p4 for Linux and macOS happen to be the same. So we can add the version number directly into the "P4WHENCE" variable, and reuse it in p4 installation for macOS. By removing the "LINUX_P4_VERSION" variable from "ci/lib.sh", the comment left above has nothing to do with p4, but still applies to git-lfs. Since we have a fixed version of git-lfs installed on Linux, we may have a different version on macOS. [1]: https://cdist2.perforce.com/perforce/ Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-11-27ci: remove the pipe after "p4 -V" to catch errorsJiang Xin1-2/+2
When installing p4 as a dependency, we used to pipe output of "p4 -V" and "p4d -V" to validate the installation and output a condensed version information. But this would hide potential errors of p4 and would stop with an empty output. E.g.: p4d version 16.2 running on ubuntu 22.04 causes sigfaults, even before it produces any output. By removing the pipe after "p4 -V" and "p4d -V", we may get a verbose output, and stop immediately on errors because we have "set -e" in "ci/lib.sh". Since we won't look at these trace logs unless something fails, just including the raw output seems most sensible. Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-11-27github-actions: run gcc-8 on ubuntu-20.04 imageJiang Xin3-7/+4
GitHub starts to upgrade its runner image "ubuntu-latest" from version "ubuntu-20.04" to version "ubuntu-22.04". It will fail to find and install "gcc-8" package on the new runner image. Change some of the runner images from "ubuntu-latest" to "ubuntu-20.04" in order to install "gcc-8" as a dependency. The first revision of this patch tried to replace "$runs_on_pool" in "ci/*.sh" with a new "$runs_on_os" environment variable based on the "os" field in the matrix strategy. But these "os" fields in matrix strategies are obsolete legacies from commit [1] and commit [2], and are no longer useful. So remove these unused "os" fields. [1]: c08bb26010 (CI: rename the "Linux32" job to lower-case "linux32", 2021-11-23) [2]: 25715419bf (CI: don't run "make test" twice in one job, 2021-11-23) Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-27Downmerge a bit more for 2.38.2Junio C Hamano1-0/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-27Merge branch 'rs/archive-dedup-printf' into maint-2.38Junio C Hamano1-5/+3
Code simplification. * rs/archive-dedup-printf: archive: deduplicate verbose printing
2022-10-27Merge branch 'jh/struct-zero-init-with-older-clang' into maint-2.38Junio C Hamano1-0/+25
Work around older clang that warns against C99 zero initialization syntax for struct. * jh/struct-zero-init-with-older-clang: config.mak.dev: disable suggest braces error on old clang versions
2022-10-27Merge branch 'rs/use-fspathncmp' into maint-2.38Junio C Hamano1-3/+1
Code clean-up. * rs/use-fspathncmp: dir: use fspathncmp() in pl_hashmap_cmp()
2022-10-27Merge branch 'rj/branch-edit-desc-unborn' into maint-2.38Junio C Hamano2-2/+58
"git branch --edit-description" on an unborh branch misleadingly said that no such branch exists, which has been corrected. * rj/branch-edit-desc-unborn: branch: description for non-existent branch errors
2022-10-27Merge branch 'pw/remove-rebase-p-test' into maint-2.38Junio C Hamano1-8/+0
Remove outdated test. * pw/remove-rebase-p-test: t3435: remove redundant test case
2022-10-27Merge branch 'jc/use-of-uc-in-log-messages' into maint-2.38Junio C Hamano1-1/+3
Clarify that "the sentence after <area>: prefix does not begin with a capital letter" rule applies only to the commit title. * jc/use-of-uc-in-log-messages: SubmittingPatches: use usual capitalization in the log message body
2022-10-27Merge branch 'jc/tmp-objdir' into maint-2.38Junio C Hamano1-36/+4
The code to clean temporary object directories (used for quarantine) tried to remove them inside its signal handler, which was a no-no. * jc/tmp-objdir: tmp-objdir: skip clean up when handling a signal
2022-10-27Merge branch 'dd/document-runtime-prefix-better' into maint-2.38Junio C Hamano1-2/+3
Update comment in the Makefile about the RUNTIME_PREFIX config knob. * dd/document-runtime-prefix-better: Makefile: clarify runtime relative gitexecdir
2022-10-27Merge branch 'ab/unused-annotation' into maint-2.38Junio C Hamano1-1/+4
Compilation fix for ancient compilers. * ab/unused-annotation: git-compat-util.h: GCC deprecated message arg only in GCC 4.5+
2022-10-27Merge branch 'tb/midx-repack-ignore-cruft-packs' into maint-2.38Junio C Hamano3-6/+107
"git multi-pack-index repack/expire" used to repack unreachable cruft into a new pack, which have been corrected. cf. <63a1c3d4-eff3-af10-4263-058c88e74594@github.com> * tb/midx-repack-ignore-cruft-packs: midx.c: avoid cruft packs with non-zero `repack --batch-size` midx.c: remove unnecessary loop condition midx.c: replace `xcalloc()` with `CALLOC_ARRAY()` midx.c: avoid cruft packs with `repack --batch-size=0` midx.c: prevent `expire` from removing the cruft pack Documentation/git-multi-pack-index.txt: clarify expire behavior Documentation/git-multi-pack-index.txt: fix typo
2022-10-27Merge branch 'so/diff-merges-cleanup' into maint-2.38Junio C Hamano2-19/+27
Code clean-up. * so/diff-merges-cleanup: diff-merges: clarify log.diffMerges documentation diff-merges: cleanup set_diff_merges() diff-merges: cleanup func_by_opt()
2022-10-27Merge branch 'rj/ref-filter-get-head-description-leakfix' into maint-2.38Junio C Hamano1-0/+2
Leakfix. * rj/ref-filter-get-head-description-leakfix: ref-filter.c: fix a leak in get_head_description
2022-10-27Merge branch 'jc/environ-docs' into maint-2.38Junio C Hamano2-16/+28
Documentation on various Boolean GIT_* environment variables have been clarified. * jc/environ-docs: environ: GIT_INDEX_VERSION affects not just a new repository environ: simplify description of GIT_INDEX_FILE environ: GIT_FLUSH should be made a usual Boolean environ: explain Boolean environment variables environ: document GIT_SSL_NO_VERIFY
2022-10-27Makefile: force -O0 when compiling with SANITIZE=leakJeff King1-0/+1
Cherry pick commit d3775de0 (Makefile: force -O0 when compiling with SANITIZE=leak, 2022-10-18), as otherwise the leak checker at GitHub Actions CI seems to fail with a false positive. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25Downmerge a handful of topics for 2.38.2Junio C Hamano2-1/+48
2022-10-25Merge branch 'jk/cleanup-callback-parameters' into maint-2.38Junio C Hamano4-57/+17
Code clean-up. * jk/cleanup-callback-parameters: attr: drop DEBUG_ATTR code commit: avoid writing to global in option callback multi-pack-index: avoid writing to global in option callback test-submodule: inline resolve_relative_url() function
2022-10-25Merge branch 'rs/gc-pack-refs-simplify' into maint-2.38Junio C Hamano1-9/+2
Code clean-up. * rs/gc-pack-refs-simplify: gc: simplify maintenance_task_pack_refs()
2022-10-25Merge branch 'nb/doc-mergetool-typofix' into maint-2.38Junio C Hamano1-1/+1
Typofix. * nb/doc-mergetool-typofix: mergetool.txt: typofix 'overwriten' -> 'overwritten'
2022-10-25Merge branch 'jk/sequencer-missing-author-name-check' into maint-2.38Junio C Hamano2-1/+60
Typofix in code. * jk/sequencer-missing-author-name-check: sequencer: detect author name errors in read_author_script()
2022-10-25Merge branch 'ds/bundle-uri-docfix' into maint-2.38Junio C Hamano1-4/+4
Doc formatting fix. * ds/bundle-uri-docfix: bundle-uri: fix technical doc issues
2022-10-25Merge branch 'ab/test-malloc-with-sanitize-leak' into maint-2.38Junio C Hamano1-1/+3
Test fix. * ab/test-malloc-with-sanitize-leak: test-lib: have SANITIZE=leak imply TEST_NO_MALLOC_CHECK
2022-10-25Merge branch 'rs/bisect-start-leakfix' into maint-2.38Junio C Hamano1-4/+3
Code clean-up that results in plugging a leak. * rs/bisect-start-leakfix: bisect--helper: plug strvec leak
2022-10-25Merge branch 'jc/branch-description-unset' into maint-2.38Junio C Hamano2-2/+7
"GIT_EDITOR=: git branch --edit-description" resulted in failure, which has been corrected. * jc/branch-description-unset: branch: do not fail a no-op --edit-desc
2022-10-25Merge branch 'pw/ssh-sign-report-errors' into maint-2.38Junio C Hamano1-3/+4
The codepath to sign learned to report errors when it fails to read from "ssh-keygen". * pw/ssh-sign-report-errors: ssh signing: return an error when signature cannot be read
2022-10-25Merge branch 'pw/mailinfo-b-fix' into maint-2.38Junio C Hamano2-3/+3
Fix a logic in "mailinfo -b" that miscomputed the length of a substring, which lead to an out-of-bounds access. * pw/mailinfo-b-fix: mailinfo -b: fix an out of bounds access
2022-10-25Merge branch 'rs/test-httpd-in-C-locale' into maint-2.38Junio C Hamano1-0/+2
Force C locale while running tests around httpd to make sure we can find expected error messages in the log. * rs/test-httpd-in-C-locale: t/lib-httpd: pass LANG and LC_ALL to Apache
2022-10-25Merge branch 'js/merge-ort-in-read-only-repo' into maint-2.38Junio C Hamano2-34/+69
In read-only repositories, "git merge-tree" tried to come up with a merge result tree object, which it failed (which is not wrong) and led to a segfault (which is bad), which has been corrected. * js/merge-ort-in-read-only-repo: merge-ort: return early when failing to write a blob merge-ort: fix segmentation fault in read-only repositories
2022-10-25Merge branch 'ja/rebase-i-avoid-amending-self' into maint-2.38Junio C Hamano2-2/+15
"git rebase -i" can mistakenly attempt to apply a fixup to a commit itself, which has been corrected. * ja/rebase-i-avoid-amending-self: sequencer: avoid dropping fixup commit that targets self via commit-ish
2022-10-25Merge branch 'jk/fsck-on-diet' into maint-2.38Junio C Hamano2-4/+5
"git fsck" failed to release contents of tree objects already used from the memory, which has been fixed. * jk/fsck-on-diet: parse_object_buffer(): respect save_commit_buffer fsck: turn off save_commit_buffer fsck: free tree buffers after walking unreachable objects
2022-10-25Merge branch 'ah/fsmonitor-daemon-usage-non-l10n' into maint-2.38Junio C Hamano1-2/+2
Fix messages incorrectly marked for translation. * ah/fsmonitor-daemon-usage-non-l10n: fsmonitor--daemon: don't translate literal commands