summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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-27Merge branch 'js/cmake-updates'Junio C Hamano4-8/+20
Update to build procedure with VS using CMake/CTest. * js/cmake-updates: cmake: increase time-out for a long-running test cmake: avoid editing t/test-lib.sh add -p: avoid ambiguous signed/unsigned comparison cmake: copy the merge tools for testing cmake: make it easier to diagnose regressions in CTest runs
2022-10-27Merge branch 'nw/t1002-cleanup'Junio C Hamano1-8/+8
Code clean-up in test. * nw/t1002-cleanup: t1002: modernize outdated conditional
2022-10-27Merge branch 'ab/run-hook-api-cleanup'Junio C Hamano9-205/+265
Move a global variable added as a hack during regression fixes to its proper place in the API. * ab/run-hook-api-cleanup: run-command.c: remove "max_processes", add "const" to signal() handler run-command.c: pass "opts" further down, and use "opts->processes" run-command.c: use "opts->processes", not "pp->max_processes" run-command.c: don't copy "data" to "struct parallel_processes" run-command.c: don't copy "ungroup" to "struct parallel_processes" run-command.c: don't copy *_fn to "struct parallel_processes" run-command.c: make "struct parallel_processes" const if possible run-command API: move *_tr2() users to "run_processes_parallel()" run-command API: have run_process_parallel() take an "opts" struct run-command.c: use designated init for pp_init(), add "const" run-command API: don't fall back on online_cpus() run-command API: make "n" parameter a "size_t" run-command tests: use "return", not "exit" run-command API: have "run_processes_parallel{,_tr2}()" return void run-command test helper: use "else if" pattern
2022-10-27Merge branch 'tb/save-keep-pack-during-geometric-repack'Junio C Hamano3-1/+34
When geometric repacking feature is in use together with the --pack-kept-objects option, we lost packs marked with .keep files. * tb/save-keep-pack-during-geometric-repack: repack: don't remove .keep packs with `--pack-kept-objects`
2022-10-27Merge branch 'jk/unused-anno-more'Junio C Hamano19-57/+70
More UNUSED annotation to help using -Wunused option with the compiler. * jk/unused-anno-more: ll-merge: mark unused parameters in callbacks diffcore-pickaxe: mark unused parameters in pickaxe functions convert: mark unused parameter in null stream filter apply: mark unused parameters in noop error/warning routine apply: mark unused parameters in handlers date: mark unused parameters in handler functions string-list: mark unused callback parameters object-file: mark unused parameters in hash_unknown functions mark unused parameters in trivial compat functions update-index: drop unused argc from do_reupdate() submodule--helper: drop unused argc from module_list_compute() diffstat_consume(): assert non-zero length
2022-10-27Merge branch 'tb/midx-bitmap-selection-fix'Junio C Hamano3-2/+64
A bugfix with tracing support in midx codepath * tb/midx-bitmap-selection-fix: pack-bitmap-write.c: instrument number of reused bitmaps midx.c: instrument MIDX and bitmap generation with trace2 regions midx.c: consider annotated tags during bitmap selection midx.c: fix whitespace typo
2022-10-26config: let feature.experimental imply gc.cruftPacks=trueEmily Shaffer5-2/+63
We are interested in exploring whether gc.cruftPacks=true should become the default value. To determine whether it is safe to do so, let's encourage more users to try it out. Users who have set feature.experimental=true have already volunteered to try new and possibly-breaking config changes, so let's try this new default with that set of users. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-26gc: add tests for --cruft and friendsEmily Shaffer1-0/+43
In 5b92477f89 (builtin/gc.c: conditionally avoid pruning objects via loose, 2022-05-20) gc learned to respect '--cruft' and 'gc.cruftPacks'. '--cruft' is exercised in t5329-pack-objects-cruft.sh, but in a way that doesn't check whether a lone gc run generates these cruft packs. 'gc.cruftPacks' is never exercised. Add some tests to exercise these options to gc in the gc test suite. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-26Documentation/howto/maintain-git.txt: fix Meta/redo-jch.sh invocationTaylor Blau1-1/+1
The Meta/redo-jch.sh script is generated a few lines earlier by running: $ Meta/Reintegrate master..seen >Meta/redo-jch.sh But the resulting script is not necessarily executable. Later mentions of this script invoke it with sh (instead of directly), but this one is an odd one out. Update the documentation to invoke the Meta/redo-jch.sh script with sh in case the maintainer has not made the script executable. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-26branch: error code with --edit-descriptionRubén Justo2-2/+2
Since c2d17ba3db0d (branch --edit-description: protect against mistyped branch name, 2012-02-05) we return -1 on error editing the branch description. Let's change to 1, which follows the established convention and it is better for portability reasons. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-26branch: error copying or renaming a detached HEADRubén Justo2-20/+19
In c847f53712 (Detached HEAD (experimental), 2007-01-01) an error condition was introduced in rename_branch() to prevent renaming, later also copying, a detached HEAD. The condition used was checking for NULL in oldname, the source branch to rename/copy. That condition cannot be satisfied because if no source branch is specified, HEAD is going to be used in the call. The error issued instead is: fatal: Invalid branch name: 'HEAD' Let's remove the condition in copy_or_rename_branch() (the current function name) and check for HEAD before calling it, dying with the original intended error if we're in a detached HEAD. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-26Sync with 'maint'Junio C Hamano2-19/+47
2022-10-25negotiator/skipping: avoid stack overflowJonathan Tan1-12/+17
mark_common() in negotiator/skipping.c may overflow the stack due to recursive function calls. Avoid this by instead recursing using a heap-allocated data structure. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25The sixth batchJunio C Hamano1-0/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25Merge branch 'jc/more-sanitizer-at-ci'Junio C Hamano2-0/+12
Enable address and undefined sanitizer tasks at GitHub Actions CI. * jc/more-sanitizer-at-ci: ci: add address and undefined sanitizer tasks
2022-10-25Merge branch 'jc/ci-osx-with-sha1dc'Junio C Hamano1-0/+2
Give a bit more diversity to macOS CI by using sha1dc in one of the jobs (the other one tests Apple Common Crypto). * jc/ci-osx-with-sha1dc: ci: use DC_SHA1=YesPlease on osx-clang job for CI
2022-10-25Merge branch 'gc/bare-repo-discovery'Junio C Hamano3-22/+26
Allow configuration files in "protected" scopes to include other configuration files. * gc/bare-repo-discovery: config: respect includes in protected config
2022-10-25Merge branch 'rs/diff-caret-bang-with-parents'Junio C Hamano5-13/+35
"git diff rev^!" did not show combined diff to go to the rev from its parents. * rs/diff-caret-bang-with-parents: diff: support ^! for merges revisions.txt: unspecify order of resolved parts of ^! revision: use strtol_i() for exclude_parent
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
2022-10-25Merge branch 'jk/clone-allow-bare-and-o-together' into maint-2.38Junio C Hamano2-7/+5
"git clone" did not like to see the "--bare" and the "--origin" options used together without a good reason. * jk/clone-allow-bare-and-o-together: clone: allow "--bare" with "-o"
2022-10-25Merge branch 'jk/remote-rename-without-fetch-refspec' into maint-2.38Junio C Hamano2-21/+34
"git remote rename" failed to rename a remote without fetch refspec, which has been corrected. * jk/remote-rename-without-fetch-refspec: remote: handle rename of remote without fetch refspec
2022-10-25Merge branch 'vd/fix-unaligned-read-index-v4' into maint-2.38Junio C Hamano1-19/+42
The codepath that reads from the index v4 had unaligned memory accesses, which has been corrected. * vd/fix-unaligned-read-index-v4: read-cache: avoid misaligned reads in index v4
2022-10-25Merge branch 'ab/coding-guidelines-c99' into maint-2.38Junio C Hamano2-17/+25
Update CodingGuidelines to clarify what features to use and avoid in C99. * ab/coding-guidelines-c99: CodingGuidelines: recommend against unportable C99 struct syntax CodingGuidelines: mention C99 features we can't use CodingGuidelines: allow declaring variables in for loops CodingGuidelines: mention dynamic C99 initializer elements CodingGuidelines: update for C99
2022-10-25Documentation: add lint-fsck-msgidsJunio C Hamano2-0/+81
During the initial development of the fsck-msgids.txt feature, it has become apparent that it is very much error prone to make sure the description in the documentation file are sorted and correctly match what is in the fsck.h header file. Add a quick-and-dirty Perl script and doc-lint target to sanity check that the fsck-msgids.txt is consistent with the error type list in the fsck.h header file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25fsck: document msg-idJohn Cai4-0/+183
The documentation lacks mention of specific <msg-id> that are supported. While git-help --config will display a list of these options, often developers' first instinct is to consult the git docs to find valid config values. Add a list of fsck error messages, and link to it from the git-fsck documentation. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25fsck: remove the unused MISSING_TREE_OBJECTJunio C Hamano1-1/+0
This error type has never been used since it was introduced at 159e7b08 (fsck: detect gitmodules files, 2018-05-02). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25fsck: remove the unused BAD_TAG_OBJECTJohn Cai1-1/+0
2175a0c6 (fsck: stop checking tag->tagged, 2019-10-18) stopped checking the tagged object referred to by a tag object, which is what the error message BAD_TAG_OBJECT was for. Since then the BAD_TAG_OBJECT message is no longer used anywhere. Remove the BAD_TAG_OBJECT msg-id. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-25apply: reject patches larger than ~1 GiBTaylor Blau2-1/+34
The apply code is not prepared to handle extremely large files. It uses "int" in some places, and "unsigned long" in others. This combination leads to unfortunate problems when switching between the two types. Using "int" prevents us from handling large files, since large offsets will wrap around and spill into small negative values, which can result in wrong behavior (like accessing the patch buffer with a negative offset). Converting from "unsigned long" to "int" also has truncation problems even on LLP64 platforms where "long" is the same size as "int", since the former is unsigned but the latter is not. To avoid potential overflow and truncation issues in `git apply`, apply similar treatment as in dcd1742e56 (xdiff: reject files larger than ~1GB, 2015-09-24), where the xdiff code was taught to reject large files for similar reasons. The maximum size was chosen somewhat arbitrarily, but picking a value just shy of a gigabyte allows us to double it without overflowing 2^31-1 (after which point our value would wrap around to a negative number). To give ourselves a bit of extra margin, the maximum patch size is a MiB smaller than a full GiB, which gives us some slop in case we allocate "(records + 1) * sizeof(int)" or similar. Luckily, the security implications of these conversion issues are relatively uninteresting, because a victim needs to be convinced to apply a malicious patch. Reported-by: 정재우 <thebound7@gmail.com> Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-24embargoed releases: also describe the git-security list and the processJulia Ramer1-25/+140
With the recent turnover on the git-security list, questions came up how things are usually run. Rather than answering questions individually, extend Git's existing documentation about security vulnerabilities to describe the git-security mailing list, how things are run on that list, and what to expect throughout the process from the time a security bug is reported all the way to the time when a fix is released. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Julia Ramer <gitprplr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-24builtin: patch-id: remove unused diff-tree prefixJerry Zhang1-2/+2
The last git version that had "diff-tree" in the header text of "git diff-tree" output was v1.3.0 from 2006. The header text was changed from "diff-tree" to "commit" in 91539833 ("Log message printout cleanups"). Given how long ago this change was made, it is highly unlikely that anyone is still feeding in outputs from that git version. Remove the handling of the "diff-tree" prefix and document the source of the other prefixes so that the overall functionality is more clear. Signed-off-by: Jerry Zhang <Jerry@skydio.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-24builtin: patch-id: add --verbatim as a command modeJerry Zhang3-35/+120
There are situations where the user might not want the default setting where patch-id strips all whitespace. They might be working in a language where white space is syntactically important, or they might have CI testing that enforces strict whitespace linting. In these cases, a whitespace change would result in the patch fundamentally changing, and thus deserving of a different id. Add a new mode that is exclusive of --stable and --unstable called --verbatim. It also corresponds to the config patchid.verbatim = true. In this mode, the stable algorithm is used and whitespace is not stripped from the patch text. Users of --unstable mainly care about compatibility with old git versions, which unstripping the whitespace would break. Thus there isn't a usecase for the combination of --verbatim and --unstable, and we don't expose this so as to not add maintainence burden. Signed-off-by: Jerry Zhang <jerry@skydio.com> fixes https://github.com/Skydio/revup/issues/2 Signed-off-by: Junio C Hamano <gitster@pobox.com>