]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agoMerge branch 'pw/rebase-abort-clean-rewritten'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)] 
Merge branch 'pw/rebase-abort-clean-rewritten'

"git rebase --abort" used to leave refs/rewritten/ when concluding
"git rebase -r", which has been corrected.

* pw/rebase-abort-clean-rewritten:
  rebase --abort/--quit: cleanup refs/rewritten
  sequencer: return errors from sequencer_remove_state()
  rebase: warn if state directory cannot be removed
  rebase: fix a memory leak

4 years agoMerge branch 'am/p4-branches-excludes'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'am/p4-branches-excludes'

"git p4" update.

* am/p4-branches-excludes:
  git-p4: respect excluded paths when detecting branches
  git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"
  git-p4: don't exclude other files with same prefix
  git-p4: add failing test for "don't exclude other files with same prefix"
  git-p4: don't groom exclude path list on every commit
  git-p4: match branches case insensitively if configured
  git-p4: add failing test for "git-p4: match branches case insensitively if configured"
  git-p4: detect/prevent infinite loop in gitCommitByP4Change()

4 years agoMerge branch 'tg/stash-ref-by-index-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'tg/stash-ref-by-index-fix'

"git stash show 23" used to work, but no more after getting
rewritten in C; this regression has been corrected.

* tg/stash-ref-by-index-fix:
  stash: fix show referencing stash index

4 years agoMerge branch 'cb/mkstemps-uint-type-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'cb/mkstemps-uint-type-fix'

Variable type fix.

* cb/mkstemps-uint-type-fix:
  wrapper: avoid undefined behaviour in macOS

4 years agoMerge branch 'jk/trailers-use-config'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'jk/trailers-use-config'

"git interpret-trailers" always treated '#' as the comment
character, regardless of core.commentChar setting, which has been
corrected.

* jk/trailers-use-config:
  interpret-trailers: load default config

4 years agoMerge branch 'js/t3404-typofix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:39 +0000 (15:25 -0700)] 
Merge branch 'js/t3404-typofix'

Typofix.

* js/t3404-typofix:
  t3404: fix a typo

4 years agoMerge branch 'pw/doc-synopsis-markup-opmode-options'
Junio C Hamano [Tue, 9 Jul 2019 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'pw/doc-synopsis-markup-opmode-options'

Docfix.

* pw/doc-synopsis-markup-opmode-options:
  show --continue/skip etc. consistently in synopsis

4 years agoMerge branch 'rs/copy-array'
Junio C Hamano [Tue, 9 Jul 2019 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'rs/copy-array'

Code clean-up.

* rs/copy-array:
  use COPY_ARRAY for copying arrays
  coccinelle: use COPY_ARRAY for copying arrays

4 years agoMerge branch 'cb/fsmonitor-intfix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'cb/fsmonitor-intfix'

Variable type fix.

* cb/fsmonitor-intfix:
  fsmonitor: avoid signed integer overflow / infinite loop

4 years agoMerge branch 'rs/avoid-overflow-in-midpoint-computation'
Junio C Hamano [Tue, 9 Jul 2019 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'rs/avoid-overflow-in-midpoint-computation'

Code clean-up to avoid signed integer overlaps during binary search.

* rs/avoid-overflow-in-midpoint-computation:
  cleanup: fix possible overflow errors in binary search, part 2

4 years agoMerge branch 'pw/add-p-recount'
Junio C Hamano [Tue, 9 Jul 2019 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'pw/add-p-recount'

"git checkout -p" needs to selectively apply a patch in reverse,
which did not work well.

* pw/add-p-recount:
  add -p: fix checkout -p with pathological context

4 years agoMerge branch 'ds/close-object-store'
Junio C Hamano [Tue, 9 Jul 2019 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'ds/close-object-store'

The commit-graph file is now part of the "files that the runtime
may keep open file descriptors on, all of which would need to be
closed when done with the object store", and the file descriptor to
an existing commit-graph file now is closed before "gc" finalizes a
new instance to replace it.

* ds/close-object-store:
  packfile: rename close_all_packs to close_object_store
  packfile: close commit-graph in close_all_packs
  commit-graph: use raw_object_store when closing

4 years agoMerge branch 'ds/commit-graph-write-refactor'
Junio C Hamano [Tue, 9 Jul 2019 22:25:36 +0000 (15:25 -0700)] 
Merge branch 'ds/commit-graph-write-refactor'

Renamed from commit-graph-format-v2 and changed scope.

* ds/commit-graph-write-refactor:
  commit-graph: extract write_commit_graph_file()
  commit-graph: extract copy_oids_to_commits()
  commit-graph: extract count_distinct_commits()
  commit-graph: extract fill_oids_from_all_packs()
  commit-graph: extract fill_oids_from_commit_hex()
  commit-graph: extract fill_oids_from_packs()
  commit-graph: create write_commit_graph_context
  commit-graph: remove Future Work section
  commit-graph: collapse parameters into flags
  commit-graph: return with errors during write
  commit-graph: fix the_repository reference

4 years agoMerge branch 'sg/trace2-rename'
Junio C Hamano [Tue, 9 Jul 2019 22:25:36 +0000 (15:25 -0700)] 
Merge branch 'sg/trace2-rename'

Dev support update to help tracing out tests.

* sg/trace2-rename:
  trace2: correct typo in technical documentation
  Revert "test-lib: whitelist GIT_TR2_* in the environment"

4 years agoMerge branch 'nd/completion-no-cache-failure'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'nd/completion-no-cache-failure'

An incorrect list of options was cached after command line
completion failed (e.g. trying to complete a command that requires
a repository outside one), which has been corrected.

* nd/completion-no-cache-failure:
  completion: do not cache if --git-completion-helper fails

4 years agoMerge branch 'js/mergetool-optim'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'js/mergetool-optim'

"git mergetool" and its tests now spawn fewer subprocesses.

* js/mergetool-optim:
  mergetool: use shell variable magic instead of `awk`
  mergetool: dissect strings with shell variable magic instead of `expr`
  t7610-mergetool: use test_cmp instead of test $(cat file) = $txt
  t7610-mergetool: do not place pipelines headed by `yes` in subshells

4 years agoMerge branch 'mo/hpux-dynpath'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'mo/hpux-dynpath'

Auto-detect how to tell HP-UX aCC where to use dynamically linked
libraries from at runtime.

* mo/hpux-dynpath:
  configure: Detect linking style for HP aCC on HP-UX

4 years agoMerge branch 'dl/config-alias-doc'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'dl/config-alias-doc'

Doc update.

* dl/config-alias-doc:
  config/alias.txt: document alias accepting non-command first word
  config/alias.txt: change " and ' to `

4 years agoMerge branch 'tm/tag-gpgsign-config'
Junio C Hamano [Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)] 
Merge branch 'tm/tag-gpgsign-config'

A new tag.gpgSign configuration variable turns "git tag -a" into
"git tag -s".

* tm/tag-gpgsign-config:
  tag: add tag.gpgSign config option to force all tags be GPG-signed

4 years agoMerge branch 'fc/fetch-with-import-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)] 
Merge branch 'fc/fetch-with-import-fix'

Code restructuring during 2.20 period broke fetching tags via
"import" based transports.

* fc/fetch-with-import-fix:
  fetch: fix regression with transport helpers
  fetch: make the code more understandable
  fetch: trivial cleanup
  t5801 (remote-helpers): add test to fetch tags
  t5801 (remote-helpers): cleanup refspec stuff

4 years agoMerge branch 'po/doc-branch'
Junio C Hamano [Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)] 
Merge branch 'po/doc-branch'

Doc update.

* po/doc-branch:
  doc branch: provide examples for listing remote tracking branches

4 years agoMerge branch 'nb/branch-show-other-worktrees-head'
Junio C Hamano [Tue, 9 Jul 2019 22:25:33 +0000 (15:25 -0700)] 
Merge branch 'nb/branch-show-other-worktrees-head'

"git branch --list" learned to show branches that are checked out
in other worktrees connected to the same repository prefixed with
'+', similar to the way the currently checked out branch is shown
with '*' in front.

* nb/branch-show-other-worktrees-head:
  branch: add worktree info on verbose output
  branch: update output to include worktree info
  ref-filter: add worktreepath atom

4 years agotrace2: correct typo in technical documentation
Carlo Marcelo Arenas Belón [Wed, 26 Jun 2019 20:03:03 +0000 (13:03 -0700)] 
trace2: correct typo in technical documentation

an apparent typo for the environment variable was included with 81567caf87
("trace2: update docs to describe system/global config settings",
2019-04-15), and was missed when renamed variables by e4b75d6a1d
("trace2: rename environment variables to GIT_TRACE2*", 2019-05-19)

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe third batch
Junio C Hamano [Fri, 21 Jun 2019 18:26:11 +0000 (11:26 -0700)] 
The third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'mo/clang-format-for-each-update'
Junio C Hamano [Fri, 21 Jun 2019 18:24:12 +0000 (11:24 -0700)] 
Merge branch 'mo/clang-format-for-each-update'

The list of for-each like macros used by clang-format has been
updated.

* mo/clang-format-for-each-update:
  clang-format: use git grep to generate the ForEachMacros list

4 years agoMerge branch 'md/url-parse-harden'
Junio C Hamano [Fri, 21 Jun 2019 18:24:12 +0000 (11:24 -0700)] 
Merge branch 'md/url-parse-harden'

The URL decoding code has been updated to avoid going past the end
of the string while parsing %-<hex>-<hex> sequence.

* md/url-parse-harden:
  url: do not allow %00 to represent NUL in URLs
  url: do not read past end of buffer

4 years agoMerge branch 'an/ignore-doc-update'
Junio C Hamano [Fri, 21 Jun 2019 18:24:11 +0000 (11:24 -0700)] 
Merge branch 'an/ignore-doc-update'

The description about slashes in gitignore patterns (used to
indicate things like "anchored to this level only" and "only
matches directories") has been revamped.

* an/ignore-doc-update:
  gitignore.txt: make slash-rules more readable

4 years agoMerge branch 'ab/hash-object-doc'
Junio C Hamano [Fri, 21 Jun 2019 18:24:11 +0000 (11:24 -0700)] 
Merge branch 'ab/hash-object-doc'

Doc update.

* ab/hash-object-doc:
  hash-object doc: stop mentioning git-cvsimport

4 years agoMerge branch 'cm/send-email-document-req-modules'
Junio C Hamano [Fri, 21 Jun 2019 18:24:10 +0000 (11:24 -0700)] 
Merge branch 'cm/send-email-document-req-modules'

A doc update.

* cm/send-email-document-req-modules:
  send-email: update documentation of required Perl modules

4 years agoMerge branch 'md/list-objects-filter-parse-msgfix'
Junio C Hamano [Fri, 21 Jun 2019 18:24:10 +0000 (11:24 -0700)] 
Merge branch 'md/list-objects-filter-parse-msgfix'

Make an end-user facing message localizable.

* md/list-objects-filter-parse-msgfix:
  list-objects-filter-options: error is localizeable

4 years agoMerge branch 'md/list-objects-filter-memfix'
Junio C Hamano [Fri, 21 Jun 2019 18:24:09 +0000 (11:24 -0700)] 
Merge branch 'md/list-objects-filter-memfix'

The filter_data used in the list-objects-filter (which manages a
lazily sparse clone repository) did not use the dynamic array API
correctly---'nr' is supposed to point at one past the last element
of the array in use.  This has been corrected.

* md/list-objects-filter-memfix:
  list-objects-filter: correct usage of ALLOC_GROW

4 years agoMerge branch 'jt/partial-clone-missing-ref-delta-base'
Junio C Hamano [Fri, 21 Jun 2019 18:24:09 +0000 (11:24 -0700)] 
Merge branch 'jt/partial-clone-missing-ref-delta-base'

"git fetch" into a lazy clone forgot to fetch base objects that are
necessary to complete delta in a thin packfile, which has been
corrected.

* jt/partial-clone-missing-ref-delta-base:
  t5616: cover case of client having delta base
  t5616: use correct flag to check object is missing
  index-pack: prefetch missing REF_DELTA bases
  t5616: refactor packfile replacement

4 years agoMerge branch 'ml/userdiff-rust'
Junio C Hamano [Fri, 21 Jun 2019 18:24:08 +0000 (11:24 -0700)] 
Merge branch 'ml/userdiff-rust'

The pattern "git diff/grep" use to extract funcname and words
boundary for Rust has been added.

* ml/userdiff-rust:
  userdiff: two simplifications of patterns for rust
  userdiff: add built-in pattern for rust

4 years agostash: fix show referencing stash index
Thomas Gummerer [Sat, 15 Jun 2019 11:26:18 +0000 (12:26 +0100)] 
stash: fix show referencing stash index

In the conversion of 'stash show' to C in dc7bd382b1 ("stash: convert
show to builtin", 2019-02-25), 'git stash show <n>', where n is the
index of a stash got broken, if n is not a file or a valid revision by
itself.

'stash show' accepts any flag 'git diff' accepts for changing the
output format.  Internally we use 'setup_revisions()' to parse these
command line flags.  Currently we pass the whole argv through to
'setup_revisions()', which includes the stash index.

As the stash index is not a valid revision or a file in the working
tree in most cases however, this 'setup_revisions()' call (and thus
the whole command) ends up failing if we use this form of 'git stash
show'.

Instead of passing the whole argv to 'setup_revisions()', only pass
the flags (and the command name) through, while excluding the stash
reference.  The stash reference is parsed (and validated) in
'get_stash_info()' already.

This separate parsing also means that we currently do produce the
correct output if the command succeeds.

Reported-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agowrapper: avoid undefined behaviour in macOS
Carlo Marcelo Arenas Belón [Sun, 16 Jun 2019 18:40:03 +0000 (11:40 -0700)] 
wrapper: avoid undefined behaviour in macOS

0620b39b3b ("compat: add a mkstemps() compatibility function", 2009-05-31)
included a function based on code from libiberty which would result in
undefined behaviour in platforms where timeval's tv_usec is a 32-bit signed
type as shown by:

wrapper.c:505:31: runtime error: left shift of 594546 by 16 places cannot be represented in type '__darwin_suseconds_t' (aka 'int')

interestingly the version of this code from gcc never had this bug and the
code had a cast that would had prevented the issue (at least in 64-bit
platforms) but was misapplied.

change the cast to uint64_t so it also works in 32-bit platforms.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agointerpret-trailers: load default config
Jeff King [Wed, 19 Jun 2019 03:37:28 +0000 (23:37 -0400)] 
interpret-trailers: load default config

The interpret-trailers program does not do the usual loading of config
via git_default_config(), and thus does not respect many of the usual
options. In particular, we will not load core.commentChar, even though
the underlying trailer code uses its value.

This can be seen in the accompanying test, where setting
core.commentChar to anything besides "#" results in a failure to treat
the comments correctly.

Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoshow --continue/skip etc. consistently in synopsis
Phillip Wood [Mon, 17 Jun 2019 09:17:09 +0000 (10:17 +0100)] 
show --continue/skip etc. consistently in synopsis

Command mode options that the user can choose one among many are
listed like this in the documentation:

    git am (--continue | --skip | --abort | --quit)

They are listed on a single line and in parenthesis, because they
are not optional.

But documentation pages for some commands deviate from this norm.
Fix the merge and rebase docs to match this style.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agouse COPY_ARRAY for copying arrays
René Scharfe [Sat, 15 Jun 2019 18:36:35 +0000 (20:36 +0200)] 
use COPY_ARRAY for copying arrays

Convert calls of memcpy(3) to use COPY_ARRAY, which shortens and
simplifies the code a bit.

Patch generated by Coccinelle and contrib/coccinelle/array.cocci.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agococcinelle: use COPY_ARRAY for copying arrays
René Scharfe [Sat, 15 Jun 2019 18:32:58 +0000 (20:32 +0200)] 
coccinelle: use COPY_ARRAY for copying arrays

The current semantic patch for COPY_ARRAY transforms memcpy(3) calls on
pointers, but Coccinelle distinguishes them from arrays.  It already
contains three rules to handle the options for sizeof (i.e. source,
destination and type), and handling arrays as source and destination
would require four times as many rules if we enumerated all cases.

We also don't handle array subscripts, and supporting that would
increase the number of rules by another factor of four.  (An isomorphism
telling Coccinelle that "sizeof x[...]" is equivalent to "sizeof *x"
would be nice..)

Support arrays and array subscripts, but keep the number of rules down
by adding normalization steps: First turn array subscripts into
derefences, then determine the types of expressions used with sizeof and
replace them with these types, and then convert the different possible
combinations of arrays and pointers with memcpy(3) to COPY_ARRAY.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofsmonitor: avoid signed integer overflow / infinite loop
Carlo Marcelo Arenas Belón [Sat, 15 Jun 2019 16:11:35 +0000 (09:11 -0700)] 
fsmonitor: avoid signed integer overflow / infinite loop

883e248b8a ("fsmonitor: teach git to optionally utilize a file system
monitor to speed up detecting new or changed files.", 2017-09-22) uses
an int in a loop that would wrap if index_state->cache_nr (unsigned)
is bigger than INT_MAX

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe second batch
Junio C Hamano [Mon, 17 Jun 2019 17:16:10 +0000 (10:16 -0700)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'xl/record-partial-clone-origin'
Junio C Hamano [Mon, 17 Jun 2019 17:15:20 +0000 (10:15 -0700)] 
Merge branch 'xl/record-partial-clone-origin'

When creating a partial clone, the object filtering criteria is
recorded for the origin of the clone, but this incorrectly used a
hardcoded name "origin" to name that remote; it has been corrected
to honor the "--origin <name>" option.

* xl/record-partial-clone-origin:
  clone: respect user supplied origin name when setting up partial clone

4 years agoMerge branch 'pb/request-pull-verify-remote-ref'
Junio C Hamano [Mon, 17 Jun 2019 17:15:20 +0000 (10:15 -0700)] 
Merge branch 'pb/request-pull-verify-remote-ref'

"git request-pull" learned to warn when the ref we ask them to pull
from in the local repository and in the published repository are
different.

* pb/request-pull-verify-remote-ref:
  request-pull: warn if the remote object is not the same as the local one
  request-pull: quote regex metacharacters in local ref

4 years agoMerge branch 'mm/p4-unshelve-windows-fix'
Junio C Hamano [Mon, 17 Jun 2019 17:15:19 +0000 (10:15 -0700)] 
Merge branch 'mm/p4-unshelve-windows-fix'

The command line to invoke a "git cat-file" command from inside
"git p4" was not properly quoted to protect a caret and running a
broken command on Windows, which has been corrected.

* mm/p4-unshelve-windows-fix:
  p4 unshelve: fix "Not a valid object name HEAD0" on Windows

4 years agoMerge branch 'po/git-help-on-git-itself'
Junio C Hamano [Mon, 17 Jun 2019 17:15:19 +0000 (10:15 -0700)] 
Merge branch 'po/git-help-on-git-itself'

"git help git" was hard to discover (well, at least for some
people).

* po/git-help-on-git-itself:
  Doc: git.txt: remove backticks from link and add git-scm.com/docs
  git.c: show usage for accessing the git(1) help page

4 years agoMerge branch 'es/first-contrib-tutorial'
Junio C Hamano [Mon, 17 Jun 2019 17:15:18 +0000 (10:15 -0700)] 
Merge branch 'es/first-contrib-tutorial'

A new tutorial targetting specifically aspiring git-core
developers.

* es/first-contrib-tutorial:
  doc: add some nit fixes to MyFirstContribution
  documentation: add anchors to MyFirstContribution
  documentation: add tutorial for first contribution

4 years agoMerge branch 'bb/unicode-12.1-reiwa'
Junio C Hamano [Mon, 17 Jun 2019 17:15:18 +0000 (10:15 -0700)] 
Merge branch 'bb/unicode-12.1-reiwa'

Update to Unicode 12.1 width table.

* bb/unicode-12.1-reiwa:
  unicode: update the width tables to Unicode 12.1

4 years agoMerge branch 'sw/git-p4-unshelve-branched-files'
Junio C Hamano [Mon, 17 Jun 2019 17:15:18 +0000 (10:15 -0700)] 
Merge branch 'sw/git-p4-unshelve-branched-files'

"git p4" update.

* sw/git-p4-unshelve-branched-files:
  git-p4: allow unshelving of branched files

4 years agoMerge branch 'js/fsmonitor-unflake'
Junio C Hamano [Mon, 17 Jun 2019 17:15:17 +0000 (10:15 -0700)] 
Merge branch 'js/fsmonitor-unflake'

The data collected by fsmonitor was not properly written back to
the on-disk index file, breaking t7519 tests occasionally, which
has been corrected.

* js/fsmonitor-unflake:
  mark_fsmonitor_valid(): mark the index as changed if needed
  fill_stat_cache_info(): prepare for an fsmonitor fix

4 years agoMerge branch 'ds/topo-traversal-using-commit-graph'
Junio C Hamano [Mon, 17 Jun 2019 17:15:17 +0000 (10:15 -0700)] 
Merge branch 'ds/topo-traversal-using-commit-graph'

Prepare use of reachability index in topological walker that works
on a range (A..B).

* ds/topo-traversal-using-commit-graph:
  revision: keep topo-walk free of unintersting commits
  revision: use generation for A..B --topo-order queries

4 years agoMerge branch 'bl/userdiff-octave'
Junio C Hamano [Mon, 17 Jun 2019 17:15:17 +0000 (10:15 -0700)] 
Merge branch 'bl/userdiff-octave'

The pattern "git diff/grep" use to extract funcname and words
boundary for Matlab has been extend to cover Octave, which is more
or less equivalent.

* bl/userdiff-octave:
  userdiff: fix grammar and style issues
  userdiff: add Octave

4 years agoMerge branch 'ba/clone-remote-submodules'
Junio C Hamano [Mon, 17 Jun 2019 17:15:17 +0000 (10:15 -0700)] 
Merge branch 'ba/clone-remote-submodules'

"git clone --recurse-submodules" learned to set up the submodules
to ignore commit object names recorded in the superproject gitlink
and instead use the commits that happen to be at the tip of the
remote-tracking branches from the get-go, by passing the new
"--remote-submodules" option.

* ba/clone-remote-submodules:
  clone: add `--remote-submodules` flag

4 years agoMerge branch 'vv/merge-squash-with-explicit-commit'
Junio C Hamano [Mon, 17 Jun 2019 17:15:17 +0000 (10:15 -0700)] 
Merge branch 'vv/merge-squash-with-explicit-commit'

"git merge --squash" is designed to update the working tree and the
index without creating the commit, and this cannot be countermanded
by adding the "--commit" option; the command now refuses to work
when both options are given.

* vv/merge-squash-with-explicit-commit:
  merge: refuse --commit with --squash

4 years agoMerge branch 'js/bundle-verify-require-object-store'
Junio C Hamano [Mon, 17 Jun 2019 17:15:16 +0000 (10:15 -0700)] 
Merge branch 'js/bundle-verify-require-object-store'

"git bundle verify" needs to see if prerequisite objects exist in
the receiving repository, but the command did not check if we are
in a repository upfront, which has been corrected.

* js/bundle-verify-require-object-store:
  bundle verify: error out if called without an object database

4 years agoMerge branch 'js/bisect-helper-check-get-oid-return-value'
Junio C Hamano [Mon, 17 Jun 2019 17:15:16 +0000 (10:15 -0700)] 
Merge branch 'js/bisect-helper-check-get-oid-return-value'

Code cleanup.

* js/bisect-helper-check-get-oid-return-value:
  bisect--helper: verify HEAD could be parsed before continuing

4 years agoMerge branch 'jk/am-i-resolved-fix'
Junio C Hamano [Mon, 17 Jun 2019 17:15:15 +0000 (10:15 -0700)] 
Merge branch 'jk/am-i-resolved-fix'

"git am -i --resolved" segfaulted after trying to see a commit as
if it were a tree, which has been corrected.

* jk/am-i-resolved-fix:
  am: fix --interactive HEAD tree resolution
  am: drop tty requirement for --interactive
  am: read interactive input from stdin
  am: simplify prompt response handling

4 years agoMerge branch 'jk/HEAD-symref-in-xfer-namespaces'
Junio C Hamano [Mon, 17 Jun 2019 17:15:15 +0000 (10:15 -0700)] 
Merge branch 'jk/HEAD-symref-in-xfer-namespaces'

The server side support for "git fetch" used to show incorrect
value for the HEAD symbolic ref when the namespace feature is in
use, which has been corrected.

* jk/HEAD-symref-in-xfer-namespaces:
  upload-pack: strip namespace from symref data

4 years agoMerge branch 'ew/server-info-remove-crufts'
Junio C Hamano [Mon, 17 Jun 2019 17:15:15 +0000 (10:15 -0700)] 
Merge branch 'ew/server-info-remove-crufts'

"git update-server-info" used to leave stale packfiles in its
output, which has been corrected.

* ew/server-info-remove-crufts:
  server-info: do not list unlinked packs

4 years agoMerge branch 'es/grep-require-name-when-needed'
Junio C Hamano [Mon, 17 Jun 2019 17:15:14 +0000 (10:15 -0700)] 
Merge branch 'es/grep-require-name-when-needed'

More parameter validation.

* es/grep-require-name-when-needed:
  grep: fail if call could output and name is null

4 years agoMerge branch 'es/git-debugger-doc'
Junio C Hamano [Mon, 17 Jun 2019 17:15:14 +0000 (10:15 -0700)] 
Merge branch 'es/git-debugger-doc'

Doc update.

* es/git-debugger-doc:
  doc: hint about GIT_DEBUGGER in CodingGuidelines

4 years agoMerge branch 'ds/object-info-for-prefetch-fix'
Junio C Hamano [Mon, 17 Jun 2019 17:15:14 +0000 (10:15 -0700)] 
Merge branch 'ds/object-info-for-prefetch-fix'

Code cleanup and futureproof.

* ds/object-info-for-prefetch-fix:
  sha1-file: split OBJECT_INFO_FOR_PREFETCH

4 years agot3404: fix a typo
Johannes Schindelin [Fri, 14 Jun 2019 12:16:08 +0000 (05:16 -0700)] 
t3404: fix a typo

This one slipped through the review of a9279c678588 (sequencer: do not
squash 'reword' commits when we hit conflicts, 2018-06-19).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe first batch after 2.22
Junio C Hamano [Thu, 13 Jun 2019 20:23:03 +0000 (13:23 -0700)] 
The first batch after 2.22

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'pw/rebase-edit-message-for-replayed-merge'
Junio C Hamano [Thu, 13 Jun 2019 20:19:43 +0000 (13:19 -0700)] 
Merge branch 'pw/rebase-edit-message-for-replayed-merge'

A "merge -c" instruction during "git rebase --rebase-merges" should
give the user a chance to edit the log message, even when there is
otherwise no need to create a new merge and replace the existing
one (i.e. fast-forward instead), but did not.  Which has been
corrected.

* pw/rebase-edit-message-for-replayed-merge:
  rebase -r: always reword merge -c

4 years agoMerge branch 'ab/deprecate-R-for-dynpath'
Junio C Hamano [Thu, 13 Jun 2019 20:19:43 +0000 (13:19 -0700)] 
Merge branch 'ab/deprecate-R-for-dynpath'

The way of specifying the path to find dynamic libraries at runtime
has been simplified.  The old default to pass -R/path/to/dir has been
replaced with the new default to pass -Wl,-rpath,/path/to/dir,
which is the more recent GCC uses.  Those who need to build with an
old GCC can still use "CC_LD_DYNPATH=-R"

* ab/deprecate-R-for-dynpath:
  Makefile: remove the NO_R_TO_GCC_LINKER flag

4 years agoMerge branch 'mh/import-transport-fd-fix'
Junio C Hamano [Thu, 13 Jun 2019 20:19:43 +0000 (13:19 -0700)] 
Merge branch 'mh/import-transport-fd-fix'

The ownership rule for the file descriptor to fast-import remote
backend was mixed up, leading to unrelated file descriptor getting
closed, which has been fixed.

* mh/import-transport-fd-fix:
  Use xmmap_gently instead of xmmap in use_pack
  dup() the input fd for fast-import used for remote helpers

4 years agoMerge branch 'ew/update-server-info'
Junio C Hamano [Thu, 13 Jun 2019 20:19:42 +0000 (13:19 -0700)] 
Merge branch 'ew/update-server-info'

"git update-server-info" learned not to rewrite the file with the
same contents.

* ew/update-server-info:
  update-server-info: avoid needless overwrites

4 years agoMerge branch 'jk/help-unknown-ref-fix'
Junio C Hamano [Thu, 13 Jun 2019 20:19:42 +0000 (13:19 -0700)] 
Merge branch 'jk/help-unknown-ref-fix'

Improve the code to show args with potential typo that cannot be
interpreted as a commit-ish.

* jk/help-unknown-ref-fix:
  help_unknown_ref(): check for refname ambiguity
  help_unknown_ref(): duplicate collected refnames

4 years agoMerge branch 'dl/format-patch-notes-config'
Junio C Hamano [Thu, 13 Jun 2019 20:19:42 +0000 (13:19 -0700)] 
Merge branch 'dl/format-patch-notes-config'

"git format-patch" learns a configuration to set the default for
its --notes=<ref> option.

* dl/format-patch-notes-config:
  format-patch: teach format.notes config option
  git-format-patch.txt: document --no-notes option

4 years agoMerge branch 'nd/merge-quit'
Junio C Hamano [Thu, 13 Jun 2019 20:19:41 +0000 (13:19 -0700)] 
Merge branch 'nd/merge-quit'

"git merge" learned "--quit" option that cleans up the in-progress
merge while leaving the working tree and the index still in a mess.

* nd/merge-quit:
  merge: add --quit
  merge: remove drop_save() in favor of remove_merge_branch_state()

4 years agoMerge branch 'ab/fail-prereqs-in-test'
Junio C Hamano [Thu, 13 Jun 2019 20:19:41 +0000 (13:19 -0700)] 
Merge branch 'ab/fail-prereqs-in-test'

Developer support to emulate unsatisfied prerequisites in tests to
ensure that the remainer of the tests still succeeds when tests
with prerequisites are skipped.

* ab/fail-prereqs-in-test:
  tests: add a special setup where prerequisites fail

4 years agoMerge branch 'nd/corrupt-worktrees'
Junio C Hamano [Thu, 13 Jun 2019 20:19:41 +0000 (13:19 -0700)] 
Merge branch 'nd/corrupt-worktrees'

"git worktree add" used to fail when another worktree connected to
the same repository was corrupt, which has been corrected.

* nd/corrupt-worktrees:
  worktree add: be tolerant of corrupt worktrees

4 years agoMerge branch 'js/rebase-cleanup'
Junio C Hamano [Thu, 13 Jun 2019 20:19:40 +0000 (13:19 -0700)] 
Merge branch 'js/rebase-cleanup'

Update supporting parts of "git rebase" to remove code that should
no longer be used.

* js/rebase-cleanup:
  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 'nd/worktree-name-sanitization'
Junio C Hamano [Thu, 13 Jun 2019 20:19:40 +0000 (13:19 -0700)] 
Merge branch 'nd/worktree-name-sanitization'

In recent versions of Git, per-worktree refs are exposed in
refs/worktrees/<wtname>/ hierarchy, which means that worktree names
must be a valid refname component.  The code now sanitizes the names
given to worktrees, to make sure these refs are well-formed.

* nd/worktree-name-sanitization:
  worktree add: sanitize worktree names

4 years agoMerge branch 'en/fast-export-encoding'
Junio C Hamano [Thu, 13 Jun 2019 20:19:39 +0000 (13:19 -0700)] 
Merge branch 'en/fast-export-encoding'

The "git fast-export/import" pair has been taught to handle commits
with log messages in encoding other than UTF-8 better.

* en/fast-export-encoding:
  fast-export: do automatic reencoding of commit messages only if requested
  fast-export: differentiate between explicitly UTF-8 and implicitly UTF-8
  fast-export: avoid stripping encoding header if we cannot reencode
  fast-import: support 'encoding' commit header
  t9350: fix encoding test to actually test reencoding

4 years agoMerge branch 'jk/unused-params-final-batch'
Junio C Hamano [Thu, 13 Jun 2019 20:19:34 +0000 (13:19 -0700)] 
Merge branch 'jk/unused-params-final-batch'

* jk/unused-params-final-batch:
  verify-commit: simplify parameters to run_gpg_verify()
  show-branch: drop unused parameter from show_independent()
  rev-list: drop unused void pointer from finish_commit()
  remove_all_fetch_refspecs(): drop unused "remote" parameter
  receive-pack: drop unused "commands" from prepare_shallow_update()
  pack-objects: drop unused rev_info parameters
  name-rev: drop unused parameters from is_better_name()
  mktree: drop unused length parameter
  wt-status: drop unused status parameter
  read-cache: drop unused parameter from threaded load
  clone: drop dest parameter from copy_alternates()
  submodule: drop unused prefix parameter from some functions
  builtin: consistently pass cmd_* prefix to parse_options
  cmd_{read,write}_tree: rename "unused" variable that is used

4 years agoMerge branch 'sb/format-patch-base-patch-id-fix'
Junio C Hamano [Thu, 13 Jun 2019 20:18:46 +0000 (13:18 -0700)] 
Merge branch 'sb/format-patch-base-patch-id-fix'

The "--base" option of "format-patch" computed the patch-ids for
prerequisite patches in an unstable way, which has been updated to
compute in a way that is compatible with "git patch-id --stable".

* sb/format-patch-base-patch-id-fix:
  format-patch: make --base patch-id output stable
  format-patch: inform user that patch-id generation is unstable

4 years agoMerge branch 'nd/init-relative-template-fix'
Junio C Hamano [Thu, 13 Jun 2019 20:18:46 +0000 (13:18 -0700)] 
Merge branch 'nd/init-relative-template-fix'

A relative pathname given to "git init --template=<path> <repo>"
ought to be relative to the directory "git init" gets invoked in,
but it instead was made relative to the repository, which has been
corrected.

* nd/init-relative-template-fix:
  init: make --template path relative to $CWD

4 years agoMerge branch 'ab/send-email-transferencoding-fix'
Junio C Hamano [Thu, 13 Jun 2019 20:18:46 +0000 (13:18 -0700)] 
Merge branch 'ab/send-email-transferencoding-fix'

Since "git send-email" learned to take 'auto' as the value for the
transfer-encoding, it by mistake stopped honoring the values given
to the configuration variables sendemail.transferencoding and/or
sendemail.<ident>.transferencoding.  This has been corrected to
(finally) redoing the order of setting the default, reading the
configuration and command line options.

* ab/send-email-transferencoding-fix:
  send-email: fix regression in sendemail.identity parsing
  send-email: document --no-[to|cc|bcc]
  send-email: fix broken transferEncoding tests
  send-email: remove cargo-culted multi-patch pattern in tests
  send-email: do defaults -> config -> getopt in that order
  send-email: rename the @bcclist variable for consistency
  send-email: move the read_config() function above getopts

4 years agocleanup: fix possible overflow errors in binary search, part 2
René Scharfe [Thu, 13 Jun 2019 17:51:56 +0000 (19:51 +0200)] 
cleanup: fix possible overflow errors in binary search, part 2

Calculating the sum of two array indexes to find the midpoint between
them can overflow, i.e. code like this is unsafe for big arrays:

mid = (first + last) >> 1;

Make sure the intermediate value stays within the boundaries instead,
like this:

mid = first + ((last - first) >> 1);

The loop condition of the binary search makes sure that 'last' is
always greater than 'first', so this is safe as long as 'first' is
not negative.  And that can be verified easily using the pre-context
of each change, except for name-hash.c, so add an assertion to that
effect there.

The unsafe calculations were found with:

git grep '(.*+.*) *>> *1'

This is a continuation of 19716b21a4 (cleanup: fix possible overflow
errors in binary search, 2017-10-08).

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoadd -p: fix checkout -p with pathological context
Phillip Wood [Wed, 12 Jun 2019 09:25:27 +0000 (02:25 -0700)] 
add -p: fix checkout -p with pathological context

Commit fecc6f3a68 ("add -p: adjust offsets of subsequent hunks when one is
skipped", 2018-03-01) fixed adding hunks in the correct place when a
previous hunk has been skipped. However it did not address patches that
are applied in reverse. In that case we need to adjust the pre-image
offset so that when apply reverses the patch the post-image offset is
adjusted correctly. We subtract rather than add the delta as the patch
is reversed (the easiest way to think about it is to consider a hunk of
deletions that is skipped - in that case we want to reduce offset so we
need to subtract).

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomergetool: use shell variable magic instead of `awk`
Johannes Sixt [Wed, 12 Jun 2019 16:33:48 +0000 (18:33 +0200)] 
mergetool: use shell variable magic instead of `awk`

git-mergetool spawns an enormous amount of processes. For this reason,
the test script, t7610, is exceptionally slow, in particular, on
Windows. Most of the processes are invocations of git. There are
also some that can be replaced with shell builtins. Avoid repeated
calls of `git ls-files` and `awk`.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomergetool: dissect strings with shell variable magic instead of `expr`
Johannes Sixt [Wed, 12 Jun 2019 16:33:47 +0000 (18:33 +0200)] 
mergetool: dissect strings with shell variable magic instead of `expr`

git-mergetool spawns an enormous amount of processes. For this reason,
the test script, t7610, is exceptionally slow, in particular, on
Windows. Most of the processes are invocations of git. There are
also some that can be replaced with shell builtins. Do so with `expr`.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot7610-mergetool: use test_cmp instead of test $(cat file) = $txt
Johannes Sixt [Wed, 12 Jun 2019 16:33:46 +0000 (18:33 +0200)] 
t7610-mergetool: use test_cmp instead of test $(cat file) = $txt

Fix that anti-pattern by a sequence of echo and test_cmp.

The patch was generated with this command:

   sed -i -e '/test.*(cat/s/^\(\t*\)test "..cat \(.*\))" = \(".*"\)\(.*\)/\1echo \3 >expect \&\&\n\1test_cmp expect \2\4/' t7610-mergetool.sh

This helps on Windows, where test_cmp avoids spawning a process when
there is no difference.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopackfile: rename close_all_packs to close_object_store
Derrick Stolee [Fri, 17 May 2019 18:41:49 +0000 (11:41 -0700)] 
packfile: rename close_all_packs to close_object_store

The close_all_packs() method is now responsible for more than just pack-files.
It also closes the commit-graph and the multi-pack-index. Rename the function
to be more descriptive of its larger role. The name also fits because the
input parameter is a raw_object_store.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopackfile: close commit-graph in close_all_packs
Derrick Stolee [Fri, 17 May 2019 18:41:48 +0000 (11:41 -0700)] 
packfile: close commit-graph in close_all_packs

The close_all_packs() method is used to close all read handles to
pack-files and the multi-pack-index before running 'git gc --auto'.
This is particularly important on the Windows platform, where read
handles block any writes to those files. Replacing one of these
files with a rename() will fail in this situation.

The commit-graph also performs a rename, so is susceptable to this
problem. We are careful to close the commit-graph before writing,
but that doesn't work when a 'git fetch' (or similar) process runs
'git gc --auto' which may write a commit-graph.

Here, close the commit-graph as part of close_all_packs().

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: use raw_object_store when closing
Derrick Stolee [Fri, 17 May 2019 18:41:47 +0000 (11:41 -0700)] 
commit-graph: use raw_object_store when closing

The close_commit_graph() method took a repository struct, but then
only uses the raw_object_store within. Change the function prototype
to make the method more flexible.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: extract write_commit_graph_file()
Derrick Stolee [Wed, 12 Jun 2019 13:29:45 +0000 (06:29 -0700)] 
commit-graph: extract write_commit_graph_file()

The write_commit_graph() method is too complex, so we are
extracting helper functions one by one.

Extract write_commit_graph_file() that takes all of the information
in the context struct and writes the data to a commit-graph file.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: extract copy_oids_to_commits()
Derrick Stolee [Wed, 12 Jun 2019 13:29:44 +0000 (06:29 -0700)] 
commit-graph: extract copy_oids_to_commits()

The write_commit_graph() method is too complex, so we are
extracting helper functions one by one.

Extract copy_oids_to_commits(), which fills the commits list
with the distinct commits from the oids list. During this loop,
it also counts the number of "extra" edges from octopus merges.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: extract count_distinct_commits()
Derrick Stolee [Wed, 12 Jun 2019 13:29:43 +0000 (06:29 -0700)] 
commit-graph: extract count_distinct_commits()

The write_commit_graph() method is too complex, so we are
extracting helper functions one by one.

Extract count_distinct_commits(), which sorts the oids list, then
iterates through to find duplicates.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: extract fill_oids_from_all_packs()
Derrick Stolee [Wed, 12 Jun 2019 13:29:42 +0000 (06:29 -0700)] 
commit-graph: extract fill_oids_from_all_packs()

The write_commit_graph() method is too complex, so we are
extracting helper functions one by one.

Extract fill_oids_from_all_packs() that reads all pack-files
for commits and fills the oid list in the context.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: extract fill_oids_from_commit_hex()
Derrick Stolee [Wed, 12 Jun 2019 13:29:42 +0000 (06:29 -0700)] 
commit-graph: extract fill_oids_from_commit_hex()

The write_commit_graph() method is too complex, so we are
extracting helper functions one by one.

Extract fill_oids_from_commit_hex() that reads the given commit
id list and fille the oid list in the context.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: extract fill_oids_from_packs()
Derrick Stolee [Wed, 12 Jun 2019 13:29:41 +0000 (06:29 -0700)] 
commit-graph: extract fill_oids_from_packs()

The write_commit_graph() method is too complex, so we are
extracting helper functions one by one.

This extracts fill_oids_from_packs() that reads the given
pack-file list and fills the oid list in the context.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: create write_commit_graph_context
Derrick Stolee [Wed, 12 Jun 2019 13:29:40 +0000 (06:29 -0700)] 
commit-graph: create write_commit_graph_context

The write_commit_graph() method is too large and complex. To simplify
it, we should extract several helper functions. However, we will risk
repeating a lot of declarations related to progress incidators and
object id or commit lists.

Create a new write_commit_graph_context struct that contains the
core data structures used in this process. Replace the other local
variables with the values inside the context object. Following this
change, we will start to lift code segments wholesale out of the
write_commit_graph() method and into helper functions.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: remove Future Work section
Derrick Stolee [Wed, 12 Jun 2019 13:29:39 +0000 (06:29 -0700)] 
commit-graph: remove Future Work section

The commit-graph feature began with a long list of planned
benefits, most of which are now complete. The future work
section has only a few items left.

As for making more algorithms aware of generation numbers,
some are only waiting for generation number v2 to ensure the
performance matches the existing behavior using commit date.

It is unlikely that we will ever send a commit-graph file
as part of the protocol, since we would need to verify the
data, and that is expensive. If we want to start trusting
remote content, then that item can be investigated again.

While there is more work to be done on the feature, having
a section of the docs devoted to a TODO list is wasteful and
hard to keep up-to-date.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: collapse parameters into flags
Derrick Stolee [Wed, 12 Jun 2019 13:29:38 +0000 (06:29 -0700)] 
commit-graph: collapse parameters into flags

The write_commit_graph() and write_commit_graph_reachable() methods
currently take two boolean parameters: 'append' and 'report_progress'.
As we update these methods, adding more parameters this way becomes
cluttered and hard to maintain.

Collapse these parameters into a 'flags' parameter, and adjust the
callers to provide flags as necessary.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: return with errors during write
Derrick Stolee [Wed, 12 Jun 2019 13:29:37 +0000 (06:29 -0700)] 
commit-graph: return with errors during write

The write_commit_graph() method uses die() to report failure and
exit when confronted with an unexpected condition. This use of
die() in a library function is incorrect and is now replaced by
error() statements and an int return type. Return zero on success
and a negative value on failure.

Now that we use 'goto cleanup' to jump to the terminal condition
on an error, we have new paths that could lead to uninitialized
values. New initializers are added to correct for this.

The builtins 'commit-graph', 'gc', and 'commit' call these methods,
so update them to check the return value. Test that 'git commit-graph
write' returns a proper error code when hitting a failure condition
in write_commit_graph().

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoRevert "test-lib: whitelist GIT_TR2_* in the environment"
Ævar Arnfjörð Bjarmason [Wed, 12 Jun 2019 14:29:41 +0000 (16:29 +0200)] 
Revert "test-lib: whitelist GIT_TR2_* in the environment"

This reverts my commit c1ee5796dc ("test-lib: whitelist GIT_TR2_* in
the environment", 2019-03-30), which is now redundant.

Since e4b75d6a1d ("trace2: rename environment variables to
GIT_TRACE2*", 2019-05-19) the GIT_TRACE2* variables match the existing
GIT_TRACE* pattern added in 95a1d12e9b ("tests: scrub environment of
GIT_* variables", 2011-03-15), so we no longer need to list TR2 here.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocompletion: do not cache if --git-completion-helper fails
Nguyễn Thái Ngọc Duy [Wed, 12 Jun 2019 08:56:06 +0000 (15:56 +0700)] 
completion: do not cache if --git-completion-helper fails

"git <cmd> --git-completion-helper" could fail if the command checks for
a repo before parse_options(). If the result is cached, later on when
the user moves to a worktree with repo, tab completion will still fail.

Avoid this by detecting errors and not cache the completion output. We
can try again and hopefully succeed next time (e.g. when a repo is
found).

Of course if --git-completion-helper fails permanently because of other
reasons (*), this will slow down completion. But I don't see any better
option to handle that case.

(*) one of those cases is if __gitcomp_builtin is called on a command
  that does not support --git-completion-helper. And we do have a
  generic call

    __git_complete_common "$command"

  but this case is protected with __git_support_parseopt_helper so we're
  good.

Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5616: cover case of client having delta base
Jonathan Tan [Tue, 11 Jun 2019 21:06:47 +0000 (14:06 -0700)] 
t5616: cover case of client having delta base

When fetching into a partial clone, Git first prefetches missing
REF_DELTA bases from the promisor remote. (This feature was introduced
in [1].) But as can be seen in a recent test coverage report [2], the
case in which a REF_DELTA base is already present is not covered by
tests.

Extend the tests slightly to cover this case.

[1] 8a30a1efd1 ("index-pack: prefetch missing REF_DELTA bases",
2019-05-15).
[2] https://public-inbox.org/git/396091fc-5572-19a5-4f18-61c258590dd5@gmail.com/

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>