Junio C Hamano [Mon, 29 Jul 2019 19:38:13 +0000 (12:38 -0700)]
Merge branch 'sg/git-C-empty-doc' into maint
Doc update.
* sg/git-C-empty-doc:
Document that 'git -C ""' works and doesn't change directory
Junio C Hamano [Mon, 29 Jul 2019 19:38:12 +0000 (12:38 -0700)]
Merge branch 'sg/ci-brew-gcc-workaround' into maint
Dev support update.
* sg/ci-brew-gcc-workaround:
ci/lib.sh: update a comment about installed P4 and Git-LFS versions
ci: disable Homebrew's auto cleanup
ci: don't update Homebrew
Junio C Hamano [Mon, 29 Jul 2019 19:38:12 +0000 (12:38 -0700)]
Merge branch 'js/trace2-signo-typofix' into maint
Documentation fix.
* js/trace2-signo-typofix:
trace2: correct trace2 field name documentation
Junio C Hamano [Mon, 29 Jul 2019 19:38:12 +0000 (12:38 -0700)]
Merge branch 'di/readme-markup-fix' into maint
Docfix.
* di/readme-markup-fix:
README: fix rendering of text in angle brackets
Junio C Hamano [Mon, 29 Jul 2019 19:38:12 +0000 (12:38 -0700)]
Merge branch 'vn/xmmap-gently' into maint
Clean-up an error codepath.
* vn/xmmap-gently:
read-cache.c: do not die if mmap fails
Junio C Hamano [Mon, 29 Jul 2019 19:38:12 +0000 (12:38 -0700)]
Merge branch 'rm/gpg-program-doc-fix' into maint
Docfix.
* rm/gpg-program-doc-fix:
gpg(docs): use correct --verify syntax
Junio C Hamano [Mon, 29 Jul 2019 19:38:11 +0000 (12:38 -0700)]
Merge branch 'js/unmap-before-ext-diff' into maint
Windows update.
* js/unmap-before-ext-diff:
diff: munmap() file contents before running external diff
Junio C Hamano [Mon, 29 Jul 2019 19:38:11 +0000 (12:38 -0700)]
Merge branch 'js/gcc-8-and-9' into maint
Code clean-up for new compilers.
The 'kwset' one may get a wholesale replacement, either with new
version of kwset from upstream or removal of its users, but in the
meantime, it is probably OK to merge it down.
* js/gcc-8-and-9:
config: avoid calling `labs()` on too-large data type
winansi: simplify loading the GetCurrentConsoleFontEx() function
kwset: allow building with GCC 8
poll (mingw): allow compiling with GCC 8 and DEVELOPER=1
SZEDER Gábor [Mon, 29 Jul 2019 09:59:14 +0000 (11:59 +0200)]
Documentation/git-fsck.txt: include fsck.* config variables
The 'fsck.skipList' and 'fsck.<msg-id>' config variables might be
easier to discover when they are documented in 'git fsck's man page.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlo Marcelo Arenas Belón [Sun, 28 Jul 2019 20:07:24 +0000 (13:07 -0700)]
xdiff: remove duplicate headers from xpatience.c
92b7de93fb (Implement the patience diff algorithm, 2009-01-07) added them
but were already part of xinclude.h
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlo Marcelo Arenas Belón [Sun, 28 Jul 2019 20:07:23 +0000 (13:07 -0700)]
xdiff: remove duplicate headers from xhistogram.c
8c912eea94 ("teach --histogram to diff", 2011-07-12) included them, but
were already part of xinclude.h
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlo Marcelo Arenas Belón [Sun, 28 Jul 2019 20:07:22 +0000 (13:07 -0700)]
xdiff: drop system includes in xutils.c
After
b46054b374 ("xdiff: use git-compat-util", 2019-04-11), two system
headers added with
6942efcfa9 ("xdiff: load full words in the inner loop
of xdl_hash_record", 2012-04-06) to xutils.c are no longer needed and
could conflict as shown below from an OpenIndiana build:
In file included from xdiff/xinclude.h:26:0,
from xdiff/xutils.c:25:
./git-compat-util.h:4:0: warning: "_FILE_OFFSET_BITS" redefined
#define _FILE_OFFSET_BITS 64
In file included from /usr/include/limits.h:37:0,
from xdiff/xutils.c:23:
/usr/include/sys/feature_tests.h:231:0: note: this is the location of the previous definition
#define _FILE_OFFSET_BITS 32
Make sure git-compat-util.h is the first header (through xinclude.h)
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 25 Jul 2019 21:34:17 +0000 (14:34 -0700)]
Sync with maint
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 25 Jul 2019 21:32:36 +0000 (14:32 -0700)]
Flush fixes up to the third batch post 2.22.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 25 Jul 2019 21:27:16 +0000 (14:27 -0700)]
Merge branch 'ab/hash-object-doc' into maint
Doc update.
* ab/hash-object-doc:
hash-object doc: stop mentioning git-cvsimport
Junio C Hamano [Thu, 25 Jul 2019 21:27:15 +0000 (14:27 -0700)]
Merge branch 'cm/send-email-document-req-modules' into maint
A doc update.
* cm/send-email-document-req-modules:
send-email: update documentation of required Perl modules
Junio C Hamano [Thu, 25 Jul 2019 21:27:15 +0000 (14:27 -0700)]
Merge branch 'sw/git-p4-unshelve-branched-files' into maint
"git p4" update.
* sw/git-p4-unshelve-branched-files:
git-p4: allow unshelving of branched files
Junio C Hamano [Thu, 25 Jul 2019 21:27:14 +0000 (14:27 -0700)]
Merge branch 'js/bisect-helper-check-get-oid-return-value' into maint
Code cleanup.
* js/bisect-helper-check-get-oid-return-value:
bisect--helper: verify HEAD could be parsed before continuing
Junio C Hamano [Thu, 25 Jul 2019 21:27:14 +0000 (14:27 -0700)]
Merge branch 'es/git-debugger-doc' into maint
Doc update.
* es/git-debugger-doc:
doc: hint about GIT_DEBUGGER in CodingGuidelines
Junio C Hamano [Thu, 25 Jul 2019 21:27:14 +0000 (14:27 -0700)]
Merge branch 'mo/clang-format-for-each-update' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:13 +0000 (14:27 -0700)]
Merge branch 'md/url-parse-harden' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:13 +0000 (14:27 -0700)]
Merge branch 'an/ignore-doc-update' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:12 +0000 (14:27 -0700)]
Merge branch 'md/list-objects-filter-memfix' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:12 +0000 (14:27 -0700)]
Merge branch 'jt/partial-clone-missing-ref-delta-base' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:12 +0000 (14:27 -0700)]
Merge branch 'xl/record-partial-clone-origin' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:11 +0000 (14:27 -0700)]
Merge branch 'pb/request-pull-verify-remote-ref' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:11 +0000 (14:27 -0700)]
Merge branch 'mm/p4-unshelve-windows-fix' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:10 +0000 (14:27 -0700)]
Merge branch 'bb/unicode-12.1-reiwa' into maint
Update to Unicode 12.1 width table.
* bb/unicode-12.1-reiwa:
unicode: update the width tables to Unicode 12.1
Junio C Hamano [Thu, 25 Jul 2019 21:27:10 +0000 (14:27 -0700)]
Merge branch 'js/fsmonitor-unflake' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:10 +0000 (14:27 -0700)]
Merge branch 'vv/merge-squash-with-explicit-commit' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:09 +0000 (14:27 -0700)]
Merge branch 'js/bundle-verify-require-object-store' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:09 +0000 (14:27 -0700)]
Merge branch 'jk/am-i-resolved-fix' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:09 +0000 (14:27 -0700)]
Merge branch 'jk/HEAD-symref-in-xfer-namespaces' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:08 +0000 (14:27 -0700)]
Merge branch 'ew/server-info-remove-crufts' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:08 +0000 (14:27 -0700)]
Merge branch 'es/grep-require-name-when-needed' into maint
More parameter validation.
* es/grep-require-name-when-needed:
grep: fail if call could output and name is null
Junio C Hamano [Thu, 25 Jul 2019 21:27:08 +0000 (14:27 -0700)]
Merge branch 'ds/object-info-for-prefetch-fix' into maint
Code cleanup and futureproof.
* ds/object-info-for-prefetch-fix:
sha1-file: split OBJECT_INFO_FOR_PREFETCH
Junio C Hamano [Thu, 25 Jul 2019 21:27:07 +0000 (14:27 -0700)]
Merge branch 'mh/import-transport-fd-fix' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 21:27:07 +0000 (14:27 -0700)]
Merge branch 'nd/corrupt-worktrees' into maint
"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
Junio C Hamano [Thu, 25 Jul 2019 21:27:06 +0000 (14:27 -0700)]
Merge branch 'nd/init-relative-template-fix' into maint
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
Junio C Hamano [Thu, 25 Jul 2019 20:56:20 +0000 (13:56 -0700)]
The seventh batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 25 Jul 2019 20:59:24 +0000 (13:59 -0700)]
Merge branch 'jk/test-commit-bulk'
A test helper has been introduced to optimize preparation of test
repositories with many simple commits, and a handful of test
scripts have been updated to use it.
* jk/test-commit-bulk:
t6200: use test_commit_bulk
t5703: use test_commit_bulk
t5702: use test_commit_bulk
t3311: use test_commit_bulk
t5310: increase the number of bitmapped commits
test-lib: introduce test_commit_bulk
Junio C Hamano [Thu, 25 Jul 2019 20:59:24 +0000 (13:59 -0700)]
Merge branch 'di/readme-markup-fix'
Docfix.
* di/readme-markup-fix:
README: fix rendering of text in angle brackets
Junio C Hamano [Thu, 25 Jul 2019 20:59:24 +0000 (13:59 -0700)]
Merge branch 'jc/denoise-rm-to-resolve'
"git rm" to resolve a conflicted path leaked an internal message
"needs merge" before actually removing the path, which was
confusing. This has been corrected.
* jc/denoise-rm-to-resolve:
rm: resolving by removal is not a warning-worthy event
Junio C Hamano [Thu, 25 Jul 2019 20:59:24 +0000 (13:59 -0700)]
Merge branch 'js/clean-report-too-long-a-path'
"git clean" silently skipped a path when it cannot lstat() it; now
it gives a warning.
* js/clean-report-too-long-a-path:
clean: show an error message when the path is too long
Junio C Hamano [Thu, 25 Jul 2019 20:59:23 +0000 (13:59 -0700)]
Merge branch 'tg/stash-keep-index-with-removed-paths'
"git stash --keep-index" did not work correctly on paths that have
been removed, which has been fixed.
* tg/stash-keep-index-with-removed-paths:
stash: fix handling removed files with --keep-index
Junio C Hamano [Thu, 25 Jul 2019 20:59:23 +0000 (13:59 -0700)]
Merge branch 'sr/gpg-interface-stop-at-the-end'
A codepath that reads from GPG for signed object verification read
past the end of allocated buffer, which has been fixed.
* sr/gpg-interface-stop-at-the-end:
gpg-interface: do not scan past the end of buffer
Junio C Hamano [Thu, 25 Jul 2019 20:59:23 +0000 (13:59 -0700)]
Merge branch 'js/mingw-spawn-with-spaces-in-path'
Window 7 update ;-)
* js/mingw-spawn-with-spaces-in-path:
mingw: support spawning programs containing spaces in their names
Junio C Hamano [Thu, 25 Jul 2019 20:59:22 +0000 (13:59 -0700)]
Merge branch 'jc/post-c89-rules-doc'
We have been trying out a few language features outside c89; the
coding guidelines document did not talk about them and instead had
a blanket ban against them.
* jc/post-c89-rules-doc:
CodingGuidelines: spell out post-C89 rules
Junio C Hamano [Thu, 25 Jul 2019 20:59:22 +0000 (13:59 -0700)]
Merge branch 'mt/dir-iterator-updates'
Adjust the dir-iterator API and apply it to the local clone
optimization codepath.
* mt/dir-iterator-updates:
clone: replace strcmp by fspathcmp
clone: use dir-iterator to avoid explicit dir traversal
clone: extract function from copy_or_link_directory
clone: copy hidden paths at local clone
dir-iterator: add flags parameter to dir_iterator_begin
dir-iterator: refactor state machine model
dir-iterator: use warning_errno when possible
dir-iterator: add tests for dir-iterator API
clone: better handle symlinked files at .git/objects/
clone: test for our behavior on odd objects/* content
Junio C Hamano [Thu, 25 Jul 2019 20:59:22 +0000 (13:59 -0700)]
Merge branch 'vn/xmmap-gently'
Clean-up an error codepath.
* vn/xmmap-gently:
read-cache.c: do not die if mmap fails
Junio C Hamano [Thu, 25 Jul 2019 20:59:22 +0000 (13:59 -0700)]
Merge branch 'ac/log-use-mailmap-by-default-transition'
The "git log" command learns to issue a warning when log.mailmap
configuration is not set and --[no-]mailmap option is not used, to
prepare users for future versions of Git that uses the mailmap by
default.
* ac/log-use-mailmap-by-default-transition:
tests: defang pager tests by explicitly disabling the log.mailmap warning
documentation: mention --no-use-mailmap and log.mailmap false setting
log: add warning for unspecified log.mailmap setting
Junio C Hamano [Thu, 25 Jul 2019 20:59:22 +0000 (13:59 -0700)]
Merge branch 'es/local-atomic-push-failure-with-http'
"git push --atomic" that goes over the transport-helper (namely,
the smart http transport) failed to prevent refs to be pushed when
it can locally tell that one of the ref update will fail without
having to consult the other end, which has been corrected.
* es/local-atomic-push-failure-with-http:
transport-helper: avoid var decl in for () loop control
transport-helper: enforce atomic in push_refs_with_push
Junio C Hamano [Thu, 25 Jul 2019 20:59:21 +0000 (13:59 -0700)]
Merge branch 'rm/gpg-program-doc-fix'
Docfix.
* rm/gpg-program-doc-fix:
gpg(docs): use correct --verify syntax
Junio C Hamano [Thu, 25 Jul 2019 20:59:21 +0000 (13:59 -0700)]
Merge branch 'js/unmap-before-ext-diff'
Windows update.
* js/unmap-before-ext-diff:
diff: munmap() file contents before running external diff
Junio C Hamano [Thu, 25 Jul 2019 20:59:20 +0000 (13:59 -0700)]
Merge branch 'tg/range-diff-output-update'
"git range-diff" output has been tweaked for easier identification
of which part of what file the patch shown is about.
* tg/range-diff-output-update:
range-diff: add headers to the outer hunk header
range-diff: add filename to inner diff
range-diff: add section header instead of diff header
range-diff: suppress line count in outer diff
range-diff: don't remove funcname from inner diff
range-diff: split lines manually
range-diff: fix function parameter indentation
apply: make parse_git_diff_header public
apply: only pass required data to gitdiff_* functions
apply: only pass required data to find_name_*
apply: only pass required data to check_header_line
apply: only pass required data to git_header_name
apply: only pass required data to skip_tree_prefix
apply: replace marc.info link with public-inbox
Junio C Hamano [Thu, 25 Jul 2019 20:59:20 +0000 (13:59 -0700)]
Merge branch 'ab/test-env'
Many GIT_TEST_* environment variables control various aspects of
how our tests are run, but a few followed "non-empty is true, empty
or unset is false" while others followed the usual "there are a few
ways to spell true, like yes, on, etc., and also ways to spell
false, like no, off, etc." convention.
* ab/test-env:
env--helper: mark a file-local symbol as static
tests: make GIT_TEST_FAIL_PREREQS a boolean
tests: replace test_tristate with "git env--helper"
tests README: re-flow a previously changed paragraph
tests: make GIT_TEST_GETTEXT_POISON a boolean
t6040 test: stop using global "script" variable
config.c: refactor die_bad_number() to not call gettext() early
env--helper: new undocumented builtin wrapping git_env_*()
config tests: simplify include cycle test
Johannes Schindelin [Wed, 24 Jul 2019 21:15:00 +0000 (14:15 -0700)]
git: mark cmd_rebase as requiring a worktree
We skipped marking the "rebase" built-in as requiring a .git/ directory
and a worktree only to allow to spawn the scripted version of `git
rebase`.
Now that we no longer have that escape hatch, we can change that to the
canonical form.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 24 Jul 2019 21:14:59 +0000 (14:14 -0700)]
rebase: fix white-space
This trailing space was inadvertently introduced in
9fbcc3d203 (Merge
branch 'js/rebase-orig-head-fix', 2019-03-20).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 23 Jul 2019 19:27:05 +0000 (15:27 -0400)]
xdiff: clamp function context indices in post-image
After finding a function line for --function-context in the pre-image,
xdl_emit_diff() calculates the equivalent line in the post-image. It
assumes that the lines between changes are the same on both sides. If
the option --ignore-blank-lines was also given then this is not
necessarily true.
Clamp the calculation results for start and end of the function context
to prevent out-of-bounds array accesses.
Note that this _just_ fixes the case where our mismatch sends us off the
beginning of the file. There are likely other cases where our assumption
causes us to go to the wrong line within the file. Nobody has developed
a test case yet, and the ultimate fix is likely more complicated than
this patch. But this at least prevents a segfault in the meantime.
Credit for finding the bug goes to "Liu Wei of Tencent Security Xuanwu
Lab".
Reported-by: 刘炜 <lw17qhdz@gmail.com>
Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Beat Bolli [Mon, 22 Jul 2019 18:19:23 +0000 (20:19 +0200)]
grep: print the pcre2_jit_on value
When pcre2_jit_on is neither 1 nor 0, the BUG() call printed the value
of pcre1_jit_on.
Print the value of pcre2_jit_on instead.
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 19 Jul 2019 21:56:23 +0000 (17:56 -0400)]
t6200: use test_commit_bulk
There's a loop that creates 30 commits using test_commit. Using
test_commit_bulk speeds this up from:
Benchmark #1: ./t6200-fmt-merge-msg.sh --root=/var/ram/git-tests
Time (mean ± σ): 1.926 s ± 0.240 s [User: 1.055 s, System: 0.963 s]
Range (min … max): 1.431 s … 2.166 s 10 runs
to:
Benchmark #1: ./t6200-fmt-merge-msg.sh --root=/var/ram/git-tests
Time (mean ± σ): 1.343 s ± 0.179 s [User: 766.5 ms, System: 662.9 ms]
Range (min … max): 1.032 s … 1.664 s 10 runs
for an average savings of over 30%.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor [Thu, 18 Jul 2019 15:22:34 +0000 (17:22 +0200)]
travis-ci: build with GCC 4.8 as well
C99 'for' loop initial declaration, i.e. 'for (int i = 0; i < n; i++)',
is not allowed in Git's codebase yet, to maintain compatibility with
some older compilers.
Our Travis CI builds used to catch 'for' loop initial declarations,
because the GETTEXT_POISON job has always built Git with the default
'cc', which in Travis CI's previous default Linux image (based on
Ubuntu 14.04 Trusty) is GCC 4.8, and that GCC version errors out on
this construct (not only with DEVELOPER=1, but with our default CFLAGS
as well). Alas, that's not the case anymore, becase after 14.04's EOL
Travis CI's current default Linux image is based on Ubuntu 16.04
Xenial [1] and its default 'cc' is now GCC 5.4, which, just like all
later GCC and Clang versions, simply accepts this construct, even if
we don't explicitly specify '-std=c99'.
Ideally we would adjust our CFLAGS used with DEVELOPER=1 to catch this
undesired construct already when contributors build Git on their own
machines. Unfortunately, however, there seems to be no compiler
option that would catch only this particular construct without choking
on many other things, e.g. while a later compiler with '-std=c90'
and/or '-ansi' does catch this construct, it can't build Git because
of several screenfulls of other errors.
Add the 'linux-gcc-4.8' job to Travis CI, in order to build Git with
GCC 4.8, and thus to timely catch any 'for' loop initial declarations.
To catch those it's sufficient to only build Git with GCC 4.8, so
don't run the test suite in this job, because 'make test' takes rather
long [2], and it's already run five times in other jobs, so we
wouldn't get our time's worth.
[1] The Azure Pipelines builds have been using Ubuntu 16.04 images
from the start, so I belive they never caught 'for' loop initial
declarations.
[2] On Travis CI 'make test' alone would take about 9 minutes in this
new job (without running httpd, Subversion, and P4 tests). For
comparison, starting the job and building Git with GCC 4.8 takes
only about 2 minutes.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 19 Jul 2019 18:34:23 +0000 (11:34 -0700)]
The sixth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 19 Jul 2019 18:30:23 +0000 (11:30 -0700)]
Merge branch 'ma/ref-filter-leakfix'
Leakfix.
* ma/ref-filter-leakfix:
ref-filter: fix memory leak in `free_array_item()`
Junio C Hamano [Fri, 19 Jul 2019 18:30:23 +0000 (11:30 -0700)]
Merge branch 'js/trace2-signo-typofix'
Documentation fix.
* js/trace2-signo-typofix:
trace2: correct trace2 field name documentation
Junio C Hamano [Fri, 19 Jul 2019 18:30:23 +0000 (11:30 -0700)]
Merge branch 'kb/mingw-set-home'
Windows port update.
* kb/mingw-set-home:
mingw: initialize HOME on startup
Junio C Hamano [Fri, 19 Jul 2019 18:30:23 +0000 (11:30 -0700)]
Merge branch 'ea/merge-code-cleanup'
A loop has been rewritten for conciseness and clarity.
* ea/merge-code-cleanup:
builtin/merge.c - cleanup of code in for-cycle that tests strategies
Junio C Hamano [Fri, 19 Jul 2019 18:30:23 +0000 (11:30 -0700)]
Merge branch 'jl/status-reduce-vertical-blank'
Extra blank lines in "git status" output have been reduced.
* jl/status-reduce-vertical-blank:
status: remove the empty line after hints
Junio C Hamano [Fri, 19 Jul 2019 18:30:22 +0000 (11:30 -0700)]
Merge branch 'pw/rebase-progress-test-cleanup'
Test cleanup.
* pw/rebase-progress-test-cleanup:
t3420: remove progress lines before comparing output
Junio C Hamano [Fri, 19 Jul 2019 18:30:22 +0000 (11:30 -0700)]
Merge branch 'pw/prompt-cherry-pick-revert-fix'
When one step in multi step cherry-pick or revert is reset or
committed, the command line prompt script failed to notice the
current status, which has been improved.
* pw/prompt-cherry-pick-revert-fix:
git-prompt: improve cherry-pick/revert detection
Junio C Hamano [Fri, 19 Jul 2019 18:30:22 +0000 (11:30 -0700)]
Merge branch 'ew/repack-with-bitmaps-by-default'
Generation of pack bitmaps are now disabled when .keep files exist,
as these are mutually exclusive features.
* ew/repack-with-bitmaps-by-default:
repack: disable bitmaps-by-default if .keep files exist
Junio C Hamano [Fri, 19 Jul 2019 18:30:21 +0000 (11:30 -0700)]
Merge branch 'jk/check-connected-with-alternates'
The tips of refs from the alternate object store can be used as
starting point for reachability computation now.
* jk/check-connected-with-alternates:
check_everything_connected: assume alternate ref tips are valid
object-store.h: move for_each_alternate_ref() from transport.h
Junio C Hamano [Fri, 19 Jul 2019 18:30:21 +0000 (11:30 -0700)]
Merge branch 'nd/tree-walk-with-repo'
The tree-walk API learned to pass an in-core repository
instance throughout more codepaths.
* nd/tree-walk-with-repo:
t7814: do not generate same commits in different repos
Use the right 'struct repository' instead of the_repository
match-trees.c: remove the_repo from shift_tree*()
tree-walk.c: remove the_repo from get_tree_entry_follow_symlinks()
tree-walk.c: remove the_repo from get_tree_entry()
tree-walk.c: remove the_repo from fill_tree_descriptor()
sha1-file.c: remove the_repo from read_object_with_reference()
Junio C Hamano [Fri, 19 Jul 2019 18:30:21 +0000 (11:30 -0700)]
Merge branch 'ra/cherry-pick-revert-skip'
"git cherry-pick/revert" learned a new "--skip" action.
* ra/cherry-pick-revert-skip:
cherry-pick/revert: advise using --skip
cherry-pick/revert: add --skip option
sequencer: use argv_array in reset_merge
sequencer: rename reset_for_rollback to reset_merge
sequencer: add advice for revert
Junio C Hamano [Fri, 19 Jul 2019 18:30:21 +0000 (11:30 -0700)]
Merge branch 'tb/ref-filter-multiple-patterns'
"git for-each-ref" with multiple patterns have been optimized.
* tb/ref-filter-multiple-patterns:
ref-filter.c: find disjoint pattern prefixes
Junio C Hamano [Fri, 19 Jul 2019 18:30:20 +0000 (11:30 -0700)]
Merge branch 'pw/status-with-corrupt-sequencer-state'
The code to read state files used by the sequencer machinery for
"git status" has been made more robust against a corrupt or stale
state files.
* pw/status-with-corrupt-sequencer-state:
status: do not report errors in sequencer/todo
sequencer: factor out todo command name parsing
sequencer: always allow tab after command name
Junio C Hamano [Fri, 19 Jul 2019 18:30:20 +0000 (11:30 -0700)]
Merge branch 'ds/commit-graph-incremental'
The commits in a repository can be described by multiple
commit-graph files now, which allows the commit-graph files to be
updated incrementally.
* ds/commit-graph-incremental:
commit-graph: test verify across alternates
commit-graph: normalize commit-graph filenames
commit-graph: test --split across alternate without --split
commit-graph: test octopus merges with --split
commit-graph: clean up chains after flattened write
commit-graph: verify chains with --shallow mode
commit-graph: create options for split files
commit-graph: expire commit-graph files
commit-graph: allow cross-alternate chains
commit-graph: merge commit-graph chains
commit-graph: add --split option to builtin
commit-graph: write commit-graph chains
commit-graph: rearrange chunk count logic
commit-graph: add base graphs chunk
commit-graph: load commit-graph chains
commit-graph: rename commit_compare to oid_compare
commit-graph: prepare for commit-graph chains
commit-graph: document commit-graph chains
Junio C Hamano [Fri, 19 Jul 2019 18:30:20 +0000 (11:30 -0700)]
Merge branch 'br/blame-ignore'
"git blame" learned to "ignore" commits in the history, whose
effects (as well as their presence) get ignored.
* br/blame-ignore:
t8014: remove unnecessary braces
blame: drop some unused function parameters
blame: add a test to cover blame_coalesce()
blame: use the fingerprint heuristic to match ignored lines
blame: add a fingerprint heuristic to match ignored lines
blame: optionally track line fingerprints during fill_blame_origin()
blame: add config options for the output of ignored or unblamable lines
blame: add the ability to ignore commits and their changes
blame: use a helper function in blame_chunk()
Move oidset_parse_file() to oidset.c
fsck: rename and touch up init_skiplist()
Junio C Hamano [Fri, 19 Jul 2019 18:30:19 +0000 (11:30 -0700)]
Merge branch 'cc/test-oidmap'
Extend the test coverage a bit.
* cc/test-oidmap:
t0016: add 'remove' subcommand test
test-oidmap: remove 'add' subcommand
test-hashmap: remove 'hash' command
oidmap: use sha1hash() instead of static hash() function
t: add t0016-oidmap.sh
t/helper: add test-oidmap.c
Junio C Hamano [Fri, 19 Jul 2019 18:30:19 +0000 (11:30 -0700)]
Merge branch 'ds/midx-expire-repack'
"git multi-pack-index" learned expire and repack subcommands.
* ds/midx-expire-repack:
t5319: use 'test-tool path-utils' instead of 'ls -l'
t5319-multi-pack-index.sh: test batch size zero
midx: add test that 'expire' respects .keep files
multi-pack-index: test expire while adding packs
midx: implement midx_repack()
multi-pack-index: prepare 'repack' subcommand
multi-pack-index: implement 'expire' subcommand
midx: refactor permutation logic and pack sorting
midx: simplify computation of pack name lengths
multi-pack-index: prepare for 'expire' subcommand
Docs: rearrange subcommands for multi-pack-index
repack: refactor pack deletion for future use
Johannes Schindelin [Thu, 18 Jul 2019 09:30:33 +0000 (02:30 -0700)]
clean: show an error message when the path is too long
When `lstat()` failed, `git clean` would abort without an error
message, leaving the user quite puzzled.
In particular on Windows, where the default maximum path length is
quite small (yet there are ways to circumvent that limit in many
cases), it is very important that users be given an indication why
their command failed because of too long paths when it did.
This test case makes sure that a warning is issued that would have
helped the user who reported this issue:
https://github.com/git-for-windows/git/issues/521
Note that we temporarily set `core.longpaths = false` in the regression
test; this ensures forward-compatibility with the `core.longpaths`
feature that has not yet been upstreamed from Git for Windows.
Helped-by: René Scharfe <l.s.r@web.de>
Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 16 Jul 2019 17:21:20 +0000 (10:21 -0700)]
CodingGuidelines: spell out post-C89 rules
Even though we have been sticking to C89, there are a few handy
features we borrow from more recent C language in our codebase after
trying them in weather balloons and saw that nobody screamed.
Spell them out.
While at it, extend the existing variable declaration rule a bit to
read better with the newly spelled out rule for the for loop.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Doug Ilijev [Thu, 18 Jul 2019 19:08:45 +0000 (12:08 -0700)]
README: fix rendering of text in angle brackets
Markdown incorrectly interpreted `<commandname>` as an HTML tag;
use backticks to escape `Documentation/git-<commandname>.txt` to ensure
that it renders the text as intended.
Signed-off-by: Doug Ilijev <doug.ilijev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 17 Jul 2019 20:28:24 +0000 (13:28 -0700)]
rm: resolving by removal is not a warning-worthy event
When resolving a conflict on a path in favor of removing it, using
"git rm" on it is the standard way to do so. The user however is
greeted with a "needs merge" message during that operation:
$ git merge side-branch
$ edit conflicted-path-1
$ git add conflicted-path-1
$ git rm conflicted-path-2
conflicted-path-2: needs merge
rm 'conflicted-path-2'
The removal by "git rm" does get performed, but an uninitiated user
may find it confusing, "needs merge? so I need to resolve conflict
before being able to remove it???"
The message is coming from "update-index --refresh" that is called
internally to make sure "git rm" knows which paths are clean and
which paths are dirty, in order to prevent removal of paths modified
relative to the index without the "-f" option. We somehow ended up
not squelching this message which seeped through to the UI surface.
Use the same mechanism used by "git commit", "git describe", etc. to
squelch the message.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 16 Jul 2019 20:28:21 +0000 (13:28 -0700)]
transport-helper: avoid var decl in for () loop control
We do allow a few selected C99 constructs in our codebase these
days, but this is not among them (yet).
Reported-by: Carlo Arenas <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Gummerer [Tue, 16 Jul 2019 14:23:22 +0000 (15:23 +0100)]
stash: fix handling removed files with --keep-index
git stash push --keep-index is supposed to keep all changes that have
been added to the index, both in the index and on disk.
Currently this doesn't behave correctly when a file is removed from
the index. Instead of keeping it deleted on disk, --keep-index
currently restores the file.
Fix that behaviour by using 'git checkout' in no-overlay mode which
can faithfully restore the index and working tree. This also
simplifies the code.
Note that this will overwrite untracked files if the untracked file
has the same name as a file that has been deleted in the index.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Tue, 16 Jul 2019 14:03:12 +0000 (07:03 -0700)]
mingw: support spawning programs containing spaces in their names
On some older Windows versions (e.g. Windows 7), the CreateProcessW()
function does not really support spaces in its first argument,
lpApplicationName. But it supports passing NULL as lpApplicationName,
which makes it figure out the application from the (possibly quoted)
first argument of lpCommandLine.
Let's use that trick (if we are certain that the first argument matches
the executable's path) to support launching programs whose path contains
spaces.
We will abuse the test-fake-ssh.exe helper to verify that this works and
does not regress.
This fixes https://github.com/git-for-windows/git/issues/692
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Steven Roberts [Tue, 16 Jul 2019 18:47:37 +0000 (11:47 -0700)]
gpg-interface: do not scan past the end of buffer
If the GPG output ends with trailing blank lines, after skipping
them over inside the loop to find the terminating NUL at the end,
the loop ends up looking for the next line, starting past the end.
Signed-off-by: Steven Roberts <sroberts@fenderq.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ariadne Conill [Mon, 15 Jul 2019 12:41:06 +0000 (07:41 -0500)]
tests: defang pager tests by explicitly disabling the log.mailmap warning
In the previous patch, we added a deprecation warning for the current
log.mailmap setting. This warning only appears when git is attached to
a controlling terminal. Some tests however run under an emulated
terminal, so we need to disable the warning for those tests.
Thanks to Junio for suggesting that we do this in the setup function.
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ariadne Conill [Mon, 15 Jul 2019 12:41:05 +0000 (07:41 -0500)]
documentation: mention --no-use-mailmap and log.mailmap false setting
The log.mailmap setting may be explicitly set to false, which disables
the mailmap feature implicity. In practice, doing so is equivalent to
always using the previously undocumented --no-use-mailmap option on the
command line.
Accordingly, we document both the existence of --no-use-mailmap as
well as briefly discuss the equivalence of it to log.mailmap=False.
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ariadne Conill [Mon, 15 Jul 2019 12:41:04 +0000 (07:41 -0500)]
log: add warning for unspecified log.mailmap setting
Based on discussions around changing the log.mailmap default to being
enabled, it was decided that a transitional period is required.
Accordingly, we announce this transitional period with a warning
message.
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Varun Naik [Sun, 14 Jul 2019 03:01:53 +0000 (20:01 -0700)]
read-cache.c: do not die if mmap fails
do_read_index() mmaps the index, or tries to die with an error message
on failure. It should call xmmap_gently(), which returns MAP_FAILED,
rather than xmmap(), which dies with its own error message.
An easy way to cause this mmap to fail is by setting $GIT_INDEX_FILE to
a path to a directory and then invoking any command that reads from the
index.
Signed-off-by: Varun Naik <vcnaik94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philipp Weißmann [Mon, 1 Jul 2019 05:20:33 +0000 (07:20 +0200)]
l10n: de.po: Fix typo in German translation
Fix translation error of "complete => "vollständig" instead of
"unvollständig"
Currently: Documentation states that --unshallow can NOT be used on
INcomplete projects. This is wrong;
Correct would be: --unshallow can NOT be used on complete projects.
This change fixes that error in the German translation.
Signed-off-by: Philipp Weißmann <mail@philipp-weissmann.de>
Reviewed-by: Matthias Rüster <matthias.ruester@gmail.com>
Robert Morgan [Fri, 12 Jul 2019 15:33:57 +0000 (08:33 -0700)]
gpg(docs): use correct --verify syntax
The gpg --verify usage example within the 'gpg.program' variable
reference provides an incorrect example of the gpg --verify command
arguments.
The command argument order, when providing both a detached signature
and data, should be signature first and data second:
https://gnupg.org/documentation/manuals/gnupg/Operational-GPG-Commands.html
Signed-off-by: Robert Morgan <robert.thomas.morgan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Emily Shaffer [Thu, 11 Jul 2019 21:19:19 +0000 (14:19 -0700)]
transport-helper: enforce atomic in push_refs_with_push
Teach transport-helper how to notice if skipping a ref during push would
violate atomicity on the client side. We notice that a ref would be
rejected, and choose not to send it, but don't notice that if the client
has asked for --atomic we are violating atomicity if all the other
pushes we are sending would succeed. Asking the server end to uphold
atomicity wouldn't work here as the server doesn't have any idea that we
tried to update a ref that's broken.
The added test-case is a succinct way to reproduce this issue that fails
today. The same steps work fine when we aren't using a transport-helper
to get to the upstream, i.e. when we've added a local repository as a
remote:
git remote add ~/upstream upstream
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 11 Jul 2019 22:17:22 +0000 (15:17 -0700)]
The fifth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)]
Merge branch 'js/mingw-use-utf8'
Windows update.
* js/mingw-use-utf8:
mingw: fix possible buffer overrun when calling `GetUserNameW()`
mingw: use Unicode functions explicitly
mingw: get pw_name in UTF-8 format
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)]
Merge branch 'sg/ci-brew-gcc-workaround'
Dev support update.
* sg/ci-brew-gcc-workaround:
ci/lib.sh: update a comment about installed P4 and Git-LFS versions
ci: disable Homebrew's auto cleanup
ci: don't update Homebrew
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)]
Merge branch 'kb/windows-force-utf8'
Windows update.
* kb/windows-force-utf8:
gettext: always use UTF-8 on native Windows
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)]
Merge branch 'dr/progress-i18n'
Progress messages have been made localizable.
* dr/progress-i18n:
l10n: localizable upload progress messages