summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-10-12Merge branch 'po/git-config-doc-mentions-help-c' into maintLibravatar Junio C Hamano1-0/+3
Doc update. * po/git-config-doc-mentions-help-c: doc: config, tell readers of `git help --config`
2021-10-12Merge branch 'kz/revindex-comment-fix' into maintLibravatar Junio C Hamano1-2/+2
Header comment fix. * kz/revindex-comment-fix: pack-revindex.h: correct the time complexity descriptions
2021-10-12Merge branch 'cb/plug-leaks-in-alloca-emu-users' into maintLibravatar Junio C Hamano2-12/+15
Leakfix. * cb/plug-leaks-in-alloca-emu-users: t0000: avoid masking git exit value through pipes tree-diff: fix leak when not HAVE_ALLOCA_H
2021-10-12Merge branch 'ma/doc-git-version' into maintLibravatar Junio C Hamano2-0/+32
Doc update. * ma/doc-git-version: documentation: add documentation for 'git version'
2021-10-12Merge branch 'rs/drop-core-compression-vars' into maintLibravatar Junio C Hamano3-5/+0
Code clean-up. * rs/drop-core-compression-vars: compression: drop write-only core_compression_* variables
2021-10-12Merge branch 'jk/t5562-racefix' into maintLibravatar Junio C Hamano1-8/+8
Test update. * jk/t5562-racefix: t5562: use alarm() to interrupt timed child-wait
2021-10-12Merge branch 'rs/setup-use-xopen-and-xdup' into maintLibravatar Junio C Hamano1-5/+3
Code clean-up. * rs/setup-use-xopen-and-xdup: setup: use xopen and xdup in sanitize_stdfds
2021-10-12Merge branch 'jc/prefix-filename-allocates' into maintLibravatar Junio C Hamano1-1/+1
Leakfix. * jc/prefix-filename-allocates: hash-object: prefix_filename() returns allocated memory these days
2021-10-12Merge branch 'ab/no-more-check-bindir' into maintLibravatar Junio C Hamano2-15/+1
Build simplification. * ab/no-more-check-bindir: Makefile: remove the check_bindir script
2021-10-12Merge branch 'bs/doc-bugreport-outdir' into maintLibravatar Junio C Hamano1-2/+2
Docfix. * bs/doc-bugreport-outdir: Documentation: fix default directory of git bugreport -o
2021-10-12Merge branch 'cb/ci-build-pedantic' into maintLibravatar Junio C Hamano3-3/+13
CI update. * cb/ci-build-pedantic: ci: run a pedantic build as part of the GitHub workflow
2021-10-12Merge branch 'rs/archive-use-object-id' into maintLibravatar Junio C Hamano1-4/+3
Code cleanup. * rs/archive-use-object-id: archive: convert queue_directory to struct object_id
2021-10-12Merge branch 'rs/show-branch-simplify' into maintLibravatar Junio C Hamano1-10/+5
Code cleanup. * rs/show-branch-simplify: show-branch: simplify rev_is_head()
2021-10-12Merge branch 'cb/remote-ndebug-fix' into maintLibravatar Junio C Hamano1-3/+3
Build fix. * cb/remote-ndebug-fix: remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUG
2021-10-12Merge branch 'ab/mailmap-leakfix' into maintLibravatar Junio C Hamano1-0/+2
Leakfix. * ab/mailmap-leakfix: mailmap.c: fix a memory leak in free_mailap_{info,entry}()
2021-10-12Merge branch 'ab/gc-log-rephrase' into maintLibravatar Junio C Hamano1-1/+1
A pathname in an advice message has been made cut-and-paste ready. * ab/gc-log-rephrase: gc: remove trailing dot from "gc.log" line
2021-10-12Merge branch 'ba/object-info' into maintLibravatar Junio C Hamano1-2/+3
Leakfix. * ba/object-info: protocol-caps.c: fix memory leak in send_info()
2021-10-12Merge branch 'es/walken-tutorial-fix' into maintLibravatar Junio C Hamano1-2/+2
Typofix. * es/walken-tutorial-fix: doc: fix syntax error and the format of printf
2021-10-12Merge branch 'rs/xopen-reports-open-failures' into maintLibravatar Junio C Hamano16-53/+36
Error diagnostics improvement. * rs/xopen-reports-open-failures: use xopen() to handle fatal open(2) failures xopen: explicitly report creation failures
2021-10-12Merge branch 'dd/t6300-wo-gpg-fix' into maintLibravatar Junio C Hamano1-11/+18
Test fix. * dd/t6300-wo-gpg-fix: t6300: check for cat-file exit status code t6300: don't run cat-file on non-existent object
2021-10-12Merge branch 'mh/credential-leakfix' into maintLibravatar Junio C Hamano1-0/+1
Leak fix. * mh/credential-leakfix: credential: fix leak in credential_apply_config()
2021-10-12Merge branch 'jk/t5323-no-pack-test-fix' into maintLibravatar Junio C Hamano1-2/+2
Test fix. * jk/t5323-no-pack-test-fix: t5323: drop mentions of "master"
2021-10-12Merge branch 'js/maintenance-launchctl-fix' into maintLibravatar Junio C Hamano2-21/+87
"git maintenance" scheduler fix for macOS. * js/maintenance-launchctl-fix: maintenance: skip bootout/bootstrap when plist is registered maintenance: create `launchctl` configuration using a lock file
2021-10-12Merge branch 'ab/rebase-fatal-fatal-fix' into maintLibravatar Junio C Hamano1-1/+1
Error message fix. * ab/rebase-fatal-fatal-fix: rebase: emit one "fatal" in "fatal: fatal: <error>"
2021-10-12Merge branch 'ab/ls-remote-packet-trace' into maintLibravatar Junio C Hamano2-3/+5
Debugging aid fix. * ab/ls-remote-packet-trace: ls-remote: set packet_trace_identity(<name>)
2021-10-12Merge branch 'ga/send-email-sendmail-cmd' into maintLibravatar Junio C Hamano1-1/+1
Test fix. * ga/send-email-sendmail-cmd: t9001: PATH must not use Windows-style paths
2021-10-12Merge branch 'me/t5582-cleanup' into maintLibravatar Junio C Hamano1-1/+0
Test fix. * me/t5582-cleanup: t5582: remove spurious 'cd "$D"' line
2021-10-12Merge branch 'sg/make-fix-ar-invocation' into maintLibravatar Junio C Hamano1-2/+2
Build fix. * sg/make-fix-ar-invocation: Makefile: remove archives before manipulating them with 'ar'
2021-10-12Merge branch 'ti/tcsh-completion-regression-fix' into maintLibravatar Junio C Hamano1-2/+3
Update to the command line completion (in contrib/) for tcsh. * ti/tcsh-completion-regression-fix: completion: tcsh: Fix regression by drop of wrapper functions
2021-10-12Merge branch 'fc/completion-updates' into maintLibravatar Junio C Hamano2-7/+22
Command line completion updates. * fc/completion-updates: completion: bash: add correct suffix in variables completion: bash: fix for multiple dash commands completion: bash: fix for suboptions with value completion: bash: fix prefix detection in branch.*
2021-10-12Merge branch 'cb/ci-freebsd-update' into maintLibravatar Junio C Hamano1-1/+8
Update FreeBSD CI job * cb/ci-freebsd-update: ci: update freebsd 12 cirrus job
2021-10-12Merge branch 'cb/builtin-merge-format-string-fix' into maintLibravatar Junio C Hamano1-3/+5
Code clean-up. * cb/builtin-merge-format-string-fix: builtin/merge: avoid -Wformat-extra-args from ancient Xcode
2021-10-12Merge branch 'js/log-protocol-version' into maintLibravatar Junio C Hamano3-0/+15
Debugging aid. * js/log-protocol-version: connect, protocol: log negotiated protocol version
2021-10-12Merge branch 'en/merge-strategy-docs' into maintLibravatar Junio C Hamano6-42/+55
Documentation updates. * en/merge-strategy-docs: Update error message and code comment merge-strategies.txt: add coverage of the `ort` merge strategy git-rebase.txt: correct out-of-date and misleading text about renames merge-strategies.txt: fix simple capitalization error merge-strategies.txt: avoid giving special preference to patience algorithm merge-strategies.txt: do not imply using copy detection is desired merge-strategies.txt: update wording for the resolve strategy Documentation: edit awkward references to `git merge-recursive` directory-rename-detection.txt: small updates due to merge-ort optimizations git-rebase.txt: correct antiquated claims about --rebase-merges
2021-10-12Merge branch 'ab/bundle-doc' into maintLibravatar Junio C Hamano1-30/+117
Doc update. * ab/bundle-doc: bundle doc: replace "basis" with "prerequsite(s)" bundle doc: elaborate on rev<->ref restriction bundle doc: elaborate on object prerequisites bundle doc: rewrite the "DESCRIPTION" section
2021-09-16t0000: avoid masking git exit value through pipesLibravatar Carlo Marcelo Arenas Belón1-11/+12
9af0b8dbe2 (t0000-basic: more commit-tree tests., 2006-04-26) adds tests for commit-tree that mask the return exit from git as described in a378fee5b07 (Documentation: add shell guidelines, 2018-10-05). Fix the tests, to avoid pipes by using a temporary file instead. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-16tree-diff: fix leak when not HAVE_ALLOCA_HLibravatar Carlo Marcelo Arenas Belón1-1/+3
b8ba412bf7 (tree-diff: avoid alloca for large allocations, 2016-06-07) adds a way to route some bigger allocations out of the stack and free them through the addition of two conveniently named macros, but leaves the calls to free the xalloca part, which could be also in the heap, if the system doesn't HAVE_ALLOCA_H (ex: macOS and other BSD). Add the missing free call, xalloca_free(), which is a noop if we allocated memory in the stack frame, but a real free() if we allocated in the heap instead, and while at it, change the expression to match in both macros for ease of readability. This avoids a leak reported by LSAN while running t0000 but that wouldn't fail the test (which is fixed in the next patch): SUMMARY: LeakSanitizer: 1034 byte(s) leaked in 15 allocation(s). Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-15pack-revindex.h: correct the time complexity descriptionsLibravatar Kyle Zhao1-2/+2
Time complexities for pack_pos_to_midx and midx_to_pack_pos are swapped, correct it. Signed-off-by: Kyle Zhao <kylezhao@tencent.com> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-14documentation: add documentation for 'git version'Libravatar Matthias Aßhauer2-0/+32
While 'git version' is probably the least complex git command, it is a non-experimental user-facing builtin command. As such it should have a help page. Both `git help` and `git version` can be called as options (`--help`/`--version`) that internally get converted to the corresponding command. Add a small paragraph to Documentation/git.txt describing how these two options interact with each other and link to this help page for the sub-options that `--version` can take. Well, currently there is only one sub-option, but that could potentially increase in future versions of Git. Signed-off-by: Matthias Aßhauer <mha1993@live.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-13doc: config, tell readers of `git help --config`Libravatar Philip Oakley1-0/+3
The `git help` command gained the ability to list config variables in 3ac68a93fd (help: add --config to list all available config, 2018-05-26) but failed to tell readers of the config documenation itself. Provide that cross reference. Signed-off-by: Philip Oakley <philipoakley@iee.email> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-12compression: drop write-only core_compression_* variablesLibravatar René Scharfe3-5/+0
Since 8de7eeb54b (compression: unify pack.compression configuration parsing, 2016-11-15) the variables core_compression_level and core_compression_seen are only set, but never read. Remove them. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-09t5562: use alarm() to interrupt timed child-waitLibravatar Jeff King1-8/+8
The t5562 script occasionally takes 60 extra seconds to complete due to a race condition in the invoke-with-content-length.pl helper. The way it's supposed to work is this: - we set up a SIGCLD handler - we kick off http-backend and write to it with a set content-length, but _don't_ close the pipe - we sleep for 60 seconds, assuming that SIGCLD from http-backend finishing will interrupt us - after the sleep finishes (whetherby 60 seconds or because it was interrupted by the signal), we check a flag to see if our SIGCLD handler was called. If not, then we complain. This usually completes immediately, because the signal interrupts our sleep. But very occasionally the child process dies _before_ we hit the sleep, so we don't realize it. The test still completes successfully (because our $exited flag is set), but it takes an extra 60 seconds. There's no way to check the flag and sleep atomically. So the best we can do with this approach is to sleep in smaller chunks (say, 1 second) and check the flag incrementally. Then we waste a maximum of 1 second if we lose the race. This was proposed in: https://lore.kernel.org/git/20190218205028.32486-1-max@max630.net/ and it does work. But we can do better. Instead of blocking on sleep and waiting for the child signal to interrupt us, we can block on the child exiting and set an alarm signal to trigger the timeout. This lets us exit the script immediately when the child behaves (with no race possible), and wait a maximum of 60 seconds when it doesn't. Note one small subtlety: perl is very willing to restart the waitpid() call after the alarm is delivered, even if we've thrown an exception via die. "perldoc -f alarm" claims you can get around this with an eval/die combo (and even has some example code), but it doesn't seem to work for me with waitpid(); instead, we continue waiting until the child exits. So instead, we'll instruct the child process to exit in the alarm handler itself. In the original code this was done by calling close($out). That would continue to work, since our child is always http-backend, which should exit when its stdin closes. But we can be even more robust against a hung or confused child by sending a KILL signal, which should terminate it immediately. Reported-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-09setup: use xopen and xdup in sanitize_stdfdsLibravatar René Scharfe1-5/+3
Replace the catch-all error message with specific ones for opening and duplicating by calling the wrappers xopen and xdup. The code becomes easier to follow when error handling is reduced to two letters. Remove the unnecessary mode parameter while at it -- we expect /dev/null to already exist. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-07hash-object: prefix_filename() returns allocated memory these daysLibravatar Junio C Hamano1-1/+1
Back when a1be47e4 (hash-object: fix buffer reuse with --path in a subdirectory, 2017-03-20) was written, the prefix_filename() helper used a static piece of memory to the caller, making the caller responsible for copying it, if it wants to keep it across another call to the same function. Two callers of the prefix_filename() in hash-object were made to xstrdup() the value obtained from it. But in the same series, when e4da43b1 (prefix_filename: return newly allocated string, 2017-03-20) changed the rule to gave the caller possession of the memory, we forgot to revert one of the xstrdup() changes, allowing the returned value to leak. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-07Documentation: fix default directory of git bugreport -oLibravatar Bagas Sanjaya1-2/+2
git bugreport writes bug report to the current directory by default, instead of repository root. Fix the documentation. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-07Makefile: remove the check_bindir scriptLibravatar Ævar Arnfjörð Bjarmason2-15/+1
This script was added in f28ac70f48 (Move all dashed-form commands to libexecdir, 2007-11-28) when commands such as "git-add" lived in the bin directory, instead of the git exec directory. This notice helped someone incorrectly installing version v1.6.0 and later into a directory built for a pre-v1.6.0 git version. We're now long past the point where anyone who'd be helped by this warning is likely to be doing that, so let's just remove this check and warning to simplify the Makefile. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-02remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUGLibravatar Carlo Marcelo Arenas Belón1-3/+3
In make_remote(), we store the return value of hashmap_put() and check it using assert(), but don't otherwise use it. If Git is compiled with NDEBUG, then the assert() becomes a noop, and nobody looks at the variable at all. This causes some compilers to produce warnings. Let's switch it instead to a BUG(). This accomplishes the same thing, but is always compiled in (and we don't have to worry about the cost; the check is cheap, and this is not a hot code path). Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-02gc: remove trailing dot from "gc.log" lineLibravatar Ævar Arnfjörð Bjarmason1-1/+1
Remove the trailing dot from the warning we emit about gc.log. It's common for various terminal UX's to allow the user to select "words", and by including the trailing dot a user wanting to select the path to gc.log will need to manually remove the trailing dot. Such a user would also probably need to adjust the path if it e.g. had spaces in it, but this should address this very common case. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Suggested-by: Jan Judas <snugar.i@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-31mailmap.c: fix a memory leak in free_mailap_{info,entry}()Libravatar Ævar Arnfjörð Bjarmason1-0/+2
In the free_mailmap_entry() code added in 0925ce4d49 (Add map_user() and clear_mailmap() to mailmap, 2009-02-08) the intent was clearly to clear the "me" structure, but while we freed parts of the mailmap_entry structure, we didn't free the structure itself. The same goes for the "mailmap_info" structure. This brings the number of SANITIZE=leak failures in t4203-mailmap.sh down from 50 to 49. Not really progress as far as the number of failures is concerned, but as far as I can tell this fixes all leaks in mailmap.c itself. There's still users of it such as builtin/log.c that call read_mailmap() without a clear_mailmap(), but that's on them. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-31protocol-caps.c: fix memory leak in send_info()Libravatar Ævar Arnfjörð Bjarmason1-2/+3
Fix a memory leak in a2ba162cda (object-info: support for retrieving object info, 2021-04-20) which appears to have been based on a misunderstanding of how the pkt-line.c API works. There is no need to strdup() input to packet_writer_write(), it's just a printf()-like format function. This fixes a potentially large memory leak, since the number of OID lines the "object-info" call can be arbitrarily large (or a small one if the request is small). This makes t5701-git-serve.sh pass again under SANITIZE=leak, as it did before a2ba162cda2. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Bruno Albuquerque <bga@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>