summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-22Merge branch 'jt/threaded-index-pack'Libravatar Junio C Hamano2-207/+251
"git index-pack" learned to resolve deltified objects with greater parallelism. * jt/threaded-index-pack: index-pack: make quantum of work smaller index-pack: make resolve_delta() assume base data index-pack: calculate {ref,ofs}_{first,last} early index-pack: remove redundant child field index-pack: unify threaded and unthreaded code index-pack: remove redundant parameter Documentation: deltaBaseCacheLimit is per-thread
2020-09-22Merge branch 'es/format-patch-interdiff-cleanup'Libravatar Junio C Hamano7-48/+47
"format-patch --range-diff=<prev> <origin>..HEAD" has been taught not to ignore <origin> when <prev> is a single version. * es/format-patch-interdiff-cleanup: format-patch: use 'origin' as start of current-series-range when known diff-lib: tighten show_interdiff()'s interface diff: move show_interdiff() from its own file to diff-lib
2020-09-22Merge branch 'os/fetch-submodule-optim'Libravatar Junio C Hamano1-1/+3
Optimization around submodule handling. * os/fetch-submodule-optim: fetch: do not look for submodule changes in unchanged refs
2020-09-18Fifteenth batchLibravatar Junio C Hamano1-1/+28
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-18Merge branch 'mt/config-fail-nongit-early'Libravatar Junio C Hamano2-9/+16
Unlike "git config --local", "git config --worktree" did not fail early and cleanly when started outside a git repository. * mt/config-fail-nongit-early: config: complain about --worktree outside of a git repo
2020-09-18Merge branch 'jc/dist-tarball-tweak'Libravatar Junio C Hamano1-4/+7
Allow maintainers to tweak $(TAR) invocations done while making distribution tarballs. * jc/dist-tarball-tweak: Makefile: allow extra tweaking of distribution tarball
2020-09-18Merge branch 'mf/submodule-summary-with-correct-repository'Libravatar Junio C Hamano3-15/+15
"git diff/show" on a change that involves a submodule used to read the information on commits in the submodule from a wrong repository and gave a wrong information when the commit-graph is involved. * mf/submodule-summary-with-correct-repository: submodule: use submodule repository when preparing summary revision: use repository from rev_info when parsing commits
2020-09-18Merge branch 'jc/quote-path-cleanup'Libravatar Junio C Hamano7-60/+94
"git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * jc/quote-path-cleanup: quote: turn 'nodq' parameter into a set of flags quote: rename misnamed sq_lookup[] to cq_lookup[] wt-status: consistently quote paths in "status --short" output quote_path: code clarification quote_path: optionally allow quoting a path with SP in it quote_path: give flags parameter to quote_path() quote_path: rename quote_path_relative() to quote_path()
2020-09-18Merge branch 'os/collect-changed-submodules-optim'Libravatar Junio C Hamano1-1/+8
Optimization around submodule handling. * os/collect-changed-submodules-optim: submodule: suppress checking for file name and ref ambiguity for object ids
2020-09-18Merge branch 'es/wt-add-detach'Libravatar Junio C Hamano3-1/+15
"git worktree add" learns that the "-d" is a synonym to "--detach" option to create a new worktree without being on a branch. * es/wt-add-detach: git-worktree.txt: discuss branch-based vs. throwaway worktrees worktree: teach `add` to recognize -d as shorthand for --detach git-checkout.txt: document -d short option for --detach
2020-09-18Merge branch 'jk/add-i-fixes'Libravatar Junio C Hamano3-2/+10
"add -i/-p" fixes. * jk/add-i-fixes: add--interactive.perl: specify --no-color explicitly add-patch: fix inverted return code of repo_read_index()
2020-09-18Merge branch 'pw/add-p-leakfix'Libravatar Junio C Hamano1-8/+16
Leakfix. * pw/add-p-leakfix: add -p: fix memory leak
2020-09-18Merge branch 'jc/add-i-use-builtin-experimental'Libravatar Junio C Hamano1-3/+9
The "add -i/-p" machinery has been written in C but it is not used by default yet. It is made default to those who are participating in feature.experimental experiment. * jc/add-i-use-builtin-experimental: add -i: use the built-in version when feature.experimental is set
2020-09-18Merge branch 'al/t3200-back-on-a-branch'Libravatar Junio C Hamano1-0/+1
Test fix. * al/t3200-back-on-a-branch: t3200: clean side effect of git checkout --orphan
2020-09-18Merge branch 'hn/refs-ref-log-only-bit'Libravatar Junio C Hamano2-7/+7
A bit of API reshuffling to make sure stuff common to all backends are not defined only in files backend. * hn/refs-ref-log-only-bit: refs: move REF_LOG_ONLY to refs-internal.h
2020-09-18Merge branch 'ea/blame-use-oideq'Libravatar Junio C Hamano1-2/+2
Code cleanup. * ea/blame-use-oideq: blame.c: replace instance of !oidcmp for oideq
2020-09-18Merge branch 'pb/clang-json-compilation-database'Libravatar Junio C Hamano2-5/+56
Developer support. * pb/clang-json-compilation-database: Makefile: add support for generating JSON compilation database
2020-09-18Merge branch 'so/log-tree-diff-cleanup'Libravatar Junio C Hamano1-16/+5
Code cleanup. * so/log-tree-diff-cleanup: log_tree_diff: get rid of extra check for NULL log_tree_diff: get rid of code duplication for first_parent_only
2020-09-18Merge branch 'rs/parallel-read-cache-fix'Libravatar Junio C Hamano1-1/+1
A follow-up fix to a topic already in 'master'. * rs/parallel-read-cache-fix: read-cache: fix mem-pool allocation for multi-threaded index loading
2020-09-18Merge branch 'rs/refspec-leakfix'Libravatar Junio C Hamano6-51/+47
Leakfix. * rs/refspec-leakfix: refspec: add and use refspec_appendf() push: release strbufs used for refspec formatting
2020-09-18Merge branch 'rs/misc-cleanups'Libravatar Junio C Hamano3-16/+6
Misc cleanups. * rs/misc-cleanups: pack-bitmap-write: use hashwrite_be32() in write_hash_cache() midx: use hashwrite_u8() in write_midx_header() fast-import: use write_pack_header()
2020-09-10quote: turn 'nodq' parameter into a set of flagsLibravatar Junio C Hamano3-13/+20
quote_c_style() and its friend quote_two_c_style() both take an optional "please omit the double quotes around the quoted body" parameter. Turn it into a flag word, assign one bit out of it, and call it CQUOTE_NODQ bit. No behaviour change intended. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-10quote: rename misnamed sq_lookup[] to cq_lookup[]Libravatar Junio C Hamano1-7/+7
This table is used to see if each byte needs quoting when responding to a request to C-quote the string, not quoting with single-quote in the shell style. Similarly, sq_must_quote() is fed each byte from the string being C-quoted. No behaviour change intended. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-10wt-status: consistently quote paths in "status --short" outputLibravatar Junio C Hamano2-2/+29
Tracked paths with SP in them were cquoted in "git status --short" output, but untracked, ignored, and unmerged paths weren't. The test was stolen from a patch to fix output for the 'untracked' paths by brian m. carlson, with similar tests added for 'ignored' ones. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-10quote_path: code clarificationLibravatar Junio C Hamano1-7/+12
The implementation we moved from wt-status to enclose a pathname that has a SP in it inside a dq-pair is a bit convoluted. It lets quote_c_style_counted() do its escaping and then (1) if the input string got escaped, which is checked by seeing if the result begins with a double-quote, declare that we are done. If there wasn't any SP in the input, that is OK, and if there was, the result is quoted already so it is OK, too. (2) if the input string did not get escaped, and the result has SP in it, enclose the whole thing in a dq-pair ourselves. Instead we can scan the path upfront to see if the input has SP in it. If so, we tell quote_c_style_counted() not to enclose its output in a dq-pair, and we add a dq-pair ourselves. Whether the input had bytes that quote_c_style_counted() uses backslash quoting, this would give us a desired quoted string. If the input does not have SP in it, we just let quote_c_style_counted() do its thing as usual, which would enclose the result in a dq-pair only when needed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-10quote_path: optionally allow quoting a path with SP in itLibravatar Junio C Hamano3-12/+11
Some code in wt-status.c special case a path with SP in it, which usually does not have to be c-quoted, and ensure that such a path does get quoted. Move the logic to quote_path() and give it a bit in the flags word, QUOTE_PATH_QUOTE_SP. No behaviour change intended. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-10quote_path: give flags parameter to quote_path()Libravatar Junio C Hamano5-26/+26
The quote_path() function computes a path (relative to its base directory) and c-quotes the result if necessary. Teach it to take a flags parameter to allow its behaviour to be enriched later. No behaviour change intended. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-10quote_path: rename quote_path_relative() to quote_path()Libravatar Junio C Hamano5-18/+14
There is no quote_path_absolute() or anything that causes confusion, and one of the two large consumers already rename the long name locally with a preprocessor macro. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09Fourteenth batchLibravatar Junio C Hamano1-0/+28
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09Merge branch 'os/vcbuild'Libravatar Junio C Hamano4-4/+5
Fix build procedure for MSVC. * os/vcbuild: contrib/buildsystems: fix expat library name for generated vcxproj vcbuild: fix batch file name in README vcbuild: fix library name for expat with make MSVC=1
2020-09-09Merge branch 'jt/interpret-branch-name-fallback'Libravatar Junio C Hamano20-53/+98
"git status" has trouble showing where it came from by interpreting reflog entries that recordcertain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. * jt/interpret-branch-name-fallback: wt-status: tolerate dangling marks refs: move dwim_ref() to header file sha1-name: replace unsigned int with option struct
2020-09-09Merge branch 'js/ci-squelch-false-failure'Libravatar Junio C Hamano1-3/+2
CI noise reduction. * js/ci-squelch-false-failure: ci: avoid ugly "failure" in the `ci-config` job ci: fix indentation of the `ci-config` job
2020-09-09Merge branch 'pb/imap-send-updates'Libravatar Junio C Hamano1-15/+19
"git imap-send" updates. * pb/imap-send-updates: git-imap-send.txt: add note about localized Gmail folders git-imap-send.txt: do verify SSL certificate for gmail.com git-imap-send.txt: don't duplicate 'Examples' sections
2020-09-09Merge branch 'hv/ref-filter-misc'Libravatar Junio C Hamano5-65/+161
The "--format=" option to the "for-each-ref" command and friends learned a few more tricks, e.g. the ":short" suffix that applies to "objectname" now also can be used for "parent", "tree", etc. * hv/ref-filter-misc: ref-filter: add `sanitize` option for 'subject' atom pretty: refactor `format_sanitized_subject()` ref-filter: add `short` modifier to 'parent' atom ref-filter: add `short` modifier to 'tree' atom ref-filter: rename `objectname` related functions and fields ref-filter: modify error messages in `grab_objectname()` ref-filter: refactor `grab_objectname()` ref-filter: support different email formats
2020-09-09Merge branch 'ss/submodule-summary-in-c-fixes'Libravatar Junio C Hamano2-10/+9
Fixups to a topic in 'next'. * ss/submodule-summary-in-c-fixes: t7421: eliminate 'grep' check in t7421.4 for mingw compatibility submodule: fix style in function definition submodule: eliminate unused parameters from print_submodule_summary()
2020-09-09Merge branch 'so/separate-field-for-m-and-diff-merges'Libravatar Junio C Hamano3-8/+9
Internal API clean-up to handle two options "diff-index" and "log" have, which happen to share the same short form, more sensibly. * so/separate-field-for-m-and-diff-merges: revision: add separate field for "-m" of "diff-index -m"
2020-09-09Merge branch 'es/worktree-repair'Libravatar Junio C Hamano7-2/+445
"git worktree" gained a "repair" subcommand to help users recover after moving the worktrees or repository manually without telling Git. Also, "git init --separate-git-dir" no longer corrupts administrative data related to linked worktrees. * es/worktree-repair: init: make --separate-git-dir work from within linked worktree init: teach --separate-git-dir to repair linked worktrees worktree: teach "repair" to fix outgoing links to worktrees worktree: teach "repair" to fix worktree back-links to main worktree worktree: add skeleton "repair" command
2020-09-09Merge branch 'jk/worktree-check-clean-leakfix'Libravatar Junio C Hamano1-5/+3
Leakfix. * jk/worktree-check-clean-leakfix: worktree: fix leak in check_clean_worktree()
2020-09-09Merge branch 'tb/repack-clearing-midx'Libravatar Junio C Hamano5-11/+65
When a packfile is removed by "git repack", multi-pack-index gets cleared; the code was taught to do so less aggressively by first checking if the midx actually refers to a pack that no longer exists. * tb/repack-clearing-midx: midx: traverse the local MIDX first builtin/repack.c: invalidate MIDX only when necessary
2020-09-09Merge branch 'ss/submodule-summary-in-c'Libravatar Junio C Hamano7-195/+512
Yet another subcommand of "git submodule" is getting rewritten in C. * ss/submodule-summary-in-c: submodule: port submodule subcommand 'summary' from shell to C t7421: introduce a test script for verifying 'summary' output submodule: rename helper functions to avoid ambiguity submodule: remove extra line feeds between callback struct and macro
2020-09-09config: complain about --worktree outside of a git repoLibravatar Matheus Tavares2-9/+16
Running `git config --worktree` outside of a git repository hits a BUG() when trying to enumerate the worktrees. Let's catch this error earlier and die() with a friendlier message. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09Makefile: allow extra tweaking of distribution tarballLibravatar Junio C Hamano1-4/+7
The maintainer's dist rules are used to produce distribution tarballs. They use "$(TAR) cf" and "$(TAR) rf" to produce archives out of a freshly created local installation area, which means that the built product can be affected by maintainer's umask and other local environment. Implementations of "tar" have ways (implementation specific, unfortunately) to force permission bits and other stuff to allow the user to hide these effects coming from the local environment. Teach our Makefile to allow the maintainer to tweak the invocation of the $(TAR) commands by setting TAR_DIST_EXTRA_OPTS. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08blame.c: replace instance of !oidcmp for oideqLibravatar Edmundo Carmona Antoranz1-2/+2
0906ac2b (blame: use changed-path Bloom filters, 2020-04-16) introduced a call to oidcmp() that should have been oideq(), which was introduced in 14438c44 (introduce hasheq() and oideq(), 2018-08-28). Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08index-pack: make quantum of work smallerLibravatar Jonathan Tan1-148/+200
Currently, when index-pack resolves deltas, it does not split up delta trees into threads: each delta base root (an object that is not a REF_DELTA or OFS_DELTA) can go into its own thread, but all deltas on that root (direct or indirect) are processed in the same thread. This is a problem when a repository contains a large text file (thus, delta-able) that is modified many times - delta resolution time during fetching is dominated by processing the deltas corresponding to that text file. This patch contains a solution to that. When cloning using git -c core.deltabasecachelimit=1g clone \ https://fuchsia.googlesource.com/third_party/vulkan-cts on my laptop, clone time improved from 3m2s to 2m5s (using 3 threads, which is the default). The solution is to have a global work stack. This stack contains delta bases (objects, whether appearing directly in the packfile or generated by delta resolution, that themselves have delta children) that need to be processed; whenever a thread needs work, it peeks at the top of the stack and processes its next unprocessed child. If a thread finds the stack empty, it will look for more delta base roots to push on the stack instead. The main weakness of having a global work stack is that more time is spent in the mutex, but profiling has shown that most time is spent in the resolution of the deltas themselves, so this shouldn't be an issue in practice. In any case, experimentation (as described in the clone command above) shows that this patch is a net improvement. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08refs: move REF_LOG_ONLY to refs-internal.hLibravatar Han-Wen Nienhuys2-7/+7
REF_LOG_ONLY is used in the transaction preparation: if a symref is involved in a transaction, the referent of the symref should be updated, and the symref itself should only be updated in the reflog. Other ref backends will need to duplicate this logic too, so move it to a central place. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08t3200: clean side effect of git checkout --orphanLibravatar Aaron Lipman1-0/+1
The "refuse --edit-description on unborn branch for now" test in t3200 switches to an orphan branch, causing subsequent git commands referencing HEAD to fail. Avoid this side-effect by switching back to master after the test finishes. This has gone undetected, as the next affected test expects failure - but it currently fails for the wrong reason. Verbose output of the next test referencing HEAD, "--merged is incompatible with --no-merged": fatal: malformed object name HEAD Which this commit corrects to: error: option `no-merged' is incompatible with --merged Signed-off-by: Aaron Lipman <alipman88@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08format-patch: use 'origin' as start of current-series-range when knownLibravatar Eric Sunshine1-7/+11
When formatting a patch series over `origin..HEAD`, one would expect that range to be used as the current-series-range when computing a range-diff between the previous and current versions of a patch series. However, infer_range_diff_ranges() ignores `origin..HEAD` when --range-diff=<prev> specifies a single revision rather than a range, and instead unexpectedly computes the current-series-range based upon <prev>. Address this anomaly by unconditionally using `origin..HEAD` as the current-series-range regardless of <prev> as long as `origin` is known, and only fall back to basing current-series-range on <prev> when `origin` is not known. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08diff-lib: tighten show_interdiff()'s interfaceLibravatar Eric Sunshine4-6/+14
To compute and show an interdiff, show_interdiff() needs only the two OID's to compare and a diffopts, yet it expects callers to supply an entire rev_info. The demand for rev_info is not only overkill, but also places unnecessary burden on potential future callers which might not otherwise have a rev_info at hand. Address this by tightening its signature to require only the items it needs instead of a full rev_info. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08diff: move show_interdiff() from its own file to diff-libLibravatar Eric Sunshine7-39/+26
show_interdiff() is a relatively small function and not likely to grow larger or more complicated. Rather than dedicating an entire source file to it, relocate it to diff-lib.c which houses other "take two things and compare them" functions meant to be re-used but not so low-level as to reside in the core diff implementation. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08add -i: use the built-in version when feature.experimental is setLibravatar Junio C Hamano1-3/+9
We have had parallel implementations of "add -i/-p" since 2.25 and have been using them from various codepaths since 2.26 days, but never made the built-in version the default. We have found and fixed a handful of corner case bugs in the built-in version, and it may be a good time to start switching over the user base from the scripted version to the built-in version. Let's enable the built-in version for those who opt into the feature.experimental guinea-pig program to give wider exposure. Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>