]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agoMerge branch 'jk/list-objects-optim-wo-trees'
Junio C Hamano [Mon, 7 Oct 2019 02:32:56 +0000 (11:32 +0900)] 
Merge branch 'jk/list-objects-optim-wo-trees'

The object traversal machinery has been optimized not to load tree
objects when we are only interested in commit history.

* jk/list-objects-optim-wo-trees:
  list-objects: don't queue root trees unless revs->tree_objects is set

4 years agoMerge branch 'jk/disable-commit-graph-during-upload-pack'
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)] 
Merge branch 'jk/disable-commit-graph-during-upload-pack'

The "upload-pack" (the counterpart of "git fetch") needs to disable
commit-graph when responding to a shallow clone/fetch request, but
the way this was done made Git panic, which has been corrected.

* jk/disable-commit-graph-during-upload-pack:
  upload-pack: disable commit graph more gently for shallow traversal
  commit-graph: bump DIE_ON_LOAD check to actual load-time

4 years agoMerge branch 'mr/complete-more-for-log-etc'
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)] 
Merge branch 'mr/complete-more-for-log-etc'

Completion updates.

* mr/complete-more-for-log-etc:
  completion: add missing completions for log, diff, show

4 years agoMerge branch 'dl/complete-rebase-and-archive'
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)] 
Merge branch 'dl/complete-rebase-and-archive'

The command line completion for "git archive" and "git rebase" are
now made less prone to go out of sync with the binary.

* dl/complete-rebase-and-archive:
  completion: teach archive to use __gitcomp_builtin
  completion: teach rebase to use __gitcomp_builtin

4 years agoMerge branch 'jk/commit-graph-cleanup'
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)] 
Merge branch 'jk/commit-graph-cleanup'

A pair of small fixups to "git commit-graph" have been applied.

* jk/commit-graph-cleanup:
  commit-graph: turn off save_commit_buffer
  commit-graph: don't show progress percentages while expanding reachable commits

4 years agoMerge branch 'ss/get-time-cleanup'
Junio C Hamano [Mon, 7 Oct 2019 02:32:54 +0000 (11:32 +0900)] 
Merge branch 'ss/get-time-cleanup'

Code simplification.

* ss/get-time-cleanup:
  test_date.c: remove reference to GIT_TEST_DATE_NOW
  Quit passing 'now' to date code

4 years agoMerge branch 'rs/simplify-by-deco-with-deco-refs-exclude'
Junio C Hamano [Mon, 7 Oct 2019 02:32:54 +0000 (11:32 +0900)] 
Merge branch 'rs/simplify-by-deco-with-deco-refs-exclude'

"git log --decorate-refs-exclude=<pattern>" was incorrectly
overruled when the "--simplify-by-decoration" option is used, which
has been corrected.

* rs/simplify-by-deco-with-deco-refs-exclude:
  log-tree: call load_ref_decorations() in get_name_decoration()
  log: test --decorate-refs-exclude with --simplify-by-decoration

4 years agoMerge branch 'jk/partial-clone-sparse-blob'
Junio C Hamano [Mon, 7 Oct 2019 02:32:54 +0000 (11:32 +0900)] 
Merge branch 'jk/partial-clone-sparse-blob'

The name of the blob object that stores the filter specification
for sparse cloning/fetching was interpreted in a wrong place in the
code, causing Git to abort.

* jk/partial-clone-sparse-blob:
  list-objects-filter: use empty string instead of NULL for sparse "base"
  list-objects-filter: give a more specific error sparse parsing error
  list-objects-filter: delay parsing of sparse oid
  t5616: test cloning/fetching with sparse:oid=<oid> filter

4 years agoMerge branch 'tg/stash-refresh-index'
Junio C Hamano [Mon, 7 Oct 2019 02:32:53 +0000 (11:32 +0900)] 
Merge branch 'tg/stash-refresh-index'

"git stash" learned to write refreshed index back to disk.

* tg/stash-refresh-index:
  stash: make sure to write refreshed cache
  merge: use refresh_and_write_cache
  factor out refresh_and_write_cache function

4 years agoFifth batch
Junio C Hamano [Sun, 6 Oct 2019 03:25:51 +0000 (12:25 +0900)] 
Fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'cb/skip-utf8-check-with-pcre1'
Junio C Hamano [Sun, 6 Oct 2019 03:25:17 +0000 (12:25 +0900)] 
Merge branch 'cb/skip-utf8-check-with-pcre1'

Make sure the grep machinery does not abort when seeing a payload
that is not UTF-8 even when JIT is not in use with PCRE1.

* cb/skip-utf8-check-with-pcre1:
  grep: skip UTF8 checks explicitly

4 years agoMerge branch 'ma/user-manual-markup-update'
Junio C Hamano [Sun, 6 Oct 2019 03:25:16 +0000 (12:25 +0900)] 
Merge branch 'ma/user-manual-markup-update'

The markup used in user-manual has been updated to work better with
asciidoctor.

* ma/user-manual-markup-update:
  user-manual.txt: render ASCII art correctly under Asciidoctor
  asciidoctor-extensions.rb: handle "book" doctype in linkgit
  user-manual.txt: change header notation
  user-manual.txt: add missing section label

4 years agoMerge branch 'bc/doc-use-docbook-5'
Junio C Hamano [Sun, 6 Oct 2019 03:25:16 +0000 (12:25 +0900)] 
Merge branch 'bc/doc-use-docbook-5'

Start using DocBook 5 (instead of DocBook 4.5) as Asciidoctor 2.0
no longer works with the older one.

* bc/doc-use-docbook-5:
  Documentation: fix build with Asciidoctor 2

4 years agoMerge branch 'ma/asciidoctor-more-fixes'
Junio C Hamano [Sun, 6 Oct 2019 03:25:16 +0000 (12:25 +0900)] 
Merge branch 'ma/asciidoctor-more-fixes'

Doc formatting updates.

* ma/asciidoctor-more-fixes:
  gitweb.conf.txt: switch pluses to backticks to help Asciidoctor
  git-merge-index.txt: wrap shell listing in "----"
  git-receive-pack.txt: wrap shell [script] listing in "----"
  git-ls-remote.txt: wrap shell listing in "----"
  Documentation: wrap config listings in "----"
  git-merge-base.txt: render indentations correctly under Asciidoctor
  Documentation: wrap blocks with "--"

4 years agoMerge branch 'ma/asciidoctor-refmiscinfo'
Junio C Hamano [Sun, 6 Oct 2019 03:25:15 +0000 (12:25 +0900)] 
Merge branch 'ma/asciidoctor-refmiscinfo'

Update support for Asciidoctor documentation toolchain.

* ma/asciidoctor-refmiscinfo:
  doc-diff: replace --cut-header-footer with --cut-footer
  asciidoctor-extensions: provide `<refmiscinfo/>`
  Doc/Makefile: give mansource/-version/-manual attributes

4 years agoMerge branch 'am/mailmap-andrey-mazo'
Junio C Hamano [Sun, 6 Oct 2019 03:25:15 +0000 (12:25 +0900)] 
Merge branch 'am/mailmap-andrey-mazo'

* am/mailmap-andrey-mazo:
  .mailmap: update email address of Andrey Mazo

4 years agoMerge branch 'jc/git-gui-has-maintainer'
Junio C Hamano [Sun, 6 Oct 2019 03:25:15 +0000 (12:25 +0900)] 
Merge branch 'jc/git-gui-has-maintainer'

* jc/git-gui-has-maintainer:
  SubmittingPatches: git-gui has a new maintainer

4 years agoFourth batch
Junio C Hamano [Mon, 30 Sep 2019 04:30:46 +0000 (13:30 +0900)] 
Fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'ds/commit-graph-on-fetch'
Junio C Hamano [Mon, 30 Sep 2019 04:19:32 +0000 (13:19 +0900)] 
Merge branch 'ds/commit-graph-on-fetch'

A configuration variable tells "git fetch" to write the commit
graph after finishing.

* ds/commit-graph-on-fetch:
  fetch: add fetch.writeCommitGraph config setting

4 years agoMerge branch 'bw/rebase-autostash-keep-current-branch'
Junio C Hamano [Mon, 30 Sep 2019 04:19:32 +0000 (13:19 +0900)] 
Merge branch 'bw/rebase-autostash-keep-current-branch'

"git rebase --autostash <upstream> <branch>", when <branch> is
different from the current branch, incorrectly moved the tip of the
current branch, which has been corrected.

* bw/rebase-autostash-keep-current-branch:
  builtin/rebase.c: Remove pointless message
  builtin/rebase.c: make sure the active branch isn't moved when autostashing

4 years agoMerge branch 'ds/include-exclude'
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)] 
Merge branch 'ds/include-exclude'

The internal code originally invented for ".gitignore" processing
got reshuffled and renamed to make it less tied to "excluding" and
stress more that it is about "matching", as it has been reused for
things like sparse checkout specification that want to check if a
path is "included".

* ds/include-exclude:
  unpack-trees: rename 'is_excluded_from_list()'
  treewide: rename 'exclude' methods to 'pattern'
  treewide: rename 'EXCL_FLAG_' to 'PATTERN_FLAG_'
  treewide: rename 'struct exclude_list' to 'struct pattern_list'
  treewide: rename 'struct exclude' to 'struct path_pattern'

4 years agoMerge branch 'jh/trace2-pretty-output'
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)] 
Merge branch 'jh/trace2-pretty-output'

Output from trace2 subsystem is formatted more prettily now.

* jh/trace2-pretty-output:
  trace2: cleanup whitespace in perf format
  trace2: cleanup whitespace in normal format
  quote: add sq_append_quote_argv_pretty()
  trace2: trim trailing whitespace in normal format error message
  trace2: remove dead code in maybe_add_string_va()
  trace2: trim whitespace in region messages in perf target format
  trace2: cleanup column alignment in perf target format

4 years agoMerge branch 'dl/rebase-i-keep-base'
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)] 
Merge branch 'dl/rebase-i-keep-base'

"git rebase --keep-base <upstream>" tries to find the original base
of the topic being rebased and rebase on top of that same base,
which is useful when running the "git rebase -i" (and its limited
variant "git rebase -x").

The command also has learned to fast-forward in more cases where it
can instead of replaying to recreate identical commits.

* dl/rebase-i-keep-base:
  rebase: teach rebase --keep-base
  rebase tests: test linear branch topology
  rebase: fast-forward --fork-point in more cases
  rebase: fast-forward --onto in more cases
  rebase: refactor can_fast_forward into goto tower
  t3432: test for --no-ff's interaction with fast-forward
  t3432: distinguish "noop-same" v.s. "work-same" in "same head" tests
  t3432: test rebase fast-forward behavior
  t3431: add rebase --fork-point tests

4 years agoMerge branch 'sg/clean-nested-repo-with-ignored'
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)] 
Merge branch 'sg/clean-nested-repo-with-ignored'

A bug documentation.

* sg/clean-nested-repo-with-ignored:
  t7300-clean: demonstrate deleting nested repo with an ignored file breakage

4 years agoMerge branch 'dl/complete-cherry-pick-revert-skip'
Junio C Hamano [Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)] 
Merge branch 'dl/complete-cherry-pick-revert-skip'

The command line completion support (in contrib/) learned about the
"--skip" option of "git revert" and "git cherry-pick".

* dl/complete-cherry-pick-revert-skip:
  status: mention --skip for revert and cherry-pick
  completion: add --skip for cherry-pick and revert
  completion: merge options for cherry-pick and revert

4 years agoMerge branch 'dl/use-sq-from-test-lib'
Junio C Hamano [Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)] 
Merge branch 'dl/use-sq-from-test-lib'

Code cleanup.

* dl/use-sq-from-test-lib:
  t: use common $SQ variable

4 years agoMerge branch 'jk/misc-uninitialized-fixes'
Junio C Hamano [Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)] 
Merge branch 'jk/misc-uninitialized-fixes'

Various fixes to codepaths gcc 9 had trouble following dataflow.

* jk/misc-uninitialized-fixes:
  pack-objects: drop packlist index_pos optimization
  test-read-cache: drop namelen variable
  diff-delta: set size out-parameter to 0 for NULL delta
  bulk-checkin: zero-initialize hashfile_checkpoint
  pack-objects: use object_id in packlist_alloc()
  git-am: handle missing "author" when parsing commit

4 years agoMerge branch 'sg/git-test-boolean'
Junio C Hamano [Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)] 
Merge branch 'sg/git-test-boolean'

Fix an earlier regression in the test suite, which mistakenly
stopped running HTTPD tests.

* sg/git-test-boolean:
  ci: restore running httpd tests
  t/lib-git-svn.sh: check GIT_TEST_SVN_HTTPD when running SVN HTTP tests

4 years agoMerge branch 'rs/get-tagged-oid'
Junio C Hamano [Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)] 
Merge branch 'rs/get-tagged-oid'

Code cleanup.

* rs/get-tagged-oid:
  use get_tagged_oid()
  tag: factor out get_tagged_oid()

4 years agoMerge branch 'en/filter-branch-deprecation'
Junio C Hamano [Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)] 
Merge branch 'en/filter-branch-deprecation'

Start discouraging the use of "git filter-branch".

* en/filter-branch-deprecation:
  t9902: use a non-deprecated command for testing
  Recommend git-filter-repo instead of git-filter-branch
  t6006: simplify, fix, and optimize empty message test

4 years agoMerge branch 'en/merge-options-ff-and-friends'
Junio C Hamano [Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)] 
Merge branch 'en/merge-options-ff-and-friends'

Doc update.

* en/merge-options-ff-and-friends:
  merge-options.txt: clarify meaning of various ff-related options

4 years agoMerge branch 'tg/push-all-in-mirror-forbidden'
Junio C Hamano [Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)] 
Merge branch 'tg/push-all-in-mirror-forbidden'

Fix an earlier regression to "git push --all" which should have
been forbidden when the target remote repository is set to be a
mirror.

* tg/push-all-in-mirror-forbidden:
  push: disallow --all and refspecs when remote.<name>.mirror is set

4 years agoMerge branch 'dt/remote-helper-doc-re-lock-option'
Junio C Hamano [Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)] 
Merge branch 'dt/remote-helper-doc-re-lock-option'

Doc update.

* dt/remote-helper-doc-re-lock-option:
  clarify documentation for remote helpers

4 years agoMerge branch 'rs/help-unknown-ref-does-not-return'
Junio C Hamano [Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)] 
Merge branch 'rs/help-unknown-ref-does-not-return'

Code cleanup.

* rs/help-unknown-ref-does-not-return:
  help: make help_unknown_ref() NORETURN

4 years agoMerge branch 'nd/switch-and-restore'
Junio C Hamano [Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)] 
Merge branch 'nd/switch-and-restore'

Resurrect a performance hack.

* nd/switch-and-restore:
  checkout: add simple check for 'git checkout -b'

4 years agoMerge branch 'tb/file-url-to-unc-path'
Junio C Hamano [Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)] 
Merge branch 'tb/file-url-to-unc-path'

Windows update.

* tb/file-url-to-unc-path:
  mingw: support UNC in git clone file://server/share/repo

4 years agoMerge branch 'js/gitdir-at-unc-root'
Junio C Hamano [Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)] 
Merge branch 'js/gitdir-at-unc-root'

On Windows, the root level of UNC share is now allowed to be used
just like any other directory.

* js/gitdir-at-unc-root:
  setup_git_directory(): handle UNC root paths correctly
  Fix .git/ discovery at the root of UNC shares
  setup_git_directory(): handle UNC paths correctly

4 years agoMerge branch 'ar/mingw-run-external-with-non-ascii-path'
Junio C Hamano [Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)] 
Merge branch 'ar/mingw-run-external-with-non-ascii-path'

Windows update.

* ar/mingw-run-external-with-non-ascii-path:
  mingw: fix launching of externals from Unicode paths

4 years agoMerge branch 'rs/parse-tree-indirect'
Junio C Hamano [Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)] 
Merge branch 'rs/parse-tree-indirect'

Code cleanup.

* rs/parse-tree-indirect:
  tree: simplify parse_tree_indirect()

4 years agoMerge branch 'jk/fast-import-history-bugfix'
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)] 
Merge branch 'jk/fast-import-history-bugfix'

The memory ownership model of the "git fast-import" got
straightened out.

* jk/fast-import-history-bugfix:
  fast-import: duplicate into history rather than passing ownership
  fast-import: duplicate parsed encoding string

4 years agoMerge branch 'mh/notes-duplicate-entries'
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)] 
Merge branch 'mh/notes-duplicate-entries'

A few implementation fixes in the notes API.

* mh/notes-duplicate-entries:
  notes: avoid potential use-after-free during insertion
  notes: avoid leaking duplicate entries

4 years agoMerge branch 'tb/banned-vsprintf-namefix'
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)] 
Merge branch 'tb/banned-vsprintf-namefix'

Error message fix.

* tb/banned-vsprintf-namefix:
  banned.h: fix vsprintf()'s ban message

4 years agoMerge branch 'mh/release-commit-memory-fix'
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)] 
Merge branch 'mh/release-commit-memory-fix'

Leakfix.

* mh/release-commit-memory-fix:
  commit: free the right buffer in release_commit_memory

4 years agoMerge branch 'mh/http-urlmatch-cleanup'
Junio C Hamano [Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)] 
Merge branch 'mh/http-urlmatch-cleanup'

Leakfix.

* mh/http-urlmatch-cleanup:
  http: don't leak urlmatch_config.vars

4 years agoMerge branch 'rs/strbuf-detach'
Junio C Hamano [Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)] 
Merge branch 'rs/strbuf-detach'

Straighten out the use of strbuf_detach() API function.

* rs/strbuf-detach:
  grep: use return value of strbuf_detach()
  log-tree: always use return value of strbuf_detach()

4 years agoMerge branch 'rs/trace2-dst-warning'
Junio C Hamano [Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)] 
Merge branch 'rs/trace2-dst-warning'

Code cleanup.

* rs/trace2-dst-warning:
  trace2: use warning() directly in tr2_dst_malformed_warning()

4 years agoMerge branch 'dl/format-patch-doc-test-cleanup'
Junio C Hamano [Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)] 
Merge branch 'dl/format-patch-doc-test-cleanup'

The documentation and tests for "git format-patch" have been
cleaned up.

* dl/format-patch-doc-test-cleanup:
  config/format.txt: specify default value of format.coverLetter
  Doc: add more detail for git-format-patch
  t4014: stop losing return codes of git commands
  t4014: remove confusing pipe in check_threading()
  t4014: use test_line_count() where possible
  t4014: let sed open its own files
  t4014: drop redirections to /dev/null
  t4014: use indentable here-docs
  t4014: remove spaces after redirect operators
  t4014: use sq for test case names
  t4014: move closing sq onto its own line
  t4014: s/expected/expect/
  t4014: drop unnecessary blank lines from test cases

4 years agoMerge branch 'bc/hash-independent-tests-part-5'
Junio C Hamano [Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)] 
Merge branch 'bc/hash-independent-tests-part-5'

Preparation for SHA-256 upgrade continues in the test department.

* bc/hash-independent-tests-part-5:
  t4009: make hash size independent
  t4002: make hash independent
  t4000: make hash size independent
  t3903: abstract away SHA-1-specific constants
  t3800: make hash-size independent
  t3600: make hash size independent
  t3506: make hash independent
  t3430: avoid hard-coded object IDs
  t3404: abstract away SHA-1-specific constants
  t3306: abstract away SHA-1-specific constants
  t3305: make hash size independent
  t3301: abstract away SHA-1-specific constants
  t3206: abstract away hash size constants
  t3201: abstract away SHA-1-specific constants

4 years agoMerge branch 'jc/test-cleanup'
Junio C Hamano [Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)] 
Merge branch 'jc/test-cleanup'

Code cleanup.

* jc/test-cleanup:
  t3005: remove unused variable
  t: use LF variable defined in the test harness

4 years agoMerge branch 'dl/compat-cleanup'
Junio C Hamano [Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)] 
Merge branch 'dl/compat-cleanup'

Code cleanup.

* dl/compat-cleanup:
  compat/*.[ch]: remove extern from function declarations using spatch
  mingw: apply array.cocci rule

4 years agoMerge branch 'js/visual-studio'
Junio C Hamano [Mon, 30 Sep 2019 04:19:22 +0000 (13:19 +0900)] 
Merge branch 'js/visual-studio'

Adjust .gitignore to unignore a path that we started to track.

* js/visual-studio:
  .gitignore: stop ignoring `.manifest` files

4 years agouser-manual.txt: render ASCII art correctly under Asciidoctor
Martin Ågren [Sun, 22 Sep 2019 11:57:59 +0000 (13:57 +0200)] 
user-manual.txt: render ASCII art correctly under Asciidoctor

This commit is similar to 379805051d ("Documentation: render revisions
correctly under Asciidoctor", 2018-05-06) and is a no-op with AsciiDoc.

When creating a literal block from an indented block without any sort of
delimiters, Asciidoctor strips off all leading whitespace, resulting in
a misrendered ASCII drawing. Use an explicit literal block to indicate
to Asciidoctor that we want to keep the leading whitespace. Drop the
common indentation for all lines to make this a no-op with AsciiDoc.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoasciidoctor-extensions.rb: handle "book" doctype in linkgit
Martin Ågren [Sun, 22 Sep 2019 11:57:58 +0000 (13:57 +0200)] 
asciidoctor-extensions.rb: handle "book" doctype in linkgit

user-manual.txt is the only file we process using the "book" doctype.
When we use AsciiDoc, user-manual.conf ensures that the linkgit macro
expands into something like

  <ulink url="git-foo.html">git-foo(1)</ulink>

in user-manual.xml, which we then process into a clickable link, both in
user-manual.html and user-manual.pdf. With Asciidoctor,
user-manual.conf is ignored (this is expected) and our
Asciidoctor-specific implementation of linkgit kicks in:

  <citerefentry>
    <refentrytitle>git-foo</refentrytitle><manvolnum>1</manvolnum>
  </citerefentry>

This eventually renders as "git-foo(1)", which is not bad, but it
doesn't turn into a link.

Teach our Asciidoctor-specific implementation of the linkgit macro that
if the doctype is "book", we should emit <ulink .../> just like we do
with AsciiDoc. While we're doing this, future-proof by supporting a
"prefix". The implementation in user-manual.conf doesn't support this,
and we don't need this for now because user-manual.txt is the only file
we process this way (and it's immediately in Documentation/).

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agouser-manual.txt: change header notation
Martin Ågren [Sun, 22 Sep 2019 11:57:57 +0000 (13:57 +0200)] 
user-manual.txt: change header notation

When AsciiDoc processes user-manual.txt, it generates a book containing
chapters containing sections. So for example, we have chapter 6,
"Advanced branch management", which contains four relatively short
sections, 6.1-6.4. Asciidoctor generates a book containing *parts*
containing *chapters* instead. So part 6, "Advanced branch management"
contains four short chapters, 1-4. This looks a bit odd.

To make AsciiDoc (8.6.10) and Asciidoctor (1.5.5) handle these the same,
change from indicating chapters like so:

  [[foobar]]
  Foobar
  ======

to doing it like so:

  [[foobar]]
  == Foobar

Same thing for sections (line of dashes to ===), subsections (line of
tildes to ====) and subsubsections (line of carets to =====). Mark the
appendices with "[appendix]", which both AsciiDoc and Asciidoctor
understand. This means we need to drop the "Appendix X: " from their
titles, or those "Appendix X: " would be included literally in the name
of the appendix.

This commit is a no-op for AsciiDoc: The generated user-manual.xml is
identical before and after this patch. Asciidoctor now creates the same
chapter-section-subsection structure as AsciiDoc.

Changing the book title at the start of the document to similarly use
"=" instead of a line of equal signs makes no difference with any of the
engines, but let's do that change anyway for consistency.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agouser-manual.txt: add missing section label
Martin Ågren [Sun, 22 Sep 2019 11:57:56 +0000 (13:57 +0200)] 
user-manual.txt: add missing section label

We provide a label for each chapter and section except for the "Pitfalls
with submodules" section. Since we're doing it everywhere else, let's do
it here, too.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.mailmap: update email address of Andrey Mazo
Andrey Mazo [Tue, 27 Aug 2019 04:24:41 +0000 (07:24 +0300)] 
.mailmap: update email address of Andrey Mazo

I don't have access to my old work email since 20 Apr 2019.
Replace with my personal email address.

Signed-off-by: Andrey Mazo <ahippo@yandex.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agostash: make sure to write refreshed cache
Thomas Gummerer [Wed, 11 Sep 2019 18:20:27 +0000 (19:20 +0100)] 
stash: make sure to write refreshed cache

When converting stash into C, calls to 'git update-index --refresh'
were replaced with the 'refresh_cache()' function.  That is fine as
long as the index is only needed in-core, and not re-read from disk.

However in many cases we do actually need the refreshed index to be
written to disk, for example 'merge_recursive_generic()' discards the
in-core index before re-reading it from disk, and in the case of 'apply
--quiet', the 'refresh_cache()' we currently have is pointless without
writing the index to disk.

Always write the index after refreshing it to ensure there are no
regressions in this compared to the scripted stash.  In the future we
can consider avoiding the write where possible after making sure none
of the subsequent calls actually need the refreshed cache, and it is
not expected to be refreshed after stash exits or it is written
somewhere else already.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge: use refresh_and_write_cache
Thomas Gummerer [Wed, 11 Sep 2019 18:20:26 +0000 (19:20 +0100)] 
merge: use refresh_and_write_cache

Use the 'refresh_and_write_cache()' convenience function introduced in
the last commit, instead of refreshing and writing the index manually
in merge.c

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofactor out refresh_and_write_cache function
Thomas Gummerer [Wed, 11 Sep 2019 18:20:25 +0000 (19:20 +0100)] 
factor out refresh_and_write_cache function

Getting the lock for the index, refreshing it and then writing it is a
pattern that happens more than once throughout the codebase, and isn't
trivial to get right.  Factor out the refresh_and_write_cache function
from builtin/am.c to read-cache.c, so it can be re-used in other
places in a subsequent commit.

Note that we return different error codes for failing to refresh the
cache, and failing to write the index.  The current caller only cares
about failing to write the index.  However for other callers we're
going to convert in subsequent patches we will need this distinction.

Helped-by: Martin Ågren <martin.agren@gmail.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotest_date.c: remove reference to GIT_TEST_DATE_NOW
Stephen P. Smith [Thu, 12 Sep 2019 04:11:02 +0000 (21:11 -0700)] 
test_date.c: remove reference to GIT_TEST_DATE_NOW

Remove the reference to the GIT_TEST_DATE_NOW which is done in date.c.
We can't get rid of the "x" variable, since it serves as a generic
scratch variable for parsing later in the function.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoSubmittingPatches: git-gui has a new maintainer
Junio C Hamano [Wed, 18 Sep 2019 20:57:13 +0000 (13:57 -0700)] 
SubmittingPatches: git-gui has a new maintainer

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThird batch
Junio C Hamano [Wed, 18 Sep 2019 18:55:13 +0000 (11:55 -0700)] 
Third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'jt/avoid-ls-refs-with-http'
Junio C Hamano [Wed, 18 Sep 2019 18:50:10 +0000 (11:50 -0700)] 
Merge branch 'jt/avoid-ls-refs-with-http'

The http transport lacked some optimization the native transports
learned to avoid unnecessary ref advertisement, which has been
corrected.

* jt/avoid-ls-refs-with-http:
  transport: teach all vtables to allow fetch first
  transport-helper: skip ls-refs if unnecessary

4 years agoMerge branch 'md/list-objects-filter-combo'
Junio C Hamano [Wed, 18 Sep 2019 18:50:09 +0000 (11:50 -0700)] 
Merge branch 'md/list-objects-filter-combo'

The list-objects-filter API (used to create a sparse/lazy clone)
learned to take a combined filter specification.

* md/list-objects-filter-combo:
  list-objects-filter-options: make parser void
  list-objects-filter-options: clean up use of ALLOC_GROW
  list-objects-filter-options: allow mult. --filter
  strbuf: give URL-encoding API a char predicate fn
  list-objects-filter-options: make filter_spec a string_list
  list-objects-filter-options: move error check up
  list-objects-filter: implement composite filters
  list-objects-filter-options: always supply *errbuf
  list-objects-filter: put omits set in filter struct
  list-objects-filter: encapsulate filter components

4 years agoMerge branch 'cc/multi-promisor'
Junio C Hamano [Wed, 18 Sep 2019 18:50:09 +0000 (11:50 -0700)] 
Merge branch 'cc/multi-promisor'

Teach the lazy clone machinery that there can be more than one
promisor remote and consult them in order when downloading missing
objects on demand.

* cc/multi-promisor:
  Move core_partial_clone_filter_default to promisor-remote.c
  Move repository_format_partial_clone to promisor-remote.c
  Remove fetch-object.{c,h} in favor of promisor-remote.{c,h}
  remote: add promisor and partial clone config to the doc
  partial-clone: add multiple remotes in the doc
  t0410: test fetching from many promisor remotes
  builtin/fetch: remove unique promisor remote limitation
  promisor-remote: parse remote.*.partialclonefilter
  Use promisor_remote_get_direct() and has_promisor_remote()
  promisor-remote: use repository_format_partial_clone
  promisor-remote: add promisor_remote_reinit()
  promisor-remote: implement promisor_remote_get_direct()
  Add initial support for many promisor remotes
  fetch-object: make functions return an error code
  t0410: remove pipes after git commands

4 years agoMerge branch 'sg/line-log-tree-diff-optim'
Junio C Hamano [Wed, 18 Sep 2019 18:50:09 +0000 (11:50 -0700)] 
Merge branch 'sg/line-log-tree-diff-optim'

Optimize unnecessary full-tree diff away from "git log -L" machinery.

* sg/line-log-tree-diff-optim:
  line-log: avoid unnecessary full tree diffs
  line-log: extract pathspec parsing from line ranges into a helper function

4 years agoMerge branch 'sg/complete-configuration-variables'
Junio C Hamano [Wed, 18 Sep 2019 18:50:08 +0000 (11:50 -0700)] 
Merge branch 'sg/complete-configuration-variables'

Command line completion updates for "git -c var.name=val"

* sg/complete-configuration-variables:
  completion: complete config variables and values for 'git clone --config='
  completion: complete config variables names and values for 'git clone -c'
  completion: complete values of configuration variables after 'git -c var='
  completion: complete configuration sections and variable names for 'git -c'
  completion: split _git_config()
  completion: simplify inner 'case' pattern in __gitcomp()
  completion: use 'sort -u' to deduplicate config variable names
  completion: deduplicate configuration sections
  completion: add tests for 'git config' completion
  completion: complete more values of more 'color.*' configuration variables
  completion: fix a typo in a comment

4 years agoMerge branch 'js/pre-merge-commit-hook'
Junio C Hamano [Wed, 18 Sep 2019 18:50:08 +0000 (11:50 -0700)] 
Merge branch 'js/pre-merge-commit-hook'

A new "pre-merge-commit" hook has been introduced.

* js/pre-merge-commit-hook:
  merge: --no-verify to bypass pre-merge-commit hook
  git-merge: honor pre-merge-commit hook
  merge: do no-verify like commit
  t7503: verify proper hook execution

4 years agoMerge branch 'cb/curl-use-xmalloc'
Junio C Hamano [Wed, 18 Sep 2019 18:50:08 +0000 (11:50 -0700)] 
Merge branch 'cb/curl-use-xmalloc'

Tell cURL library to use the same malloc() implementation, with the
xmalloc() wrapper, as the rest of the system, for consistency.

* cb/curl-use-xmalloc:
  http: use xmalloc with cURL

4 years agoMerge branch 'jk/drop-release-pack-memory'
Junio C Hamano [Wed, 18 Sep 2019 18:50:07 +0000 (11:50 -0700)] 
Merge branch 'jk/drop-release-pack-memory'

xmalloc() used to have a mechanism to ditch memory and address
space resources as the last resort upon seeing an allocation
failure from the underlying malloc(), which made the code complex
and thread-unsafe with dubious benefit, as major memory resource
users already do limit their uses with various other mechanisms.
It has been simplified away.

* jk/drop-release-pack-memory:
  packfile: drop release_pack_memory()

4 years agoMerge branch 'js/rebase-r-strategy'
Junio C Hamano [Wed, 18 Sep 2019 18:50:07 +0000 (11:50 -0700)] 
Merge branch 'js/rebase-r-strategy'

"git rebase --rebase-merges" learned to drive different merge
strategies and pass strategy specific options to them.

* js/rebase-r-strategy:
  t3427: accelerate this test by using fast-export and fast-import
  rebase -r: do not (re-)generate root commits with `--root` *and* `--onto`
  t3418: test `rebase -r` with merge strategies
  t/lib-rebase: prepare for testing `git rebase --rebase-merges`
  rebase -r: support merge strategies other than `recursive`
  t3427: fix another incorrect assumption
  t3427: accommodate for the `rebase --merge` backend having been replaced
  t3427: fix erroneous assumption
  t3427: condense the unnecessarily repetitive test cases into three
  t3427: move the `filter-branch` invocation into the `setup` case
  t3427: simplify the `setup` test case significantly
  t3427: add a clarifying comment
  rebase: fold git-rebase--common into the -p backend
  sequencer: the `am` and `rebase--interactive` scripts are gone
  .gitignore: there is no longer a built-in `git-rebase--interactive`
  t3400: stop referring to the scripted rebase
  Drop unused git-rebase--am.sh

4 years agoMerge branch 'master' of https://github.com/prati0100/git-gui
Junio C Hamano [Wed, 18 Sep 2019 18:22:11 +0000 (11:22 -0700)] 
Merge branch 'master' of https://github.com/prati0100/git-gui

* 'master' of https://github.com/prati0100/git-gui:
  git-gui: add hotkey to toggle "Amend Last Commit"
  git-gui: add horizontal scrollbar to commit buffer
  git-gui: convert new/amend commit radiobutton to checkbutton
  git-gui: add hotkeys to set widget focus
  git-gui: allow undoing last revert
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines

4 years agoMerge gitk to pick up emergency build fix
Junio C Hamano [Tue, 17 Sep 2019 21:59:18 +0000 (14:59 -0700)] 
Merge gitk to pick up emergency build fix

  gitk: rename zh_CN.po to zh_cn.po

4 years agogitk: rename zh_CN.po to zh_cn.po
Denton Liu [Tue, 17 Sep 2019 08:52:06 +0000 (01:52 -0700)] 
gitk: rename zh_CN.po to zh_cn.po

When running make from a clean environment, all of the *.po files should
be converted into *.msg files. After that, when make is run without any
changes, make should not do anything.

After beffae768a (gitk: Add Chinese (zh_CN) translation, 2017-03-11),
zh_CN.po was introduced. When make was run, a zh_cn.msg file was
generated (notice the lowercase). However, since make is case-sensitive,
it expects zh_CN.po to generate a zh_CN.msg file so make will keep
reattempting to generate a zh_CN.msg so successive make invocations
result in

    Generating catalog po/zh_cn.msg
    msgfmt --statistics --tcl po/zh_cn.po -l zh_cn -d po/
    317 translated messages.

happening continuously.

Rename zh_CN.po to zh_cn.po so that when make generates the zh_cn.msg
file, it will realize that it was successfully generated and only run
once.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolist-objects-filter: use empty string instead of NULL for sparse "base"
Jeff King [Sun, 15 Sep 2019 16:51:56 +0000 (12:51 -0400)] 
list-objects-filter: use empty string instead of NULL for sparse "base"

We use add_excludes_from_blob_to_list() to parse a sparse blob. Since
we don't have a base path, we pass NULL and 0 for the base and baselen,
respectively. But the rest of the exclude code passes a literal empty
string instead of NULL for this case. And indeed, we eventually end up
with match_pathname() calling fspathncmp(), which then calls the system
strncmp(path, base, baselen).

This works on many platforms, which notice that baselen is 0 and do not
look at the bytes of "base" at all. But it does violate the C standard,
and building with SANITIZE=undefined will complain. You can also see it
by instrumenting fspathncmp like this:

diff --git a/dir.c b/dir.c
index d021c908e5..4bb3d3ec96 100644
--- a/dir.c
+++ b/dir.c
@@ -71,6 +71,8 @@ int fspathcmp(const char *a, const char *b)

 int fspathncmp(const char *a, const char *b, size_t count)
 {
+ if (!a || !b)
+ BUG("null fspathncmp arguments");
  return ignore_case ? strncasecmp(a, b, count) : strncmp(a, b, count);
 }

We could perhaps be more defensive in match_pathname(), but even if we
did so, it makes sense for this code to match the rest of the exclude
callers.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolist-objects-filter: give a more specific error sparse parsing error
Jon Simons [Sun, 15 Sep 2019 01:13:47 +0000 (21:13 -0400)] 
list-objects-filter: give a more specific error sparse parsing error

The sparse:oid filter has two error modes: we might fail to resolve the
name to an OID, or we might fail to parse the contents of that OID. In
the latter case, let's give a less generic error message, and mention
the OID we did find.

While we're here, let's also mark both messages as translatable.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolist-objects-filter: delay parsing of sparse oid
Jeff King [Sun, 15 Sep 2019 16:12:44 +0000 (12:12 -0400)] 
list-objects-filter: delay parsing of sparse oid

The list-objects-filter code has two steps to its initialization:

  1. parse_list_objects_filter() makes sure the spec is a filter we know
     about and is syntactically correct. This step is done by "rev-list"
     or "upload-pack" that is going to apply a filter, but also by "git
     clone" or "git fetch" before they send the spec across the wire.

  2. list_objects_filter__init() runs the type-specific initialization
     (using function pointers established in step 1). This happens at
     the start of traverse_commit_list_filtered(), when we're about to
     actually use the filter.

It's a good idea to parse as much as we can in step 1, in order to catch
problems early (e.g., a blob size limit that isn't a number). But one
thing we _shouldn't_ do is resolve any oids at that step (e.g., for
sparse-file contents specified by oid). In the case of a fetch, the oid
has to be resolved on the remote side.

The current code does resolve the oid during the parse phase, but
ignores any error (which we must do, because we might just be sending
the spec across the wire). This leads to two bugs:

  - if we're not in a repository (e.g., because it's git-clone parsing
    the spec), then we trigger a BUG() trying to resolve the name

  - if we did hit the error case, we still have to notice that later and
    bail. The code path in rev-list handles this, but the one in
    upload-pack does not, leading to a segfault.

We can fix both by moving the oid resolution into the sparse-oid init
function. At that point we know we have a repository (because we're
about to traverse), and handling the error there fixes the segfault.

As a bonus, we can drop the NULL sparse_oid_value check in rev-list,
since this is now handled in the sparse-oid-filter init function.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5616: test cloning/fetching with sparse:oid=<oid> filter
Jon Simons [Sun, 15 Sep 2019 01:11:16 +0000 (21:11 -0400)] 
t5616: test cloning/fetching with sparse:oid=<oid> filter

We test in t5317 that "sparse:oid" filters work with rev-list, but
there's no coverage at all confirming that they work with a fetch or
clone (and in fact, there are several bugs). Let's do a basic test that
a clone fetches the correct objects.

[jk: extracted from Jon's earlier fix patches. I also simplified the
     setup down to a single sparse file, and I added checks that we got the
     right blobs]

Signed-off-by: Jon Simons <jon@jonsimons.org>
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodoc-diff: replace --cut-header-footer with --cut-footer
Martin Ågren [Mon, 16 Sep 2019 19:00:28 +0000 (21:00 +0200)] 
doc-diff: replace --cut-header-footer with --cut-footer

After the previous commit, AsciiDoc and Asciidoctor render the manpage
headers identically, so we no longer need the "cut the header" part of
our `--cut-header-footer` option. We do still need the "cut the footer"
part, though. The previous commits improved the rendering of the footer
in Asciidoctor by quite a bit, but the two programs still disagree on
how to format the date in the footer: 01/01/1970 vs 1970-01-01.

We could keep using `--cut-header-footer`, but it would be nice if we
had a slightly smaller hammer `--cut-footer` that would be less likely
to hide regressions. Rather than simply adding such an option, let's
also drop `--cut-header-footer`, i.e., rework it to lose the "header"
part of its name and functionality.

`--cut-header-footer` is just a developer tool and it probably has no
more than a handful of users, so we can afford to be aggressive.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoasciidoctor-extensions: provide `<refmiscinfo/>`
Martin Ågren [Mon, 16 Sep 2019 19:00:27 +0000 (21:00 +0200)] 
asciidoctor-extensions: provide `<refmiscinfo/>`

As can be seen from the previous commit, there are three attributes that
we provide to AsciiDoc through asciidoc.conf. Asciidoctor ignores that
file. After that patch, newer versions of Asciidoctor pick up the
`manmanual` and `mansource` attributes as we invoke `asciidoctor`, but
they don't pick up `manversion`. ([1] says: "Not used by Asciidoctor.")
Older versions (<1.5.7) don't handle these attributes at all. As a
result, we are missing one or three `<refmiscinfo/>` tags in each
xml-file produced when we build with Asciidoctor.

Because of this, xmlto doesn't include the Git version number in the
rendered manpages. And in particular, with versions <1.5.7, the manpage
footers instead contain the fairly ugly "[FIXME: source]".

That Asciidoctor ignores asciidoc.conf is nothing new. This is why we
implement the `linkgit:` macro in asciidoc.conf *and* in
asciidoctor-extensions.rb. Follow suit and provide these tags in
asciidoctor-extensions.rb, using a "postprocessor" extension where we
just search and replace in the XML, treated as text.

We may consider a few alternatives:

  * Inject these lines into the xml-files from the *Makefile*, e.g.,
    using `sed`. That would reduce repetition, but it feels wrong to
    impose another step and another risk on the AsciiDoc-processing only
    to benefit the Asciidoctor-one.

  * I tried providing a "docinfo processor" to inject these tags, but
    could not figure out how to "merge" the two <refmeta/> sections that
    resulted. To avoid xmlto barfing on the result, I needed to use
    `xmlto --skip-validation ...`, which seems unfortunate.

Let's instead inject the missing tags using a postprocessor. We'll make
it fairly obvious that we aim to inject the exact same three lines of
`<refmiscinfo/>` that asciidoc.conf provides. We inject them in
*post*-processing so we need to do the variable expansion ourselves. We
do introduce the bug that asciidoc.conf already has in that we won't do
any escaping, e.g., of funky versions like "some v <2.25, >2.20".

The postprocessor we add here works on the XML as raw text and doesn't
really use the full potential of XML to do a more structured injection.
This is actually precisely what the Asciidoctor User Manual does in its
postprocessor example [2]. I looked into two other approaches:

  1. The nokogiri library is apparently the "modern" way of doing XML
     in ruby. I got it working fairly easily:
        require 'nokogiri'
        doc = Nokogiri::XML(output)
        doc.search("refmeta").each { |n| n.add_child(new_tags) }
        output = doc.to_xml
     However, this adds another dependency (e.g., the "ruby-nokogiri"
     package on Ubuntu). Using Asciidoctor is not our default, but it
     will probably need to become so soon. Let's avoid adding a
     dependency just so that we can say "search...add_child" rather than
     "sub(regex...)".

  2. The older REXML is apparently always(?) bundled with ruby, but I
     couldn't even parse the original document:
        require 'rexml/document'
        doc = REXML::Document.new(output)
        ...
     The error was "no implicit conversion of nil into String" and I
     stopped there.

I don't think it's unlikely that doing a plain old search-and-replace
will work just as fine or better compared to parsing XML and worrying
about libraries and library versions.

[1] https://asciidoctor.org/docs/user-manual/#builtin-attributes

[2] https://asciidoctor.org/docs/user-manual/#postprocessor-example

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoDoc/Makefile: give mansource/-version/-manual attributes
Martin Ågren [Mon, 16 Sep 2019 19:00:26 +0000 (21:00 +0200)] 
Doc/Makefile: give mansource/-version/-manual attributes

Rather than hardcoding "Git Manual" and "Git" as the manual and source
in asciidoc.conf, provide them as attributes `manmanual` and
`mansource`. Rename the `git_version` attribute to `manversion`.

These new attribute names are not arbitrary, see, e.g., [1].

For AsciiDoc (8.6.10) and Asciidoctor <1.5.7, this is a no-op. Starting
with Asciidoctor 1.5.7, `manmanual` and `mansource` actually end up in
the xml-files and eventually in the rendered manpages. In particular,
the manpage headers now render just as with AsciiDoc.

No versions of Asciidoctor pick up the `manversion` [2], and older
versions don't pick up any of these attributes. -- We'll fix that with a
bit of a hack in the next commit.

[1] https://asciidoctor.org/docs/user-manual/#man-pages

[2] Note how [1] says "Not used by Asciidoctor".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoDocumentation: fix build with Asciidoctor 2
brian m. carlson [Sun, 15 Sep 2019 22:43:32 +0000 (22:43 +0000)] 
Documentation: fix build with Asciidoctor 2

Our documentation toolchain has traditionally been built around DocBook
4.5.  This version of DocBook is the last DTD-based version of DocBook.
In 2009, DocBook 5 was introduced using namespaces and its syntax is
expressed in RELAX NG, which is more expressive and allows a wider
variety of syntax forms.

Asciidoctor, one of the alternatives for building our documentation,
moved support for DocBook 4.5 out of core in its recent 2.0 release and
now only supports DocBook 5 in the main release.  The DocBoook 4.5
converter is still available as a separate component, but this is not
available in most distro packages.  This would not be a problem but for
the fact that we use xmlto, which is still stuck in the DocBook 4.5 era.

xmlto performs DTD validation as part of the build process.  This is not
problematic for DocBook 4.5, which has a valid DTD, but it clearly
cannot work for DocBook 5, since no DTD can adequately express its full
syntax.  In addition, even if xmlto did support RELAX NG validation,
that wouldn't be sufficient because it uses the libxml2-based xmllint to
do so, which has known problems with validating interleaves in RELAX NG.

Fortunately, there's an easy way forward: ask Asciidoctor to use its
DocBook 5 backend and tell xmlto to skip validation.  Asciidoctor has
supported DocBook 5 since v0.1.4 in 2013 and xmlto has supported
skipping validation for probably longer than that.

We also need to teach xmlto how to use the namespaced DocBook XSLT
stylesheets instead of the non-namespaced ones it usually uses.
Normally these stylesheets are interchangeable, but the non-namespaced
ones have a bug that causes them not to strip whitespace automatically
from certain elements when namespaces are in use.  This results in
additional whitespace at the beginning of list elements, which is
jarring and unsightly.

We can do this by passing a custom stylesheet with the -x option that
simply imports the namespaced stylesheets via a URL.  Any system with
support for XML catalogs will automatically look this URL up and
reference a local copy instead without us having to know where this
local copy is located.  We know that anyone using xmlto will already
have catalogs set up properly since the DocBook 4.5 DTD used during
validation is also looked up via catalogs.  All major Linux
distributions distribute the necessary stylesheets and have built-in
catalog support, and Homebrew does as well, albeit with a requirement to
set an environment variable to enable catalog support.

On the off chance that someone lacks support for catalogs, it is
possible for xmlto (via xmllint) to download the stylesheets from the
URLs in question, although this will likely perform poorly enough to
attract attention.  People still have the option of using the prebuilt
documentation that we ship, so happily this should not be an impediment.

Finally, we need to filter out some messages from other stylesheets that
occur when invoking dblatex in the CI job.  This tool strips namespaces
much like the unnamespaced DocBook stylesheets and prints similar
messages.  If we permit these messages to be printed to standard error,
our documentation CI job will fail because we check standard error for
unexpected output.  Due to dblatex's reliance on Python 2, we may need
to revisit its use in the future, in which case this problem may go
away, but this can be delayed until a future patch.

The final message we filter is due to libxslt on modern Debian and
Ubuntu.  The patch which they use to implement reproducible ID
generation also prints messages about the ID generation.  While this
doesn't affect our current CI images since they use Ubuntu 16.04 which
lacks this patch, if we upgrade to Ubuntu 18.04 or a modern Debian,
these messages will appear and, like the above messages, cause a CI
failure.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'master' of git://ozlabs.org/~paulus/gitk
Junio C Hamano [Mon, 16 Sep 2019 17:25:08 +0000 (10:25 -0700)] 
Merge branch 'master' of git://ozlabs.org/~paulus/gitk

* 'master' of git://ozlabs.org/~paulus/gitk:
  gitk: Do not mistake unchanged lines for submodule changes
  gitk: Use right colour for remote refs in the "Tags and heads" dialog
  gitk: Add Chinese (zh_CN) translation
  gitk: Make web links clickable

4 years agoMerge branch 'bp/amend-toggle-bind'
Pratyush Yadav [Sat, 14 Sep 2019 17:53:12 +0000 (23:23 +0530)] 
Merge branch 'bp/amend-toggle-bind'

Toggle amend on and off with the keyboard shortcut "Ctrl+e".

* bp/amend-toggle-bind:
  git-gui: add hotkey to toggle "Amend Last Commit"

4 years agogit-gui: add hotkey to toggle "Amend Last Commit"
Birger Skogeng Pedersen [Sat, 14 Sep 2019 09:18:35 +0000 (11:18 +0200)] 
git-gui: add hotkey to toggle "Amend Last Commit"

Selecting whether to "Amend Last Commit" or not does not have a hotkey.

With this patch, the user may toggle between the two options with
CTRL/CMD+e.

Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Rebased-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogitk: Do not mistake unchanged lines for submodule changes
Gabriele Mazzotta [Sat, 23 Mar 2019 17:00:36 +0000 (18:00 +0100)] 
gitk: Do not mistake unchanged lines for submodule changes

Unchanged lines are prefixed with a white-space, thus unchanged lines
starting with either " <" or " >" are mistaken for submodule changes.
Check if a line starts with either "  <" or "  >" only if we are listing
the changes of a submodule.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogitk: Use right colour for remote refs in the "Tags and heads" dialog
Paul Wise [Thu, 21 Mar 2019 07:05:32 +0000 (15:05 +0800)] 
gitk: Use right colour for remote refs in the "Tags and heads" dialog

Makes it easier to see which refs are local and which refs are remote.
Adds consistency with the remote background colour in the graph display.

Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogitk: Add Chinese (zh_CN) translation
YanKe [Fri, 10 Mar 2017 19:00:00 +0000 (03:00 +0800)] 
gitk: Add Chinese (zh_CN) translation

Signed-off-by: YanKe <imyanke@163.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agoMerge branch 'bw/commit-scrollbuffer'
Pratyush Yadav [Fri, 13 Sep 2019 20:49:38 +0000 (02:19 +0530)] 
Merge branch 'bw/commit-scrollbuffer'

Add a scrollbar at the bottom of the commit message buffer.

* bw/commit-scrollbuffer:
  git-gui: add horizontal scrollbar to commit buffer

4 years agoMerge branch 'bw/amend-checkbutton'
Pratyush Yadav [Fri, 13 Sep 2019 20:48:27 +0000 (02:18 +0530)] 
Merge branch 'bw/amend-checkbutton'

Change the amend setting from two radio buttons ("New commit" and "Amend
commit") to a single checkbutton. The two radio buttons can never be
selected together because they are exactly the opposite of each other,
so it makes sense to change it to a single checkbutton.

* bw/amend-checkbutton:
  git-gui: convert new/amend commit radiobutton to checkbutton

4 years agogit-gui: add horizontal scrollbar to commit buffer
Bert Wesarg [Fri, 13 Sep 2019 20:16:28 +0000 (22:16 +0200)] 
git-gui: add horizontal scrollbar to commit buffer

While the commit message widget has a configurable fixed width, it
nevertheless allowed to write commit messages which exceeded this limit.
Though there is no visual clue, that there is scrolling going on. Now
there is a horizontal scrollbar.

There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which
does not update the horizontal scrollbar if one removes the whole
content at once.

Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: convert new/amend commit radiobutton to checkbutton
Bert Wesarg [Fri, 13 Sep 2019 06:02:30 +0000 (08:02 +0200)] 
git-gui: convert new/amend commit radiobutton to checkbutton

Its a bi-state anyway and also saves one line in the menu.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agocompletion: teach archive to use __gitcomp_builtin
Denton Liu [Thu, 12 Sep 2019 19:43:57 +0000 (12:43 -0700)] 
completion: teach archive to use __gitcomp_builtin

Currently, _git_archive() uses a hardcoded list of options for its
completion. However, we can use __gitcomp_builtin() to get a dynamically
generated list of completions instead.

Teach _git_archive() to use __gitcomp_builtin() so that newly
implemented options in archive will be automatically completed without
any mucking around in git-completion.bash. While we're at it, teach it
to complete the missing `--worktree-attributes` option as well.

Unfortunately, since some args are passed through from cmd_archive() to
write_archive() (which calls parse_archive_args()), there's no way that a
`--git-completion-helper` arg can end up reaching parse_archive_args()
since the first call to parse_options() will end up calling exit(0). As
a result, we have to carry the options supported by write_archive() in
the hardcoded string.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocompletion: teach rebase to use __gitcomp_builtin
Denton Liu [Thu, 12 Sep 2019 19:43:55 +0000 (12:43 -0700)] 
completion: teach rebase to use __gitcomp_builtin

Currently, _git_rebase() uses a hardcoded list of options for its
completion. However, we can use __gitcomp_builtin() to get a dynamically
generated list of completions instead.

Teach _git_rebase() to use __gitcomp_builtin() so that newly implemented
options in rebase will be automatically completed without any mucking
around in git-completion.bash.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocompletion: add missing completions for log, diff, show
Max Rothman [Tue, 2 Jul 2019 01:56:26 +0000 (01:56 +0000)] 
completion: add missing completions for log, diff, show

The bash completion script knows some options to "git log" and
"git show" only in the positive form, (e.g. "--abbrev-commit"), but not
in their negative form (e.g. "--no-abbrev-commit"). Add them.

Also, the bash completion script is missing some other options to
"git diff", and "git show" (and thus, all other commands that take
"git diff"'s options). Add them. Of note, since "--indent-heuristic" is
no longer experimental, add that too.

Signed-off-by: Max Rothman <max.r.rothman@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoupload-pack: disable commit graph more gently for shallow traversal
Jeff King [Thu, 12 Sep 2019 14:44:45 +0000 (10:44 -0400)] 
upload-pack: disable commit graph more gently for shallow traversal

When the client has asked for certain shallow options like
"deepen-since", we do a custom rev-list walk that pretends to be
shallow. Before doing so, we have to disable the commit-graph, since it
is not compatible with the shallow view of the repository. That's
handled by 829a321569 (commit-graph: close_commit_graph before shallow
walk, 2018-08-20). That commit literally closes and frees our
repo->objects->commit_graph struct.

That creates an interesting problem for commits that have _already_ been
parsed using the commit graph. Their commit->object.parsed flag is set,
their commit->graph_pos is set, but their commit->maybe_tree may still
be NULL. When somebody later calls repo_get_commit_tree(), we see that
we haven't loaded the tree oid yet and try to get it from the commit
graph. But since it has been freed, we segfault!

So the root of the issue is a data dependency between the commit's
lazy-load of the tree oid and the fact that the commit graph can go
away mid-process. How can we resolve it?

There are a couple of general approaches:

  1. The obvious answer is to avoid loading the tree from the graph when
     we see that it's NULL. But then what do we return for the tree oid?
     If we return NULL, our caller in do_traverse() will rightly
     complain that we have no tree. We'd have to fallback to loading the
     actual commit object and re-parsing it. That requires teaching
     parse_commit_buffer() to understand re-parsing (i.e., not starting
     from a clean slate and not leaking any allocated bits like parent
     list pointers).

  2. When we close the commit graph, walk through the set of in-memory
     objects and clear any graph_pos pointers. But this means we also
     have to "unparse" any such commits so that we know they still need
     to open the commit object to fill in their trees. So it's no less
     complicated than (1), and is more expensive (since we clear objects
     we might not later need).

  3. Stop freeing the commit-graph struct. Continue to let it be used
     for lazy-loads of tree oids, but let upload-pack specify that it
     shouldn't be used for further commit parsing.

  4. Push the whole shallow rev-list out to its own sub-process, with
     the commit-graph disabled from the start, giving it a clean memory
     space to work from.

I've chosen (3) here. Options (1) and (2) would work, but are
non-trivial to implement. Option (4) is more expensive, and I'm not sure
how complicated it is (shelling out for the actual rev-list part is
easy, but we do then parse the resulting commits internally, and I'm not
clear which parts need to be handling shallow-ness).

The new test in t5500 triggers this segfault, but see the comments there
for how horribly intimate it has to be with how both upload-pack and
commit graphs work.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: bump DIE_ON_LOAD check to actual load-time
Jeff King [Thu, 12 Sep 2019 14:44:34 +0000 (10:44 -0400)] 
commit-graph: bump DIE_ON_LOAD check to actual load-time

Commit 43d3561805 (commit-graph write: don't die if the existing graph
is corrupt, 2019-03-25) added an environment variable we use only in the
test suite, $GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD. But it put the check for
this variable at the very top of prepare_commit_graph(), which is called
every time we want to use the commit graph. Most importantly, it comes
_before_ we check the fast-path "did we already try to load?", meaning
we end up calling getenv() for every single use of the commit graph,
rather than just when we load.

getenv() is allowed to have unexpected side effects, but that shouldn't
be a problem here; we're lazy-loading the graph so it's clear that at
least _one_ invocation of this function is going to call it.

But it is inefficient. getenv() typically has to do a linear search
through the environment space.

We could memoize the call, but it's simpler still to just bump the check
down to the actual loading step. That's fine for our sole user in t5318,
and produces this minor real-world speedup:

  [before]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      1.460 s ±  0.017 s    [User: 1.174 s, System: 0.285 s]
    Range (min … max):    1.440 s …  1.491 s    10 runs

  [after]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      1.391 s ±  0.005 s    [User: 1.118 s, System: 0.273 s]
    Range (min … max):    1.385 s …  1.399 s    10 runs

Of course that actual speedup depends on how big your environment is. We
can game it like this:

  for i in $(seq 10000); do
    export dummy$i=$i
  done

in which case I get:

  [before]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      6.257 s ±  0.061 s    [User: 6.005 s, System: 0.250 s]
    Range (min … max):    6.174 s …  6.337 s    10 runs

  [after]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
  Time (mean ± σ):      1.403 s ±  0.005 s    [User: 1.146 s, System: 0.256 s]
  Range (min … max):    1.396 s …  1.412 s    10 runs

So this is really more about avoiding the pathological case than
providing a big real-world speedup.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolist-objects: don't queue root trees unless revs->tree_objects is set
Jeff King [Thu, 12 Sep 2019 01:11:37 +0000 (21:11 -0400)] 
list-objects: don't queue root trees unless revs->tree_objects is set

When traverse_commit_list() processes each commit, it queues the
commit's root tree in the pending array. Then, after all commits are
processed, it calls traverse_trees_and_blobs() to walk over the pending
list, calling process_tree() on each. But if revs->tree_objects is not
set, process_tree() just exists immediately!

We can save ourselves some work by not even bothering to queue these
trees in the first place. There are a few subtle points to make:

  - we also detect commits with a NULL tree pointer here. But this isn't
    an interesting check for broken commits, since the lookup_tree()
    we'd have done during commit parsing doesn't actually check that we
    have the tree on disk. So we're not losing any robustness.

  - besides queueing, we also set the NOT_USER_GIVEN flag on the tree
    object. This is used by the traverse_commit_list_filtered() variant.
    But if we're not exploring trees, then we won't actually care about
    this flag, which is used only inside process_tree() code-paths.

  - queueing trees eventually leads to us queueing blobs, too. But we
    don't need to check revs->blob_objects here. Even in the current
    code, we still wouldn't find those blobs, because we'd never open up
    the tree objects to list their contents.

  - the user-visible impact to the caller is minimal. The pending trees
    are all cleared by the time the function returns anyway, by
    traverse_trees_and_blobs(). We do call a show_commit() callback,
    which technically could be looking at revs->pending during the
    callback. But it seems like a rather unlikely thing to do (if you
    want the tree of the current commit, then accessing the tree struct
    member is a lot simpler).

So this should be safe to do. Let's look at the benefits:

  [before]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      7.651 s ±  0.021 s    [User: 7.399 s, System: 0.252 s]
    Range (min … max):    7.607 s …  7.683 s    10 runs

  [after]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      7.593 s ±  0.023 s    [User: 7.329 s, System: 0.264 s]
    Range (min … max):    7.565 s …  7.634 s    10 runs

Not too impressive, but then we're really just avoiding sticking a
pointer into a growable array. But still, I'll take a free 0.75%
speedup.

Let's try it after running "git commit-graph write":

  [before]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      1.458 s ±  0.011 s    [User: 1.199 s, System: 0.259 s]
    Range (min … max):    1.447 s …  1.481 s    10 runs

  [after]
  Benchmark #1: git -C linux rev-list HEAD >/dev/null
    Time (mean ± σ):      1.126 s ±  0.023 s    [User: 896.5 ms, System: 229.0 ms]
    Range (min … max):    1.106 s …  1.181 s    10 runs

Now that's more like it. We saved over 22% of the total time. Part of
that is because the runtime is shorter overall, but the absolute
improvement is also much larger. What's going on?

When we fill in a commit struct using the commit graph, we don't bother
to set the tree pointer, and instead lazy-load it when somebody calls
get_commit_tree(). So we're not only skipping the pointer write to the
pending queue, but we're skipping the lazy-load of the tree entirely.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoQuit passing 'now' to date code
Stephen P. Smith [Thu, 12 Sep 2019 04:11:01 +0000 (21:11 -0700)] 
Quit passing 'now' to date code

Commit b841d4ff43 (Add `human` format to test-tool, 2019-01-28) added
a get_time() function which allows $GIT_TEST_DATE_NOW in the
environment to override the current time. So we no longer need to
interpret that variable in cmd__date().

Therefore, we can stop passing the "now" parameter down through the
date functions, since nobody uses them. Note that we do need to make
sure all of the previous callers that took a "now" parameter are
correctly using get_time().

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'py/revert-hunks-lines'
Pratyush Yadav [Wed, 11 Sep 2019 21:11:12 +0000 (02:41 +0530)] 
Merge branch 'py/revert-hunks-lines'

git-gui learned to revert selected lines and hunks, just like it can
stage selected lines and hunks. To provide a safety net for accidental
revert, the most recent revert can be undone.

* py/revert-hunks-lines:
  git-gui: allow undoing last revert
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines