summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-12-08Merge branch 'fc/random-cleanup'Libravatar Junio C Hamano4-18/+16
Random cleanup. * fc/random-cleanup: gitignore: remove entry for git serve gitignore: drop duplicate entry for git-sh-i18n tests: lib-functions: trivial style cleanups test: completion: fix typos .gitignore: remove dangling file refspec: trivial cleanup
2020-12-08Merge branch 'nm/imap-send-use-default-config'Libravatar Junio C Hamano1-22/+30
"git imap-send" used to ignore configuration variables like core.askpass; this has been corrected. * nm/imap-send-use-default-config: imap-send: parse default git config
2020-12-08Merge branch 'jk/banned'Libravatar Junio C Hamano1-0/+13
Non-reentrant time-related library functions and ctime/asctime with awkward calling interfaces are banned from the codebase. * jk/banned: banned.h: mark ctime_r() and asctime_r() as banned banned.h: mark non-reentrant gmtime, etc as banned
2020-12-08Merge branch 'tb/bugreport-no-localtime'Libravatar Junio C Hamano1-1/+2
Use of non-reentrant localtime() has been removed. * tb/bugreport-no-localtime: builtin/bugreport.c: use thread-safe localtime_r()
2020-12-08Merge branch 'rs/maintenance-run-outside-repo'Libravatar Junio C Hamano3-8/+9
"git maintenance run/start/stop" needed to be run in a repository to hold the lockfile they use, but didn't make sure they are actually in a repository, which has been corrected. * rs/maintenance-run-outside-repo: t7900: fix typo: "test_execpt_success" maintenance: fix SEGFAULT when no repository
2020-12-08Merge branch 'rs/fetch-pack-invalid-lockfile'Libravatar Junio C Hamano1-2/+3
"fetch-pack" could pass NULL pointer to unlink(2) when it sees an invalid filename; the error checking has been tightened to make this impossible. * rs/fetch-pack-invalid-lockfile: fetch-pack: disregard invalid pack lockfiles
2020-12-08Merge branch 'nk/perf-fsmonitor-cleanup'Libravatar Junio C Hamano1-2/+1
Test clean-up. * nk/perf-fsmonitor-cleanup: perf/fsmonitor: use test_must_be_empty helper
2020-12-08Merge branch 'ma/grep-init-default'Libravatar Junio C Hamano6-100/+36
Code clean-up. * ma/grep-init-default: MyFirstObjectWalk: drop `init_walken_defaults()` grep: copy struct in one fell swoop grep: use designated initializers for `grep_defaults` grep: don't set up a "default" repo for grep
2020-12-08Merge branch 'js/trace2-session-id'Libravatar Junio C Hamano12-3/+198
The transport layer was taught to optionally exchange the session ID assigned by the trace2 subsystem during fetch/push transactions. * js/trace2-session-id: receive-pack: log received client session ID send-pack: advertise session ID in capabilities upload-pack, serve: log received client session ID fetch-pack: advertise session ID in capabilities transport: log received server session ID serve: advertise session ID in v2 capabilities receive-pack: advertise session ID in v0 capabilities upload-pack: advertise session ID in v0 capabilities trace2: add a public function for getting the SID docs: new transfer.advertiseSID option docs: new capability to advertise session IDs
2020-12-08Merge branch 'mt/do-not-use-scld-in-working-tree'Libravatar Junio C Hamano5-6/+47
"git apply" adjusted the permission bits of working-tree files and directories according core.sharedRepository setting by mistake and for a long time, which has been corrected. * mt/do-not-use-scld-in-working-tree: apply: don't use core.sharedRepository to create working tree files
2020-12-08Merge branch 'ds/maintenance-part-2'Libravatar Junio C Hamano1-2/+4
Test fix. * ds/maintenance-part-2: t7900: speed up expensive test
2020-12-08Merge branch 'ds/maintenance-part-1'Libravatar Junio C Hamano1-0/+1
Build consistency fix. * ds/maintenance-part-1: Makefile: mark git-maintenance as a builtin
2020-12-08Merge branch 'ds/maintenance-part-3'Libravatar Junio C Hamano2-2/+15
"git maintenance" command had trouble working in a directory whose pathname contained an ERE metacharacter like '+'. * ds/maintenance-part-3: maintenance: use 'git config --fixed-value'
2020-12-08Merge branch 'ds/config-literal-value'Libravatar Junio C Hamano7-76/+312
Various subcommands of "git config" that takes value_regex learn the "--literal-value" option to take the value_regex option as a literal string. * ds/config-literal-value: config doc: value-pattern is not necessarily a regexp config: implement --fixed-value with --get* config: plumb --fixed-value into config API config: add --fixed-value option, un-implemented t1300: add test for --replace-all with value-pattern t1300: test "set all" mode with value-pattern config: replace 'value_regex' with 'value_pattern' config: convert multi_replace to flags
2020-12-08Merge branch 'tb/idx-midx-race-fix'Libravatar Junio C Hamano3-20/+31
Processes that access packdata while the .idx file gets removed (e.g. while repacking) did not fail or fall back gracefully as they could. * tb/idx-midx-race-fix: midx.c: protect against disappearing packs packfile.c: protect against disappearing indexes
2020-12-08Merge branch 'ps/update-ref-multi-transaction'Libravatar Junio C Hamano4-50/+126
"git update-ref --stdin" learns to take multiple transactions in a single session. * ps/update-ref-multi-transaction: update-ref: disallow "start" for ongoing transactions p1400: use `git-update-ref --stdin` to test multiple transactions update-ref: allow creation of multiple transactions t1400: avoid touching refs on filesystem
2020-12-08Merge branch 'js/add-i-color-fix'Libravatar Junio C Hamano4-32/+127
"git add -i" failed to honor custom colors configured to show patches, which has been corrected. * js/add-i-color-fix: add -i: verify in the tests that colors can be overridden add -p: prefer color.diff.context over color.diff.plain add -i (Perl version): color header to match the C version add -i (built-in): use the same indentation as the Perl version add -p (built-in): do not color the progress indicator separately add -i (built-in): use correct names to load color.diff.* config add -i (built-in): prevent the `reset` "color" from being configured add -i: use `reset_color` consistently add -p (built-in): imitate `xdl_format_hunk_hdr()` generating hunk headers add -i (built-in): send error messages to stderr add -i (built-in): do show an error message for incorrect inputs
2020-12-08Merge branch 'jt/trace-error-on-warning'Libravatar Junio C Hamano2-1/+7
Like die() and error(), a call to warning() will also trigger a trace2 event. * jt/trace-error-on-warning: usage: add trace2 entry upon warning()
2020-12-08t7900: fix typo: "test_execpt_success"Libravatar Josh Steadmon1-1/+1
Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-03Tenth batchLibravatar Junio C Hamano1-5/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-03Merge branch 'pk/subsub-fetch-fix'Libravatar Junio C Hamano2-67/+10
An earlier attempt to fix "git fetch --recurse-submodules" broke another use case; revert it until a better fix is found. * pk/subsub-fetch-fix: Revert "submodules: fix of regression on fetching of non-init subsub-repo"
2020-12-03Merge branch 'jk/stop-pack-objects-when-fetch-is-killed'Libravatar Junio C Hamano1-0/+1
"git fetch" that is killed may leave a pack-objects process behind, still computing to find a good compression, wasting cycles. This has been corrected. * jk/stop-pack-objects-when-fetch-is-killed: upload-pack: kill pack-objects helper on signal or exit
2020-12-03Merge branch 'jk/stop-pack-objects-when-push-is-killed'Libravatar Junio C Hamano1-0/+1
"git push" that is killed may leave a pack-objects process behind, still computing to find a good compression, wasting cycles. This has been corrected. * jk/stop-pack-objects-when-push-is-killed: send-pack: kill pack-objects helper on signal or exit
2020-12-03Merge branch 'tb/repack-simplify'Libravatar Junio C Hamano1-99/+54
Simplify the logic to deal with a repack operation that ended up creating the same packfile. * tb/repack-simplify: builtin/repack.c: don't move existing packs out of the way builtin/repack.c: keep track of what pack-objects wrote repack: make "exts" array available outside cmd_repack()
2020-12-03Merge branch 'pb/pull-rebase-recurse-submodules'Libravatar Junio C Hamano2-14/+90
"git pull --rebase --recurse-submodules" checked for local changes in a wrong range and failed to run correctly when it should. * pb/pull-rebase-recurse-submodules: pull: check for local submodule modifications with the right range t5572: describe '--rebase' tests a little more t5572: add notes on a peculiar test pull --rebase: compute rebase arguments in separate function
2020-12-03Merge branch 'ab/retire-parse-remote'Libravatar Junio C Hamano6-138/+11
"git-parse-remote" shell script library outlived its usefulness. * ab/retire-parse-remote: submodule: fix fetch_in_submodule logic parse-remote: remove this now-unused library submodule: remove sh function in favor of helper submodule: use "fetch" logic instead of custom remote discovery
2020-12-02Revert "submodules: fix of regression on fetching of non-init subsub-repo"Libravatar Junio C Hamano2-67/+10
This reverts commit 1b7ac4e6d4d490b224f5206af7418ed74e490608; in <CAN0XMOLiS_8JZKF_wW70BvRRxkDHyUoa=Z3ODtB_Bd6f5Y=7JQ@mail.gmail.com>, Ralf Thielow reports that "git fetch" with submodule.recurse set can result in a bogus and infinitely recursive fetching of the same submodule.
2020-12-02Makefile: mark git-maintenance as a builtinLibravatar Jeff King1-0/+1
We normally get the list of builtin commands by expanding BUILTIN_OBJS. But for commands which are embedded inside another's source file (e.g., cmd_show() in builtin/log.c), the Makefile needs to be told explicitly about them. Since cmd_maintenance() is inside buitin/gc.c, it should be listed explicitly in the BUILT_INS list in the Makefile. Not doing so isn't _too_ tragic, as it simply means we will not make a git-maintenance symlink in libexec/git-core. Since we encourage people to use the "git foo" form, even in scripts which have put libexec into their PATH, nobody seems to have noticed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-02apply: don't use core.sharedRepository to create working tree filesLibravatar Matheus Tavares5-6/+47
core.sharedRepository defines which permissions Git should set when creating files in $GIT_DIR, so that the repository may be shared with other users. But (in its current form) the setting shouldn't affect how files are created in the working tree. This is not respected by apply and am (which uses apply), when creating leading directories: $ cat d.patch diff --git a/d/f b/d/f new file mode 100644 index 0000000..e69de29 Apply without the setting: $ umask 0077 $ git apply d.patch $ ls -ld d drwx------ Apply with the setting: $ umask 0077 $ git -c core.sharedRepository=0770 apply d.patch $ ls -ld d drwxrws--- Only the leading directories are affected. That's because they are created with safe_create_leading_directories(), which calls adjust_shared_perm() to set the directories' permissions based on core.sharedRepository. To fix that, let's introduce a variant of this function that ignores the setting, and use it in apply. Also add a regression test and a note in the function documentation about the use of each variant according to the destination (working tree or git dir). Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-02banned.h: mark ctime_r() and asctime_r() as bannedLibravatar Jeff King1-0/+4
The ctime_r() and asctime_r() functions are reentrant, but have no check that the buffer we pass in is long enough (the manpage says it "should have room for at least 26 bytes"). Since this is such an easy-to-get-wrong interface, and since we have the much safer strftime() as well as its more convenient strbuf_addftime() wrapper, let's ban both of those. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-02gitignore: remove entry for git serveLibravatar René Scharfe1-1/+0
b7ce24d095 (Turn `git serve` into a test helper, 2019-04-18) demoted git serve from a builtin command to a test helper. As a result the git-serve binary is no longer built and thus doesn't have to be ignored anymore. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-02gitignore: drop duplicate entry for git-sh-i18nLibravatar Jeff King1-1/+0
This was accidentally added by e00cf070a4 (git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers, 2011-05-14), even though an earlier commit in the same series had already done so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-02t7900: speed up expensive testLibravatar Jeff King1-2/+4
A test marked with EXPENSIVE creates two 2.5GB files and adds them to the repository. This takes 194s to run on my machine, versus 2s when the EXPENSIVE prereq isn't set. We can trim this down a bit by doing two things: - use "git commit --quiet" to avoid spending time generating a diff summary (this actually only helps for the second commit, but I've added it here to both for consistency). This shaves off 8s. - set core.compression to 0. We know these files are full of random bytes, and so won't compress (that's the point of the test!). Spending cycles on zlib is pointless. This shaves off 122s. After this, my total time to run the script is 64s. That won't help normal runs without GIT_TEST_LONG set, of course, but it's easy enough to do. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01banned.h: mark non-reentrant gmtime, etc as bannedLibravatar Jeff King1-0/+9
The traditional gmtime(), localtime(), ctime(), and asctime() functions return pointers to shared storage. This means they're not thread-safe, and they also run the risk of somebody holding onto the result across multiple calls (where each call invalidates the previous result). All callers should be using their reentrant counterparts. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01builtin/bugreport.c: use thread-safe localtime_r()Libravatar Taylor Blau1-1/+2
To generate its filename, the 'git bugreport' builtin asks the system for the current time with 'localtime()'. Since this uses a shared buffer, it is not thread-safe. Even though 'git bugreport' is not multi-threaded, using localtime() can trigger some static analysis tools to complain, and a quick $ git grep -oh 'localtime\(_.\)\?' -- **/*.c | sort | uniq -c shows that the only usage of the thread-unsafe 'localtime' is in a piece of documentation. So, convert this instance to use the thread-safe version for consistency, and to appease some analysis tools. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01upload-pack: kill pack-objects helper on signal or exitLibravatar Jeff King1-0/+1
We spawn an external pack-objects process to actually send objects to the remote side. If we are killed by a signal during this process, then pack-objects may continue to run. As soon as it starts producing output for the pack, it will see a failure writing to upload-pack and exit itself. But before then, it may do significant work traversing the object graph, compressing deltas, etc, which will all be pointless. So let's make sure to kill as soon as we know that the caller will not read the result. There's no test here, since it's inherently racy, but here's an easy reproduction is on a large-ish repo like linux.git: - make sure you don't have pack bitmaps (since they make the enumerating phase go quickly). For linux.git it takes ~30s or so to walk the whole graph on my machine. - run "git clone --no-local -q . dst"; the "-q" is important because if pack-objects is writing progress to upload-pack (to get multiplexed over the sideband to the client), then it will notice pretty quickly the failure to write to stderr - kill the client-side clone process in another terminal (don't use ^C, as that will send SIGINT to all of the processes) - run "ps au | grep git" or similar to observe upload-pack dying within 5 seconds (it will send a keepalive that will notice the client has gone away) - but you'll still see pack-objects consuming 100% CPU (and 1GB+ of RAM) during the traversal and delta compression phases. It will exit as soon as it starts to write the pack (when it will notice that upload-pack went away). With this patch, pack-objects exits as soon as upload-pack does. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01imap-send: parse default git configLibravatar Nicolas Morey-Chaisemartin1-22/+30
git imap-send does not parse the default git config settings and thus ignore core.askpass value. Rewrite config parsing to support core settings. Reported-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01tests: lib-functions: trivial style cleanupsLibravatar Felipe Contreras1-4/+4
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01test: completion: fix typosLibravatar Felipe Contreras1-2/+2
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01.gitignore: remove dangling fileLibravatar Felipe Contreras1-1/+0
The library was removed 7 years ago on commit ae34ac126f. But not from the .gitignore file. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-12-01refspec: trivial cleanupLibravatar Felipe Contreras1-9/+10
We can remove one level of indentation and make the code clearer. No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-30Ninth batchLibravatar Junio C Hamano1-0/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-30Merge branch 'sa/credential-store-timeout'Libravatar Junio C Hamano2-2/+12
Multiple "credential-store" backends can race to lock the same file, causing everybody else but one to fail---reattempt locking with some timeout to reduce the rate of the failure. * sa/credential-store-timeout: crendential-store: use timeout when locking file
2020-11-30Merge branch 'km/stash-error-message-fix'Libravatar Junio C Hamano1-1/+1
Error message fix. * km/stash-error-message-fix: stash: add missing space to an error message
2020-11-30Merge branch 'hn/sleep-millisec-decl'Libravatar Junio C Hamano2-1/+2
Move a definition of compatibility wrapper from cache.h to git-compat-util.h * hn/sleep-millisec-decl: move sleep_millisec to git-compat-util.h
2020-11-30Merge branch 'js/t3404-master-to-primary'Libravatar Junio C Hamano1-44/+45
A test script got cleaned up and then made not to depend on the value of init.defaultBranch. * js/t3404-master-to-primary: t3404: do not depend on any specific default branch name
2020-11-30Merge branch 'na/notes-displayref-is-not-boolean'Libravatar Junio C Hamano2-1/+6
Config parser fix for "git notes". * na/notes-displayref-is-not-boolean: t3301: test proper exit response to no-value notes.displayRef. notes.c: fix a segfault in notes_display_config()
2020-11-30Merge branch 'jc/do-not-just-explain-but-update-your-patch'Libravatar Junio C Hamano1-1/+15
Expectation for the original contributor after responding to a review comment to use the explanation in a patch update has been described. * jc/do-not-just-explain-but-update-your-patch: MyFirstContribition: answering questions is not the end of the story
2020-11-30Merge branch 'mt/worktree-error-message-fix'Libravatar Junio C Hamano1-2/+2
Fix formulation of an error message with two placeholders in "git worktree add" subcommand. * mt/worktree-error-message-fix: worktree: fix order of arguments in error message
2020-11-30Merge branch 'ab/gc-keep-base-option'Libravatar Junio C Hamano2-7/+7
Fix an option name in "gc" documentation. * ab/gc-keep-base-option: gc: rename keep_base_pack variable for --keep-largest-pack gc docs: change --keep-base-pack to --keep-largest-pack