git
4 years agoMerge branch 'dl/t5520-cleanup'
Junio C Hamano [Thu, 5 Dec 2019 20:52:47 +0000 (12:52 -0800)] 
Merge branch 'dl/t5520-cleanup'

Test cleanup.

* dl/t5520-cleanup:
  t5520: replace `! git` with `test_must_fail git`
  t5520: remove redundant lines in test cases
  t5520: replace $(cat ...) comparison with test_cmp
  t5520: don't put git in upstream of pipe
  t5520: test single-line files by git with test_cmp
  t5520: use test_cmp_rev where possible
  t5520: replace test -{n,z} with test-lib functions
  t5520: use test_line_count where possible
  t5520: remove spaces after redirect operator
  t5520: replace test -f with test-lib functions
  t5520: let sed open its own input
  t5520: use sq for test case names
  t5520: improve test style
  t: teach test_cmp_rev to accept ! for not-equals
  t0000: test multiple local assignment

4 years agoMerge branch 'nl/reset-patch-takes-a-tree'
Junio C Hamano [Thu, 5 Dec 2019 20:52:47 +0000 (12:52 -0800)] 
Merge branch 'nl/reset-patch-takes-a-tree'

"git reset --patch $object" without any pathspec should allow a
tree object to be given, but incorrectly required a committish,
which has been corrected.

* nl/reset-patch-takes-a-tree:
  reset: parse rev as tree-ish in patch mode

4 years agoMerge branch 'mg/doc-submodule-status-cached'
Junio C Hamano [Thu, 5 Dec 2019 20:52:47 +0000 (12:52 -0800)] 
Merge branch 'mg/doc-submodule-status-cached'

"git submodule status" and "git submodule status --cached" show
different things, but the documentation did not cover them
correctly, which has been corrected.

* mg/doc-submodule-status-cached:
  doc: document 'git submodule status --cached'

4 years agoMerge branch 'js/git-svn-use-rebase-merges'
Junio C Hamano [Thu, 5 Dec 2019 20:52:46 +0000 (12:52 -0800)] 
Merge branch 'js/git-svn-use-rebase-merges'

Prepare further for "rebase --preserve-merges" deprecation.

* js/git-svn-use-rebase-merges:
  git svn: stop using `rebase --preserve-merges`

4 years agoMerge branch 'hi/gpg-optional-pkfp-fix'
Junio C Hamano [Thu, 5 Dec 2019 20:52:46 +0000 (12:52 -0800)] 
Merge branch 'hi/gpg-optional-pkfp-fix'

The code to parse GPG output used to assume incorrectly that the
finterprint for the primary key would always be present for a valid
signature, which has been corrected.

* hi/gpg-optional-pkfp-fix:
  gpg-interface: limit search for primary key fingerprint
  gpg-interface: refactor the free-and-xmemdupz pattern

4 years agoMerge branch 'pw/sequencer-compare-with-right-parent-to-check-empty-commits'
Junio C Hamano [Thu, 5 Dec 2019 20:52:46 +0000 (12:52 -0800)] 
Merge branch 'pw/sequencer-compare-with-right-parent-to-check-empty-commits'

The sequencer machinery compared the HEAD and the state it is
attempting to commit to decide if the result would be a no-op
commit, even when amending a commit, which was incorrect, and
has been corrected.

* pw/sequencer-compare-with-right-parent-to-check-empty-commits:
  sequencer: fix empty commit check when amending

4 years agoMerge branch 'jk/fail-show-toplevel-outside-working-tree'
Junio C Hamano [Thu, 5 Dec 2019 20:52:45 +0000 (12:52 -0800)] 
Merge branch 'jk/fail-show-toplevel-outside-working-tree'

"git rev-parse --show-toplevel" run outside of any working tree did
not error out, which has been corrected.

* jk/fail-show-toplevel-outside-working-tree:
  rev-parse: make --show-toplevel without a worktree an error

4 years agoMerge branch 'sg/unpack-progress-throughput'
Junio C Hamano [Thu, 5 Dec 2019 20:52:45 +0000 (12:52 -0800)] 
Merge branch 'sg/unpack-progress-throughput'

"git unpack-objects" used to show progress based only on the number
of received and unpacked objects, which stalled when it has to
handle an unusually large object.  It now shows the throughput as
well.

* sg/unpack-progress-throughput:
  builtin/unpack-objects.c: show throughput progress

4 years agoMerge branch 'pb/submodule-update-fetches'
Junio C Hamano [Thu, 5 Dec 2019 20:52:45 +0000 (12:52 -0800)] 
Merge branch 'pb/submodule-update-fetches'

Doc update.

* pb/submodule-update-fetches:
  doc: mention that 'git submodule update' fetches missing commits

4 years agoMerge branch 'jc/azure-ci-osx-fix-fix'
Junio C Hamano [Thu, 5 Dec 2019 20:52:44 +0000 (12:52 -0800)] 
Merge branch 'jc/azure-ci-osx-fix-fix'

CI jobs for macOS has been made less chatty when updating perforce
package used during testing.

* jc/azure-ci-osx-fix-fix:
  ci(osx): update homebrew-cask repository with less noise

4 years agoMerge branch 'dl/range-diff-with-notes'
Junio C Hamano [Thu, 5 Dec 2019 20:52:44 +0000 (12:52 -0800)] 
Merge branch 'dl/range-diff-with-notes'

"git range-diff" learned to take the "--notes=<ref>" and the
"--no-notes" options to control the commit notes included in the
log message that gets compared.

* dl/range-diff-with-notes:
  format-patch: pass notes configuration to range-diff
  range-diff: pass through --notes to `git log`
  range-diff: output `## Notes ##` header
  t3206: range-diff compares logs with commit notes
  t3206: s/expected/expect/
  t3206: disable parameter substitution in heredoc
  t3206: remove spaces after redirect operators
  pretty-options.txt: --notes accepts a ref instead of treeish
  rev-list-options.txt: remove reference to --show-notes
  argv-array: add space after `while`

4 years agoMerge branch 'jh/userdiff-python-async'
Junio C Hamano [Thu, 5 Dec 2019 20:52:44 +0000 (12:52 -0800)] 
Merge branch 'jh/userdiff-python-async'

The userdiff machinery has been taught that "async def" is another
way to begin a "function" in Python.

* jh/userdiff-python-async:
  userdiff: support Python async functions

4 years agoMerge branch 'ec/fetch-mark-common-refs-trace2'
Junio C Hamano [Thu, 5 Dec 2019 20:52:43 +0000 (12:52 -0800)] 
Merge branch 'ec/fetch-mark-common-refs-trace2'

Trace2 annotation.

* ec/fetch-mark-common-refs-trace2:
  fetch: add trace2 instrumentation

4 years agoMerge branch 'dd/rebase-merge-reserves-onto-label'
Junio C Hamano [Thu, 5 Dec 2019 20:52:43 +0000 (12:52 -0800)] 
Merge branch 'dd/rebase-merge-reserves-onto-label'

The logic to avoid duplicate label names generated by "git rebase
--rebase-merges" forgot that the machinery itself uses "onto" as a
label name, which must be avoided by auto-generated labels, which
has been corrected.

* dd/rebase-merge-reserves-onto-label:
  sequencer: handle rebase-merges for "onto" message

4 years agoMerge branch 'js/builtin-add-i'
Junio C Hamano [Thu, 5 Dec 2019 20:52:43 +0000 (12:52 -0800)] 
Merge branch 'js/builtin-add-i'

The beginning of rewriting "git add -i" in C.

* js/builtin-add-i:
  built-in add -i: implement the `help` command
  built-in add -i: use color in the main loop
  built-in add -i: support `?` (prompt help)
  built-in add -i: show unique prefixes of the commands
  built-in add -i: implement the main loop
  built-in add -i: color the header in the `status` command
  built-in add -i: implement the `status` command
  diff: export diffstat interface
  Start to implement a built-in version of `git add --interactive`

4 years agoMerge branch 'js/rebase-r-safer-label'
Junio C Hamano [Thu, 5 Dec 2019 20:52:43 +0000 (12:52 -0800)] 
Merge branch 'js/rebase-r-safer-label'

A label used in the todo list that are generated by "git rebase
--rebase-merges" is used as a part of a refname; the logic to come
up with the label has been tightened to avoid names that cannot be
used as such.

* js/rebase-r-safer-label:
  rebase -r: let `label` generate safer labels
  rebase-merges: move labels' whitespace mangling into `label_oid()`

4 years agoMerge branch 'ep/guard-kset-tar-headers'
Junio C Hamano [Thu, 5 Dec 2019 20:52:43 +0000 (12:52 -0800)] 
Merge branch 'ep/guard-kset-tar-headers'

Code clean-up.

* ep/guard-kset-tar-headers:
  kset.h, tar.h: add missing header guard to prevent multiple inclusion

4 years agoThe second batch
Junio C Hamano [Sun, 1 Dec 2019 17:04:07 +0000 (09:04 -0800)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'jk/gitweb-anti-xss'
Junio C Hamano [Sun, 1 Dec 2019 17:04:41 +0000 (09:04 -0800)] 
Merge branch 'jk/gitweb-anti-xss'

Some codepaths in "gitweb" that forgot to escape URLs generated
based on end-user input have been corrected.

* jk/gitweb-anti-xss:
  gitweb: escape URLs generated by href()
  t/gitweb-lib.sh: set $REQUEST_URI
  t/gitweb-lib.sh: drop confusing quotes
  t9502: pass along all arguments in xss helper

4 years agoMerge branch 'ar/install-doc-update-cmds-needing-the-shell'
Junio C Hamano [Sun, 1 Dec 2019 17:04:41 +0000 (09:04 -0800)] 
Merge branch 'ar/install-doc-update-cmds-needing-the-shell'

Doc update.

* ar/install-doc-update-cmds-needing-the-shell:
  INSTALL: use existing shell scripts as example

4 years agoMerge branch 'ma/t7004'
Junio C Hamano [Sun, 1 Dec 2019 17:04:41 +0000 (09:04 -0800)] 
Merge branch 'ma/t7004'

Test fix.

* ma/t7004:
  t7004: check existence of correct tag

4 years agoMerge branch 'js/complete-svn-recursive'
Junio C Hamano [Sun, 1 Dec 2019 17:04:40 +0000 (09:04 -0800)] 
Merge branch 'js/complete-svn-recursive'

The completion script (in contrib/) has been taught that "git svn"
supports the "--recursive" option.

* js/complete-svn-recursive:
  completion: tab-complete "git svn --recursive"

4 years agoMerge branch 'jk/send-pack-remote-failure'
Junio C Hamano [Sun, 1 Dec 2019 17:04:40 +0000 (09:04 -0800)] 
Merge branch 'jk/send-pack-remote-failure'

Error handling after "git push" finishes sending the packdata and
waits for the response to the remote side has been improved.

* jk/send-pack-remote-failure:
  send-pack: check remote ref status on pack-objects failure

4 years agoMerge branch 'jc/fsmonitor-sanity-fix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:39 +0000 (09:04 -0800)] 
Merge branch 'jc/fsmonitor-sanity-fix'

Remove an incorrect BUG() that should not trigger.

* jc/fsmonitor-sanity-fix:
  fsmonitor: do not compare bitmap size with size of split index

4 years agoMerge branch 'sg/skip-skipped-prereq'
Junio C Hamano [Sun, 1 Dec 2019 17:04:39 +0000 (09:04 -0800)] 
Merge branch 'sg/skip-skipped-prereq'

Test update to avoid wasted cycles.

* sg/skip-skipped-prereq:
  test-lib: don't check prereqs of test cases that won't be run anyway

4 years agoMerge branch 'ds/test-read-graph'
Junio C Hamano [Sun, 1 Dec 2019 17:04:39 +0000 (09:04 -0800)] 
Merge branch 'ds/test-read-graph'

Dev support for commit-graph feature.

* ds/test-read-graph:
  test-tool: use 'read-graph' helper

4 years agoMerge branch 'rs/use-copy-array-in-mingw-shell-command-preparation'
Junio C Hamano [Sun, 1 Dec 2019 17:04:39 +0000 (09:04 -0800)] 
Merge branch 'rs/use-copy-array-in-mingw-shell-command-preparation'

Code cleanup.

* rs/use-copy-array-in-mingw-shell-command-preparation:
  mingw: use COPY_ARRAY for copying array

4 years agoMerge branch 'rs/parse-options-dup-null-fix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:38 +0000 (09:04 -0800)] 
Merge branch 'rs/parse-options-dup-null-fix'

Code cleanup.

* rs/parse-options-dup-null-fix:
  parse-options: avoid arithmetic on pointer that's potentially NULL

4 years agoMerge branch 'jt/fetch-remove-lazy-fetch-plugging'
Junio C Hamano [Sun, 1 Dec 2019 17:04:38 +0000 (09:04 -0800)] 
Merge branch 'jt/fetch-remove-lazy-fetch-plugging'

"git fetch" codepath had a big "do not lazily fetch missing objects
when I ask if something exists" switch.  This has been corrected by
marking the "does this thing exist?" calls with "if not please do not
lazily fetch it" flag.

* jt/fetch-remove-lazy-fetch-plugging:
  promisor-remote: remove fetch_if_missing=0
  clone: remove fetch_if_missing=0
  fetch: remove fetch_if_missing=0

4 years agoMerge branch 'jk/optim-in-pack-idx-conversion'
Junio C Hamano [Sun, 1 Dec 2019 17:04:38 +0000 (09:04 -0800)] 
Merge branch 'jk/optim-in-pack-idx-conversion'

Code clean-up.

* jk/optim-in-pack-idx-conversion:
  pack-objects: avoid pointless oe_map_new_pack() calls

4 years agoMerge branch 'dl/complete-rebase-onto'
Junio C Hamano [Sun, 1 Dec 2019 17:04:37 +0000 (09:04 -0800)] 
Merge branch 'dl/complete-rebase-onto'

The completion script (in contrib/) learned that the "--onto"
option of "git rebase" can take its argument as the value of the
option.

* dl/complete-rebase-onto:
  completion: learn to complete `git rebase --onto=`

4 years agoMerge branch 'tg/stash-refresh-index'
Junio C Hamano [Sun, 1 Dec 2019 17:04:37 +0000 (09:04 -0800)] 
Merge branch 'tg/stash-refresh-index'

Recent update to "git stash pop" made the command empty the index
when run with the "--quiet" option, which has been corrected.

* tg/stash-refresh-index:
  stash: make sure we have a valid index before writing it

4 years agoMerge branch 'nn/doc-rebase-merges'
Junio C Hamano [Sun, 1 Dec 2019 17:04:36 +0000 (09:04 -0800)] 
Merge branch 'nn/doc-rebase-merges'

Doc update.

* nn/doc-rebase-merges:
  doc: improve readability of --rebase-merges in git-rebase

4 years agoMerge branch 'dd/sequencer-utf8'
Junio C Hamano [Sun, 1 Dec 2019 17:04:36 +0000 (09:04 -0800)] 
Merge branch 'dd/sequencer-utf8'

Handling of commit objects that use non UTF-8 encoding during
"rebase -i" has been improved.

* dd/sequencer-utf8:
  sequencer: reencode commit message for am/rebase --show-current-patch
  sequencer: reencode old merge-commit message
  sequencer: reencode squashing commit's message
  sequencer: reencode revert/cherry-pick's todo list
  sequencer: reencode to utf-8 before arrange rebase's todo list
  t3900: demonstrate git-rebase problem with multi encoding
  configure.ac: define ICONV_OMITS_BOM if necessary
  t0028: eliminate non-standard usage of printf

4 years agoMerge branch 'jk/remove-sha1-to-hex'
Junio C Hamano [Sun, 1 Dec 2019 17:04:36 +0000 (09:04 -0800)] 
Merge branch 'jk/remove-sha1-to-hex'

Code clean-up.

* jk/remove-sha1-to-hex:
  hex: drop sha1_to_hex()
  hex: drop sha1_to_hex_r()

4 years agoMerge branch 'dj/typofix-merge-strat'
Junio C Hamano [Sun, 1 Dec 2019 17:04:36 +0000 (09:04 -0800)] 
Merge branch 'dj/typofix-merge-strat'

Typofix.

* dj/typofix-merge-strat:
  merge-strategies: fix typo "reflected to" to "reflected in"

4 years agoMerge branch 'rj/bundle-ui-updates'
Junio C Hamano [Sun, 1 Dec 2019 17:04:36 +0000 (09:04 -0800)] 
Merge branch 'rj/bundle-ui-updates'

"git bundle" has been taught to use the parse options API.  "git
bundle verify" learned "--quiet" and "git bundle create" learned
options to control the progress output.

* rj/bundle-ui-updates:
  bundle-verify: add --quiet
  bundle-create: progress output control
  bundle: framework for options before bundle file

4 years agoMerge branch 'rs/skip-iprefix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:36 +0000 (09:04 -0800)] 
Merge branch 'rs/skip-iprefix'

Code simplification.

* rs/skip-iprefix:
  convert: use skip_iprefix() in validate_encoding()
  utf8: use skip_iprefix() in same_utf_encoding()

4 years agoMerge branch 'ln/userdiff-elixir'
Junio C Hamano [Sun, 1 Dec 2019 17:04:35 +0000 (09:04 -0800)] 
Merge branch 'ln/userdiff-elixir'

The patterns to detect function boundary for Elixir language has
been added.

* ln/userdiff-elixir:
  userdiff: add Elixir to supported userdiff languages

4 years agoMerge branch 'py/shortlog-list-options-for-log'
Junio C Hamano [Sun, 1 Dec 2019 17:04:35 +0000 (09:04 -0800)] 
Merge branch 'py/shortlog-list-options-for-log'

Documentation pages for "git shortlog" now lists commit limiting
options explicitly.

* py/shortlog-list-options-for-log:
  git-shortlog.txt: include commit limiting options

4 years agoMerge branch 'en/doc-typofix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:35 +0000 (09:04 -0800)] 
Merge branch 'en/doc-typofix'

Docfix.

* en/doc-typofix:
  Fix spelling errors in no-longer-updated-from-upstream modules
  multimail: fix a few simple spelling errors
  sha1dc: fix trivial comment spelling error
  Fix spelling errors in test commands
  Fix spelling errors in messages shown to users
  Fix spelling errors in names of tests
  Fix spelling errors in comments of testcases
  Fix spelling errors in code comments
  Fix spelling errors in documentation outside of Documentation/
  Documentation: fix a bunch of typos, both old and new

4 years agoMerge branch 'ns/test-desc-typofix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:34 +0000 (09:04 -0800)] 
Merge branch 'ns/test-desc-typofix'

Typofix.

* ns/test-desc-typofix:
  t: fix typo in test descriptions

4 years agoMerge branch 'en/t6024-style'
Junio C Hamano [Sun, 1 Dec 2019 17:04:34 +0000 (09:04 -0800)] 
Merge branch 'en/t6024-style'

Test updates.

* en/t6024-style:
  t6024: modernize style

4 years agoMerge branch 'en/misc-doc-fixes'
Junio C Hamano [Sun, 1 Dec 2019 17:04:34 +0000 (09:04 -0800)] 
Merge branch 'en/misc-doc-fixes'

Misc doc fixes.

* en/misc-doc-fixes:
  name-hash.c: remove duplicate word in comment
  hashmap: fix documentation misuses of -> versus .
  git-filter-branch.txt: correct argument name typo

4 years agoMerge branch 'js/fetch-multi-lockfix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:33 +0000 (09:04 -0800)] 
Merge branch 'js/fetch-multi-lockfix'

Fetching from multiple remotes into the same repository in parallel
had a bad interaction with the recent change to (optionally) update
the commit-graph after a fetch job finishes, as these parallel
fetches compete with each other.  Which has been corrected.

* js/fetch-multi-lockfix:
  fetch: avoid locking issues between fetch.jobs/fetch.writeCommitGraph
  fetch: add the command-line option `--write-commit-graph`

4 years agoMerge branch 'rs/trace2-dots'
Junio C Hamano [Sun, 1 Dec 2019 17:04:33 +0000 (09:04 -0800)] 
Merge branch 'rs/trace2-dots'

Code cleanup.

* rs/trace2-dots:
  trace2: add dots directly to strbuf in perf_fmt_prepare()

4 years agoMerge branch 'kw/fsmonitor-watchman-fix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:33 +0000 (09:04 -0800)] 
Merge branch 'kw/fsmonitor-watchman-fix'

The watchman integration for fsmonitor was racy, which has been
corrected to be more conservative.

* kw/fsmonitor-watchman-fix:
  fsmonitor: fix watchman integration

4 years agoMerge branch 'cb/curl-use-xmalloc'
Junio C Hamano [Sun, 1 Dec 2019 17:04:33 +0000 (09:04 -0800)] 
Merge branch 'cb/curl-use-xmalloc'

HTTP transport had possible allocator/deallocator mismatch, which
has been corrected.

* cb/curl-use-xmalloc:
  remote-curl: unbreak http.extraHeader with custom allocators

4 years agoMerge branch 'rt/fetch-message-fix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:32 +0000 (09:04 -0800)] 
Merge branch 'rt/fetch-message-fix'

A small message update.

* rt/fetch-message-fix:
  fetch.c: fix typo in a warning message

4 years agoMerge branch 'es/myfirstcontrib-updates'
Junio C Hamano [Sun, 1 Dec 2019 17:04:32 +0000 (09:04 -0800)] 
Merge branch 'es/myfirstcontrib-updates'

Doc updates.

* es/myfirstcontrib-updates:
  myfirstcontrib: hint to find gitgitgadget allower
  myfirstcontrib: add dependency installation step
  myfirstcontrib: add 'psuh' to command-list.txt

4 years agoMerge branch 'hw/config-doc-in-header'
Junio C Hamano [Sun, 1 Dec 2019 17:04:32 +0000 (09:04 -0800)] 
Merge branch 'hw/config-doc-in-header'

Follow recent push to move API docs from Documentation/ to header
files and update config.h

* hw/config-doc-in-header:
  config: move documentation to config.h

4 years agoMerge branch 'dl/doc-diff-no-index-implies-exit-code'
Junio C Hamano [Sun, 1 Dec 2019 17:04:31 +0000 (09:04 -0800)] 
Merge branch 'dl/doc-diff-no-index-implies-exit-code'

Doc update.

* dl/doc-diff-no-index-implies-exit-code:
  git-diff.txt: document return code of `--no-index`

4 years agoMerge branch 'js/vreportf-wo-buffering'
Junio C Hamano [Sun, 1 Dec 2019 17:04:31 +0000 (09:04 -0800)] 
Merge branch 'js/vreportf-wo-buffering'

Messages from die() etc. can be mixed up from multiple processes
without even line buffering on Windows, which has been worked
around.

* js/vreportf-wo-buffering:
  vreportf(): avoid relying on stdio buffering

4 years agoMerge branch 'pb/no-recursive-reset-hard-in-worktree-add'
Junio C Hamano [Sun, 1 Dec 2019 17:04:31 +0000 (09:04 -0800)] 
Merge branch 'pb/no-recursive-reset-hard-in-worktree-add'

"git worktree add" internally calls "reset --hard" that should not
descend into submodules, even when submodule.recurse configuration
is set, but it was affected.  This has been corrected.

* pb/no-recursive-reset-hard-in-worktree-add:
  worktree: teach "add" to ignore submodule.recurse config

4 years agoMerge branch 'pb/help-list-gitsubmodules-among-guides'
Junio C Hamano [Sun, 1 Dec 2019 17:04:30 +0000 (09:04 -0800)] 
Merge branch 'pb/help-list-gitsubmodules-among-guides'

Help update.

* pb/help-list-gitsubmodules-among-guides:
  help: add gitsubmodules to the list of guides

4 years agoMerge branch 'sg/blame-indent-heuristics-is-now-the-default'
Junio C Hamano [Sun, 1 Dec 2019 17:04:30 +0000 (09:04 -0800)] 
Merge branch 'sg/blame-indent-heuristics-is-now-the-default'

Message update.

* sg/blame-indent-heuristics-is-now-the-default:
  builtin/blame.c: remove '--indent-heuristic' from usage string

4 years agoMerge branch 'mr/clone-dir-exists-to-path-exists'
Junio C Hamano [Sun, 1 Dec 2019 17:04:29 +0000 (09:04 -0800)] 
Merge branch 'mr/clone-dir-exists-to-path-exists'

Code cleanup.

* mr/clone-dir-exists-to-path-exists:
  clone: rename static function `dir_exists()`.

4 years agoMerge branch 'ma/bisect-doc-sample-update'
Junio C Hamano [Sun, 1 Dec 2019 17:04:29 +0000 (09:04 -0800)] 
Merge branch 'ma/bisect-doc-sample-update'

"git merge --no-commit" needs "--no-ff" if you do not want to move
HEAD, which has been corrected in the manual page for "git bisect".

* ma/bisect-doc-sample-update:
  Documentation/git-bisect.txt: add --no-ff to merge command

4 years agoMerge branch 'js/git-path-head-dot-lock-fix'
Junio C Hamano [Sun, 1 Dec 2019 17:04:29 +0000 (09:04 -0800)] 
Merge branch 'js/git-path-head-dot-lock-fix'

"git rev-parse --git-path HEAD.lock" did not give the right path
when run in a secondary worktree.

* js/git-path-head-dot-lock-fix:
  git_path(): handle `.lock` files correctly
  t1400: wrap setup code in test case

4 years agoMerge branch 'jc/log-graph-simplify'
Junio C Hamano [Sun, 1 Dec 2019 17:04:28 +0000 (09:04 -0800)] 
Merge branch 'jc/log-graph-simplify'

The implementation of "git log --graph" got refactored and then its
output got simplified.

* jc/log-graph-simplify:
  t4215: use helper function to check output
  graph: fix coloring of octopus dashes
  graph: flatten edges that fuse with their right neighbor
  graph: smooth appearance of collapsing edges on commit lines
  graph: rename `new_mapping` to `old_mapping`
  graph: commit and post-merge lines for left-skewed merges
  graph: tidy up display of left-skewed merges
  graph: example of graph output that can be simplified
  graph: extract logic for moving to GRAPH_PRE_COMMIT state
  graph: remove `mapping_idx` and `graph_update_width()`
  graph: reduce duplication in `graph_insert_into_new_columns()`
  graph: reuse `find_new_column_by_commit()`
  graph: handle line padding in `graph_next_line()`
  graph: automatically track display width of graph lines

4 years agoMerge branch 'jk/cleanup-object-parsing-and-fsck'
Junio C Hamano [Sun, 1 Dec 2019 17:04:28 +0000 (09:04 -0800)] 
Merge branch 'jk/cleanup-object-parsing-and-fsck'

Crufty code and logic accumulated over time around the object
parsing and low-level object access used in "git fsck" have been
cleaned up.

* jk/cleanup-object-parsing-and-fsck: (23 commits)
  fsck: accept an oid instead of a "struct tree" for fsck_tree()
  fsck: accept an oid instead of a "struct commit" for fsck_commit()
  fsck: accept an oid instead of a "struct tag" for fsck_tag()
  fsck: rename vague "oid" local variables
  fsck: don't require an object struct in verify_headers()
  fsck: don't require an object struct for fsck_ident()
  fsck: drop blob struct from fsck_finish()
  fsck: accept an oid instead of a "struct blob" for fsck_blob()
  fsck: don't require an object struct for report()
  fsck: only require an oid for skiplist functions
  fsck: only provide oid/type in fsck_error callback
  fsck: don't require object structs for display functions
  fsck: use oids rather than objects for object_name API
  fsck_describe_object(): build on our get_object_name() primitive
  fsck: unify object-name code
  fsck: require an actual buffer for non-blobs
  fsck: stop checking tag->tagged
  fsck: stop checking commit->parent counts
  fsck: stop checking commit->tree value
  commit, tag: don't set parsed bit for parse failures
  ...

4 years agoreset: parse rev as tree-ish in patch mode
Nika Layzell [Sun, 24 Nov 2019 20:25:49 +0000 (20:25 +0000)] 
reset: parse rev as tree-ish in patch mode

Since 2f328c3d ("reset $sha1 $pathspec: require $sha1 only to be
treeish", 2013-01-14), we allowed "git reset $object -- $path" to reset
individual paths that match the pathspec to take the blob from a tree
object, not necessarily a commit, while the form to reset the tip of the
current branch to some other commit still must be given a commit.

Like resetting with paths, "git reset --patch" does not update HEAD, and
need not require a commit. The path-filtered form, "git reset --patch
$object -- $pathspec", has accepted a tree-ish since 2f328c3d.

"git reset --patch" is documented as accepting a <tree-ish> since
bf44142f ("reset: update documentation to require only tree-ish with
paths", 2013-01-16). Documentation changes are not required.

Loosen the restriction that requires a commit for the unfiltered "git
reset --patch $object".

Signed-off-by: Nika Layzell <nika@thelayzells.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodoc: mention that 'git submodule update' fetches missing commits
Philippe Blain [Sun, 24 Nov 2019 02:01:35 +0000 (21:01 -0500)] 
doc: mention that 'git submodule update' fetches missing commits

'git submodule update' will fetch new commits from the submodule remote
if the SHA-1 recorded in the superproject is not found. This was not
mentioned in the documentation.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodoc: document 'git submodule status --cached'
Manish Goregaokar [Sat, 23 Nov 2019 05:54:28 +0000 (05:54 +0000)] 
doc: document 'git submodule status --cached'

'git submodule status --cached' reports the SHAs recorded in the
index of the superproject, instead of the SHAs that are checked out
in the submodule.

Signed-off-by: Manish Goregaokar <manishsmail@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosequencer: fix empty commit check when amending
Phillip Wood [Fri, 22 Nov 2019 19:43:03 +0000 (19:43 +0000)] 
sequencer: fix empty commit check when amending

This fixes a regression introduced in 356ee4659b ("sequencer: try to
commit without forking 'git commit'", 2017-11-24). When amending a
commit try_to_commit() was using the wrong parent when checking if the
commit would be empty. When amending we need to check against HEAD^ not
HEAD.

t3403 may not seem like the natural home for the new tests but a further
patch series will improve the advice printed by `git commit`. That
series will mutate these tests to check that the advice includes
suggesting `rebase --skip` to skip the fixup that would empty the
commit.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogit svn: stop using `rebase --preserve-merges`
Johannes Schindelin [Fri, 22 Nov 2019 22:59:29 +0000 (22:59 +0000)] 
git svn: stop using `rebase --preserve-merges`

We deprecated `--preserve-merges` in favor of `--rebase-merges`; Let's
reflect that in `git svn`.

Note: Even when the user asks for `--preserve-merges`, we now silently
pass `--rebase-merges` to `git rebase` instead. Technically, this is a
change of behavior. But practically, `git svn` only ever asks for a
non-interactive rebase, and `--preserve-merges` and `--rebase-merges`
are on par with regard to that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogpg-interface: limit search for primary key fingerprint
Hans Jerry Illikainen [Fri, 22 Nov 2019 20:23:12 +0000 (20:23 +0000)] 
gpg-interface: limit search for primary key fingerprint

The VALIDSIG status line from GnuPG with --status-fd is documented to
have 9 required and 1 optional fields [1].  The final, and optional,
field is used to specify the fingerprint of the primary key that made
the signature in case it was made by a subkey.  However, this field is
only available for OpenPGP signatures; not for CMS/X.509.

If the VALIDSIG status line does not have the optional 10th field, the
current code will continue reading onto the next status line.  And this
is the case for non-OpenPGP signatures [1].

The consequence is that a subsequent status line may be considered as
the "primary key" for signatures that does not have an actual primary
key.

Limit the search of these 9 or 10 fields to the single line to avoid
this problem.  If the 10th field is missing, report that there is no
primary key fingerprint.

[Reference]

[1] GnuPG Details, General status codes
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=doc/DETAILS;h=6ce340e8c04794add995e84308bb3091450bd28f;hb=HEAD#l483

The documentation says:

    VALIDSIG <args>

    The args are:

    - <fingerprint_in_hex>
    - <sig_creation_date>
    - <sig-timestamp>
    - <expire-timestamp>
    - <sig-version>
    - <reserved>
    - <pubkey-algo>
    - <hash-algo>
    - <sig-class>
    - [ <primary-key-fpr> ]

    This status indicates that the signature is cryptographically
    valid. [...] PRIMARY-KEY-FPR is the fingerprint of the primary key
    or identical to the first argument.

    The primary-key-fpr parameter is used for OpenPGP and not available
    for CMS signatures.  [...]

Signed-off-by: Hans Jerry Illikainen <hji@dyntopia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogpg-interface: refactor the free-and-xmemdupz pattern
Hans Jerry Illikainen [Thu, 21 Nov 2019 23:43:35 +0000 (23:43 +0000)] 
gpg-interface: refactor the free-and-xmemdupz pattern

Introduce a static replace_cstring() function to simplify repeated
pattern of free-and-xmemdupz() for GPG status line parsing.

This also helps us avoid potential memleaks if parsing of new status
lines are introduced in the future.

Signed-off-by: Hans Jerry Illikainen <hji@dyntopia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: replace `! git` with `test_must_fail git`
Denton Liu [Tue, 12 Nov 2019 23:08:16 +0000 (15:08 -0800)] 
t5520: replace `! git` with `test_must_fail git`

Currently, if a git command fails in an unexpected way, such as a
segfault, it will be masked and ignored. Replace the ! with
test_must_fail so that only expected failures pass.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: remove redundant lines in test cases
Denton Liu [Tue, 12 Nov 2019 23:08:14 +0000 (15:08 -0800)] 
t5520: remove redundant lines in test cases

In the previous patches, the mechanical application of changes left some
duplicate statements in the test case which were not strictly incorrect
but were redundant and possibly misleading. Remove these duplicate
statements so that it is clear that the intent behind the tests are that
the content of the file stays the same throughout the whole test case.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: replace $(cat ...) comparison with test_cmp
Denton Liu [Tue, 12 Nov 2019 23:08:12 +0000 (15:08 -0800)] 
t5520: replace $(cat ...) comparison with test_cmp

We currently have many instances of `test <line> = $(cat <file>)` and
`test $(cat <file>) = <line>`.  In the case where this fails, it will be
difficult for a developer to debug since the output will be masked.
Replace these instances with invocations of test_cmp().

This change was done with the following GNU sed expressions:

s/\(\s*\)test \([^=]*\)= "$(cat \([^)]*\))"/\1echo \2>expect \&\&\n\1test_cmp expect \3/
s/\(\s*\)test "$(cat \([^)]*\))" = \([^&]*\)\( &&\)\?$/\1echo \3 >expect \&\&\n\1test_cmp expect \2\4/

A future patch will clean up situations where we have multiple duplicate
statements within a test case. This is done to keep this patch purely
mechanical.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: don't put git in upstream of pipe
Denton Liu [Tue, 12 Nov 2019 23:08:10 +0000 (15:08 -0800)] 
t5520: don't put git in upstream of pipe

Before, if the invocation of git failed, it would be masked by the pipe
since only the return code of the last element of a pipe is used.
Rewrite the test to put the git command on its own line so its return
code is not masked.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: test single-line files by git with test_cmp
Denton Liu [Tue, 12 Nov 2019 23:08:07 +0000 (15:08 -0800)] 
t5520: test single-line files by git with test_cmp

In case an invocation of a git command fails within the command
substitution, the failure will be masked. Replace the command
substitution with a file-redirection and a call to test_cmp.

This change was done with the following GNU sed expressions:

s/\(\s*\)test \([^ ]*\) = "$(\(git [^)]*\))"/\1echo \2 >expect \&\&\n\1\3 >actual \&\&\n\1test_cmp expect actual/
s/\(\s*\)test "$(\(git [^)]*\))" = \([^ ]*\)/\1echo \3 >expect \&\&\n\1\2 >actual \&\&\n\1test_cmp expect actual/

A future patch will clean up situations where we have multiple duplicate
statements within a test case. This is done to keep this patch purely
mechanical.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: use test_cmp_rev where possible
Denton Liu [Tue, 12 Nov 2019 23:08:05 +0000 (15:08 -0800)] 
t5520: use test_cmp_rev where possible

In case an invocation of `git rev-list` fails within the command
substitution, the failure will be masked. Remove the command
substitution and use test_cmp_rev() so that failures can be discovered.

This change was done with the following sed expressions:

s/test "$(git rev-parse.* \([^)]*\))" = "$(git rev-parse \([^)]*\))"/test_cmp_rev \1 \2/
s/test \([^ ]*\) = "$(git rev-parse.* \([^)]*\))"/test_cmp_rev \1 \2/
s/test "$(git rev-parse.* \([^)]*\))" != "$(git rev-parse.* \([^)]*\))"/test_cmp_rev ! \1 \2/
s/test \([^ ]*\) != "$(git rev-parse.* \([^)]*\))"/test_cmp_rev ! \1 \2/

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: replace test -{n,z} with test-lib functions
Denton Liu [Tue, 12 Nov 2019 23:08:02 +0000 (15:08 -0800)] 
t5520: replace test -{n,z} with test-lib functions

When wrapping a git command in a command substitution within another
command, we throw away the git command's exit code. In case the git
command fails, we would like to know about it rather than the failure
being silent. Extract git commands so that their exit codes are not
lost.

Instead of using `test -n` or `test -z`, replace them respectively with
invocations of test_file_not_empty() and test_must_be_empty() so that we
get better debugging information in the case of a failure.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: use test_line_count where possible
Denton Liu [Tue, 12 Nov 2019 23:08:00 +0000 (15:08 -0800)] 
t5520: use test_line_count where possible

Instead of rolling our own functionality to test the number of lines a
command outputs, use test_line_count() which provides better debugging
information in the case of a failure.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: remove spaces after redirect operator
Denton Liu [Tue, 12 Nov 2019 23:07:58 +0000 (15:07 -0800)] 
t5520: remove spaces after redirect operator

The style for tests in Git is to have the redirect operator attached to
the filename with no spaces. Fix test cases where this is not the case.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: replace test -f with test-lib functions
Denton Liu [Tue, 12 Nov 2019 23:07:55 +0000 (15:07 -0800)] 
t5520: replace test -f with test-lib functions

Although `test -f` has the same functionality as test_path_is_file(), in
the case where test_path_is_file() fails, we get much better debugging
information.

Replace `test -f` with test_path_is_file() so that future developers
will have a better experience debugging these test cases.

Also, in the case of `! test -f`, not only should that path not be a
file, it shouldn't exist at all so replace it with
test_path_is_missing().

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: let sed open its own input
Denton Liu [Tue, 12 Nov 2019 23:07:52 +0000 (15:07 -0800)] 
t5520: let sed open its own input

We were using a redirection operator to feed input into sed. However,
since sed is capable of opening its own files, make sed open its own
files instead of redirecting input into it.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: use sq for test case names
Denton Liu [Tue, 12 Nov 2019 23:07:50 +0000 (15:07 -0800)] 
t5520: use sq for test case names

The usual convention is for test case names to be written between
single-quotes. Change all double-quoted test case names to single-quotes
except for two test case names that use variables within.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5520: improve test style
Denton Liu [Tue, 12 Nov 2019 23:07:48 +0000 (15:07 -0800)] 
t5520: improve test style

Improve the test style by removing leading and trailing empty lines
within test cases. Also, reformat multi-line subshells to conform to the
existing style.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot: teach test_cmp_rev to accept ! for not-equals
Denton Liu [Tue, 12 Nov 2019 23:07:45 +0000 (15:07 -0800)] 
t: teach test_cmp_rev to accept ! for not-equals

In the case where we are using test_cmp_rev() to report not-equals, we
write `! test_cmp_rev`. However, since test_cmp_rev() contains

r1=$(git rev-parse --verify "$1") &&
r2=$(git rev-parse --verify "$2") &&

`! test_cmp_rev` will succeed if any of the rev-parses fail. This
behavior is not desired. We want the rev-parses to _always_ be
successful.

Rewrite test_cmp_rev() to optionally accept "!" as the first argument to
do a not-equals comparison. Rewrite `! test_cmp_rev` to `test_cmp_rev !`
in all tests to take advantage of this new functionality.

Also, rewrite the rev-parse logic to end with a `|| return 1` instead of
&&-chaining into the rev-comparison logic. This makes it obvious to
future readers that we explicitly intend on returning early if either of
the rev-parses fail.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot0000: test multiple local assignment
Denton Liu [Thu, 14 Nov 2019 00:52:15 +0000 (16:52 -0800)] 
t0000: test multiple local assignment

According to POSIX enhancement request '0000767: Add built-in
"local"'[1],

dash only allows one variable in a local definition; it permits
assignment though it doesn't document that clearly.

however, this isn't true since t0000 still passes with this patch
applied on dash 0.5.10.2. Needless to say, since `local` isn't POSIX
standardized, it is not exactly clear what `local` entails on different
versions of different shells.

We currently already have many instances of multiple local assignments
in our codebase. Ensure that this is actually supported by explicitly
testing that it is sane.

[1]: http://austingroupbugs.net/bug_view_page.php?bug_id=767

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoformat-patch: pass notes configuration to range-diff
Denton Liu [Wed, 20 Nov 2019 21:18:47 +0000 (13:18 -0800)] 
format-patch: pass notes configuration to range-diff

Since format-patch accepts `--[no-]notes`, one would expect the
range-diff generated to also respect the setting. Unfortunately, the
range-diff we currently generate only uses the default option (which
always outputs default notes, even when notes are not being used
elsewhere).

Pass the notes configuration to range-diff so that it can honor it.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorange-diff: pass through --notes to `git log`
Denton Liu [Wed, 20 Nov 2019 21:18:45 +0000 (13:18 -0800)] 
range-diff: pass through --notes to `git log`

When a commit being range-diff'd has a note attached to it, the note
will be compared as well. However, if a user has multiple notes refs or
if they want to suppress notes from being printed, there is currently no
way to do this.

Pass through `--[no-]notes[=<ref>]` to the `git log` call so that this
option is customizable.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorange-diff: output `## Notes ##` header
Denton Liu [Wed, 20 Nov 2019 21:18:43 +0000 (13:18 -0800)] 
range-diff: output `## Notes ##` header

When notes were included in the output of range-diff, they were just
mashed together with the rest of the commit message. As a result, users
wouldn't be able to clearly distinguish where the commit message ended
and where the notes started.

Output a `## Notes ##` header when notes are detected so that notes can
be compared more clearly.

Note that we handle case of `Notes (<ref>): -> ## Notes (<ref>) ##` with
this code as well. We can't test this in this patch, however, since
there is currently no way to pass along different notes refs to `git
log`. This will be fixed in a future patch.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3206: range-diff compares logs with commit notes
Denton Liu [Wed, 20 Nov 2019 21:18:41 +0000 (13:18 -0800)] 
t3206: range-diff compares logs with commit notes

The test suite had a blindspot where it did not check the behavior of
range-diff and format-patch when notes were present. Cover this
blindspot.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3206: s/expected/expect/
Denton Liu [Wed, 20 Nov 2019 21:18:38 +0000 (13:18 -0800)] 
t3206: s/expected/expect/

For test cases, the usual convention is to name expected output files
"expect", not "expected". Replace all instances of "expected" with
"expect".

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3206: disable parameter substitution in heredoc
Denton Liu [Wed, 20 Nov 2019 21:18:36 +0000 (13:18 -0800)] 
t3206: disable parameter substitution in heredoc

In the first heredoc, parameter substitution is not used so prevent it
from happening in the future (perhaps by accident) by escaping the limit
EOF.

The remaining heredocs use parameter substitution so they cannot be
changed.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3206: remove spaces after redirect operators
Denton Liu [Wed, 20 Nov 2019 21:18:33 +0000 (13:18 -0800)] 
t3206: remove spaces after redirect operators

For shell scripts, the usual convention is for there to be no space
after redirection operators, (e.g. `>file`, not `> file`). Remove the
one instance of this.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopretty-options.txt: --notes accepts a ref instead of treeish
Denton Liu [Wed, 20 Nov 2019 21:18:31 +0000 (13:18 -0800)] 
pretty-options.txt: --notes accepts a ref instead of treeish

Although `--notes=` accepts and handles a tree-ish just fine, it isn't a
common use-case for users to pass in bare trees. By having "treeish", it
makes it harder to click in users' minds that the argument here is the
same type as the `notes.displayRef` configuration variable, for example.

Change `treeish` to `ref` so that it will be easier for users to make
this connection.

Note that we don't completely lose the notion that `--notes=` can accept
a tree-ish. In git-notes.txt, we have

It is also permitted for a notes ref to point directly to a tree
object, in which case the history of the notes can be read with
`git log -p -g <refname>`.

which means that a hardcore user who wants to take advantage of this
obscure use-case will be able to infer the connection and not be
completely left in the dark.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agouserdiff: support Python async functions
Josh Holland [Tue, 19 Nov 2019 15:08:10 +0000 (15:08 +0000)] 
userdiff: support Python async functions

Python's async functions (declared with "async def" rather than "def")
were not being displayed in hunk headers. This commit teaches git about
the async function syntax, and adds tests for the Python userdiff regex.

Signed-off-by: Josh Holland <anowlcalledjosh@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorev-list-options.txt: remove reference to --show-notes
Denton Liu [Tue, 19 Nov 2019 23:55:32 +0000 (15:55 -0800)] 
rev-list-options.txt: remove reference to --show-notes

In ab18b2c0df ("log/pretty-options: Document --[no-]notes and deprecate
old notes options", 2011-03-30), the `--show-notes` option was
deprecated. However, this reference to it still remains. Change it to
reference the replacement option: `--notes`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoargv-array: add space after `while`
Denton Liu [Tue, 19 Nov 2019 23:55:29 +0000 (15:55 -0800)] 
argv-array: add space after `while`

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci(osx): update homebrew-cask repository with less noise
Junio C Hamano [Wed, 20 Nov 2019 01:18:39 +0000 (10:18 +0900)] 
ci(osx): update homebrew-cask repository with less noise

The OSX CI build procedure updates the homebrew-cask repository
before attempting to install perforce again, after seeing an
installation failure.  This involves a "git pull" that by default
computes and outputs diffstat, which would only grow as the time
goes by and the repository cast in stone in the CI build image
becomes more and more stale relative to the upstream repository in
the outside world.

Suppress the diffstat to both save cycles to generate it, and strain
on the eyeballs to skip it.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosequencer: handle rebase-merges for "onto" message
Doan Tran Cong Danh [Mon, 18 Nov 2019 11:57:47 +0000 (18:57 +0700)] 
sequencer: handle rebase-merges for "onto" message

In order to work correctly, git-rebase --rebase-merges needs to make
initial todo list with unique labels.

Those unique labels is being handled by employing a hashmap and
appending an unique number if any duplicate is found.

But, we forget that beside those labels for side branches,
we also have a special label `onto' for our so-called new-base.

In a special case that any of those labels for side branches named
`onto', git will run into trouble.

Correct it.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobuiltin/unpack-objects.c: show throughput progress
SZEDER Gábor [Tue, 19 Nov 2019 01:25:25 +0000 (02:25 +0100)] 
builtin/unpack-objects.c: show throughput progress

'git unpack-objects' shows a progress line only counting the number of
unpacked objects, so if some of the received objects are unusually
large, then that progress might appear to be frozen while processing
such a larger object.  I just stared at a seemingly stuck progress
line for over half a minute, while 'git fetch' was busy receiving a
pack with only a couple of objects (i.e. fewer than
'fetch.unpackLimit'), with one of them being over 80MB.

Display throughput in 'git unpack-objects' progress line, so we show
that something is going on even when receiving and processing a large
object.

Counting the consumed bytes is far away from the place that
counts objects and displays progress, and to pass around the 'struct
progress' instance we would have to modify the signature of five
functions and 14 of their callsites: this is just too much churn, so
let's rather make it file-scope static.

'git index-pack', i.e. the non-unpacking cousin of 'git
unpack-objects' already includes throughput in its progress line, and
it uses a file-scope static 'struct progress' instance as well.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorev-parse: make --show-toplevel without a worktree an error
Jeff King [Tue, 19 Nov 2019 08:05:43 +0000 (03:05 -0500)] 
rev-parse: make --show-toplevel without a worktree an error

Ever since it was introduced in 7cceca5ccc (Add 'git rev-parse
--show-toplevel' option., 2010-01-12), the --show-toplevel option has
treated a missing working tree as a quiet success: it neither prints a
toplevel path, but nor does it report any kind of error.

While a caller could distinguish this case by looking for an empty
response, the behavior is rather confusing. We're better off complaining
that there is no working tree, as other internal commands would do in
similar cases (e.g., "git status" or any builtin with NEED_WORK_TREE set
would just die()). So let's do the same here.

While we're at it, let's clarify the documentation and add some tests,
both for the new behavior and for the more mundane case (which was not
covered).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofetch: add trace2 instrumentation
Erik Chen [Tue, 19 Nov 2019 23:02:09 +0000 (23:02 +0000)] 
fetch: add trace2 instrumentation

Add trace2 regions to fetch-pack.c to better track time spent in the various
phases of a fetch:

    * parsing remote refs and finding a cutoff
    * marking local refs as complete
    * marking complete remote refs as common

All stages could potentially be slow for repositories with many refs.

Signed-off-by: Erik Chen <erikchen@chromium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorebase -r: let `label` generate safer labels
Matthew Rogers [Sun, 17 Nov 2019 23:16:10 +0000 (23:16 +0000)] 
rebase -r: let `label` generate safer labels

The `label` todo command in interactive rebases creates temporary refs
in the `refs/rewritten/` namespace. These refs are stored as loose refs,
i.e. as files in `.git/refs/rewritten/`, therefore they have to conform
with file name limitations on the current filesystem in addition to the
accepted ref format.

This poses a problem in particular on NTFS/FAT, where e.g. the colon,
double-quote and pipe characters are disallowed as part of a file name.

Let's safeguard against this by replacing not only white-space
characters by dashes, but all non-alpha-numeric ones.

However, we exempt non-ASCII UTF-8 characters from that, as it should be
quite possible to reflect branch names such as `↯↯↯` in refs/file names.

Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>