Junio C Hamano [Wed, 11 Nov 2020 21:18:38 +0000 (13:18 -0800)]
Merge branch 'cw/ci-ghwf-check-ws-errors'
Dev support update.
* cw/ci-ghwf-check-ws-errors:
ci: make the whitespace checker more robust
Junio C Hamano [Wed, 11 Nov 2020 21:18:38 +0000 (13:18 -0800)]
Merge branch 'rs/worktree-list-show-locked'
Typofix.
* rs/worktree-list-show-locked:
t2402: fix typo
Junio C Hamano [Wed, 11 Nov 2020 21:18:38 +0000 (13:18 -0800)]
Merge branch 'rs/pack-write-hashwrite-simplify'
Code clean-up.
* rs/pack-write-hashwrite-simplify:
pack-write: use hashwrite_be32() instead of double-buffering array
Junio C Hamano [Wed, 11 Nov 2020 21:18:38 +0000 (13:18 -0800)]
Merge branch 'sd/prompt-local-variable'
Code clean-up.
* sd/prompt-local-variable:
git-prompt.sh: localize `option` in __git_ps1_show_upstream
Junio C Hamano [Wed, 11 Nov 2020 21:18:37 +0000 (13:18 -0800)]
Merge branch 'rs/clear-commit-marks-in-repo'
Code clean-up.
* rs/clear-commit-marks-in-repo:
bisect: clear flags in passed repository
object: allow clear_commit_marks_all to handle any repo
Junio C Hamano [Wed, 11 Nov 2020 21:18:37 +0000 (13:18 -0800)]
Merge branch 'so/format-patch-doc-on-default-diff-format'
Docfix.
* so/format-patch-doc-on-default-diff-format:
doc/diff-options: fix out of place mentions of '--patch/-p'
Junio C Hamano [Mon, 9 Nov 2020 21:31:58 +0000 (13:31 -0800)]
Fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 9 Nov 2020 22:06:29 +0000 (14:06 -0800)]
Merge branch 'js/default-branch-name-adjust-t5411'
Prepare a test script to transition of the default branch name to
'main'.
* js/default-branch-name-adjust-t5411:
t5411: finish preparing for `main` being the default branch name
t5411: adjust the remaining support files for init.defaultBranch=main
t5411: start adjusting the support files for init.defaultBranch=main
t5411: start using the default branch name "main"
Junio C Hamano [Mon, 9 Nov 2020 22:06:29 +0000 (14:06 -0800)]
Merge branch 'fc/zsh-completion'
Zsh autocompletion (in contrib/) update.
* fc/zsh-completion: (29 commits)
zsh: update copyright notices
completion: bash: remove old compat wrappers
completion: bash: cleanup cygwin check
completion: bash: trivial cleanup
completion: zsh: add simple version check
completion: zsh: trivial simplification
completion: zsh: add alias descriptions
completion: zsh: improve command tags
completion: zsh: refactor command completion
completion: zsh: shuffle functions around
completion: zsh: simplify file_direct
completion: zsh: simplify nl_append
completion: zsh: trivial cleanup
completion: zsh: simplify direct compadd
completion: zsh: simplify compadd functions
completion: zsh: fix splitting of words
completion: zsh: add missing direct_append
completion: fix conflict with bashcomp
completion: zsh: fix completion for --no-.. options
completion: bash: remove zsh wrapper
...
Junio C Hamano [Mon, 9 Nov 2020 22:06:29 +0000 (14:06 -0800)]
Merge branch 'jk/sideband-more-error-checking'
The code to detect premature EOF in the sideband demultiplexer has
been cleaned up.
* jk/sideband-more-error-checking:
sideband: diagnose more sideband anomalies
Junio C Hamano [Mon, 9 Nov 2020 22:06:27 +0000 (14:06 -0800)]
Merge branch 'jk/committer-date-is-author-date-fix-simplify'
Code simplification.
* jk/committer-date-is-author-date-fix-simplify:
am, sequencer: stop parsing our own committer ident
Junio C Hamano [Mon, 9 Nov 2020 22:06:26 +0000 (14:06 -0800)]
Merge branch 'ab/git-remote-exit-code'
Exit codes from "git remote add" etc. were not usable by scripted
callers.
* ab/git-remote-exit-code:
remote: add meaningful exit code on missing/existing
Junio C Hamano [Mon, 9 Nov 2020 22:06:26 +0000 (14:06 -0800)]
Merge branch 'pb/ref-filter-with-crlf'
A commit and tag object may have CR at the end of each and
every line (you can create such an object with hash-object or
using --cleanup=verbatim to decline the default clean-up
action), but it would make it impossible to have a blank line
to separate the title from the body of the message. Be lenient
and accept a line with lone CR on it as a blank line, too.
* pb/ref-filter-with-crlf:
log, show: add tests for messages containing CRLF
ref-filter: handle CRLF at end-of-line more gracefully
Junio C Hamano [Mon, 9 Nov 2020 22:06:26 +0000 (14:06 -0800)]
Merge branch 'jk/checkout-index-errors'
"git checkout-index" did not consistently signal an error with its
exit status.
* jk/checkout-index-errors:
checkout-index: propagate errors to exit code
checkout-index: drop error message from empty --stage=all
Junio C Hamano [Mon, 9 Nov 2020 22:06:25 +0000 (14:06 -0800)]
Merge branch 'jk/perl-warning'
Dev support.
* jk/perl-warning:
perl: check for perl warnings while running tests
Junio C Hamano [Mon, 9 Nov 2020 22:06:25 +0000 (14:06 -0800)]
Merge branch 'nk/diff-files-vs-fsmonitor'
"git diff" and other commands that share the same machinery to
compare with working tree files have been taught to take advantage
of the fsmonitor data when available.
* nk/diff-files-vs-fsmonitor:
p7519-fsmonitor: add a git add benchmark
p7519-fsmonitor: refactor to avoid code duplication
perf lint: add make test-lint to perf tests
t/perf: add fsmonitor perf test for git diff
t/perf/p7519-fsmonitor.sh: warm cache on first git status
t/perf/README: elaborate on output format
fsmonitor: use fsmonitor data in `git diff`
Junio C Hamano [Mon, 9 Nov 2020 22:06:25 +0000 (14:06 -0800)]
Merge branch 'as/tests-cleanup'
Micro clean-up of a couple of test scripts.
* as/tests-cleanup:
t2200,t9832: avoid using 'git' upstream in a pipe
Junio C Hamano [Mon, 9 Nov 2020 22:06:25 +0000 (14:06 -0800)]
Merge branch 'en/dir-rename-tests'
More preliminary tests have been added to document desired outcome
of various "directory rename" situations.
* en/dir-rename-tests:
t6423: more involved rules for renaming directories into each other
t6423: update directory rename detection tests with new rule
t6423: more involved directory rename test
directory-rename-detection.txt: update references to regression tests
Junio C Hamano [Mon, 9 Nov 2020 22:06:25 +0000 (14:06 -0800)]
Merge branch 'mr/bisect-in-c-3'
Rewriting "git bisect" in C continues.
* mr/bisect-in-c-3:
bisect--helper: retire `--bisect-autostart` subcommand
bisect--helper: retire `--write-terms` subcommand
bisect--helper: retire `--check-expected-revs` subcommand
bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C
bisect--helper: retire `--next-all` subcommand
bisect--helper: retire `--bisect-clean-state` subcommand
bisect--helper: finish porting `bisect_start()` to C
Johannes Schindelin [Tue, 3 Nov 2020 15:55:31 +0000 (15:55 +0000)]
ci: make the whitespace checker more robust
In
32c83afc2c69 (ci: github action - add check for whitespace errors,
2020-09-22), we introduced a GitHub workflow that automatically checks
Pull Requests for whitespace problems.
However, when affected lines contain one or more double quote
characters, this workflow failed to attach the informative comment
because the Javascript snippet incorrectly interpreted these quotes
instead of using the `git log` output as-is.
Let's fix that.
While at it, let's `await` the result of the `createComment()` function.
Finally, we enclose the log in the comment with ```...``` to avoid
having the diff marker be misinterpreted as an enumeration bullet.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Tue, 3 Nov 2020 11:48:07 +0000 (11:48 +0000)]
t2402: fix typo
In
c57b3367bed (worktree: teach `list` to annotate locked worktree,
2020-10-11), we introduced a test case that wanted to talk about
"worktrees" but talked about "worktress" instead. Let's fix that.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 2 Nov 2020 21:17:20 +0000 (13:17 -0800)]
Third batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 2 Nov 2020 21:17:47 +0000 (13:17 -0800)]
Merge branch 'jc/doc-final-resend'
Update developer doc.
* jc/doc-final-resend:
SubmittingPatches: clarify the purpose of the final resend
Junio C Hamano [Mon, 2 Nov 2020 21:17:46 +0000 (13:17 -0800)]
Merge branch 'es/tutorial-mention-asciidoc-early'
Doc update.
* es/tutorial-mention-asciidoc-early:
MyFirstContribution: clarify asciidoc dependency
Junio C Hamano [Mon, 2 Nov 2020 21:17:46 +0000 (13:17 -0800)]
Merge branch 'js/default-branch-name-part-4-minus-1'
Adjust tests so that they won't scream when the default initial
branch name is changed to 'main'.
* js/default-branch-name-part-4-minus-1:
t1400: prepare for `main` being default branch name
tests: prepare aligned mentions of the default branch name
t9902: prepare a test for the upcoming default branch name
t3200: prepare for `main` being shorter than `master`
t5703: adjust a test case for the upcoming default branch name
t6200: adjust suppression pattern to also match "main"
tests: start moving to a different default main branch name
t9801: use `--` in preparation for default branch rename
fmt-merge-msg: also suppress "into main" by default
Junio C Hamano [Mon, 2 Nov 2020 21:17:46 +0000 (13:17 -0800)]
Merge branch 've/userdiff-bash'
The userdiff pattern learned to identify the function definition in
POSIX shells and bash.
* ve/userdiff-bash:
userdiff: support Bash
Junio C Hamano [Mon, 2 Nov 2020 21:17:45 +0000 (13:17 -0800)]
Merge branch 'bc/svn-hash-oid-fix'
A recent oid->hash conversion missed one spot, breaking "git svn".
* bc/svn-hash-oid-fix:
svn: use correct variable name for short OID
Junio C Hamano [Mon, 2 Nov 2020 21:17:45 +0000 (13:17 -0800)]
Merge branch 'js/t7006-cleanup'
Code clean-up.
* js/t7006-cleanup:
t7006: Use test_path_is_* functions in test script
Junio C Hamano [Mon, 2 Nov 2020 21:17:44 +0000 (13:17 -0800)]
Merge branch 'en/sequencer-rollback-lock-cleanup'
Code clean-up.
* en/sequencer-rollback-lock-cleanup:
sequencer: remove duplicate rollback_lock_file() call
Junio C Hamano [Mon, 2 Nov 2020 21:17:43 +0000 (13:17 -0800)]
Merge branch 'mk/diff-ignore-regex'
"git diff" family of commands learned the "-I<regex>" option to
ignore hunks whose changed lines all match the given pattern.
* mk/diff-ignore-regex:
diff: add -I<regex> that ignores matching changes
merge-base, xdiff: zero out xpparam_t structures
Junio C Hamano [Mon, 2 Nov 2020 21:17:43 +0000 (13:17 -0800)]
Merge branch 'jt/apply-reverse-twice'
"git apply -R" did not handle patches that touch the same path
twice correctly, which has been corrected. This is most relevant
in a patch that changes a path from a regular file to a symbolic
link (and vice versa).
* jt/apply-reverse-twice:
apply: when -R, also reverse list of sections
Junio C Hamano [Mon, 2 Nov 2020 21:17:43 +0000 (13:17 -0800)]
Merge branch 'sc/sequencer-gpg-octopus'
"git rebase --rebase-merges" did not correctly pass --gpg-sign
command line option to underlying "git merge" when replaying a merge
using non-default merge strategy or when replaying an octopus merge
(because replaying a two-head merge with the default strategy was
done in a separate codepath, the problem did not trigger for most
users), which has been corrected.
* sc/sequencer-gpg-octopus:
t3435: add tests for rebase -r GPG signing
sequencer: pass explicit --no-gpg-sign to merge
sequencer: fix gpg option passed to merge subcommand
Junio C Hamano [Mon, 2 Nov 2020 21:17:42 +0000 (13:17 -0800)]
Merge branch 'en/test-selector'
Our test scripts can be told to run only individual pieces while
skipping others with the "--run=..." option; they were taught to
take a substring of test title, in addition to numbers, to name the
test pieces to run.
* en/test-selector:
test-lib: reduce verbosity of skipped tests
t6006, t6012: adjust tests to use 'setup' instead of synonyms
test-lib: allow selecting tests by substring/glob with --run
Junio C Hamano [Mon, 2 Nov 2020 21:17:42 +0000 (13:17 -0800)]
Merge branch 'jk/report-fn-typedef'
Code clean-up.
* jk/report-fn-typedef:
usage: define a type for a reporting function
Junio C Hamano [Mon, 2 Nov 2020 21:17:41 +0000 (13:17 -0800)]
Merge branch 'nk/dir-c-comment-update'
Update stale in-code comment.
* nk/dir-c-comment-update:
dir.c: fix comments to agree with argument name
Junio C Hamano [Mon, 2 Nov 2020 21:17:41 +0000 (13:17 -0800)]
Merge branch 'jk/no-common'
Dev support to catch a tentative definition of a variable in our C
code as an error.
* jk/no-common:
config.mak.dev: build with -fno-common
Junio C Hamano [Mon, 2 Nov 2020 21:17:40 +0000 (13:17 -0800)]
Merge branch 'as/sample-push-to-checkout-hook'
Add a sample 'push-to-checkout' hook, that performs the same as
what the built-in default action does.
* as/sample-push-to-checkout-hook:
hook: add sample template for push-to-checkout
Junio C Hamano [Mon, 2 Nov 2020 21:17:40 +0000 (13:17 -0800)]
Merge branch 'jk/fast-import-marks-cleanup'
Code clean-up.
* jk/fast-import-marks-cleanup:
fast-import: remove duplicated option-parsing line
Junio C Hamano [Mon, 2 Nov 2020 21:17:40 +0000 (13:17 -0800)]
Merge branch 'lo/zsh-completion'
Update instructions for command line completion (in contrib/) for zsh.
* lo/zsh-completion:
completion: fix zsh installation instructions
Junio C Hamano [Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)]
Merge branch 'tk/credential-config'
"git credential' didn't honor the core.askPass configuration
variable (among other things), which has been corrected.
* tk/credential-config:
credential: load default config
Junio C Hamano [Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)]
Merge branch 'dl/diff-merge-base'
"git diff A...B" learned "git diff --merge-base A B", which is a
longer short-hand to say the same thing.
* dl/diff-merge-base:
contrib/completion: complete `git diff --merge-base`
builtin/diff-tree: learn --merge-base
builtin/diff-index: learn --merge-base
t4068: add --merge-base tests
diff-lib: define diff_get_merge_base()
diff-lib: accept option flags in run_diff_index()
contrib/completion: extract common diff/difftool options
git-diff.txt: backtick quote command text
git-diff-index.txt: make --cached description a proper sentence
t4068: remove unnecessary >tmp
Junio C Hamano [Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)]
Merge branch 'bk/sob-dco'
Document that the meaning of a Signed-off-by trailer can vary from
project to project in the end-user documentation, and clarify what
it means to this project.
* bk/sob-dco:
Documentation: stylistically normalize references to Signed-off-by:
SubmittingPatches: clarify DCO is our --signoff rule
Documentation: clarify and expand description of --signoff
doc: preparatory clean-up of description on the sign-off option
Junio C Hamano [Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)]
Merge branch 'ds/maintenance-commit-graph-auto-fix'
Test-coverage enhancement of running commit-graph task "git
maintenance" as needed led to discovery and fix of a bug.
* ds/maintenance-commit-graph-auto-fix:
maintenance: core.commitGraph=false prevents writes
maintenance: test commit-graph auto condition
Junio C Hamano [Mon, 2 Nov 2020 21:17:39 +0000 (13:17 -0800)]
Merge branch 'ds/commit-graph-merging-fix'
When "git commit-graph" detects the same commit recorded more than
once while it is merging the layers, it used to die. The code now
ignores all but one of them and continues.
* ds/commit-graph-merging-fix:
commit-graph: don't write commit-graph when disabled
commit-graph: ignore duplicates when merging layers
Junio C Hamano [Mon, 2 Nov 2020 21:17:38 +0000 (13:17 -0800)]
Merge branch 'es/test-cmp-typocatcher'
A test helper "test_cmp A B" was taught to diagnose missing files A
or B as a bug in test, but some tests legitimately wanted to notice
a failure to even create file B as an error, in addition to leaving
the expected result in it, and were misdiagnosed as a bug. This
has been corrected.
* es/test-cmp-typocatcher:
Revert "test_cmp: diagnose incorrect arguments"
Junio C Hamano [Mon, 2 Nov 2020 21:17:37 +0000 (13:17 -0800)]
Merge branch 'jk/fast-import-marks-alloc-fix'
"git fast-import" wasted a lot of memory when many marks were in use.
* jk/fast-import-marks-alloc-fix:
fast-import: fix over-allocation of marks storage
Junio C Hamano [Mon, 2 Nov 2020 21:17:37 +0000 (13:17 -0800)]
Merge branch 'js/avoid-split-sideband-message'
The side-band status report can be sent at the same time as the
primary payload multiplexed, but the demultiplexer on the receiving
end incorrectly split a single status report into two, which has
been corrected.
* js/avoid-split-sideband-message:
test-pkt-line: drop colon from sideband identity
sideband: report unhandled incomplete sideband messages as bugs
sideband: avoid reporting incomplete sideband messages
Sibo Dong [Sat, 31 Oct 2020 22:09:46 +0000 (22:09 +0000)]
git-prompt.sh: localize `option` in __git_ps1_show_upstream
The variable 'option' is used in __git_ps1_show_upstream()
without being localized.
This clobbers the variable the user may be using for other
purposes, which is bad. Luckily, $option is not used to carry
information around in the script as a global variable. The use
of it in this script has very limited scope (namely, only inside
this function), so just declare that it is "local".
Signed-off-by: Sibo Dong <sibo.dong@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sun, 1 Nov 2020 08:52:12 +0000 (09:52 +0100)]
pack-write: use hashwrite_be32() instead of double-buffering array
hashwrite() already buffers writes, so pass the fanout table entries
individually via hashwrite_be32(), which also does the endianess
conversion for us. This avoids a memory copy, shortens the code and
reduces the number of magic numbers.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Sat, 31 Oct 2020 19:46:03 +0000 (19:46 +0000)]
t5411: finish preparing for `main` being the default branch name
In addition to the trivial search-and-replace performed over the course
of the previous three commits, there is one test in t5411 that depends
on the length of the default branch name.
Adjust it and use `main` as the default branch name in this test.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Sat, 31 Oct 2020 19:46:02 +0000 (19:46 +0000)]
t5411: adjust the remaining support files for init.defaultBranch=main
This trick was performed via
$ sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -- t/t5411/*
In the previous commit, we adjusted roughly half of the support files,
to stay under the 100kB limit (mails larger than that are rejected by
the Git mailing list).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Sat, 31 Oct 2020 19:46:01 +0000 (19:46 +0000)]
t5411: start adjusting the support files for init.defaultBranch=main
This trick was performed via
$ sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -- t/t5411/test-00[3-5]*
We do not convert the files in `t/t5411/` in one go because the patch
would be too big (mails larger than 100kB are rejected by the Git
mailing list). Instead, we start with roughly half of the support files.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Sat, 31 Oct 2020 19:46:00 +0000 (19:46 +0000)]
t5411: start using the default branch name "main"
This is a straight-forward search-and-replace in the test script;
However, this is not yet complete because it requires many more
replacements in `t/t5411/`, too many for a single patch (the Git mailing
list rejects mails larger than 100kB). For that reason, we disable this
test script temporarily via the `PREPARE_FOR_MAIN_BRANCH` prereq.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sergey Organov [Sat, 31 Oct 2020 19:37:34 +0000 (22:37 +0300)]
doc/diff-options: fix out of place mentions of '--patch/-p'
First, references to --patch and -p appeared in the description of
git-format-patch, where the options themselves are not included.
Next, the description of --unified option elsewhere had duplicate implied
statements: "Implies --patch. Implies -p."
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sat, 31 Oct 2020 12:47:58 +0000 (13:47 +0100)]
bisect: clear flags in passed repository
69d2cfe6e8 (bisect.c: remove the_repository reference, 2018-11-10) kept
the implicit the_repository reference in clear_commit_marks_all, which
was made explicit by the previous commit (and which also renamed it to
repo_clear_commit_marks). Replace it as well.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sat, 31 Oct 2020 12:46:08 +0000 (13:46 +0100)]
object: allow clear_commit_marks_all to handle any repo
Allow callers to specify the repository to use. Rename the function to
repo_clear_commit_marks to document its new scope. No functional change
intended.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 30 Oct 2020 20:04:01 +0000 (13:04 -0700)]
Second batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 30 Oct 2020 20:04:24 +0000 (13:04 -0700)]
Merge branch 'js/ci-ghwf-dedup-tests'
GitHub Actions automated test improvement to skip tests on a tree
identical to what has already been tested.
* js/ci-ghwf-dedup-tests:
ci: make the "skip-if-redundant" check more defensive
ci: work around old records of GitHub runs
Junio C Hamano [Fri, 30 Oct 2020 20:04:24 +0000 (13:04 -0700)]
Merge branch 'dl/resurrect-update-for-sha256'
"git resurrect" script (in contrib/) learned that the object names
may be longer than 40-hex depending on the hash function in use.
* dl/resurrect-update-for-sha256:
contrib/git-resurrect.sh: use hash-agnostic OID pattern
contrib/git-resurrect.sh: indent with tabs
Junio C Hamano [Fri, 30 Oct 2020 20:04:24 +0000 (13:04 -0700)]
Merge branch 'cm/t7xxx-cleanup'
Micro clean-up.
* cm/t7xxx-cleanup:
t7102: prepare expected output inside test_expect_* block
t7201: put each command on a separate line
t7201: use 'git -C' to avoid subshell
t7102,t7201: remove whitespace after redirect operator
t7102,t7201: remove unnecessary blank spaces in test body
t7101,t7102,t7201: modernize test formatting
Junio C Hamano [Fri, 30 Oct 2020 20:04:24 +0000 (13:04 -0700)]
Merge branch 'ct/t0000-use-test-path-is-file'
Micro clean-up of a test script.
* ct/t0000-use-test-path-is-file:
t0000: use test_path_is_file instead of "test -f"
Junio C Hamano [Fri, 30 Oct 2020 20:04:23 +0000 (13:04 -0700)]
Merge branch 'en/t7518-unflake'
Work around flakiness in a test.
* en/t7518-unflake:
t7518: fix flaky grep invocation
Junio C Hamano [Thu, 29 Oct 2020 21:25:15 +0000 (14:25 -0700)]
Sync with Git 2.29.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 29 Oct 2020 21:24:09 +0000 (14:24 -0700)]
Git 2.29.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 29 Oct 2020 21:18:48 +0000 (14:18 -0700)]
Merge branch 'cc/doc-filter-branch-typofix' into maint
Docfix.
* cc/doc-filter-branch-typofix:
filter-branch doc: fix filter-repo typo
Junio C Hamano [Thu, 29 Oct 2020 21:18:47 +0000 (14:18 -0700)]
Merge branch 'jk/committer-date-is-author-date-fix' into maint
In 2.29, "--committer-date-is-author-date" option of "rebase" and
"am" subcommands lost the e-mail address by mistake, which has been
corrected.
* jk/committer-date-is-author-date-fix:
rebase: fix broken email with --committer-date-is-author-date
am: fix broken email with --committer-date-is-author-date
t3436: check --committer-date-is-author-date result more carefully
Philippe Blain [Thu, 29 Oct 2020 12:48:29 +0000 (12:48 +0000)]
log, show: add tests for messages containing CRLF
A previous commit adjusted the code in ref-filter.c so that messages
containing CRLF are now correctly parsed and displayed.
Add tests to also check that `git log` and `git show` correctly handle
such messages, to prevent futur regressions if these commands are
refactored to use the ref-filter API.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philippe Blain [Thu, 29 Oct 2020 12:48:28 +0000 (12:48 +0000)]
ref-filter: handle CRLF at end-of-line more gracefully
The ref-filter code does not correctly handle commit or tag messages
that use CRLF as the line terminator. Such messages can be created with
the `--cleanup=verbatim` option of `git commit` and `git tag`, or by
using `git commit-tree` directly.
The function `find_subpos` in ref-filter.c looks for two consecutive
LFs to find the end of the subject line, a sequence which is absent in
messages using CRLF. This results in the whole message being parsed as
the subject line (`%(contents:subject)`), and the body of the message
(`%(contents:body)`) being empty.
Moreover, in `copy_subject`, which wants to return the subject as a
single line, '\n' is replaced by space, but '\r' is
untouched.
This impacts the output of `git branch`, `git tag` and `git
for-each-ref`.
This behaviour is a regression for `git branch --verbose`, which
bisects down to
949af0684c (branch: use ref-filter printing APIs,
2017-01-10).
Adjust the ref-filter code to be more lenient by hardening the logic in
`copy_subject` and `find_subpos` to correctly parse messages containing
CRLF.
Add a new test script, 't3920-crlf-messages.sh', to test the behaviour
of commands using either the ref-filter or the pretty APIs with messages
using CRLF line endings. The function `test_crlf_subject_body_and_contents`
can be used to test that the `--format` option of `branch`, `tag`,
`for-each-ref`, `log` and `show` correctly displays the subject, body
and raw content of commit and tag messages using CRLF. Test the
output of `branch`, `tag` and `for-each-ref` with such commits.
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 28 Oct 2020 09:33:24 +0000 (05:33 -0400)]
sideband: diagnose more sideband anomalies
In demultiplex_sideband(), there are two oddities when we check an
incoming packet:
- if it has zero length, then we assume it's a flush packet. This
means we fail to notice the difference between a real flush and a
true zero-length packet that's missing its sideband designator. It's
not a huge problem in practice because we'd never send a zero-length
data packet (even our keepalives are otherwise-empty sideband-1
packets).
But it would be nice to detect and report the error, since it's
likely to cause other confusion (we think the other side flushed,
but they do not).
- we try to detect packets missing their designator by checking for
"if (len < 1)". But this will never trigger for "len == 0"; we've
already detected that and left the function before then.
It _could_ detect a negative "len" parameter. But in that case, the
error message is wrong. The issue is not "no sideband" but rather
"eof while reading the packet". However, this can't actually be
triggered in practice, because neither of the two callers uses
pkt_read's GENTLE_ON_EOF flag. Which means they'd die with "the
remote end hung up unexpectedly" before we even get here.
So this truly is dead code.
We can improve these cases by passing in a pkt-line status to the
demultiplexer, and by having recv_sideband() use GENTLE_ON_EOF. This
gives us two improvements:
- we can now reliably detect flush packets, and will report a normal
packet missing its sideband designator as an error
- we'll report an eof with a more detailed "protocol error: eof while
reading sideband packet", rather than the generic "the remote end
hung up unexpectedly"
- when we see an eof, we'll flush the sideband scratch buffer, which
may provide some hints from the remote about why they hung up
(though note we already flush on newlines, so it's likely that most
such messages already made it through)
In some sense this patch goes against
fbd76cd450 (sideband: reverse its
dependency on pkt-line, 2019-01-16), which caused the sideband code not
to depend on the pkt-line code. But that commit was really just trying
to deal with the circular header dependency. The two modules are
conceptually interlinked, and it was just trying to keep things
compiling. And indeed, there's a sticking point in this patch: because
pkt-line.h includes sideband.h, we can't add the reverse include we need
for the sideband code to have an "enum packet_read_status" parameter.
Nor can we forward declare it, because you can't forward declare an enum
in C. However, C does guarantee that enums fit in an int, so we can just
use that type.
One alternative would be for the callers to check themselves that they
got something sane from the pkt-line code. But besides duplicating
logic, this gets quite tricky. Any error condition requires flushing the
sideband #2 scratch buffer, which only demultiplex_sideband() knows how
to do.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:12 +0000 (20:07 -0600)]
zsh: update copyright notices
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:11 +0000 (20:07 -0600)]
completion: bash: remove old compat wrappers
It's been eight years, more than enough time to move on.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:10 +0000 (20:07 -0600)]
completion: bash: cleanup cygwin check
Avoid Yoda conditions, and use $OSTYPE.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:09 +0000 (20:07 -0600)]
completion: bash: trivial cleanup
There's no need to set a variable we are not going to use.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:08 +0000 (20:07 -0600)]
completion: zsh: add simple version check
A lot of people are confused about which completion script they are
using; Zsh's Git script, or Git's Zsh script.
Add a simple helper so they can type 'git zsh<tab>' and find out if they
are running the correct one: this.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:07 +0000 (20:07 -0600)]
completion: zsh: trivial simplification
>From upstream bash simplification:
d9ee1e0617 (completion: simplify inner 'case' pattern in __gitcomp())
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:06 +0000 (20:07 -0600)]
completion: zsh: add alias descriptions
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:05 +0000 (20:07 -0600)]
completion: zsh: improve command tags
There's no need to use _alternative and repeat a lot of the code.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:04 +0000 (20:07 -0600)]
completion: zsh: refactor command completion
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:03 +0000 (20:07 -0600)]
completion: zsh: shuffle functions around
Just to have a nice order.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:02 +0000 (20:07 -0600)]
completion: zsh: simplify file_direct
It's exactly the same as __gitcomp_file() with no prefix.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:01 +0000 (20:07 -0600)]
completion: zsh: simplify nl_append
It's exactly the same as __gitcomp_nl(), no need to duplicate code.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:07:00 +0000 (20:07 -0600)]
completion: zsh: trivial cleanup
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:59 +0000 (20:06 -0600)]
completion: zsh: simplify direct compadd
Instead of manually removing the suffix so zsh can add its own, we can
tell zsh to add no suffix, so we don't have to remove it.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:58 +0000 (20:06 -0600)]
completion: zsh: simplify compadd functions
We don't need to override IFS, zsh has a native way of splitting by new
lines: the expansion flag (f).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:57 +0000 (20:06 -0600)]
completion: zsh: fix splitting of words
Files don't need to be split by '=:', words do.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:56 +0000 (20:06 -0600)]
completion: zsh: add missing direct_append
Commit
688077910b forgot to add the corresponding zsh function.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:55 +0000 (20:06 -0600)]
completion: fix conflict with bashcomp
We don't want to override the 'complete()' function in zsh, which can be
used by bashcomp.
Reported-by: Mark Lodato <lodato@google.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:54 +0000 (20:06 -0600)]
completion: zsh: fix completion for --no-.. options
This was introduced in upstream's bash script, but never in zsh's:
b221b5ab9b (completion: collapse extra --no-.. options)
It has been failing since v2.19.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:53 +0000 (20:06 -0600)]
completion: bash: remove zsh wrapper
It has been deprecated for more than eight years now, it's never up to
date, and it's a hassle to maintain.
It's time to move on.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:52 +0000 (20:06 -0600)]
completion: bash: synchronize zsh wrapper
A function was missing.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:51 +0000 (20:06 -0600)]
completion: zsh: fix for command aliasing
A lot of people want to define aliases like gc='git commit', and zsh
allows that (when not using 'complete_aliases'), but we need to handle
services that call a function other than the main one.
With this patch we can do:
compdef _git gc=git_commit
Additionally, add compatibility for Zsh Git functions which have the
form git-commit (with dash, not underscore).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:50 +0000 (20:06 -0600)]
completion: prompt: fix color for Zsh
We don't need PROMPT_COMMAND in Zsh; we are already using %F{color} %f,
which in turn use %{ and %}, which are the equivalent of Bash's
\[ and \].
We can use as many colors as we want and output directly into PS1
(or RPS1) without the risk of buffer wrapping issues.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Wed, 28 Oct 2020 02:06:49 +0000 (20:06 -0600)]
completion: zsh: update slave script locations
Update the default locations of typical system bash-completion,
including the default bash-completion location for user scripts, and the
recommended way to find the system location (with pkg-config).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 27 Oct 2020 05:52:28 +0000 (22:52 -0700)]
First batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 27 Oct 2020 22:09:51 +0000 (15:09 -0700)]
Merge branch 'dl/checkout-guess'
"git checkout" learned to use checkout.guess configuration variable
and enable/disable its "--[no-]guess" option accordingly.
* dl/checkout-guess:
checkout: learn to respect checkout.guess
Documentation/config/checkout: replace sq with backticks
Junio C Hamano [Tue, 27 Oct 2020 22:09:50 +0000 (15:09 -0700)]
Merge branch 'dl/checkout-p-merge-base'
"git checkout -p A...B [-- <path>]" did not work, even though the
same command without "-p" correctly used the merge-base between
commits A and B.
* dl/checkout-p-merge-base:
t2016: add a NEEDSWORK about the PERL prerequisite
add-patch: add NEEDSWORK about comparing commits
Doc: document "A...B" form for <tree-ish> in checkout and switch
builtin/checkout: fix `git checkout -p HEAD...` bug
Junio C Hamano [Tue, 27 Oct 2020 22:09:49 +0000 (15:09 -0700)]
Merge branch 'sb/clone-origin'
"git clone" learned clone.defaultremotename configuration variable
to customize what nickname to use to call the remote the repository
was cloned from.
* sb/clone-origin:
clone: allow configurable default for `-o`/`--origin`
clone: read new remote name from remote_name instead of option_origin
clone: validate --origin option before use
refs: consolidate remote name validation
remote: add tests for add and rename with invalid names
clone: use more conventional config/option layering
clone: add tests for --template and some disallowed option pairs
Junio C Hamano [Tue, 27 Oct 2020 22:09:49 +0000 (15:09 -0700)]
Merge branch 'sk/force-if-includes'
"git push --force-with-lease[=<ref>]" can easily be misused to lose
commits unless the user takes good care of their own "git fetch".
A new option "--force-if-includes" attempts to ensure that what is
being force-pushed was created after examining the commit at the
tip of the remote ref that is about to be force-replaced.
* sk/force-if-includes:
t, doc: update tests, reference for "--force-if-includes"
push: parse and set flag for "--force-if-includes"
push: add reflog check for "--force-if-includes"
Junio C Hamano [Tue, 27 Oct 2020 22:09:47 +0000 (15:09 -0700)]
Merge branch 'ds/maintenance-part-2'
"git maintenance", an extended big brother of "git gc", continues
to evolve.
* ds/maintenance-part-2:
maintenance: add incremental-repack auto condition
maintenance: auto-size incremental-repack batch
maintenance: add incremental-repack task
midx: use start_delayed_progress()
midx: enable core.multiPackIndex by default
maintenance: create auto condition for loose-objects
maintenance: add loose-objects task
maintenance: add prefetch task
Junio C Hamano [Tue, 27 Oct 2020 22:09:47 +0000 (15:09 -0700)]
Merge branch 'rs/worktree-list-show-locked'
"git worktree list" now shows if each worktree is locked. This
possibly may open us to show other kinds of states in the future.
* rs/worktree-list-show-locked:
worktree: teach `list` to annotate locked worktree