summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-13Git 2.46.1v2.46.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-13Merge branch 'rj/compat-terminal-unused-fix' into maint-2.46Junio C Hamano
Build fix. * rj/compat-terminal-unused-fix: compat/terminal: mark parameter of git_terminal_prompt() UNUSED
2024-09-13Merge branch 'jc/config-doc-update' into maint-2.46Junio C Hamano
Docfix. * jc/config-doc-update: git-config.1: fix description of --regexp in synopsis git-config.1: --get-all description update
2024-09-13Merge branch 'aa/cat-file-batch-output-doc' into maint-2.46Junio C Hamano
Docfix. * aa/cat-file-batch-output-doc: docs: explain the order of output in the batched mode of git-cat-file(1)
2024-09-13Merge branch 'cl/config-regexp-docfix' into maint-2.46Junio C Hamano
Docfix. * cl/config-regexp-docfix: doc: replace 3 dash with correct 2 dash in git-config(1)
2024-09-13Merge branch 'jc/coding-style-c-operator-with-spaces' into maint-2.46Junio C Hamano
Write down whitespacing rules around C opeators. * jc/coding-style-c-operator-with-spaces: CodingGuidelines: spaces around C operators
2024-09-13Merge branch 'ps/stash-keep-untrack-empty-fix' into maint-2.46Junio C Hamano
A corner case bug in "git stash" was fixed. * ps/stash-keep-untrack-empty-fix: builtin/stash: fix `--keep-index --include-untracked` with empty HEAD
2024-09-13Merge branch 'ps/index-pack-outside-repo-fix' into maint-2.46Junio C Hamano
"git verify-pack" and "git index-pack" started dying outside a repository, which has been corrected. * ps/index-pack-outside-repo-fix: builtin/index-pack: fix segfaults when running outside of a repo
2024-09-13Merge branch 'jk/free-commit-buffer-of-skipped-commits' into maint-2.46Junio C Hamano
The code forgot to discard unnecessary in-core commit buffer data for commits that "git log --skip=<number>" traversed but omitted from the output, which has been corrected. * jk/free-commit-buffer-of-skipped-commits: revision: free commit buffers for skipped commits
2024-09-12Another batch of topics for 2.46.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-12Merge branch 'jc/grammo-fixes' into maint-2.46Junio C Hamano
Doc updates. * jc/grammo-fixes: doc: grammofix in git-diff-tree tutorial: grammofix
2024-09-12Merge branch 'jc/tests-no-useless-tee' into maint-2.46Junio C Hamano
Test fixes. * jc/tests-no-useless-tee: tests: drop use of 'tee' that hides exit status
2024-09-12Merge branch 'jc/how-to-maintain-updates' into maint-2.46Junio C Hamano
Doc updates. * jc/how-to-maintain-updates: howto-maintain: mention preformatted docs
2024-09-12Merge branch 'ps/bundle-outside-repo-fix' into maint-2.46Junio C Hamano
"git bundle unbundle" outside a repository triggered a BUG() unnecessarily, which has been corrected. * ps/bundle-outside-repo-fix: bundle: default to SHA1 when reading bundle headers builtin/bundle: have unbundle check for repo before opening its bundle
2024-09-12Merge branch 'jc/patch-id' into maint-2.46Junio C Hamano
The patch parser in "git patch-id" has been tightened to avoid getting confused by lines that look like a patch header in the log message. cf. <Zqh2T_2RLt0SeKF7@tanuki> * jc/patch-id: patch-id: tighten code to detect the patch header patch-id: rewrite code that detects the beginning of a patch patch-id: make get_one_patchid() more extensible patch-id: call flush_current_id() only when needed t4204: patch-id supports various input format
2024-09-12Merge branch 'jk/apply-patch-mode-check-fix' into maint-2.46Junio C Hamano
Test fix. * jk/apply-patch-mode-check-fix: t4129: fix racy index when calling chmod after git-add apply: canonicalize modes read from patches
2024-09-04builtin/index-pack: fix segfaults when running outside of a repoPatrick Steinhardt
It was reported that git-verify-pack(1) has started to crash with Git v2.46.0 when run outside of a repository. This is another fallout from c8aed5e8da (repository: stop setting SHA1 as the default object hash, 2024-05-07), where we have stopped setting the default hash algorithm for `the_repository`. Consequently, code that relies on `the_hash_algo` will now crash when it hasn't explicitly been initialized, which may be the case when running outside of a Git repository. The crash is not in git-verify-pack(1) but instead in git-index-pack(1), which gets called by the former. Ideally, both of these programs should be able to identify the hash algorithm used by the packfile and index without having to rely on external information. But unfortunately, the format for neither of them is completely self-describing, so it is not possible to derive that information. This is a design issue that we should address by introducing a new packfile version that encodes its object hash. For now though the more important fix is to not make either of these programs crash anymore, which we do by falling back to SHA1 when the object hash is unconfigured. This pessimizes reading packfiles which use a different hash than SHA1, but restores previous behaviour. Reported-by: Ilya K <me@0upti.me> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-01compat/terminal: mark parameter of git_terminal_prompt() UNUSEDRamsay Jones
If neither HAVE_DEV_TTY nor GIT_WINDOWS_NATIVE is set, the fallback code calls the system getpass(). This unfortunately ignores the "echo" boolean parameter, as we have no way to implement that functionality. But we still have to keep the unused parameter, since our interface has to match the other implementations. Co-authored-by: Jeff King <peff@peff.net> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-30revision: free commit buffers for skipped commitsJeff King
In git-log we leave the save_commit_buffer flag set to "1", which tells the commit parsing code to store the object content after it has parsed it to find parents, tree, etc. That lets us reuse the contents for pretty-printing the commit in the output. And then after printing each commit, we call free_commit_buffer(), since we don't need it anymore. But some options may cause us to traverse commits which are not part of the output. And so git-log does not see them at all, and doesn't free them. One such case is something like: git log -n 1000 --skip=1000000 which will churn through a million commits, before showing only a thousand. We loop through these inside get_revision(), without freeing the contents. As a result, we end up storing the object data for those million commits simultaneously. We should free the stored buffers (if any) for those commits as we skip over them, which is what this patch does. Running the above command in linux.git drops the peak heap usage from ~1.1GB to ~200MB, according to valgrind/massif. (I thought we might get an even bigger improvement, but the remaining memory is going to commit/tree structs, which we do hold on to forever). Note that this problem doesn't occur if: - you're running a git-rev-list without a --format parameter; it turns off save_commit_buffer by default, since it only output the object id - you've built a commit-graph file, since in that case we'd use the optimized graph data instead of the initial parse, and then do a lazy parse for commits we're actually going to output There are probably some other option combinations that can likewise end up with useless stored commit buffers. For example, if you ask for "foo..bar", then we'll have to walk down to the merge base, and everything on the "foo" side won't be shown. Tuning the "save" behavior to handle that might be tricky (I guess maybe drop buffers for anything we mark as UNINTERESTING?). And in the long run, the right solution here is probably to make sure the commit-graph is built (since it fixes the memory problem _and_ drastically reduces CPU usage). But since this "--skip" case is an easy one-liner, it's worth fixing in the meantime. It should be OK to make this call even if there is no saved buffer (e.g., because save_commit_buffer=0, or because a commit-graph was used), since it's O(1) to look up the buffer and is a noop if it isn't present. I verified by running the above command after "git commit-graph write --reachable", and it takes the same time with and without this patch. Reported-by: Yuri Karnilaev <karnilaev@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-26git-config.1: fix description of --regexp in synopsisJunio C Hamano
The synopsis says --regexp=<regexp> but the --regexp option is a Boolean that says "the name given is not literal, but a pattern to match the name". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-26git-config.1: --get-all description updateJunio C Hamano
"git config --get-all foo.bar" shows all values for the foo.bar variable, but does not give the variable name in each output entry. Hence it is equivalent to "git config get --all foo.bar", without "--show-names", in the more modern syntax. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-26A bit more topics for 2.46.x maintenance trackJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-26Merge branch 'xx/diff-tree-remerge-diff-fix' into maint-2.46Junio C Hamano
"git rev-list ... | git diff-tree -p --remerge-diff --stdin" should behave more or less like "git log -p --remerge-diff" but instead it crashed, forgetting to prepare a temporary object store needed. * xx/diff-tree-remerge-diff-fix: diff-tree: fix crash when used with --remerge-diff
2024-08-26Merge branch 'rs/t-example-simplify' into maint-2.46Junio C Hamano
Unit test simplification. * rs/t-example-simplify: t-example-decorate: remove test messages
2024-08-26Merge branch 'jc/safe-directory' into maint-2.46Junio C Hamano
Follow-up on 2.45.1 regression fix. * jc/safe-directory: safe.directory: setting safe.directory="." allows the "current" directory safe.directory: normalize the configured path safe.directory: normalize the checked path safe.directory: preliminary clean-up
2024-08-26Merge branch 'jc/document-use-of-local' into maint-2.46Junio C Hamano
Doc update. * jc/document-use-of-local: doc: note that AT&T ksh does not work with our test suite
2024-08-26Merge branch 'rs/use-decimal-width' into maint-2.46Junio C Hamano
Code clean-up. * rs/use-decimal-width: log-tree: use decimal_width()
2024-08-26Merge branch 'ss/packed-ref-store-leakfix' into maint-2.46Junio C Hamano
Leakfix. * ss/packed-ref-store-leakfix: refs/files: prevent memory leak by freeing packed_ref_store
2024-08-26Merge branch 'kl/test-fixes' into maint-2.46Junio C Hamano
A flakey test and incorrect calls to strtoX() functions have been fixed. * kl/test-fixes: t6421: fix test to work when repo dir contains d0 set errno=0 before strtoX calls
2024-08-26Merge branch 'jc/reflog-expire-lookup-commit-fix' into maint-2.46Junio C Hamano
"git reflog expire" failed to honor annotated tags when computing reachable commits. * jc/reflog-expire-lookup-commit-fix: Revert "reflog expire: don't use lookup_commit_reference_gently()"
2024-08-26Merge branch 'jr/ls-files-expand-literal-doc' into maint-2.46Junio C Hamano
Docfix. * jr/ls-files-expand-literal-doc: doc: fix hex code escapes in git-ls-files
2024-08-26Merge branch 'jc/leakfix-mailmap' into maint-2.46Junio C Hamano
Leakfix. * jc/leakfix-mailmap: mailmap: plug memory leak in read_mailmap_blob()
2024-08-26Merge branch 'jc/leakfix-hashfile' into maint-2.46Junio C Hamano
Leakfix. * jc/leakfix-hashfile: csum-file: introduce discard_hashfile()
2024-08-26Merge branch 'jc/jl-git-no-advice-fix' into maint-2.46Junio C Hamano
Remove leftover debugging cruft from a test script. * jc/jl-git-no-advice-fix: t0018: remove leftover debugging cruft
2024-08-26Merge branch 'tb/config-fixed-value-with-valueless-true' into maint-2.46Junio C Hamano
"git config --value=foo --fixed-value section.key newvalue" barfed when the existing value in the configuration file used the valueless true syntax, which has been corrected. * tb/config-fixed-value-with-valueless-true: config.c: avoid segfault with --fixed-value and valueless config
2024-08-26Merge branch 'ps/ls-remote-out-of-repo-fix' into maint-2.46Junio C Hamano
A recent update broke "git ls-remote" used outside a repository, which has been corrected. * ps/ls-remote-out-of-repo-fix: builtin/ls-remote: fall back to SHA1 outside of a repo
2024-08-26Merge branch 'jk/osxkeychain-username-is-nul-terminated' into maint-2.46Junio C Hamano
The credential helper to talk to OSX keychain sometimes sent garbage bytes after the username, which has been corrected. * jk/osxkeychain-username-is-nul-terminated: credential/osxkeychain: respect NUL terminator in username
2024-08-23doc: replace 3 dash with correct 2 dash in git-config(1)Celeste Liu
Commit 4e51389000 (builtin/config: introduce "get" subcommand, 2024-05-06) introduced this typo. It uses 3 dashes for regexp argument instead of correct 2 dashes. Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-22docs: explain the order of output in the batched mode of git-cat-file(1)ahmed akef
The batched mode of git-cat-file(1) reads multiple objects from stdin and prints their respective contents to stdout. The order in which those objects are printed is not documented and may not be immediately obvious to the user. Document it. Signed-off-by: ahmed akef <aemed.akef.1@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-20Merge branch 'js/ci-win-vs-build' into maint-2.46Junio C Hamano
Sync with Windows+VS build jobs used at CI. * js/ci-win-vs-build: ci(win+VS): download the vcpkg artifacts using a dedicated GitHub Action ci: bump microsoft/setup-msbuild from v1 to v2
2024-08-20CodingGuidelines: spaces around C operatorsJunio C Hamano
As we have operated with "write like how your surrounding code is written" for too long, after a huge code drop from another project, we'll end up being inconsistent before such an imported code is cleaned up. We have many uses of cast operator with a space before its operand, mostly in the reftable code. Spell the convention out before it spreads to other places. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-20ci(win+VS): download the vcpkg artifacts using a dedicated GitHub ActionJohannes Schindelin
The Git for Windows project provides a GitHub Action to download and cache Azure Pipelines artifacts (such as the `vcpkg` artifacts), hiding gnarly internals, and also providing some robustness against network glitches. Let's use it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-20ci: bump microsoft/setup-msbuild from v1 to v2Johannes Schindelin
The main benefit: The new version uses a node.js version that is not yet deprecated. Links: - [Release notes](https://github.com/microsoft/setup-msbuild/releases) - [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md) - [Commits](https://github.com/microsoft/setup-msbuild/compare/v1...v2) This patch was originally by GitHub's Dependabot, but I cannot attribute that bot properly because it has no dedicated email address. Probably because it hasn't reached legal age yet, or something. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-16Prepare for 2.46.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-16Merge branch 'ps/p4-tests-updates' into maint-2.46Junio C Hamano
Perforce tests have been updated. cf. <na5mwletzpnacietbc7pzqcgb622mvrwgrkjgjosysz3gvjcso@gzxxi7d7icr7> * ps/p4-tests-updates: t98xx: mark Perforce tests as memory-leak free ci: update Perforce version to r23.2 t98xx: fix Perforce tests with p4d r23 and newer
2024-08-16Merge branch 'ks/unit-test-comment-typofix' into maint-2.46Junio C Hamano
Typofix. * ks/unit-test-comment-typofix: unit-tests/test-lib: fix typo in check_pointer_eq() description
2024-08-16Merge branch 'dh/encoding-trace-optim' into maint-2.46Junio C Hamano
An expensive operation to prepare tracing was done in re-encoding code path even when the tracing was not requested, which has been corrected. * dh/encoding-trace-optim: convert: return early when not tracing
2024-08-16Merge branch 'dd/notes-empty-no-edit-by-default' into maint-2.46Junio C Hamano
"git notes add -m '' --allow-empty" and friends that take prepared data to create notes should not invoke an editor, but it started doing so since Git 2.42, which has been corrected. * dd/notes-empty-no-edit-by-default: notes: do not trigger editor when adding an empty note
2024-08-16Merge branch 'jc/doc-rebase-fuzz-vs-offset-fix' into maint-2.46Junio C Hamano
"git rebase --help" referred to "offset" (the difference between the location a change was taken from and the change gets replaced) incorrectly and called it "fuzz", which has been corrected. * jc/doc-rebase-fuzz-vs-offset-fix: doc: difference in location to apply is "offset", not "fuzz"
2024-08-16Merge branch 'tn/doc-commit-fix' into maint-2.46Junio C Hamano
Docfix. * tn/doc-commit-fix: doc: remove dangling closing parenthesis