gitweb.git
tests: add a special setup where prerequisites failÆvar Arnfjörð Bjarmason Mon, 13 May 2019 18:32:42 +0000 (20:32 +0200)

tests: add a special setup where prerequisites fail

As discussed in [1] there's a regression in the "pu" branch now
because a new test implicitly assumed that a previous test guarded by
a prerequisite had been run. Add a "GIT_TEST_FAIL_PREREQS" special
test setup where we'll skip (nearly) all tests guarded by
prerequisites, allowing us to easily emulate those platform where we
don't run these tests.

As noted in the documentation I'm adding I'm whitelisting the SYMLINKS
prerequisite for now. A lot of tests started failing if we lied about
not supporting symlinks. It's also unlikely that we'll have a failing
test due to a hard dependency on symlinks without that being the
obvious cause, so for now it's not worth the effort to make it work.

1. https://public-inbox.org/git/nycvar.QRO.7.76.6.1905131531000.44@tvgsbejvaqbjf.bet/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.22-rc0 v2.22.0-rc0Junio C Hamano Mon, 13 May 2019 14:40:13 +0000 (23:40 +0900)

Git 2.22-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jh/trace2'Junio C Hamano Mon, 13 May 2019 14:50:35 +0000 (23:50 +0900)

Merge branch 'jh/trace2'

A few embarrassing bugfixes.

* jh/trace2:
trace2: fix up a missing "leave" entry point
trace2: fix incorrect function pointer check

Merge branch 'cc/access-on-aix-workaround'Junio C Hamano Mon, 13 May 2019 14:50:35 +0000 (23:50 +0900)

Merge branch 'cc/access-on-aix-workaround'

Workaround for standard-compliant but less-than-useful behaviour of
access(2) for the root user.

* cc/access-on-aix-workaround:
git-compat-util: work around for access(X_OK) under root

Merge branch 'pw/clean-sequencer-state-upon-final-commit'Junio C Hamano Mon, 13 May 2019 14:50:35 +0000 (23:50 +0900)

Merge branch 'pw/clean-sequencer-state-upon-final-commit'

"git chery-pick" (and "revert" that shares the same runtime engine)
that deals with multiple commits got confused when the final step
gets stopped with a conflict and the user concluded the sequence
with "git commit". Attempt to fix it by cleaning up the state
files used by these commands in such a situation.

* pw/clean-sequencer-state-upon-final-commit:
fix cherry-pick/revert status after commit
commit/reset: try to clean up sequencer state

Merge branch 'pw/rebase-i-internal'Junio C Hamano Mon, 13 May 2019 14:50:34 +0000 (23:50 +0900)

Merge branch 'pw/rebase-i-internal'

The internal implementation of "git rebase -i" has been updated to
avoid forking a separate "rebase--interactive" process.

* pw/rebase-i-internal:
rebase -i: run without forking rebase--interactive
rebase: use a common action enum
rebase -i: use struct rebase_options in do_interactive_rebase()
rebase -i: use struct rebase_options to parse args
rebase -i: use struct object_id for squash_onto
rebase -i: use struct commit when parsing options
rebase -i: remove duplication
rebase -i: combine rebase--interactive.c with rebase.c
rebase: use OPT_RERERE_AUTOUPDATE()
rebase: rename write_basic_state()
rebase: don't translate trace strings
sequencer: always discard index after checkout

Merge branch 'jk/perf-aggregate-wo-libjson'Junio C Hamano Mon, 13 May 2019 14:50:34 +0000 (23:50 +0900)

Merge branch 'jk/perf-aggregate-wo-libjson'

The script to aggregate perf result unconditionally depended on
libjson-perl even though it did not have to, which has been
corrected.

* jk/perf-aggregate-wo-libjson:
t/perf: depend on perl JSON only when using --codespeed

Merge branch 'dl/rev-tilde-doc-clarify'Junio C Hamano Mon, 13 May 2019 14:50:33 +0000 (23:50 +0900)

Merge branch 'dl/rev-tilde-doc-clarify'

Docfix.

* dl/rev-tilde-doc-clarify:
revisions.txt: remove ambibuity between <rev>:<path> and :<path>
revisions.txt: mention <rev>~ form
revisions.txt: mark optional rev arguments with []
revisions.txt: change "rev" to "<rev>"

Merge branch 'jc/make-dedup-ls-files-output'Junio C Hamano Mon, 13 May 2019 14:50:33 +0000 (23:50 +0900)

Merge branch 'jc/make-dedup-ls-files-output'

A "ls-files" that emulates "find" to enumerate files in the working
tree resulted in duplicated Makefile rules that caused the build to
issue an unnecessary warning during a trial build after merge
conflicts are resolved in working tree *.h files but before the
resolved results are added to the index. This has been corrected.

* jc/make-dedup-ls-files-output:
Makefile: dedup list of files obtained from ls-files

Merge branch 'jk/ls-files-doc-markup-fix'Junio C Hamano Mon, 13 May 2019 14:50:33 +0000 (23:50 +0900)

Merge branch 'jk/ls-files-doc-markup-fix'

Docfix.

* jk/ls-files-doc-markup-fix:
doc/ls-files: put nested list for "-t" option into block

Merge branch 'jk/p5302-avoid-collision-check-cost'Junio C Hamano Mon, 13 May 2019 14:50:32 +0000 (23:50 +0900)

Merge branch 'jk/p5302-avoid-collision-check-cost'

Fix index-pack perf test so that the repeated invocations always
run in an empty repository, which emulates the initial clone
situation better.

* jk/p5302-avoid-collision-check-cost:
p5302: create the repo in each index-pack test

Merge branch 'dl/no-extern-in-func-decl'Junio C Hamano Mon, 13 May 2019 14:50:32 +0000 (23:50 +0900)

Merge branch 'dl/no-extern-in-func-decl'

Mechanically and systematically drop "extern" from function
declarlation.

* dl/no-extern-in-func-decl:
*.[ch]: manually align parameter lists
*.[ch]: remove extern from function declarations using sed
*.[ch]: remove extern from function declarations using spatch

Merge branch 'ew/repack-with-bitmaps-by-default'Junio C Hamano Mon, 13 May 2019 14:50:32 +0000 (23:50 +0900)

Merge branch 'ew/repack-with-bitmaps-by-default'

The connectivity bitmaps are created by default in bare
repositories now; also the pathname hash-cache is created by
default to avoid making crappy deltas when repacking.

* ew/repack-with-bitmaps-by-default:
pack-objects: default to writing bitmap hash-cache
t5310: correctly remove bitmaps for jgit test
repack: enable bitmaps by default on bare repos

Merge branch 'js/partial-clone-connectivity-check'Junio C Hamano Mon, 13 May 2019 14:50:31 +0000 (23:50 +0900)

Merge branch 'js/partial-clone-connectivity-check'

During an initial "git clone --depth=..." partial clone, it is
pointless to spend cycles for a large portion of the connectivity
check that enumerates and skips promisor objects (which by
definition is all objects fetched from the other side). This has
been optimized out.

* js/partial-clone-connectivity-check:
t/perf: add perf script for partial clones
clone: do faster object check for partial clones

Merge branch 'jh/trace2-sid-fix'Junio C Hamano Mon, 13 May 2019 14:50:31 +0000 (23:50 +0900)

Merge branch 'jh/trace2-sid-fix'

Polishing of the new trace2 facility continues. The system-level
configuration can specify site-wide trace2 settings, which can be
overridden with per-user configuration and environment variables.

* jh/trace2-sid-fix:
trace2: fixup access problem on /etc/gitconfig in read_very_early_config
trace2: update docs to describe system/global config settings
trace2: make SIDs more unique
trace2: clarify UTC datetime formatting
trace2: report peak memory usage of the process
trace2: use system/global config for default trace2 settings
config: add read_very_early_config()
trace2: find exec-dir before trace2 initialization
trace2: add absolute elapsed time to start event
trace2: refactor setting process starting time
config: initialize opts structure in repo_read_config()

trace2: fix up a missing "leave" entry pointÆvar Arnfjörð Bjarmason Fri, 10 May 2019 13:37:38 +0000 (15:37 +0200)

trace2: fix up a missing "leave" entry point

Fix a trivial bug that's been here since the shared/do_write_index
tracing was added in 42fee7a388 ("trace2:data: add trace2
instrumentation to index read/write", 2019-02-22). We should have
enter/leave points, not two enter/enter points. This resulted in an
"enter" event without a corresponding "leave" event.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

The eighth batchJunio C Hamano Wed, 8 May 2019 15:37:54 +0000 (00:37 +0900)

The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'vk/autoconf-gettext'Junio C Hamano Wed, 8 May 2019 15:37:29 +0000 (00:37 +0900)

Merge branch 'vk/autoconf-gettext'

The autoconf generated configure script failed to use the right
gettext() implementations from -libintl by ignoring useless stub
implementations shipped in some C library, which has been
corrected.

* vk/autoconf-gettext:
autoconf: #include <libintl.h> when checking for gettext()

Merge branch 'cc/aix-has-fileno-as-a-macro'Junio C Hamano Wed, 8 May 2019 15:37:28 +0000 (00:37 +0900)

Merge branch 'cc/aix-has-fileno-as-a-macro'

AIX shared the same build issues with other BSDs around fileno(fp),
which has been corrected.

* cc/aix-has-fileno-as-a-macro:
Makefile: use fileno macro work around on AIX

Merge branch 'jt/submodule-repo-is-with-worktree'Junio C Hamano Wed, 8 May 2019 15:37:28 +0000 (00:37 +0900)

Merge branch 'jt/submodule-repo-is-with-worktree'

The logic to tell if a Git repository has a working tree protects
"git branch -D" from removing the branch that is currently checked
out by mistake. The implementation of this logic was broken for
repositories with unusual name, which unfortunately is the norm for
submodules these days. This has been fixed.

* jt/submodule-repo-is-with-worktree:
worktree: update is_bare heuristics

Merge branch 'jk/untracked-cache-more-fixes'Junio C Hamano Wed, 8 May 2019 15:37:28 +0000 (00:37 +0900)

Merge branch 'jk/untracked-cache-more-fixes'

Code clean-up.

* jk/untracked-cache-more-fixes:
untracked-cache: simplify parsing by dropping "len"
untracked-cache: simplify parsing by dropping "next"
untracked-cache: be defensive about missing NULs in index

Merge branch 'jk/prune-optim'Junio C Hamano Wed, 8 May 2019 15:37:27 +0000 (00:37 +0900)

Merge branch 'jk/prune-optim'

A follow-up test for an earlier "git prune" improvements.

* jk/prune-optim:
t5304: add a test for pruning with bitmaps

Merge branch 'js/misc-doc-fixes'Junio C Hamano Wed, 8 May 2019 15:37:27 +0000 (00:37 +0900)

Merge branch 'js/misc-doc-fixes'

"make check-docs", "git help -a", etc. did not account for cases
where a particular build may deliberately omit some subcommands,
which has been corrected.

* js/misc-doc-fixes:
Turn `git serve` into a test helper
test-tool: handle the `-C <directory>` option just like `git`
check-docs: do not bother checking for legacy scripts' documentation
docs: exclude documentation for commands that have been excluded
check-docs: allow command-list.txt to contain excluded commands
help -a: do not list commands that are excluded from the build
Makefile: drop the NO_INSTALL variable
remote-testgit: move it into the support directory for t5801

Merge branch 'dr/ref-filter-push-track-fix'Junio C Hamano Wed, 8 May 2019 15:37:26 +0000 (00:37 +0900)

Merge branch 'dr/ref-filter-push-track-fix'

%(push:track) token used in the --format option to "git
for-each-ref" and friends was not showing the right branch, which
has been fixed.

* dr/ref-filter-push-track-fix:
ref-filter: use correct branch for %(push:track)

Merge branch 'ss/msvc-path-utils-fix'Junio C Hamano Wed, 8 May 2019 15:37:26 +0000 (00:37 +0900)

Merge branch 'ss/msvc-path-utils-fix'

An earlier update for MinGW and Cygwin accidentally broke MSVC build,
which has been fixed.

* ss/msvc-path-utils-fix:
MSVC: include compat/win32/path-utils.h for MSVC, too, for real_path()

Merge branch 'jt/clone-server-option'Junio C Hamano Wed, 8 May 2019 15:37:25 +0000 (00:37 +0900)

Merge branch 'jt/clone-server-option'

"git clone" learned a new --server-option option when talking over
the protocol version 2.

* jt/clone-server-option:
clone: send server options when using protocol v2
transport: die if server options are unsupported

Merge branch 'tb/unexpected'Junio C Hamano Wed, 8 May 2019 15:37:25 +0000 (00:37 +0900)

Merge branch 'tb/unexpected'

Code tightening against a "wrong" object appearing where an object
of a different type is expected, instead of blindly assuming that
the connection between objects are correctly made.

* tb/unexpected:
rev-list: detect broken root trees
rev-list: let traversal die when --missing is not in use
get_commit_tree(): return NULL for broken tree
list-objects.c: handle unexpected non-tree entries
list-objects.c: handle unexpected non-blob entries
t: introduce tests for unexpected object types
t: move 'hex2oct' into test-lib-functions.sh

Merge branch 'nd/sha1-name-c-wo-the-repository'Junio C Hamano Wed, 8 May 2019 15:37:24 +0000 (00:37 +0900)

Merge branch 'nd/sha1-name-c-wo-the-repository'

Further code clean-up to allow the lowest level of name-to-object
mapping layer to work with a passed-in repository other than the
default one.

* nd/sha1-name-c-wo-the-repository: (34 commits)
sha1-name.c: remove the_repo from get_oid_mb()
sha1-name.c: remove the_repo from other get_oid_*
sha1-name.c: remove the_repo from maybe_die_on_misspelt_object_name
submodule-config.c: use repo_get_oid for reading .gitmodules
sha1-name.c: add repo_get_oid()
sha1-name.c: remove the_repo from get_oid_with_context_1()
sha1-name.c: remove the_repo from resolve_relative_path()
sha1-name.c: remove the_repo from diagnose_invalid_index_path()
sha1-name.c: remove the_repo from handle_one_ref()
sha1-name.c: remove the_repo from get_oid_1()
sha1-name.c: remove the_repo from get_oid_basic()
sha1-name.c: remove the_repo from get_describe_name()
sha1-name.c: remove the_repo from get_oid_oneline()
sha1-name.c: add repo_interpret_branch_name()
sha1-name.c: remove the_repo from interpret_branch_mark()
sha1-name.c: remove the_repo from interpret_nth_prior_checkout()
sha1-name.c: remove the_repo from get_short_oid()
sha1-name.c: add repo_for_each_abbrev()
sha1-name.c: store and use repo in struct disambiguate_state
sha1-name.c: add repo_find_unique_abbrev_r()
...

Merge branch 'cc/replace-graft-peel-tags'Junio C Hamano Wed, 8 May 2019 15:37:24 +0000 (00:37 +0900)

Merge branch 'cc/replace-graft-peel-tags'

When given a tag that points at a commit-ish, "git replace --graft"
failed to peel the tag before writing a replace ref, which did not
make sense because the old graft mechanism the feature wants to
mimick only allowed to replace one commit object with another.
This has been fixed.

* cc/replace-graft-peel-tags:
replace: peel tag when passing a tag first to --graft
replace: peel tag when passing a tag as parent to --graft
t6050: redirect expected error output to a file
t6050: use test_line_count instead of wc -l

Merge branch 'js/trace2-to-directory'Junio C Hamano Wed, 8 May 2019 15:37:24 +0000 (00:37 +0900)

Merge branch 'js/trace2-to-directory'

The trace2 tracing facility learned to auto-generate a filename
when told to log to a directory.

* js/trace2-to-directory:
trace2: write to directory targets

Merge branch 'dl/merge-cleanup-scissors-fix'Junio C Hamano Wed, 8 May 2019 15:37:24 +0000 (00:37 +0900)

Merge branch 'dl/merge-cleanup-scissors-fix'

The list of conflicted paths shown in the editor while concluding a
conflicted merge was shown above the scissors line when the
clean-up mode is set to "scissors", even though it was commented
out just like the list of updated paths and other information to
help the user explain the merge better.

* dl/merge-cleanup-scissors-fix:
cherry-pick/revert: add scissors line on merge conflict
sequencer.c: save and restore cleanup mode
merge: add scissors line on merge conflict
merge: cleanup messages like commit
parse-options.h: extract common --cleanup option
commit: extract cleanup_mode functions to sequencer
t7502: clean up style
t7604: clean up style
t3507: clean up style
t7600: clean up style

Merge branch 'pw/sequencer-cleanup-with-signoff-x-fix'Junio C Hamano Wed, 8 May 2019 15:37:23 +0000 (00:37 +0900)

Merge branch 'pw/sequencer-cleanup-with-signoff-x-fix'

"git cherry-pick" run with the "-x" or the "--signoff" option used
to (and more importantly, ought to) clean up the commit log message
with the --cleanup=space option by default, but this has been
broken since late 2017. This has been fixed.

* pw/sequencer-cleanup-with-signoff-x-fix:
sequencer: fix cleanup with --signoff and -x

Merge branch 'jk/pack-objects-reports-num-objects-to... Junio C Hamano Wed, 8 May 2019 15:37:23 +0000 (00:37 +0900)

Merge branch 'jk/pack-objects-reports-num-objects-to-trace2'

The "git pack-objects" command learned to report the number of
objects it packed via the trace2 mechanism.

* jk/pack-objects-reports-num-objects-to-trace2:
pack-objects: write objects packed to trace2

Merge branch 'tz/git-svn-doc-markup-fix'Junio C Hamano Wed, 8 May 2019 15:37:23 +0000 (00:37 +0900)

Merge branch 'tz/git-svn-doc-markup-fix'

Doc formatting fix.

* tz/git-svn-doc-markup-fix:
Documentation/git-svn: improve asciidoctor compatibility

Merge branch 'km/empty-repo-is-still-a-repo'Junio C Hamano Wed, 8 May 2019 15:37:23 +0000 (00:37 +0900)

Merge branch 'km/empty-repo-is-still-a-repo'

Running "git add" on a repository created inside the current
repository is an explicit indication that the user wants to add it
as a submodule, but when the HEAD of the inner repository is on an
unborn branch, it cannot be added as a submodule. Worse, the files
in its working tree can be added as if they are a part of the outer
repository, which is not what the user wants. These problems are
being addressed.

* km/empty-repo-is-still-a-repo:
add: error appropriately on repository with no commits
dir: do not traverse repositories with no commits
submodule: refuse to add repository with no commits

Merge branch 'dl/warn-tagging-a-tag'Junio C Hamano Wed, 8 May 2019 15:37:22 +0000 (00:37 +0900)

Merge branch 'dl/warn-tagging-a-tag'

"git tag" learned to give an advice suggesting it might be a
mistake when creating an annotated or signed tag that points at
another tag.

* dl/warn-tagging-a-tag:
tag: advise on nested tags
tag: fix formatting

Merge branch 'en/merge-directory-renames'Junio C Hamano Wed, 8 May 2019 15:37:22 +0000 (00:37 +0900)

Merge branch 'en/merge-directory-renames'

"git merge-recursive" backend recently learned a new heuristics to
infer file movement based on how other files in the same directory
moved. As this is inherently less robust heuristics than the one
based on the content similarity of the file itself (rather than
based on what its neighbours are doing), it sometimes gives an
outcome unexpected by the end users. This has been toned down to
leave the renamed paths in higher/conflicted stages in the index so
that the user can examine and confirm the result.

* en/merge-directory-renames:
merge-recursive: switch directory rename detection default
merge-recursive: give callers of handle_content_merge() access to contents
merge-recursive: track information associated with directory renames
t6043: fix copied test description to match its purpose
merge-recursive: switch from (oid,mode) pairs to a diff_filespec
merge-recursive: cleanup handle_rename_* function signatures
merge-recursive: track branch where rename occurred in rename struct
merge-recursive: remove ren[12]_other fields from rename_conflict_info
merge-recursive: shrink rename_conflict_info
merge-recursive: move some struct declarations together
merge-recursive: use 'ci' for rename_conflict_info variable name
merge-recursive: rename locals 'o' and 'a' to 'obuf' and 'abuf'
merge-recursive: rename diff_filespec 'one' to 'o'
merge-recursive: rename merge_options argument from 'o' to 'opt'
Use 'unsigned short' for mode, like diff_filespec does

revisions.txt: remove ambibuity between <rev>:<path... Andreas Heiduk Sun, 5 May 2019 16:07:10 +0000 (12:07 -0400)

revisions.txt: remove ambibuity between <rev>:<path> and :<path>

The revision ':README' is mentioned as an example for '<rev>:<path>'
but the explanation forwards to the ':<n>:<path>' syntax. At the same
time ':<n>:<path>' did not mark the '<n>:' as optional.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revisions.txt: mention <rev>~ formDenton Liu Sun, 5 May 2019 16:07:07 +0000 (12:07 -0400)

revisions.txt: mention <rev>~ form

In revisions.txt, the '<rev>^' form is mentioned but the '<rev>~' form
is missing. Although both forms are essentially equivalent (they each
get the first parent of the specified revision), we should mention the
latter for completeness. Make this change.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revisions.txt: mark optional rev arguments with []Denton Liu Sun, 5 May 2019 16:07:03 +0000 (12:07 -0400)

revisions.txt: mark optional rev arguments with []

In revisions.txt, an optional rev argument was not distinguised.
Instead, a user had to continue and read the description in order to
learn that the argument was optional.

Since the [] notation for an optional argument is common-knowledge in
the Git documentation, mark optional arguments with [] so that it's more
obvious for the reader.

Helped-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revisions.txt: change "rev" to "<rev>"Denton Liu Sun, 5 May 2019 16:06:59 +0000 (12:06 -0400)

revisions.txt: change "rev" to "<rev>"

In revisions.txt, there were some instances of a rev argument being
written as "rev". However, since they didn't mean the string literal,
write "<rev>", instead.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2: fixup access problem on /etc/gitconfig in read_... Jeff Hostetler Mon, 29 Apr 2019 20:14:22 +0000 (13:14 -0700)

trace2: fixup access problem on /etc/gitconfig in read_very_early_config

Teach do_git_config_sequence() to optionally gently check for access to
the system config. Use this option in read_very_early_config() when
initializing trace2.

In [1] SZEDER Gábor reported that my changes in [2] introduced a
regression when the user does not have permission to read the system
config.

This commit addresses that problem by optionally ignoring that error.

[1] https://public-inbox.org/git/285beb2b2d740ce20fdd8af1becf371ab39703db.1554995916.git.gitgitgadget@gmail.com/T/#m342e839289aec515523a98b5e34d7f42d3f1fd79
[2] https://public-inbox.org/git/285beb2b2d740ce20fdd8af1becf371ab39703db.1554995916.git.gitgitgadget@gmail.com/T/#m11b59c9228c698442f750ee8f9b10c629399ae48

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

*.[ch]: manually align parameter listsDenton Liu Mon, 29 Apr 2019 08:28:23 +0000 (04:28 -0400)

*.[ch]: manually align parameter lists

In previous patches, extern was mechanically removed from function
declarations without care to formatting, causing parameter lists to be
misaligned. Manually format changed sections such that the parameter
lists should be realigned.

Viewing this patch with 'git diff -w' should produce no output.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

*.[ch]: remove extern from function declarations using sedDenton Liu Mon, 29 Apr 2019 08:28:20 +0000 (04:28 -0400)

*.[ch]: remove extern from function declarations using sed

There has been a push to remove extern from function declarations.
Finish the job by removing all instances of "extern" for function
declarations in headers using sed.

This was done by running the following on my system with sed 4.2.2:

$ git ls-files \*.{c,h} |
grep -v ^compat/ |
xargs sed -i'' -e 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/'

Files under `compat/` are intentionally excluded as some are directly
copied from external sources and we should avoid churning them as much
as possible.

Then, leftover instances of extern were found by running

$ git grep -w -C3 extern \*.{c,h}

and manually checking the output. No other instances were found.

Note that the regex used specifically excludes function variables which
_should_ be left as extern.

Not the most elegant way to do it but it gets the job done.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

*.[ch]: remove extern from function declarations using... Denton Liu Mon, 29 Apr 2019 08:28:14 +0000 (04:28 -0400)

*.[ch]: remove extern from function declarations using spatch

There has been a push to remove extern from function declarations.
Remove some instances of "extern" for function declarations which are
caught by Coccinelle. Note that Coccinelle has some difficulty with
processing functions with `__attribute__` or varargs so some `extern`
declarations are left behind to be dealt with in a future patch.

This was the Coccinelle patch used:

@@
type T;
identifier f;
@@
- extern
T f(...);

and it was run with:

$ git ls-files \*.{c,h} |
grep -v ^compat/ |
xargs spatch --sp-file contrib/coccinelle/noextern.cocci --in-place

Files under `compat/` are intentionally excluded as some are directly
copied from external sources and we should avoid churning them as much
as possible.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/perf: add perf script for partial clonesJeff King Thu, 2 May 2019 21:45:09 +0000 (17:45 -0400)

t/perf: add perf script for partial clones

We don't cover the partial clone feature at all in t/perf. Let's at
least run a few basic tests so that we'll notice any regressions.

We'll do a no-blob clone, and split it into two parts: the actual object
transfer, and the subsequent checkout (which will of course require
another transfer to get the blobs). That will help us more clearly
assess the performance of each.

There are obviously a lot more possibilities besides just a no-blob
partial clone, but this should serve as a canary that alerts us to any
generic slow-downs (and we can add more tests later for cases that
aren't exercised here).

There are a few non-ideal things here that make this not an entirely
accurate test, but are probably OK for our purposes:

1. We have to do some extra prep/cleanup work inside the timing tests,
since they impact the on-disk state and the perf harness may run
each one multiple times.

In practice this is probably OK, since these bits should be much
less expensive than the operations we are measuring.

2. The clone time is likely to be dominated by the server's object
enumeration. In the real world, a repo large enough to drive people
to partial clones is likely to have reachability bitmaps enabled.

And in the opposite direction, our object transfer is happening at
the speed of a local pipe, whereas in the real world it would
bottle-neck on the network.

So any percentage speedups should be taken with a grain of salt.
But hopefully any regressions will produce enough of an effect to
be noticeable.

This script also demonstrates the recent improvement from dfa33a298d
(clone: do faster object check for partial clones, 2019-04-19):

Test dfa33a298d^ dfa33a298d
-------------------------------------------------------------------------
5600.2: clone without blobs 18.41(22.72+1.09) 6.83(11.65+0.50) -62.9%
5600.3: checkout of result 1.82(3.24+0.26) 1.84(3.24+0.26) +1.1%

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2: fix incorrect function pointer checkJosh Steadmon Thu, 25 Apr 2019 17:08:53 +0000 (10:08 -0700)

trace2: fix incorrect function pointer check

Fix trace2_data_json_fl() to check for the presence of pfn_data_json_fl
in its targets, rather than pfn_data_fl, which is not actually called.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-compat-util: work around for access(X_OK) under... Clément Chigot Thu, 25 Apr 2019 07:01:56 +0000 (07:01 +0000)

git-compat-util: work around for access(X_OK) under root

On AIX, access(X_OK) may succeed when run as root even if the
execution isn't possible. This behavior is allowed by POSIX
which says:

... for a process with appropriate privileges, an implementation
may indicate success for X_OK even if execute permission is not
granted to any user.

It can lead hook programs to have their execution refused:

git commit -m content
fatal: cannot exec '.git/hooks/pre-commit': Permission denied

Add NEED_ACCESS_ROOT_HANDLER in order to use an access helper function.
It checks with stat if any executable flags is set when the current user
is root.

Signed-off-by: Clément Chigot <clement.chigot@atos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: use fileno macro work around on AIXClément Chigot Thu, 18 Apr 2019 08:55:09 +0000 (08:55 +0000)

Makefile: use fileno macro work around on AIX

Declare FILENO_IS_A_MACRO on AIX

On AIX, fileno(fp) is a macro and need to use the work around already made for BSD's.

Signed-off-by: Clément Chigot <clement.chigot@atos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

The seventh batchJunio C Hamano Thu, 25 Apr 2019 07:03:52 +0000 (16:03 +0900)

The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/macos-gettext-build'Junio C Hamano Thu, 25 Apr 2019 07:41:25 +0000 (16:41 +0900)

Merge branch 'js/macos-gettext-build'

Build with gettext breaks on recent macOS w/ Homebrew when
/usr/local/bin is not on PATH, which has been corrected.

* js/macos-gettext-build:
macOS: make sure that gettext is found

Merge branch 'bs/sendemail-tighten-anything-by'Junio C Hamano Thu, 25 Apr 2019 07:41:25 +0000 (16:41 +0900)

Merge branch 'bs/sendemail-tighten-anything-by'

The recently added feature to add addresses that are on
anything-by: trailers in 'git send-email' was found to be way too
eager and considered nonsense strings as if they can be legitimate
beginning of *-by: trailer. This has been tightened.

* bs/sendemail-tighten-anything-by:
send-email: don't cc *-by lines with '-' prefix

Merge branch 'bc/send-email-qp-cr'Junio C Hamano Thu, 25 Apr 2019 07:41:25 +0000 (16:41 +0900)

Merge branch 'bc/send-email-qp-cr'

"git send-email" has been taught to use quoted-printable when the
payload contains carriage-return. The use of the mechanism is in
line with the design originally added the codepath that chooses QP
when the payload has overly long lines.

* bc/send-email-qp-cr:
send-email: default to quoted-printable when CR is present

Merge branch 'nd/submodule-foreach-quiet'Junio C Hamano Thu, 25 Apr 2019 07:41:24 +0000 (16:41 +0900)

Merge branch 'nd/submodule-foreach-quiet'

"git submodule foreach <command> --quiet" did not pass the option
down correctly, which has been corrected.

* nd/submodule-foreach-quiet:
submodule foreach: fix "<command> --quiet" not being respected

Merge branch 'js/iso8895-test-on-apfs'Junio C Hamano Thu, 25 Apr 2019 07:41:24 +0000 (16:41 +0900)

Merge branch 'js/iso8895-test-on-apfs'

Test fix on APFS that is incapable of store paths in Latin-1.

* js/iso8895-test-on-apfs:
t9822: skip tests if file names cannot be ISO-8859-1 encoded

Merge branch 'jc/gettext-test-fix'Junio C Hamano Thu, 25 Apr 2019 07:41:23 +0000 (16:41 +0900)

Merge branch 'jc/gettext-test-fix'

The GETTEXT_POISON test option has been quite broken ever since it
was made runtime-tunable, which has been fixed.

* jc/gettext-test-fix:
gettext tests: export the restored GIT_TEST_GETTEXT_POISON

Merge branch 'jk/fetch-reachability-error-fix'Junio C Hamano Thu, 25 Apr 2019 07:41:23 +0000 (16:41 +0900)

Merge branch 'jk/fetch-reachability-error-fix'

Code clean-up and a fix for "git fetch" by an explicit object name
(as opposed to fetching refs by name).

* jk/fetch-reachability-error-fix:
fetch: do not consider peeled tags as advertised tips
remote.c: make singular free_ref() public
fetch: use free_refs()
pkt-line: prepare buffer before handling ERR packets
upload-pack: send ERR packet for non-tip objects
t5530: check protocol response for "not our ref"
t5516: drop ok=sigpipe from unreachable-want tests

Merge branch 'jk/xmalloc'Junio C Hamano Thu, 25 Apr 2019 07:41:23 +0000 (16:41 +0900)

Merge branch 'jk/xmalloc'

The code is updated to check the result of memory allocation before
it is used in more places, by using xmalloc and/or xcalloc calls.

* jk/xmalloc:
progress: use xmalloc/xcalloc
xdiff: use xmalloc/xrealloc
xdiff: use git-compat-util
test-prio-queue: use xmalloc

Merge branch 'km/t3000-retitle'Junio C Hamano Thu, 25 Apr 2019 07:41:22 +0000 (16:41 +0900)

Merge branch 'km/t3000-retitle'

A test update.

* km/t3000-retitle:
t3000 (ls-files -o): widen description to reflect current tests

Merge branch 'js/untracked-cache-allocfix'Junio C Hamano Thu, 25 Apr 2019 07:41:22 +0000 (16:41 +0900)

Merge branch 'js/untracked-cache-allocfix'

An underallocation in the code to read the untracked cache
extension has been corrected.

* js/untracked-cache-allocfix:
untracked cache: fix off-by-one

Merge branch 'js/t3301-unbreak-notes-test'Junio C Hamano Thu, 25 Apr 2019 07:41:21 +0000 (16:41 +0900)

Merge branch 'js/t3301-unbreak-notes-test'

Test fix.

* js/t3301-unbreak-notes-test:
t3301: fix false negative

Merge branch 'tz/doc-apostrophe-no-longer-needed'Junio C Hamano Thu, 25 Apr 2019 07:41:21 +0000 (16:41 +0900)

Merge branch 'tz/doc-apostrophe-no-longer-needed'

Doc formatting fix.

* tz/doc-apostrophe-no-longer-needed:
Documentation/git-show-branch: avoid literal {apostrophe}

Merge branch 'sg/blame-in-bare-start-at-head'Junio C Hamano Thu, 25 Apr 2019 07:41:21 +0000 (16:41 +0900)

Merge branch 'sg/blame-in-bare-start-at-head'

"git blame -- path" in a non-bare repository starts blaming from
the working tree, and the same command in a bare repository errors
out because there is no working tree by definition. The command
has been taught to instead start blaming from the commit at HEAD,
which is more useful.

* sg/blame-in-bare-start-at-head:
blame: default to HEAD in a bare repo when no start commit is given

Merge branch 'tg/ls-files-debug-format-fix'Junio C Hamano Thu, 25 Apr 2019 07:41:20 +0000 (16:41 +0900)

Merge branch 'tg/ls-files-debug-format-fix'

Debugging code fix.

* tg/ls-files-debug-format-fix:
ls-files: use correct format string

Merge branch 'po/describe-not-necessarily-7'Junio C Hamano Thu, 25 Apr 2019 07:41:20 +0000 (16:41 +0900)

Merge branch 'po/describe-not-necessarily-7'

Docfix.

* po/describe-not-necessarily-7:
describe doc: remove '7-char' abbreviation reference

Merge branch 'po/rerere-doc-fmt'Junio C Hamano Thu, 25 Apr 2019 07:41:19 +0000 (16:41 +0900)

Merge branch 'po/rerere-doc-fmt'

Docfix.

* po/rerere-doc-fmt:
rerere doc: quote `rerere.enabled`

Merge branch 'sg/overlong-progress-fix'Junio C Hamano Thu, 25 Apr 2019 07:41:19 +0000 (16:41 +0900)

Merge branch 'sg/overlong-progress-fix'

Updating the display with progress message has been cleaned up to
deal better with overlong messages.

* sg/overlong-progress-fix:
progress: break too long progress bar lines
progress: clear previous progress update dynamically
progress: assemble percentage and counters in a strbuf before printing
progress: make display_progress() return void

Merge branch 'jt/batch-fetch-blobs-in-diff'Junio C Hamano Thu, 25 Apr 2019 07:41:19 +0000 (16:41 +0900)

Merge branch 'jt/batch-fetch-blobs-in-diff'

While running "git diff" in a lazy clone, we can upfront know which
missing blobs we will need, instead of waiting for the on-demand
machinery to discover them one by one. Aim to achieve better
performance by batching the request for these promised blobs.

* jt/batch-fetch-blobs-in-diff:
diff: batch fetching of missing blobs
sha1-file: support OBJECT_INFO_FOR_PREFETCH

Merge branch 'ab/gc-docs'Junio C Hamano Thu, 25 Apr 2019 07:41:18 +0000 (16:41 +0900)

Merge branch 'ab/gc-docs'

Update docs around "gc".

* ab/gc-docs:
gc docs: remove incorrect reference to gc.auto=0
gc docs: clarify that "gc" doesn't throw away referenced objects
gc docs: note "gc --aggressive" in "fast-import"
gc docs: downplay the usefulness of --aggressive
gc docs: note how --aggressive impacts --window & --depth
gc docs: fix formatting for "gc.writeCommitGraph"
gc docs: re-flow the "gc.*" section in "config"
gc docs: include the "gc.*" section from "config" in "gc"
gc docs: clean grammar for "gc.bigPackThreshold"
gc docs: stop noting "repack" flags
gc docs: modernize the advice for manually running "gc"

Merge branch 'dl/submodule-set-branch'Junio C Hamano Thu, 25 Apr 2019 07:41:18 +0000 (16:41 +0900)

Merge branch 'dl/submodule-set-branch'

"git submodule" learns "set-branch" subcommand that allows the
submodule.*.branch settings to be modified.

* dl/submodule-set-branch:
submodule: teach set-branch subcommand
submodule--helper: teach config subcommand --unset
git-submodule.txt: "--branch <branch>" option defaults to 'master'

Merge branch 'jk/revision-rewritten-parents-in-prio... Junio C Hamano Thu, 25 Apr 2019 07:41:18 +0000 (16:41 +0900)

Merge branch 'jk/revision-rewritten-parents-in-prio-queue'

Performance fix for "rev-list --parents -- pathspec".

* jk/revision-rewritten-parents-in-prio-queue:
revision: use a prio_queue to hold rewritten parents

Merge branch 'dk/blame-keep-origin-blob'Junio C Hamano Thu, 25 Apr 2019 07:41:17 +0000 (16:41 +0900)

Merge branch 'dk/blame-keep-origin-blob'

Performance fix around "git blame", especially in a linear history
(which is the norm we should optimize for).

* dk/blame-keep-origin-blob:
blame.c: don't drop origin blobs as eagerly

Merge branch 'bc/hash-transition-16'Junio C Hamano Thu, 25 Apr 2019 07:41:17 +0000 (16:41 +0900)

Merge branch 'bc/hash-transition-16'

Conversion from unsigned char[20] to struct object_id continues.

* bc/hash-transition-16: (35 commits)
gitweb: make hash size independent
Git.pm: make hash size independent
read-cache: read data in a hash-independent way
dir: make untracked cache extension hash size independent
builtin/difftool: use parse_oid_hex
refspec: make hash size independent
archive: convert struct archiver_args to object_id
builtin/get-tar-commit-id: make hash size independent
get-tar-commit-id: parse comment record
hash: add a function to lookup hash algorithm by length
remote-curl: make hash size independent
http: replace sha1_to_hex
http: compute hash of downloaded objects using the_hash_algo
http: replace hard-coded constant with the_hash_algo
http-walker: replace sha1_to_hex
http-push: remove remaining uses of sha1_to_hex
http-backend: allow 64-character hex names
http-push: convert to use the_hash_algo
builtin/pull: make hash-size independent
builtin/am: make hash size independent
...

Merge branch 'en/fast-import-parsing-fix'Junio C Hamano Thu, 25 Apr 2019 07:41:16 +0000 (16:41 +0900)

Merge branch 'en/fast-import-parsing-fix'

"git fast-import" update.

* en/fast-import-parsing-fix:
fast-import: fix erroneous handling of get-mark with empty orphan commits
fast-import: only allow cat-blob requests where it makes sense
fast-import: check most prominent commands first
git-fast-import.txt: fix wording about where ls command can appear
t9300: demonstrate bug with get-mark and empty orphan commits

Merge branch 'jt/fetch-no-update-shallow-in-proto-v2'Junio C Hamano Thu, 25 Apr 2019 07:41:16 +0000 (16:41 +0900)

Merge branch 'jt/fetch-no-update-shallow-in-proto-v2'

Fix for protocol v2 support in "git fetch-pack" of shallow clones.

* jt/fetch-no-update-shallow-in-proto-v2:
fetch-pack: respect --no-update-shallow in v2
fetch-pack: call prepare_shallow_info only if v0

Merge branch 'jt/fetch-pack-wanted-refs-optim'Junio C Hamano Thu, 25 Apr 2019 07:41:16 +0000 (16:41 +0900)

Merge branch 'jt/fetch-pack-wanted-refs-optim'

Performance fix around "git fetch" that grabs many refs.

* jt/fetch-pack-wanted-refs-optim:
fetch-pack: binary search when storing wanted-refs

Merge branch 'ab/test-lib-pass-trace2-env'Junio C Hamano Thu, 25 Apr 2019 07:41:15 +0000 (16:41 +0900)

Merge branch 'ab/test-lib-pass-trace2-env'

Allow tracing of Git executable while running the testsuite.

* ab/test-lib-pass-trace2-env:
test-lib: whitelist GIT_TR2_* in the environment

Merge branch 'sg/index-pack-progress'Junio C Hamano Thu, 25 Apr 2019 07:41:15 +0000 (16:41 +0900)

Merge branch 'sg/index-pack-progress'

A progress indicator has been added to the "index-pack" step, which
often makes users wait for completion during "git clone".

* sg/index-pack-progress:
index-pack: show progress while checking objects

Merge branch 'ab/commit-graph-fixes'Junio C Hamano Thu, 25 Apr 2019 07:41:15 +0000 (16:41 +0900)

Merge branch 'ab/commit-graph-fixes'

Code cleanup with more careful error checking before using data
read from the commit-graph file.

* ab/commit-graph-fixes:
commit-graph: improve & i18n error messages
commit-graph write: don't die if the existing graph is corrupt
commit-graph verify: detect inability to read the graph
commit-graph: don't pass filename to load_commit_graph_one_fd_st()
commit-graph: don't early exit(1) on e.g. "git status"
commit-graph: fix segfault on e.g. "git status"
commit-graph tests: test a graph that's too small
commit-graph tests: split up corrupt_graph_and_verify()

Merge branch 'ab/gc-reflog'Junio C Hamano Thu, 25 Apr 2019 07:41:14 +0000 (16:41 +0900)

Merge branch 'ab/gc-reflog'

Fix various glitches in "git gc" around reflog handling.

* ab/gc-reflog:
gc: handle & check gc.reflogExpire config
reflog tests: assert lack of early exit with expiry="never"
reflog tests: test for the "points nowhere" warning
reflog tests: make use of "test_config" idiom
gc: refactor a "call me once" pattern
gc: convert to using the_hash_algo
gc: remove redundant check for gc_auto_threshold

Merge branch 'nd/checkout-m'Junio C Hamano Thu, 25 Apr 2019 07:41:14 +0000 (16:41 +0900)

Merge branch 'nd/checkout-m'

"git checkout -m <other>" was about carrying the differences
between HEAD and the working-tree files forward while checking out
another branch, and ignored the differences between HEAD and the
index. The command has been taught to abort when the index and the
HEAD are different.

* nd/checkout-m:
checkout: prevent losing staged changes with --merge
read-tree: add --quiet
unpack-trees: rename "gently" flag to "quiet"
unpack-trees: keep gently check inside add_rejected_path

Merge branch 'js/difftool-no-index'Junio C Hamano Thu, 25 Apr 2019 07:41:14 +0000 (16:41 +0900)

Merge branch 'js/difftool-no-index'

"git difftool" can now run outside a repository.

* js/difftool-no-index:
difftool: allow running outside Git worktrees with --no-index
parse-options: make OPT_ARGUMENT() more useful
difftool: remove obsolete (and misleading) comment

Merge branch 'pw/cherry-pick-continue'Junio C Hamano Thu, 25 Apr 2019 07:41:13 +0000 (16:41 +0900)

Merge branch 'pw/cherry-pick-continue'

"git cherry-pick --options A..B", after giving control back to the
user to ask help resolving a conflicted step, did not honor the
options it originally received, which has been corrected.

* pw/cherry-pick-continue:
cherry-pick --continue: remember options
cherry-pick: demonstrate option amnesia
sequencer: break some long lines

Merge branch 'nd/commit-a-with-paths-msg-update'Junio C Hamano Thu, 25 Apr 2019 07:41:13 +0000 (16:41 +0900)

Merge branch 'nd/commit-a-with-paths-msg-update'

The message given when "git commit -a <paths>" errors out has been
updated.

* nd/commit-a-with-paths-msg-update:
commit: improve error message in "-a <paths>" case

Merge branch 'jk/server-info-rabbit-hole'Junio C Hamano Thu, 25 Apr 2019 07:41:13 +0000 (16:41 +0900)

Merge branch 'jk/server-info-rabbit-hole'

Code clean-up around a much-less-important-than-it-used-to-be
update_server_info() funtion.

* jk/server-info-rabbit-hole:
update_info_refs(): drop unused force parameter
server-info: drop objdirlen pointer arithmetic
server-info: drop nr_alloc struct member
server-info: use strbuf to read old info/packs file
server-info: simplify cleanup in parse_pack_def()
server-info: fix blind pointer arithmetic
http: simplify parsing of remote objects/info/packs
packfile: fix pack basename computation
midx: check both pack and index names for containment
t5319: drop useless --buffer from cat-file
t5319: fix bogus cat-file argument
pack-revindex: open index if necessary
packfile.h: drop extern from function declarations

Merge branch 'nd/diff-parseopt-4'Junio C Hamano Thu, 25 Apr 2019 07:41:12 +0000 (16:41 +0900)

Merge branch 'nd/diff-parseopt-4'

Fourth batch to teach the diff machinery to use the parse-options
API.

* nd/diff-parseopt-4:
am: avoid diff_opt_parse()
diff --no-index: use parse_options() instead of diff_opt_parse()
range-diff: use parse_options() instead of diff_opt_parse()
diff.c: allow --no-color-moved-ws
diff-parseopt: convert --color-moved-ws
diff-parseopt: convert --[no-]color-moved
diff-parseopt: convert --inter-hunk-context
diff-parseopt: convert --no-prefix
diff-parseopt: convert --line-prefix
diff-parseopt: convert --[src|dst]-prefix
diff-parseopt: convert --[no-]abbrev
diff-parseopt: convert --diff-filter
diff-parseopt: convert --find-object
diff-parseopt: convert -O
diff-parseopt: convert --pickaxe-all|--pickaxe-regex
diff-parseopt: convert -S|-G
diff-parseopt: convert -l
diff-parseopt: convert -z
diff-parseopt: convert --ita-[in]visible-in-index
diff-parseopt: convert --ws-error-highlight

Merge branch 'jk/unused-params-even-more'Junio C Hamano Thu, 25 Apr 2019 07:41:12 +0000 (16:41 +0900)

Merge branch 'jk/unused-params-even-more'

Code cleanup.

* jk/unused-params-even-more:
parse_opt_ref_sorting: always use with NONEG flag
pretty: drop unused strbuf from parse_padding_placeholder()
pretty: drop unused "type" parameter in needs_rfc2047_encoding()
parse-options: drop unused ctx parameter from show_gitcomp()
fetch_pack(): drop unused parameters
report_path_error(): drop unused prefix parameter
unpack-trees: drop unused error_type parameters
unpack-trees: drop name_entry from traverse_by_cache_tree()
test-date: drop unused "now" parameter from parse_dates()
update-index: drop unused prefix_length parameter from do_reupdate()
log: drop unused "len" from show_tagger()
log: drop unused rev_info from early output
revision: drop some unused "revs" parameters

Merge branch 'sg/test-atexit'Junio C Hamano Thu, 25 Apr 2019 07:41:12 +0000 (16:41 +0900)

Merge branch 'sg/test-atexit'

Test framework update to more robustly clean up leftover files and
processes after tests are done.

* sg/test-atexit:
t9811-git-p4-label-import: fix pipeline negation
git p4 test: disable '-x' tracing in the p4d watchdog loop
git p4 test: simplify timeout handling
git p4 test: clean up the p4d cleanup functions
git p4 test: use 'test_atexit' to kill p4d and the watchdog process
t0301-credential-cache: use 'test_atexit' to stop the credentials helper
tests: use 'test_atexit' to stop httpd
git-daemon: use 'test_atexit` to stop 'git-daemon'
test-lib: introduce 'test_atexit'
t/lib-git-daemon: make sure to kill the 'git-daemon' process
test-lib: fix interrupt handling with 'dash' and '--verbose-log -x'

Merge branch 'ag/sequencer-reduce-rewriting-todo'Junio C Hamano Thu, 25 Apr 2019 07:41:11 +0000 (16:41 +0900)

Merge branch 'ag/sequencer-reduce-rewriting-todo'

The scripted version of "git rebase -i" wrote and rewrote the todo
list many times during a single step of its operation, and the
recent C-rewrite made a faithful conversion of the logic to C. The
implementation has been updated to carry necessary information
around in-core to avoid rewriting the same file over and over
unnecessarily.

* ag/sequencer-reduce-rewriting-todo:
rebase--interactive: move transform_todo_file()
sequencer: use edit_todo_list() in complete_action()
rebase-interactive: rewrite edit_todo_list() to handle the initial edit
rebase-interactive: append_todo_help() changes
rebase-interactive: use todo_list_write_to_file() in edit_todo_list()
sequencer: refactor skip_unnecessary_picks() to work on a todo_list
rebase--interactive: move rearrange_squash_in_todo_file()
rebase--interactive: move sequencer_add_exec_commands()
sequencer: change complete_action() to use the refactored functions
sequencer: make sequencer_make_script() write its script to a strbuf
sequencer: refactor rearrange_squash() to work on a todo_list
sequencer: refactor sequencer_add_exec_commands() to work on a todo_list
sequencer: refactor check_todo_list() to work on a todo_list
sequencer: introduce todo_list_write_to_file()
sequencer: refactor transform_todos() to work on a todo_list
sequencer: remove the 'arg' field from todo_item
sequencer: make the todo_list structure public
sequencer: changes in parse_insn_buffer()

Merge branch 'bp/post-index-change-hook'Junio C Hamano Thu, 25 Apr 2019 07:41:10 +0000 (16:41 +0900)

Merge branch 'bp/post-index-change-hook'

A new hook "post-index-change" is called when the on-disk index
file changes, which can help e.g. a virtualized working tree
implementation.

* bp/post-index-change-hook:
read-cache: add post-index-change hook

t/perf: depend on perl JSON only when using --codespeedJeff King Tue, 23 Apr 2019 04:34:20 +0000 (00:34 -0400)

t/perf: depend on perl JSON only when using --codespeed

Commit 05eb1c37ed (perf/aggregate: implement codespeed JSON output,
2018-01-05) added a dependency on the perl JSON module to show output
from aggregate.perl, but we only need it when the user asks for
--codespeed output. While the module is pretty common, it's not part of
the base system, and this dependency can get in the way of producing the
default human-readable output.

Let's bump the "use" down to a "require" in the code path that needs it,
which will be interpreted at run-time instead of compile-time. People
not using "--codespeed" won't even load the module, and anybody using it
should see the same results (including the same perl error if they don't
have it).

Note that this skips the importing step, so we'll have to fully qualify
our function call. We could accomplish the same thing in other ways.
E.g., calling JSON->import() ourselves, or wrapping "use JSON" in an
eval. Since there's only one such call, this seems like the
least-magical way of doing it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc/ls-files: put nested list for "-t" option into... Jeff King Mon, 22 Apr 2019 15:15:41 +0000 (11:15 -0400)

doc/ls-files: put nested list for "-t" option into block

The description for the "-t" option contains a sub-list of all of the
possible file status outputs. But because of the newline separating that
list from the description paragraph, asciidoc treats the sub-list
entries as a continuation of the overall options list, rather than as
children of the "-t" description.

We could fix it by adding a "+" before the sub-list to connect it to the
rest of the "-t" text. But using a pair of "--" to delimit the block is
perhaps more readable, and may have better compatibility with
asciidoctor, as in 39a869b2f2 (Documentation/rev-list-options: wrap
--date=<format> block with "--", 2019-03-30).

The extra blank line comes from 5bc0e247c4 (Document ls-files -t as
semi-obsolete., 2010-07-28), but the problem actually seems older than
that. Before then, we did:

-t:: some text...
H:: cached
M:: unmerged
etc...

but asciidoc also treats that as one big list. So this problem seems to
have been around forever.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p5302: create the repo in each index-pack testJeff King Mon, 22 Apr 2019 21:19:52 +0000 (17:19 -0400)

p5302: create the repo in each index-pack test

The p5302 script runs "index-pack --stdin" in each timing test. It does
two things to try to get good timings:

1. we do the repo creation in a separate (non-timed) setup test, so
that our timing is purely the index-pack run

2. we use a separate repo for each test; this is important because the
presence of existing objects in the repo influences the result
(because we'll end up doing collision checks against them)

But this forgets one thing: we generally run each timed test multiple
times to reduce the impact of noise. Which means that repeats of each
test after the first will be subject to the collision slowdown from
point 2, and we'll generally just end up taking the first time anyway.

Instead, let's create the repo in the test (effectively undoing point
1). That does add a constant amount of extra work to each iteration, but
it's quite small compared to the actual effects we're interested in
measuring.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: dedup list of files obtained from ls-filesJunio C Hamano Sun, 21 Apr 2019 13:19:04 +0000 (22:19 +0900)

Makefile: dedup list of files obtained from ls-files

Since 33533975 ("Makefile: ask "ls-files" to list source files if
available", 2011-10-18), we optionally asked "ls-files" to list the
source files that ought to exist, as a faster approximation for
"find" on working tree files.

This works reasonably well, except that it ends up listing the same
path multiple times if the index is unmerged. Because the original
use of this construct was to name files to run etags over, and the
etags command happily takes the same filename multiple times without
causing any harm, there was no problem (other than perhaps spending
slightly more cycles, but who cares how fast the TAGS file gets
updated).

We however recently added a similar call to "ls-files" to list *.h
files, instead of using "find", in 92b88eba ("Makefile: use `git
ls-files` to list header files, if possible", 2019-03-04). In this
new use of "ls-files", the resulting list $(LIB_H) is used for,
among other things, generating the header files to run hdr-check
target, and the duplicate unfortunately becomes a true problem. It
causes $(MAKE) to notice that there are multiple %.hco targets and
complain.

Let the resulting list consumed by $(sort), which deduplicates,
to fix this.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

The sixth batchJunio C Hamano Mon, 22 Apr 2019 02:14:24 +0000 (11:14 +0900)

The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'da/smerge'Junio C Hamano Mon, 22 Apr 2019 02:14:48 +0000 (11:14 +0900)

Merge branch 'da/smerge'

"git mergetool" learned to offer Sublime Merge (smerge) as one of
its backends.

* da/smerge:
contrib/completion: add smerge to the mergetool completion candidates
mergetools: add support for smerge (Sublime Merge)

Merge branch 'dl/flex-str-cocci'Junio C Hamano Mon, 22 Apr 2019 02:14:47 +0000 (11:14 +0900)

Merge branch 'dl/flex-str-cocci'

Code clean-up.

* dl/flex-str-cocci:
cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STR
midx.c: convert FLEX_ALLOC_MEM to FLEX_ALLOC_STR

Merge branch 'js/spell-out-options-in-tests'Junio C Hamano Mon, 22 Apr 2019 02:14:47 +0000 (11:14 +0900)

Merge branch 'js/spell-out-options-in-tests'

The tests have been updated not to rely on the abbreviated option
names the parse-options API offers, to protect us from an
abbreviated form of an option that used to be unique within the
command getting non-unique when a new option that share the same
prefix is added.

* js/spell-out-options-in-tests:
tests: disallow the use of abbreviated options (by default)
tests (pack-objects): use the full, unabbreviated `--revs` option
tests (status): spell out the `--find-renames` option in full
tests (push): do not abbreviate the `--follow-tags` option
t5531: avoid using an abbreviated option
t7810: do not abbreviate `--no-exclude-standard` nor `--invert-match`
tests (rebase): spell out the `--force-rebase` option
tests (rebase): spell out the `--keep-empty` option

Merge branch 'nd/read-tree-reset-doc'Junio C Hamano Mon, 22 Apr 2019 02:14:47 +0000 (11:14 +0900)

Merge branch 'nd/read-tree-reset-doc'

The documentation for "git read-tree --reset -u" has been updated.

* nd/read-tree-reset-doc:
read-tree.txt: clarify --reset and worktree changes

Merge branch 'nd/interpret-trailers-docfix'Junio C Hamano Mon, 22 Apr 2019 02:14:47 +0000 (11:14 +0900)

Merge branch 'nd/interpret-trailers-docfix'

Doc update.

* nd/interpret-trailers-docfix:
interpret-trailers.txt: start the desc line with a capital letter