]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agoMerge branch 'pw/rebase-i-show-HEAD-to-reword'
Junio C Hamano [Fri, 11 Oct 2019 05:24:46 +0000 (14:24 +0900)] 
Merge branch 'pw/rebase-i-show-HEAD-to-reword'

"git rebase -i" showed a wrong HEAD while "reword" open the editor.

* pw/rebase-i-show-HEAD-to-reword:
  sequencer: simplify root commit creation
  rebase -i: check for updated todo after squash and reword
  rebase -i: always update HEAD before rewording

4 years agoMerge branch 'tk/git-svn-trim-author-name'
Junio C Hamano [Fri, 11 Oct 2019 05:24:46 +0000 (14:24 +0900)] 
Merge branch 'tk/git-svn-trim-author-name'

The author names taken from SVN repositories may have extra leading
or trailing whitespaces, which are now munged away.

* tk/git-svn-trim-author-name:
  git-svn: trim leading and trailing whitespaces in author name

4 years agoMerge branch 'bc/object-id-part17'
Junio C Hamano [Fri, 11 Oct 2019 05:24:46 +0000 (14:24 +0900)] 
Merge branch 'bc/object-id-part17'

Preparation for SHA-256 upgrade continues.

* bc/object-id-part17: (26 commits)
  midx: switch to using the_hash_algo
  builtin/show-index: replace sha1_to_hex
  rerere: replace sha1_to_hex
  builtin/receive-pack: replace sha1_to_hex
  builtin/index-pack: replace sha1_to_hex
  packfile: replace sha1_to_hex
  wt-status: convert struct wt_status to object_id
  cache: remove null_sha1
  builtin/worktree: switch null_sha1 to null_oid
  builtin/repack: write object IDs of the proper length
  pack-write: use hash_to_hex when writing checksums
  sequencer: convert to use the_hash_algo
  bisect: switch to using the_hash_algo
  sha1-lookup: switch hard-coded constants to the_hash_algo
  config: use the_hash_algo in abbrev comparison
  combine-diff: replace GIT_SHA1_HEXSZ with the_hash_algo
  bundle: switch to use the_hash_algo
  connected: switch GIT_SHA1_HEXSZ to the_hash_algo
  show-index: switch hard-coded constants to the_hash_algo
  blame: remove needless comparison with GIT_SHA1_HEXSZ
  ...

4 years agoMerge branch 'en/clean-nested-with-ignored'
Junio C Hamano [Fri, 11 Oct 2019 05:24:45 +0000 (14:24 +0900)] 
Merge branch 'en/clean-nested-with-ignored'

"git clean" fixes.

* en/clean-nested-with-ignored:
  dir: special case check for the possibility that pathspec is NULL
  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

4 years agoCODE_OF_CONDUCT: mention individual project-leader emails
Jeff King [Thu, 26 Sep 2019 07:20:46 +0000 (03:20 -0400)] 
CODE_OF_CONDUCT: mention individual project-leader emails

It's possible that somebody on the project committee is the subject of a
complaint. In that case, it may be useful to be able to contact the
other members individually, so let's make it clear that's an option.

This also serves to enumerate the set of people on the committee. That
lets you easily _know_ if you're in the situation mentioned above. And
it's just convenient to list who's involved in the process, since the
project committee list is not anywhere else in the repository.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoadd a Code of Conduct document
Jeff King [Tue, 24 Sep 2019 06:44:54 +0000 (02:44 -0400)] 
add a Code of Conduct document

We've never had a formally written Code of Conduct document. Though it
has been discussed off and on over the years, for the most part the
behavior on the mailing list has been good enough that nobody felt the
need to push one forward.

However, even if there aren't specific problems now, it's a good idea to
have a document:

  - it puts everybody on the same page with respect to expectations.
    This might avoid poor behavior, but also makes it easier to handle
    it if it does happen.

  - it publicly advertises that good conduct is important to us and will
    be enforced, which may make some people more comfortable with
    joining our community

  - it may be a good time to cement our expectations when things are
    quiet, since it gives everybody some distance rather than focusing
    on a current contentious issue

This patch adapts the Contributor Covenant Code of Conduct. As opposed
to writing our own from scratch, this uses common and well-accepted
language, and strikes a good balance between illustrating expectations
and avoiding a laundry list of behaviors. It's also the same document
used by the Git for Windows project.

The text is taken mostly verbatim from:

  https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

I also stole a very nice introductory paragraph from the Git for Windows
version of the file.

There are a few subtle points, though:

  - the document refers to "the project maintainers". For the code, we
    generally only consider there to be one maintainer: Junio C Hamano.
    But for dealing with community issues, it makes sense to involve
    more people to spread the responsibility. I've listed the project
    committee address of git@sfconservancy.org as the contact point.

  - the document mentions banning from the community, both in the intro
    paragraph and in "Our Responsibilities". The exact mechanism here is
    left vague. I can imagine it might start with social enforcement
    (not accepting patches, ignoring emails) and could escalate to
    technical measures if necessary (asking vger admins to block an
    address). It probably make sense _not_ to get too specific at this
    point, and deal with specifics as they come up.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: CB Bailey <cb@hashpling.org>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: Garima Singh <garimasigit@gmail.com>
Acked-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Jonathan Tan <jonathantanmy@google.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Elijah Newren <newren@gmail.com>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: brian m. carlson <sandals@crustytoothpaste.net>
Acked-by: Derrick Stolee <stolee@gmail.com>
Acked-by: Thomas Gummerer <t.gummerer@gmail.com>
Acked-by: William Baker <williamtbakeremail@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoSeventh batch
Junio C Hamano [Wed, 9 Oct 2019 05:02:58 +0000 (14:02 +0900)] 
Seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'rs/test-remove-useless-debugging-cat'
Junio C Hamano [Wed, 9 Oct 2019 05:01:01 +0000 (14:01 +0900)] 
Merge branch 'rs/test-remove-useless-debugging-cat'

Code cleanup.

* rs/test-remove-useless-debugging-cat:
  tests: remove "cat foo" before "test_i18ngrep bar foo"

4 years agoMerge branch 'pm/p4-auto-delete-named-temporary'
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)] 
Merge branch 'pm/p4-auto-delete-named-temporary'

* pm/p4-auto-delete-named-temporary:
  git-p4: auto-delete named temporary file

4 years agoMerge branch 'rs/convert-fix-utf-without-dash'
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)] 
Merge branch 'rs/convert-fix-utf-without-dash'

The code to skip "UTF" and "UTF-" prefix, when computing an advice
message, did not work correctly when the prefix was "UTF", which
has been fixed.

* rs/convert-fix-utf-without-dash:
  convert: fix handling of dashless UTF prefix in validate_encoding()

4 years agoMerge branch 'py/git-gui-has-maintainer'
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)] 
Merge branch 'py/git-gui-has-maintainer'

Doc update.

* py/git-gui-has-maintainer:
  Documentation: update the location of the git-gui repo

4 years agoMerge branch 'ah/cleanups'
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)] 
Merge branch 'ah/cleanups'

Miscellaneous code clean-ups.

* ah/cleanups:
  git_mkstemps_mode(): replace magic numbers with computed value
  wrapper: use a loop instead of repetitive statements
  diffcore-break: use a goto instead of a redundant if statement
  commit-graph: remove a duplicate assignment

4 years agoMerge branch 'js/diff-rename-force-stable-sort'
Junio C Hamano [Wed, 9 Oct 2019 05:00:59 +0000 (14:00 +0900)] 
Merge branch 'js/diff-rename-force-stable-sort'

The rename detection logic sorts a list of rename source candidates
by similarity to pick the best candidate, which means that a tie
between sources with the same similarity is broken by the original
location in the original candidate list (which is sorted by path).
Force the sorting by similarity done with a stable sort, which is
not promised by system supplied qsort(3), to ensure consistent
results across platforms.

* js/diff-rename-force-stable-sort:
  diffcore_rename(): use a stable sort
  Move git_sort(), a stable sort, into into libgit.a

4 years agoMerge branch 'js/mingw-spawn-with-spaces-in-path'
Junio C Hamano [Wed, 9 Oct 2019 05:00:59 +0000 (14:00 +0900)] 
Merge branch 'js/mingw-spawn-with-spaces-in-path'

Test fix.

* js/mingw-spawn-with-spaces-in-path:
  t0061: fix test for argv[0] with spaces (MINGW only)

4 years agoMerge branch 'as/shallow-slab-use-fix'
Junio C Hamano [Wed, 9 Oct 2019 05:00:59 +0000 (14:00 +0900)] 
Merge branch 'as/shallow-slab-use-fix'

Correct code that tried to reference all entries in a sparse array
of pointers by mistake.

* as/shallow-slab-use-fix:
  shallow.c: don't free unallocated slabs

4 years agoMerge branch 'sg/name-rev-cutoff-underflow-fix'
Junio C Hamano [Wed, 9 Oct 2019 05:00:58 +0000 (14:00 +0900)] 
Merge branch 'sg/name-rev-cutoff-underflow-fix'

Integer arithmetic fix.

* sg/name-rev-cutoff-underflow-fix:
  name-rev: avoid cutoff timestamp underflow

4 years agoMerge branch 'am/visual-studio-config-fix'
Junio C Hamano [Wed, 9 Oct 2019 05:00:58 +0000 (14:00 +0900)] 
Merge branch 'am/visual-studio-config-fix'

Dev support.

* am/visual-studio-config-fix:
  contrib/buildsystems: fix Visual Studio Debug configuration

4 years agoxdiffi: fix typos and touch up comments
Johannes Schindelin [Tue, 8 Oct 2019 18:27:52 +0000 (11:27 -0700)] 
xdiffi: fix typos and touch up comments

Inspired by the thoroughly stale https://github.com/git/git/pull/159,
this patch fixes a couple of typos, rewraps and clarifies some comments.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot0000: cover GIT_SKIP_TESTS blindspots
Denton Liu [Tue, 8 Oct 2019 09:22:47 +0000 (02:22 -0700)] 
t0000: cover GIT_SKIP_TESTS blindspots

Currently, the tests for GIT_SKIP_TESTS do not cover the situation where
we skip an entire test suite. The tests also do not cover the situation
where we have GIT_SKIP_TESTS defined but the test suite does not match.

Add two test cases so we cover this blindspot.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosend-pack: never fetch when checking exclusions
Jonathan Tan [Tue, 8 Oct 2019 18:37:39 +0000 (11:37 -0700)] 
send-pack: never fetch when checking exclusions

When building the packfile to be sent, send_pack() is given a list of
remote refs to be used as exclusions. For each ref, it first checks if
the ref exists locally, and if it does, passes it with a "^" prefix to
pack-objects. However, in a partial clone, the check may trigger a lazy
fetch.

The additional commit ancestry information obtained during such fetches
may show that certain objects that would have been sent are already
known to the server, resulting in a smaller pack being sent. But this is
at the cost of fetching from many possibly unrelated refs, and the lazy
fetches do not help at all in the typical case where the client is
up-to-date with the upstream of the branch being pushed.

Ensure that these lazy fetches do not occur.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4014: treat rev-list output as the expected value
Denton Liu [Tue, 8 Oct 2019 09:14:11 +0000 (02:14 -0700)] 
t4014: treat rev-list output as the expected value

In 6bd26f58ea (t4014: use test_line_count() where possible, 2019-08-27),
we converted many test cases to take advantage of the test_line_count()
function. In one conversion, we inverted the expected and actual value
as tested by test_line_count(). Although functionally correct, if
format-patch ever produced incorrect output, the debugging output would
be a bunch of hashes which would be difficult to debug.

Invert the expected and actual values provided to test_line_count() so
that if format-patch produces incorrect output, the debugging output
will be a list of human-readable files instead.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorange-diff: don't segfault with mode-only changes
Thomas Gummerer [Tue, 8 Oct 2019 17:38:43 +0000 (18:38 +0100)] 
range-diff: don't segfault with mode-only changes

In ef283b3699 ("apply: make parse_git_diff_header public", 2019-07-11)
the 'parse_git_diff_header' function was made public and useable by
callers outside of apply.c.

However it was missed that its (then) only caller, 'find_header' did
some error handling, and completing 'struct patch' appropriately.

range-diff then started using this function, and tried to handle this
appropriately itself, but fell short in some cases.  This in turn
would lead to range-diff segfaulting when there are mode-only changes
in a range.

Move the error handling and completing of the struct into the
'parse_git_diff_header' function, so other callers can take advantage
of it.  This fixes the segfault in 'git range-diff'.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotransport: push codepath can take arbitrary repository
Junio C Hamano [Tue, 8 Oct 2019 04:18:24 +0000 (13:18 +0900)] 
transport: push codepath can take arbitrary repository

The previous step added annotations with "the_repository" to various
functions in the push codepath in the transport layer, but they all
can take arbitrary repository pointer, and may be working on a
repository that is not the_repository.  Fix them.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosq_quote_buf_pretty: don't drop empty arguments
Garima Singh [Mon, 7 Oct 2019 19:38:56 +0000 (12:38 -0700)] 
sq_quote_buf_pretty: don't drop empty arguments

Empty arguments passed on the command line can be represented by
a '', however sq_quote_buf_pretty was incorrectly dropping these
arguments altogether. Fix this problem by ensuring that such
arguments are emitted as '' instead.

Signed-off-by: Garima Singh <garima.singh@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: fix the fix to the diff3 common ancestor label
Elijah Newren [Mon, 7 Oct 2019 15:52:11 +0000 (08:52 -0700)] 
merge-recursive: fix the fix to the diff3 common ancestor label

In commit 8e4ec337 ("merge-recursive: fix the diff3 common ancestor
label for virtual commits", 2019-10-01), which was a fix to commit
743474cbfa8b ("merge-recursive: provide a better label for diff3
common ancestor", 2019-08-17), the label for the common ancestor was
changed from always being

         "merged common ancestors"

to instead be based on the number of merge bases and whether the merge
base was a real commit or a virtual one:

    >=2: "merged common ancestors"
      1, via merge_recursive_generic: "constructed merge base"
      1, otherwise: <abbreviated commit hash>
      0: "<empty tree>"

The handling for "constructed merge base" worked by allowing
opt->ancestor to be set in merge_recursive_generic(), so we paid
attention to the setting of that variable in merge_recursive_internal().
Now, for the outer merge, the code flow was simply the following:

ancestor_name = "merged merge bases"
loop over merge_bases: merge_recursive_internal()

The first merge base not needing recursion would determine its own
ancestor_name however necessary and thus run

ancestor_name = $SOMETHING
empty loop over merge_bases...
opt->ancestor = ancestor_name
        merge_trees_internal()

Now, the next set of merge_bases that would need to be merged after this
particular merge had completed would note that opt->ancestor has been
set to something (to a local ancestor_name variable that has since been
popped off the stack), and thus it would run:

... else if (opt->ancestor) {
ancestor_name = opt->ancestor;  /* OOPS! */
        loop over merge_bases: merge_recursive_internal()
        opt->ancestor = ancestor_name
        merge_trees_internal()

This resulted in garbage strings being printed for the virtual merge
bases, which was visible in git.git by just merging commit b744c3af07
into commit 6d8cb22a4f.  There are two ways to fix this: set
opt->ancestor to NULL after using it to avoid re-use, or add a
!opt->priv->call_depth check to the if block for using a pre-defined
opt->ancestor.  Apply both fixes.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoSixth batch
Junio C Hamano [Mon, 7 Oct 2019 02:33:44 +0000 (11:33 +0900)] 
Sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'bw/submodule-helper-usage-fix'
Junio C Hamano [Mon, 7 Oct 2019 02:33:03 +0000 (11:33 +0900)] 
Merge branch 'bw/submodule-helper-usage-fix'

Typofix.

* bw/submodule-helper-usage-fix:
  builtin/submodule--helper: fix usage string for 'update-clone'

4 years agoMerge branch 'dl/honor-cflags-in-hdr-check'
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)] 
Merge branch 'dl/honor-cflags-in-hdr-check'

Dev support.

* dl/honor-cflags-in-hdr-check:
  ci: run `hdr-check` as part of the `Static Analysis` job
  Makefile: emulate compile in $(HCO) target better
  pack-bitmap.h: remove magic number
  promisor-remote.h: include missing header
  apply.h: include missing header

4 years agoMerge branch 'cb/do-not-use-test-cmp-with-a'
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)] 
Merge branch 'cb/do-not-use-test-cmp-with-a'

Test portability fix.

* cb/do-not-use-test-cmp-with-a:
  t4038: Remove non-portable '-a' option passed to test_cmp

4 years agoMerge branch 'cc/multi-promisor'
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)] 
Merge branch 'cc/multi-promisor'

Cleanup.

* cc/multi-promisor:
  promisor-remote: skip move_to_tail when no-op
  promisor-remote.h: drop extern from function declaration

4 years agoMerge branch 'jt/merge-recursive-symlink-is-not-a-dir-in-way'
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)] 
Merge branch 'jt/merge-recursive-symlink-is-not-a-dir-in-way'

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

4 years agoMerge branch 'ps/my-first-contribution-alphasort'
Junio C Hamano [Mon, 7 Oct 2019 02:33:01 +0000 (11:33 +0900)] 
Merge branch 'ps/my-first-contribution-alphasort'

Docfix.

* ps/my-first-contribution-alphasort:
  doc: MyFirstContribution: fix cmd placement instructions

4 years agoMerge branch 'sg/travis-help-debug'
Junio C Hamano [Mon, 7 Oct 2019 02:33:01 +0000 (11:33 +0900)] 
Merge branch 'sg/travis-help-debug'

Dev support update.

* sg/travis-help-debug:
  travis-ci: do not skip successfully tested trees in debug mode

4 years agoMerge branch 'rs/alias-use-copy-array'
Junio C Hamano [Mon, 7 Oct 2019 02:33:01 +0000 (11:33 +0900)] 
Merge branch 'rs/alias-use-copy-array'

Code cleanup.

* rs/alias-use-copy-array:
  git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()

4 years agoMerge branch 'sg/t-helper-gitignore'
Junio C Hamano [Mon, 7 Oct 2019 02:33:00 +0000 (11:33 +0900)] 
Merge branch 'sg/t-helper-gitignore'

Update the way build artifacts in t/helper/ directory are ignored.

* sg/t-helper-gitignore:
  t/helper: ignore only executable files

4 years agoMerge branch 'cc/svn-fe-py-shebang'
Junio C Hamano [Mon, 7 Oct 2019 02:33:00 +0000 (11:33 +0900)] 
Merge branch 'cc/svn-fe-py-shebang'

* cc/svn-fe-py-shebang:
  contrib/svn-fe: fix shebang for svnrdump_sim.py

4 years agoMerge branch 'ah/doc-submodule-ignore-submodules'
Junio C Hamano [Mon, 7 Oct 2019 02:33:00 +0000 (11:33 +0900)] 
Merge branch 'ah/doc-submodule-ignore-submodules'

Docfix.

* ah/doc-submodule-ignore-submodules:
  doc: fix reference to --ignore-submodules

4 years agoMerge branch 'rs/nth-switch-code-simplification'
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)] 
Merge branch 'rs/nth-switch-code-simplification'

Code simplification.

* rs/nth-switch-code-simplification:
  sha1_name: simplify strbuf handling in interpret_nth_prior_checkout()

4 years agoMerge branch 'hb/hg-to-git-py3'
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)] 
Merge branch 'hb/hg-to-git-py3'

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

4 years agoMerge branch 'sg/progress-fix'
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)] 
Merge branch 'sg/progress-fix'

Regression fix for progress output.

* sg/progress-fix:
  Test the progress display
  Revert "progress: use term_clear_line()"

4 years agoMerge branch 'js/doc-patch-text'
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)] 
Merge branch 'js/doc-patch-text'

Docfix.

* js/doc-patch-text:
  diff, log doc: small grammer, format, and language fixes
  diff, log doc: say "patch text" instead of "patches"

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

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

4 years agoMerge branch 'jt/cache-tree-avoid-lazy-fetch-during-merge'
Junio C Hamano [Mon, 7 Oct 2019 02:32:58 +0000 (11:32 +0900)] 
Merge branch 'jt/cache-tree-avoid-lazy-fetch-during-merge'

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

4 years agoMerge branch 'dl/cocci-everywhere'
Junio C Hamano [Mon, 7 Oct 2019 02:32:58 +0000 (11:32 +0900)] 
Merge branch 'dl/cocci-everywhere'

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)

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

* gs/commit-graph-progress:
  commit-graph: add --[no-]progress to write and verify

4 years agoMerge branch 'ms/fetch-follow-tag-optim'
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)] 
Merge branch 'ms/fetch-follow-tag-optim'

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

4 years agoMerge branch 'rs/commit-graph-use-list-count'
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)] 
Merge branch 'rs/commit-graph-use-list-count'

Code cleanup.

* rs/commit-graph-use-list-count:
  commit-graph: use commit_list_count()

4 years agoMerge branch 'rs/nth-parent-parse'
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)] 
Merge branch 'rs/nth-parent-parse'

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"

4 years agoMerge branch 'dl/submodule-set-branch'
Junio C Hamano [Mon, 7 Oct 2019 02:32:56 +0000 (11:32 +0900)] 
Merge branch 'dl/submodule-set-branch'

Docfix.

* dl/submodule-set-branch:
  git-submodule.txt: fix AsciiDoc formatting error

4 years agoMerge branch 'cs/pretty-formats-doc-typofix'
Junio C Hamano [Mon, 7 Oct 2019 02:32:56 +0000 (11:32 +0900)] 
Merge branch 'cs/pretty-formats-doc-typofix'

Doc fix.

* cs/pretty-formats-doc-typofix:
  doc: minor formatting fix

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 agohashmap_entry: remove first member requirement from docs
Eric Wong [Sun, 6 Oct 2019 23:30:43 +0000 (23:30 +0000)] 
hashmap_entry: remove first member requirement from docs

Comments stating that "struct hashmap_entry" must be the first
member in a struct are no longer valid.

Suggested-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap: remove type arg from hashmap_{get,put,remove}_entry
Eric Wong [Sun, 6 Oct 2019 23:30:42 +0000 (23:30 +0000)] 
hashmap: remove type arg from hashmap_{get,put,remove}_entry

Since these macros already take a `keyvar' pointer of a known type,
we can rely on OFFSETOF_VAR to get the correct offset without
relying on non-portable `__typeof__' and `offsetof'.

Argument order is also rearranged, so `keyvar' and `member' are
sequential as they are used as: `keyvar->member'

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoOFFSETOF_VAR macro to simplify hashmap iterators
Eric Wong [Sun, 6 Oct 2019 23:30:41 +0000 (23:30 +0000)] 
OFFSETOF_VAR macro to simplify hashmap iterators

While we cannot rely on a `__typeof__' operator being portable
to use with `offsetof'; we can calculate the pointer offset
using an existing pointer and the address of a member using
pointer arithmetic for compilers without `__typeof__'.

This allows us to simplify usage of hashmap iterator macros
by not having to specify a type when a pointer of that type
is already given.

In the future, list iterator macros (e.g. list_for_each_entry)
may also be implemented using OFFSETOF_VAR to save hackers the
trouble of using container_of/list_entry macros and without
relying on non-portable `__typeof__'.

v3: use `__typeof__' to avoid clang warnings

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap: introduce hashmap_free_entries
Eric Wong [Sun, 6 Oct 2019 23:30:40 +0000 (23:30 +0000)] 
hashmap: introduce hashmap_free_entries

`hashmap_free_entries' behaves like `container_of' and passes
the offset of the hashmap_entry struct to the internal
`hashmap_free_' function, allowing the function to free any
struct pointer regardless of where the hashmap_entry field
is located.

`hashmap_free' no longer takes any arguments aside from
the hashmap itself.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap: hashmap_{put,remove} return hashmap_entry *
Eric Wong [Sun, 6 Oct 2019 23:30:39 +0000 (23:30 +0000)] 
hashmap: hashmap_{put,remove} return hashmap_entry *

And add *_entry variants to perform container_of as necessary
to simplify most callers.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap: use *_entry APIs for iteration
Eric Wong [Sun, 6 Oct 2019 23:30:38 +0000 (23:30 +0000)] 
hashmap: use *_entry APIs for iteration

Inspired by list_for_each_entry in the Linux kernel.
Once again, these are somewhat compromised usability-wise
by compilers lacking __typeof__ support.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_cmp_fn takes hashmap_entry params
Eric Wong [Sun, 6 Oct 2019 23:30:37 +0000 (23:30 +0000)] 
hashmap_cmp_fn takes hashmap_entry params

Another step in eliminating the requirement of hashmap_entry
being the first member of a struct.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_get{,_from_hash} return "struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:36 +0000 (23:30 +0000)] 
hashmap_get{,_from_hash} return "struct hashmap_entry *"

Update callers to use hashmap_get_entry, hashmap_get_entry_from_hash
or container_of as appropriate.

This is another step towards eliminating the requirement of
hashmap_entry being the first field in a struct.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap: use *_entry APIs to wrap container_of
Eric Wong [Sun, 6 Oct 2019 23:30:35 +0000 (23:30 +0000)] 
hashmap: use *_entry APIs to wrap container_of

Using `container_of' can be verbose and choosing names for
intermediate "struct hashmap_entry" pointers is a hard problem.
So introduce "*_entry" APIs inspired by similar linked-list
APIs in the Linux kernel.

Unfortunately, `__typeof__' is not portable C, so we need an
extra parameter to specify the type.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_get_next returns "struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:34 +0000 (23:30 +0000)] 
hashmap_get_next returns "struct hashmap_entry *"

This is a step towards removing the requirement for
hashmap_entry being the first field of a struct.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agointroduce container_of macro
Eric Wong [Sun, 6 Oct 2019 23:30:33 +0000 (23:30 +0000)] 
introduce container_of macro

This macro is popular within the Linux kernel for supporting
intrusive data structures such as linked lists, red-black trees,
and chained hash tables while allowing the compiler to do
type checking.

Later patches will use container_of() to remove the limitation
of "hashmap_entry" being location-dependent. This will complete
the transition to compile-time type checking for the hashmap API.

This macro already exists in our source as "list_entry" in
list.h and making "list_entry" an alias to "container_of"
as the Linux kernel has done is a possibility.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_put takes "struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:32 +0000 (23:30 +0000)] 
hashmap_put takes "struct hashmap_entry *"

This is less error-prone than "void *" as the compiler now
detects invalid types being passed.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_remove takes "const struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:31 +0000 (23:30 +0000)] 
hashmap_remove takes "const struct hashmap_entry *"

This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_get takes "const struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:30 +0000 (23:30 +0000)] 
hashmap_get takes "const struct hashmap_entry *"

This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_add takes "struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:29 +0000 (23:30 +0000)] 
hashmap_add takes "struct hashmap_entry *"

This is less error-prone than "void *" as the compiler now
detects invalid types being passed.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_get_next takes "const struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:28 +0000 (23:30 +0000)] 
hashmap_get_next takes "const struct hashmap_entry *"

This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agohashmap_entry_init takes "struct hashmap_entry *"
Eric Wong [Sun, 6 Oct 2019 23:30:27 +0000 (23:30 +0000)] 
hashmap_entry_init takes "struct hashmap_entry *"

C compilers do type checking to make life easier for us.  So
rely on that and update all hashmap_entry_init callers to take
"struct hashmap_entry *" to avoid future bugs while improving
safety and readability.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopackfile: use hashmap_entry in delta_base_cache_entry
Eric Wong [Sun, 6 Oct 2019 23:30:26 +0000 (23:30 +0000)] 
packfile: use hashmap_entry in delta_base_cache_entry

This hashmap_entry_init function is intended to take a
hashmap_entry struct pointer, not a hashmap struct pointer.

This was not noticed because hashmap_entry_init takes a "void *"
arg instead of "struct hashmap_entry *", and the hashmap struct
is larger and can be cast into a hashmap_entry struct without
data corruption.

This has the beneficial side effect of reducing the size of
a delta_base_cache_entry from 104 bytes to 72 bytes on 64-bit
systems.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agococcicheck: detect hashmap_entry.hash assignment
Eric Wong [Sun, 6 Oct 2019 23:30:25 +0000 (23:30 +0000)] 
coccicheck: detect hashmap_entry.hash assignment

Assigning hashmap_entry.hash manually leaves hashmap_entry.next
uninitialized, which can be dangerous once the hashmap_entry is
inserted into a hashmap.   Detect those assignments and use
hashmap_entry_init, instead.

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodiff: use hashmap_entry_init on moved_entry.ent
Eric Wong [Sun, 6 Oct 2019 23:30:24 +0000 (23:30 +0000)] 
diff: use hashmap_entry_init on moved_entry.ent

Otherwise, the hashmap_entry.next field appears to remain
uninitialized, which can lead to problems when
add_lines_to_move_detection calls hashmap_add.

I found this through manual inspection when converting
hashmap_add callers to take "struct hashmap_entry *".

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotests: remove "cat foo" before "test_i18ngrep bar foo"
René Scharfe [Sun, 6 Oct 2019 13:26:42 +0000 (15:26 +0200)] 
tests: remove "cat foo" before "test_i18ngrep bar foo"

Some tests print a file before searching for a pattern using
test_i18ngrep.  This is useful when debugging tests with --verbose when
the pattern is not found as expected.

Since 63b1a175ee (t: make 'test_i18ngrep' more informative on failure,
2018-02-08) test_i18ngrep already shows the contents of a file that
doesn't match the expected pattern, though.

So don't bother doing the same unconditionally up-front.  The contents
are not interesting if the expected pattern is found, and showing it
twice if it doesn't match is of no use.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogit-p4: auto-delete named temporary file
Philip.McGraw [Tue, 27 Aug 2019 03:43:58 +0000 (06:43 +0300)] 
git-p4: auto-delete named temporary file

Avoid double-open exceptions on Windows platform when
calculating for lfs compressed size threshold
(git-p4.largeFileCompressedThreshold) comparisons.

Take new approach using the NamedTemporaryFile()
file-like object as input to the ZipFile() which
auto-deletes after implicit close leaving with scope.

Original code had double-open exception on Windows
platform because file still open from NamedTemporaryFile()
using generated filename instead of object.

Thanks to Andrey for patiently suggesting several
iterations on this change for avoiding exceptions!

Also print error details after resulting IOError to make
debugging cause of exception less mysterious when it has
nothing to do with "git version recent enough."

Signed-off-by: Philip.McGraw <Philip.McGraw@bentley.com>
Reviewed-by: Andrey Mazo <ahippo@yandex.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agogit-rev-list.txt: prune options in synopsis
Denton Liu [Sat, 5 Oct 2019 00:13:08 +0000 (17:13 -0700)] 
git-rev-list.txt: prune options in synopsis

The synopsis section in git-rev-list.txt has grown to be a huge list
that probably needs its own synopsis. Since the list is huge, users may
be given the false impression that the list is complete, however it is
not. It is missing many of the available options.

Since the list of options in the synopsis is not only annoying but
actively harmful, replace it with `[<options>]` so users know to
explicitly look through the documentation for further information.

While we're at it, update the optional path notation so that it is more
modern.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoDocumentation: update the location of the git-gui repo
Pratyush Yadav [Sat, 5 Oct 2019 12:57:42 +0000 (18:27 +0530)] 
Documentation: update the location of the git-gui repo

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoconvert: fix handling of dashless UTF prefix in validate_encoding()
René Scharfe [Fri, 4 Oct 2019 19:25:50 +0000 (21:25 +0200)] 
convert: fix handling of dashless UTF prefix in validate_encoding()

Strip "UTF" and an optional dash from the start of 'upper' without
passing a NULL pointer to skip_prefix() in the second call, as it cannot
handle that.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci: also build and test with MS Visual Studio on Azure Pipelines
Johannes Schindelin [Fri, 4 Oct 2019 15:09:36 +0000 (08:09 -0700)] 
ci: also build and test with MS Visual Studio on Azure Pipelines

... because we can, now. Technically, we actually build using `MSBuild`,
which is however pretty close to building interactively in Visual
Studio.

As there is no convenient way to run Git's test suite in Visual Studio,
we unpack a Portable Git to run it, using the just-added test helper to
allow running test scripts in parallel.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci: really use shallow clones on Azure Pipelines
Johannes Schindelin [Fri, 4 Oct 2019 15:09:35 +0000 (08:09 -0700)] 
ci: really use shallow clones on Azure Pipelines

This was a left-over from the previous YAML schema, and it no longer
works. The problem was noticed while editing `azure-pipelines.yml` in VS
Code with the very helpful "Azure Pipelines" extension (syntax
highlighting and intellisense for `azure-pipelines.yml`...).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotests: let --immediate and --write-junit-xml play well together
Johannes Schindelin [Fri, 4 Oct 2019 15:09:34 +0000 (08:09 -0700)] 
tests: let --immediate and --write-junit-xml play well together

When the `--immediate` option is in effect, any test failure will
immediately exit the test script. Together with `--write-junit-xml`, we
will want the JUnit-style `.xml` file to be finalized (and not leave the
XML incomplete). Let's make it so.

This comes in particularly handy when trying to debug via Azure
Pipelines, where the JUnit-style XML is consumed to present the test
results in an informative and helpful way.

While at it, also handle the `error()` code path.

The only remaining code path that sets `GIT_EXIT_OK` happens whenever
the trash directory could not be set up, i.e. long before the JUnit XML
was written, therefore we should _not_ try to finalize that XML in that
case.

It is tempting to change the `immediate` code path to just hand off to
`error`, simplifying the code in the process. That would, however,
result in a change of behavior (an additional error message) in the test
suite, which is outside of the purview of the current patch series: its
goal is to allow building Git with Visual Studio and testing it with a
portable version of Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotest-tool run-command: learn to run (parts of) the testsuite
Johannes Schindelin [Fri, 4 Oct 2019 15:09:33 +0000 (08:09 -0700)] 
test-tool run-command: learn to run (parts of) the testsuite

Git for Windows jumps through hoops to provide a development environment
that allows to build Git and to run its test suite. To that end, an
entire MSYS2 system, including GNU make and GCC is offered as "the Git
for Windows SDK". It does come at a price: an initial download of said
SDK weighs in with several hundreds of megabytes, and the unpacked SDK
occupies ~2GB of disk space.

A much more native development environment on Windows is Visual Studio.
To help contributors use that environment, we already have a Makefile
target `vcxproj` that generates a commit with project files (and other
generated files), and Git for Windows' `vs/master` branch is
continuously re-generated using that target.

The idea is to allow building Git in Visual Studio, and to run
individual tests using a Portable Git.

The one missing thing is a way to run the entire test suite: neither
`make` nor `prove` are required to run Git, therefore Git for Windows
does not support those commands in the Portable Git.

To help with that, add a simple test helper that exercises the
`run_processes_parallel()` function to allow for running test scripts in
parallel (which is really necessary, especially on Windows, as Git's
test suite takes such a long time to run).

This will also come in handy for the upcoming change to our Azure
Pipeline: we will use this helper in a Portable Git to test the Visual
Studio build of Git.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agovcxproj: include more generated files
Johannes Schindelin [Fri, 4 Oct 2019 15:09:32 +0000 (08:09 -0700)] 
vcxproj: include more generated files

In the CI builds, we bundle all generated files into a so-called
artifacts `.tar` file, so that the test phase can fan out into multiple
parallel builds.

This patch makes sure that all files are included in the `vcxproj`
target which are needed for that artifacts `.tar` file.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agovcxproj: only copy `git-remote-http.exe` once it was built
Johannes Schindelin [Fri, 4 Oct 2019 15:09:31 +0000 (08:09 -0700)] 
vcxproj: only copy `git-remote-http.exe` once it was built

In b18ae14a8f6 (vcxproj: also link-or-copy builtins, 2019-07-29), we
started to copy or hard-link the built-ins as a post-build step of the
`git` project.

At the same time, we tried to copy or hard-link `git-remote-http.exe`,
but it is quite possible that it was not built at that time.

Let's move that latter task into a post-install step of the
`git-remote-http` project instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: work around a bug in GetEnvironmentVariable()
Johannes Schindelin [Fri, 4 Oct 2019 15:09:30 +0000 (08:09 -0700)] 
msvc: work around a bug in GetEnvironmentVariable()

The return value of that function is 0 both for variables that are
unset, as well as for variables whose values are empty. To discern those
two cases, one has to call `GetLastError()`, whose return value is
`ERROR_ENVVAR_NOT_FOUND` and `ERROR_SUCCESS`, respectively.

Except that it is not actually set to `ERROR_SUCCESS` in the latter
case, apparently, but the last error value seems to be simply unchanged.

To work around this, let's just re-set the last error value just before
inspecting the environment variable.

This fixes a problem that triggers failures in t3301-notes.sh (where we
try to override config settings by passing empty values for certain
environment variables).

This problem is hidden in the MINGW build by the fact that older
MSVC runtimes (such as the one used by MINGW builds) have a `calloc()`
that re-sets the last error value in case of success, while newer
runtimes set the error value only if `NULL` is returned by that
function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: handle DEVELOPER=1
Johannes Schindelin [Fri, 4 Oct 2019 15:09:30 +0000 (08:09 -0700)] 
msvc: handle DEVELOPER=1

We frequently build Git using the `DEVELOPER=1` make setting as a
shortcut to enable all kinds of more stringent compiler warnings.

Those compiler warnings are relatively specific to GCC, though, so let's
try our best to translate them to the equivalent options to pass to MS
Visual C++'s `cl.exe`.

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