Commit Graph

57033 Commits

Author SHA1 Message Date
Junio C Hamano
822fa2ed99 Merge branch 'ma/user-manual-markup-update' into next
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
2019-09-30 13:42:16 +09:00
Junio C Hamano
708fb8988e Merge branch 'dl/honor-cflags-in-hdr-check' into next
Dev support.

* dl/honor-cflags-in-hdr-check:
  Makefile: emulate compile in $(HCO) target better
  pack-bitmap.h: remove magic number
  promisor-remote.h: include missing header
  apply.h: include missing header
2019-09-30 13:42:16 +09:00
Junio C Hamano
273ff0e62d Merge branch 'cb/do-not-use-test-cmp-with-a' into next
Test portability fix.

* cb/do-not-use-test-cmp-with-a:
  t4038: Remove non-portable '-a' option passed to test_cmp
2019-09-30 13:42:15 +09:00
Junio C Hamano
c4826f5a08 Merge branch 'cc/multi-promisor' into next
Cleanup.

* cc/multi-promisor:
  promisor-remote.h: drop extern from function declaration
2019-09-30 13:42:15 +09:00
Junio C Hamano
5e373b3cba Merge branch 'am/mailmap-andrey-mazo' into next
* am/mailmap-andrey-mazo:
  .mailmap: update email address of Andrey Mazo
2019-09-30 13:42:15 +09:00
Junio C Hamano
a5d6788e2e Merge branch 'jt/merge-recursive-symlink-is-not-a-dir-in-way' into next
A bug in merge-recursive code that triggers when a branch with a
symbolic link is merged with a branch that replaces it with a
directory has been fixed.

* jt/merge-recursive-symlink-is-not-a-dir-in-way:
  merge-recursive: symlink's descendants not in way
2019-09-30 13:42:14 +09:00
Junio C Hamano
729e6dc708 Merge branch 'ps/my-first-contribution-alphasort' into next
Docfix.

* ps/my-first-contribution-alphasort:
  doc: MyFirstContribution: fix cmd placement instructions
2019-09-30 13:42:14 +09:00
Junio C Hamano
054a66bb75 Merge branch 'sg/travis-help-debug' into next
Dev support update.

* sg/travis-help-debug:
  travis-ci: do not skip successfully tested trees in debug mode
2019-09-30 13:42:13 +09:00
Junio C Hamano
4d90f4ba93 Merge branch 'rs/alias-use-copy-array' into next
Code cleanup.

* rs/alias-use-copy-array:
  git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()
2019-09-30 13:42:13 +09:00
Junio C Hamano
8e319a2eae Merge branch 'sg/t-helper-gitignore' into next
Update the way build artifacts in t/helper/ directory are ignored.

* sg/t-helper-gitignore:
  t/helper: ignore only executable files
2019-09-30 13:42:12 +09:00
Junio C Hamano
dfe61e947c Merge branch 'jc/git-gui-has-maintainer' into next
* jc/git-gui-has-maintainer:
  SubmittingPatches: git-gui has a new maintainer
2019-09-30 13:42:12 +09:00
Junio C Hamano
27c8457202 Merge branch 'cc/svn-fe-py-shebang' into next
* cc/svn-fe-py-shebang:
  contrib/svn-fe: fix shebang for svnrdump_sim.py
2019-09-30 13:42:12 +09:00
Junio C Hamano
9eb3de8d1b Merge branch 'ah/doc-submodule-ignore-submodules' into next
Docfix.

* ah/doc-submodule-ignore-submodules:
  doc: fix reference to --ignore-submodules
2019-09-30 13:42:11 +09:00
Junio C Hamano
4233f54a72 Merge branch 'rs/nth-switch-code-simplification' into next
Code simplification.

* rs/nth-switch-code-simplification:
  sha1_name: simplify strbuf handling in interpret_nth_prior_checkout()
2019-09-30 13:42:11 +09:00
Junio C Hamano
28f7e9bae3 Merge branch 'hb/hg-to-git-py3' into next
The hg-to-git script (in contrib/) has been updated to work with
Python 3.

* hb/hg-to-git-py3:
  hg-to-git: make it compatible with both python3 and python2
2019-09-30 13:42:10 +09:00
Junio C Hamano
d352332810 Merge branch 'sg/progress-fix' into next
Regression fix for progress output.

* sg/progress-fix:
  Test the progress display
  Revert "progress: use term_clear_line()"
2019-09-30 13:42:10 +09:00
Junio C Hamano
f9b391a66b Merge branch 'js/doc-patch-text' into next
Docfix.

* js/doc-patch-text:
  diff, log doc: small grammer, format, and language fixes
  diff, log doc: say "patch text" instead of "patches"
2019-09-30 13:42:10 +09:00
Junio C Hamano
b9350a562d Merge branch 'tb/commit-graph-harden' into next
The code to parse and use the commit-graph file has been made more
robust against corrupted input.

* tb/commit-graph-harden:
  commit-graph.c: handle corrupt/missing trees
  commit-graph.c: handle commit parsing errors
  t/t5318: introduce failing 'git commit-graph write' tests
2019-09-30 13:42:09 +09:00
Junio C Hamano
5d8ffc2e0f Merge branch 'jt/cache-tree-avoid-lazy-fetch-during-merge' into next
The cache-tree code has been taught to be less aggressive in
attempting to see if a tree object it computed already exists in
the repository.

* jt/cache-tree-avoid-lazy-fetch-during-merge:
  cache-tree: do not lazy-fetch tentative tree
2019-09-30 13:42:09 +09:00
Junio C Hamano
778cc31eac Merge branch 'en/clean-nested-with-ignored' into next
"git clean" fixes.

* en/clean-nested-with-ignored:
  clean: fix theoretical path corruption
  clean: rewrap overly long line
  clean: avoid removing untracked files in a nested git repository
  clean: disambiguate the definition of -d
  git-clean.txt: do not claim we will delete files with -n/--dry-run
  dir: add commentary explaining match_pathspec_item's return value
  dir: if our pathspec might match files under a dir, recurse into it
  dir: make the DO_MATCH_SUBMODULE code reusable for a non-submodule case
  dir: also check directories for matching pathspecs
  dir: fix off-by-one error in match_pathspec_item
  dir: fix typo in comment
  t7300: add testcases showing failure to clean specified pathspecs
2019-09-30 13:42:08 +09:00
Junio C Hamano
dc60b31833 Merge branch 'jk/packfile-reuse-cleanup' into next
The way "git pack-objects" reuses objects stored in existing pack
to generate its result has been improved.

* jk/packfile-reuse-cleanup:
  pack-objects: improve partial packfile reuse
  builtin/pack-objects: introduce obj_is_packed()
  pack-objects: introduce pack.allowPackReuse
  csum-file: introduce hashfile_total()
  pack-bitmap: introduce bitmap_walk_contains()
  pack-bitmap: don't rely on bitmap_git->reuse_objects
  ewah/bitmap: always allocate 2 more words
  ewah/bitmap: introduce bitmap_word_alloc()
  packfile: expose get_delta_base()
  builtin/pack-objects: report reused packfile objects
2019-09-30 13:42:07 +09:00
Junio C Hamano
1bb1c0846f Merge branch 'dl/cocci-everywhere' into next
Coccinelle checks are done on more source files than before now.

* dl/cocci-everywhere:
  Makefile: run coccicheck on more source files
  Makefile: strip leading ./ in $(FIND_SOURCE_FILES)
  Makefile: define THIRD_PARTY_SOURCES
  Makefile: strip leading ./ in $(LIB_H)
2019-09-30 13:42:06 +09:00
Junio C Hamano
7c03eac969 Merge branch 'gs/commit-graph-progress' into next
* gs/commit-graph-progress:
  commit-graph: add --[no-]progress to write and verify
2019-09-30 13:42:06 +09:00
Junio C Hamano
97ec83d2a2 Merge branch 'ms/fetch-follow-tag-optim' into next
The code used in following tags in "git fetch" has been optimized.

* ms/fetch-follow-tag-optim:
  fetch: use oidset to keep the want OIDs for faster lookup
2019-09-30 13:42:05 +09:00
Junio C Hamano
8986e5537f Merge branch 'rs/commit-graph-use-list-count' into next
Code cleanup.

* rs/commit-graph-use-list-count:
  commit-graph: use commit_list_count()
2019-09-30 13:42:05 +09:00
Junio C Hamano
5bdfeacdff Merge branch 'rs/nth-parent-parse' into next
The object name parser for "Nth parent" syntax has been made more
robust against integer overflows.

* rs/nth-parent-parse:
  sha1-name: check for overflow of N in "foo^N" and "foo~N"
  rev-parse: demonstrate overflow of N for "foo^N" and "foo~N"
2019-09-30 13:42:05 +09:00
Junio C Hamano
31c4cf70ae Merge branch 'bc/doc-use-docbook-5' into next
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
2019-09-30 13:42:04 +09:00
Junio C Hamano
c66b398cc1 Merge branch 'dl/submodule-set-branch' into next
Docfix.

* dl/submodule-set-branch:
  git-submodule.txt: fix AsciiDoc formatting error
2019-09-30 13:42:04 +09:00
Junio C Hamano
a29a425208 Merge branch 'cs/pretty-formats-doc-typofix' into next
Doc fix.

* cs/pretty-formats-doc-typofix:
  doc: minor formatting fix
2019-09-30 13:42:03 +09:00
Junio C Hamano
9ef098d07f Merge branch 'jk/list-objects-optim-wo-trees' into next
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
2019-09-30 13:42:03 +09:00
Junio C Hamano
87dae76fb7 Merge branch 'jk/disable-commit-graph-during-upload-pack' into next
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
2019-09-30 13:42:02 +09:00
Junio C Hamano
b2507b21cb Merge branch 'mr/complete-more-for-log-etc' into next
Completion updates.

* mr/complete-more-for-log-etc:
  completion: add missing completions for log, diff, show
2019-09-30 13:42:02 +09:00
Junio C Hamano
ddeb81ff41 Merge branch 'dl/complete-rebase-and-archive' into next
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
2019-09-30 13:42:01 +09:00
Junio C Hamano
4937cac46f Merge branch 'ma/asciidoctor-more-fixes' into next
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 "--"
2019-09-30 13:42:01 +09:00
Junio C Hamano
f78e24d14b Merge branch 'jk/commit-graph-cleanup' into next
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
2019-09-30 13:42:01 +09:00
Junio C Hamano
21a0dced8f Merge branch 'ss/get-time-cleanup' into next
Code simplification.

* ss/get-time-cleanup:
  test_date.c: remove reference to GIT_TEST_DATE_NOW
  Quit passing 'now' to date code
2019-09-30 13:42:00 +09:00
Junio C Hamano
3c155bbd24 Merge branch 'rs/simplify-by-deco-with-deco-refs-exclude' into next
"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
2019-09-30 13:42:00 +09:00
Junio C Hamano
f6113b33cf Merge branch 'cb/skip-utf8-check-with-pcre1' into next
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
2019-09-30 13:41:59 +09:00
Junio C Hamano
44b33488ea Merge branch 'jk/partial-clone-sparse-blob' into next
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
2019-09-30 13:41:59 +09:00
Junio C Hamano
de7759ad1d Merge branch 'tg/stash-refresh-index' into next
"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
2019-09-30 13:41:58 +09:00
Junio C Hamano
e5d13aceb8 Merge branch 'ma/asciidoctor-refmiscinfo' into next
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
2019-09-30 13:41:58 +09:00
Martin Ågren
c4d2f6143a 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>
2019-09-28 17:39:34 +09:00
Martin Ågren
dba3734103 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>
2019-09-28 17:37:56 +09:00
Martin Ågren
fd5b820d9c 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>
2019-09-28 17:35:46 +09:00
Martin Ågren
e79b34533a 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>
2019-09-28 17:35:44 +09:00
Denton Liu
b503a2d515 Makefile: emulate compile in $(HCO) target better
Currently, when testing headers using `make hdr-check`, headers are
directly compiled. Although this seems to test the headers, this is too
strict since we treat the headers as C sources. As a result, this will
cause warnings to appear that would otherwise not, such as a static
variable definition intended for later use throwing a unused variable
warning.

In addition, on platforms that can run `make hdr-check` but require
custom flags, this target was failing because none of them were being
passed to the compiler. For example, on MacOS, the NO_OPENSSL flag was
being set but it was not being passed into compiler so the check was
failing.

Fix these problems by emulating the compile process better, including
test compiling dummy *.hcc C sources generated from the *.h files and
passing $(ALL_CFLAGS) into the compiler for the $(HCO) target so that
these custom flags can be used.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-28 14:04:22 +09:00
Denton Liu
af26e2a9d2 pack-bitmap.h: remove magic number
When we ran `make hdr-check` with the following patch

	diff --git a/Makefile b/Makefile
	index f879697ea3..d8df4e316b 100644
	--- a/Makefile
	+++ b/Makefile
	@@ -2773,7 +2773,7 @@ CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
	HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))

	$(HCO): %.hco: %.h FORCE
	-	$(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<
	+	$(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $(ALL_CFLAGS) $<

	.PHONY: hdr-check $(HCO)
	hdr-check: $(HCO)

and with `DEVELOPER=1`, we got the following warning on Arch Linux:

	pack-bitmap.h:20:19: error: ‘BITMAP_IDX_SIGNATURE’ defined but not used [-Werror=unused-const-variable=]
	   20 | static const char BITMAP_IDX_SIGNATURE[] = {'B', 'I', 'T', 'M'};
	      |                   ^~~~~~~~~~~~~~~~~~~~
	cc1: all warnings being treated as errors

"Use" the BITMAP_IDX_SIGNATURE variable by making the size of
bitmap_disk_header.magic equal to the size of BITMAP_IDX_SIGNATURE,
thereby eliminating the magic number (4).

An alternative was to simply add MAYBE_UNUSED, however that does not
eliminate the magic number.

Another alternative was to change the definition to

	extern const char BITMAP_IDX_SIGNATURE[4];

However, this design was also not chosen as the static definition allows
us to keep the declaration together for readability along with removing
the magic number.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-28 14:04:20 +09:00
Denton Liu
b06fdead04 promisor-remote.h: include missing header
When we ran `make hdr-check`, we got the following warning message:

	promisor-remote.h:21:46: warning: declaration of 'struct repository' will not be visible outside of this function [-Wvisibility]
	extern int promisor_remote_get_direct(struct repository *repo,
						     ^
	1 warning generated.

This was caused by a missing reference to `struct repository`, which is
defined in "repository.h".

Include this missing header to fix this warning.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-28 14:04:19 +09:00
Denton Liu
97b989ee3a apply.h: include missing header
When running `make hdr-check`, we got the following error messages:

	apply.h:146:22: error: use of undeclared identifier 'GIT_MAX_HEXSZ'
		char old_oid_prefix[GIT_MAX_HEXSZ + 1];
				    ^
	apply.h:147:22: error: use of undeclared identifier 'GIT_MAX_HEXSZ'
		char new_oid_prefix[GIT_MAX_HEXSZ + 1];
				    ^
	apply.h:151:33: error: array has incomplete element type 'struct object_id'
		struct object_id threeway_stage[3];
					       ^
	./strbuf.h:79:8: note: forward declaration of 'struct object_id'
	struct object_id;
	       ^
	3 errors generated.
	make: *** [apply.hco] Error 1

Include the missing "hash.h" header to fix these errors.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-28 14:04:16 +09:00
Junio C Hamano
8ccfaed27d Revert "Merge branch 'js/honor-cflags-in-hdr-check' into next"
This reverts commit fcd9ee9f1b, reversing
changes made to 1973826628.

A separate topic that addresses essentially the same issue
supersedes it.
2019-09-28 14:01:08 +09:00