Junio C Hamano [Fri, 11 Oct 2019 05:24:46 +0000 (14:24 +0900)]
Merge branch 'tk/git-svn-trim-author-name'
The author names taken from SVN repositories may have extra leading
or trailing whitespaces, which are now munged away.
* tk/git-svn-trim-author-name:
git-svn: trim leading and trailing whitespaces in author name
Junio C Hamano [Fri, 11 Oct 2019 05:24:46 +0000 (14:24 +0900)]
Merge branch 'bc/object-id-part17'
Preparation for SHA-256 upgrade continues.
* bc/object-id-part17: (26 commits)
midx: switch to using the_hash_algo
builtin/show-index: replace sha1_to_hex
rerere: replace sha1_to_hex
builtin/receive-pack: replace sha1_to_hex
builtin/index-pack: replace sha1_to_hex
packfile: replace sha1_to_hex
wt-status: convert struct wt_status to object_id
cache: remove null_sha1
builtin/worktree: switch null_sha1 to null_oid
builtin/repack: write object IDs of the proper length
pack-write: use hash_to_hex when writing checksums
sequencer: convert to use the_hash_algo
bisect: switch to using the_hash_algo
sha1-lookup: switch hard-coded constants to the_hash_algo
config: use the_hash_algo in abbrev comparison
combine-diff: replace GIT_SHA1_HEXSZ with the_hash_algo
bundle: switch to use the_hash_algo
connected: switch GIT_SHA1_HEXSZ to the_hash_algo
show-index: switch hard-coded constants to the_hash_algo
blame: remove needless comparison with GIT_SHA1_HEXSZ
...
Junio C Hamano [Fri, 11 Oct 2019 05:24:45 +0000 (14:24 +0900)]
Merge branch 'en/clean-nested-with-ignored'
"git clean" fixes.
* en/clean-nested-with-ignored:
dir: special case check for the possibility that pathspec is NULL
clean: fix theoretical path corruption
clean: rewrap overly long line
clean: avoid removing untracked files in a nested git repository
clean: disambiguate the definition of -d
git-clean.txt: do not claim we will delete files with -n/--dry-run
dir: add commentary explaining match_pathspec_item's return value
dir: if our pathspec might match files under a dir, recurse into it
dir: make the DO_MATCH_SUBMODULE code reusable for a non-submodule case
dir: also check directories for matching pathspecs
dir: fix off-by-one error in match_pathspec_item
dir: fix typo in comment
t7300: add testcases showing failure to clean specified pathspecs
Junio C Hamano [Wed, 9 Oct 2019 05:02:58 +0000 (14:02 +0900)]
Seventh batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 9 Oct 2019 05:01:01 +0000 (14:01 +0900)]
Merge branch 'rs/test-remove-useless-debugging-cat'
Code cleanup.
* rs/test-remove-useless-debugging-cat:
tests: remove "cat foo" before "test_i18ngrep bar foo"
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)]
Merge branch 'pm/p4-auto-delete-named-temporary'
* pm/p4-auto-delete-named-temporary:
git-p4: auto-delete named temporary file
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)]
Merge branch 'rs/convert-fix-utf-without-dash'
The code to skip "UTF" and "UTF-" prefix, when computing an advice
message, did not work correctly when the prefix was "UTF", which
has been fixed.
* rs/convert-fix-utf-without-dash:
convert: fix handling of dashless UTF prefix in validate_encoding()
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)]
Merge branch 'py/git-gui-has-maintainer'
Doc update.
* py/git-gui-has-maintainer:
Documentation: update the location of the git-gui repo
Junio C Hamano [Wed, 9 Oct 2019 05:01:00 +0000 (14:01 +0900)]
Merge branch 'ah/cleanups'
Miscellaneous code clean-ups.
* ah/cleanups:
git_mkstemps_mode(): replace magic numbers with computed value
wrapper: use a loop instead of repetitive statements
diffcore-break: use a goto instead of a redundant if statement
commit-graph: remove a duplicate assignment
Junio C Hamano [Wed, 9 Oct 2019 05:00:59 +0000 (14:00 +0900)]
Merge branch 'js/diff-rename-force-stable-sort'
The rename detection logic sorts a list of rename source candidates
by similarity to pick the best candidate, which means that a tie
between sources with the same similarity is broken by the original
location in the original candidate list (which is sorted by path).
Force the sorting by similarity done with a stable sort, which is
not promised by system supplied qsort(3), to ensure consistent
results across platforms.
* js/diff-rename-force-stable-sort:
diffcore_rename(): use a stable sort
Move git_sort(), a stable sort, into into libgit.a
Junio C Hamano [Wed, 9 Oct 2019 05:00:59 +0000 (14:00 +0900)]
Merge branch 'js/mingw-spawn-with-spaces-in-path'
Test fix.
* js/mingw-spawn-with-spaces-in-path:
t0061: fix test for argv[0] with spaces (MINGW only)
Junio C Hamano [Wed, 9 Oct 2019 05:00:59 +0000 (14:00 +0900)]
Merge branch 'as/shallow-slab-use-fix'
Correct code that tried to reference all entries in a sparse array
of pointers by mistake.
* as/shallow-slab-use-fix:
shallow.c: don't free unallocated slabs
Junio C Hamano [Wed, 9 Oct 2019 05:00:58 +0000 (14:00 +0900)]
Merge branch 'sg/name-rev-cutoff-underflow-fix'
Integer arithmetic fix.
* sg/name-rev-cutoff-underflow-fix:
name-rev: avoid cutoff timestamp underflow
Junio C Hamano [Wed, 9 Oct 2019 05:00:58 +0000 (14:00 +0900)]
Merge branch 'am/visual-studio-config-fix'
Dev support.
* am/visual-studio-config-fix:
contrib/buildsystems: fix Visual Studio Debug configuration
Junio C Hamano [Mon, 7 Oct 2019 02:33:44 +0000 (11:33 +0900)]
Sixth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 7 Oct 2019 02:33:03 +0000 (11:33 +0900)]
Merge branch 'bw/submodule-helper-usage-fix'
Typofix.
* bw/submodule-helper-usage-fix:
builtin/submodule--helper: fix usage string for 'update-clone'
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)]
Merge branch 'dl/honor-cflags-in-hdr-check'
Dev support.
* dl/honor-cflags-in-hdr-check:
ci: run `hdr-check` as part of the `Static Analysis` job
Makefile: emulate compile in $(HCO) target better
pack-bitmap.h: remove magic number
promisor-remote.h: include missing header
apply.h: include missing header
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)]
Merge branch 'cb/do-not-use-test-cmp-with-a'
Test portability fix.
* cb/do-not-use-test-cmp-with-a:
t4038: Remove non-portable '-a' option passed to test_cmp
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)]
Merge branch 'cc/multi-promisor'
Cleanup.
* cc/multi-promisor:
promisor-remote: skip move_to_tail when no-op
promisor-remote.h: drop extern from function declaration
Junio C Hamano [Mon, 7 Oct 2019 02:33:02 +0000 (11:33 +0900)]
Merge branch 'jt/merge-recursive-symlink-is-not-a-dir-in-way'
A bug in merge-recursive code that triggers when a branch with a
symbolic link is merged with a branch that replaces it with a
directory has been fixed.
* jt/merge-recursive-symlink-is-not-a-dir-in-way:
merge-recursive: symlink's descendants not in way
Junio C Hamano [Mon, 7 Oct 2019 02:33:01 +0000 (11:33 +0900)]
Merge branch 'ps/my-first-contribution-alphasort'
Docfix.
* ps/my-first-contribution-alphasort:
doc: MyFirstContribution: fix cmd placement instructions
Junio C Hamano [Mon, 7 Oct 2019 02:33:01 +0000 (11:33 +0900)]
Merge branch 'sg/travis-help-debug'
Dev support update.
* sg/travis-help-debug:
travis-ci: do not skip successfully tested trees in debug mode
Junio C Hamano [Mon, 7 Oct 2019 02:33:01 +0000 (11:33 +0900)]
Merge branch 'rs/alias-use-copy-array'
Code cleanup.
* rs/alias-use-copy-array:
git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()
Junio C Hamano [Mon, 7 Oct 2019 02:33:00 +0000 (11:33 +0900)]
Merge branch 'sg/t-helper-gitignore'
Update the way build artifacts in t/helper/ directory are ignored.
* sg/t-helper-gitignore:
t/helper: ignore only executable files
Junio C Hamano [Mon, 7 Oct 2019 02:33:00 +0000 (11:33 +0900)]
Merge branch 'cc/svn-fe-py-shebang'
* cc/svn-fe-py-shebang:
contrib/svn-fe: fix shebang for svnrdump_sim.py
Junio C Hamano [Mon, 7 Oct 2019 02:33:00 +0000 (11:33 +0900)]
Merge branch 'ah/doc-submodule-ignore-submodules'
Docfix.
* ah/doc-submodule-ignore-submodules:
doc: fix reference to --ignore-submodules
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)]
Merge branch 'rs/nth-switch-code-simplification'
Code simplification.
* rs/nth-switch-code-simplification:
sha1_name: simplify strbuf handling in interpret_nth_prior_checkout()
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)]
Merge branch 'hb/hg-to-git-py3'
The hg-to-git script (in contrib/) has been updated to work with
Python 3.
* hb/hg-to-git-py3:
hg-to-git: make it compatible with both python3 and python2
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)]
Merge branch 'sg/progress-fix'
Regression fix for progress output.
* sg/progress-fix:
Test the progress display
Revert "progress: use term_clear_line()"
Junio C Hamano [Mon, 7 Oct 2019 02:32:59 +0000 (11:32 +0900)]
Merge branch 'js/doc-patch-text'
Docfix.
* js/doc-patch-text:
diff, log doc: small grammer, format, and language fixes
diff, log doc: say "patch text" instead of "patches"
Junio C Hamano [Mon, 7 Oct 2019 02:32:58 +0000 (11:32 +0900)]
Merge branch 'tb/commit-graph-harden'
The code to parse and use the commit-graph file has been made more
robust against corrupted input.
* tb/commit-graph-harden:
commit-graph.c: handle corrupt/missing trees
commit-graph.c: handle commit parsing errors
t/t5318: introduce failing 'git commit-graph write' tests
Junio C Hamano [Mon, 7 Oct 2019 02:32:58 +0000 (11:32 +0900)]
Merge branch 'jt/cache-tree-avoid-lazy-fetch-during-merge'
The cache-tree code has been taught to be less aggressive in
attempting to see if a tree object it computed already exists in
the repository.
* jt/cache-tree-avoid-lazy-fetch-during-merge:
cache-tree: do not lazy-fetch tentative tree
Junio C Hamano [Mon, 7 Oct 2019 02:32:58 +0000 (11:32 +0900)]
Merge branch 'dl/cocci-everywhere'
Coccinelle checks are done on more source files than before now.
* dl/cocci-everywhere:
Makefile: run coccicheck on more source files
Makefile: strip leading ./ in $(FIND_SOURCE_FILES)
Makefile: define THIRD_PARTY_SOURCES
Makefile: strip leading ./ in $(LIB_H)
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)]
Merge branch 'gs/commit-graph-progress'
* gs/commit-graph-progress:
commit-graph: add --[no-]progress to write and verify
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)]
Merge branch 'ms/fetch-follow-tag-optim'
The code used in following tags in "git fetch" has been optimized.
* ms/fetch-follow-tag-optim:
fetch: use oidset to keep the want OIDs for faster lookup
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)]
Merge branch 'rs/commit-graph-use-list-count'
Code cleanup.
* rs/commit-graph-use-list-count:
commit-graph: use commit_list_count()
Junio C Hamano [Mon, 7 Oct 2019 02:32:57 +0000 (11:32 +0900)]
Merge branch 'rs/nth-parent-parse'
The object name parser for "Nth parent" syntax has been made more
robust against integer overflows.
* rs/nth-parent-parse:
sha1-name: check for overflow of N in "foo^N" and "foo~N"
rev-parse: demonstrate overflow of N for "foo^N" and "foo~N"
Junio C Hamano [Mon, 7 Oct 2019 02:32:56 +0000 (11:32 +0900)]
Merge branch 'dl/submodule-set-branch'
Docfix.
* dl/submodule-set-branch:
git-submodule.txt: fix AsciiDoc formatting error
Junio C Hamano [Mon, 7 Oct 2019 02:32:56 +0000 (11:32 +0900)]
Merge branch 'cs/pretty-formats-doc-typofix'
Doc fix.
* cs/pretty-formats-doc-typofix:
doc: minor formatting fix
Junio C Hamano [Mon, 7 Oct 2019 02:32:56 +0000 (11:32 +0900)]
Merge branch 'jk/list-objects-optim-wo-trees'
The object traversal machinery has been optimized not to load tree
objects when we are only interested in commit history.
* jk/list-objects-optim-wo-trees:
list-objects: don't queue root trees unless revs->tree_objects is set
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)]
Merge branch 'jk/disable-commit-graph-during-upload-pack'
The "upload-pack" (the counterpart of "git fetch") needs to disable
commit-graph when responding to a shallow clone/fetch request, but
the way this was done made Git panic, which has been corrected.
* jk/disable-commit-graph-during-upload-pack:
upload-pack: disable commit graph more gently for shallow traversal
commit-graph: bump DIE_ON_LOAD check to actual load-time
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)]
Merge branch 'mr/complete-more-for-log-etc'
Completion updates.
* mr/complete-more-for-log-etc:
completion: add missing completions for log, diff, show
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)]
Merge branch 'dl/complete-rebase-and-archive'
The command line completion for "git archive" and "git rebase" are
now made less prone to go out of sync with the binary.
* dl/complete-rebase-and-archive:
completion: teach archive to use __gitcomp_builtin
completion: teach rebase to use __gitcomp_builtin
Junio C Hamano [Mon, 7 Oct 2019 02:32:55 +0000 (11:32 +0900)]
Merge branch 'jk/commit-graph-cleanup'
A pair of small fixups to "git commit-graph" have been applied.
* jk/commit-graph-cleanup:
commit-graph: turn off save_commit_buffer
commit-graph: don't show progress percentages while expanding reachable commits
Junio C Hamano [Mon, 7 Oct 2019 02:32:54 +0000 (11:32 +0900)]
Merge branch 'ss/get-time-cleanup'
Code simplification.
* ss/get-time-cleanup:
test_date.c: remove reference to GIT_TEST_DATE_NOW
Quit passing 'now' to date code
Junio C Hamano [Mon, 7 Oct 2019 02:32:54 +0000 (11:32 +0900)]
Merge branch 'rs/simplify-by-deco-with-deco-refs-exclude'
"git log --decorate-refs-exclude=<pattern>" was incorrectly
overruled when the "--simplify-by-decoration" option is used, which
has been corrected.
* rs/simplify-by-deco-with-deco-refs-exclude:
log-tree: call load_ref_decorations() in get_name_decoration()
log: test --decorate-refs-exclude with --simplify-by-decoration
Junio C Hamano [Mon, 7 Oct 2019 02:32:54 +0000 (11:32 +0900)]
Merge branch 'jk/partial-clone-sparse-blob'
The name of the blob object that stores the filter specification
for sparse cloning/fetching was interpreted in a wrong place in the
code, causing Git to abort.
* jk/partial-clone-sparse-blob:
list-objects-filter: use empty string instead of NULL for sparse "base"
list-objects-filter: give a more specific error sparse parsing error
list-objects-filter: delay parsing of sparse oid
t5616: test cloning/fetching with sparse:oid=<oid> filter
Junio C Hamano [Mon, 7 Oct 2019 02:32:53 +0000 (11:32 +0900)]
Merge branch 'tg/stash-refresh-index'
"git stash" learned to write refreshed index back to disk.
* tg/stash-refresh-index:
stash: make sure to write refreshed cache
merge: use refresh_and_write_cache
factor out refresh_and_write_cache function
René Scharfe [Sun, 6 Oct 2019 13:26:42 +0000 (15:26 +0200)]
tests: remove "cat foo" before "test_i18ngrep bar foo"
Some tests print a file before searching for a pattern using
test_i18ngrep. This is useful when debugging tests with --verbose when
the pattern is not found as expected.
Since
63b1a175ee (t: make 'test_i18ngrep' more informative on failure,
2018-02-08) test_i18ngrep already shows the contents of a file that
doesn't match the expected pattern, though.
So don't bother doing the same unconditionally up-front. The contents
are not interesting if the expected pattern is found, and showing it
twice if it doesn't match is of no use.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philip.McGraw [Tue, 27 Aug 2019 03:43:58 +0000 (06:43 +0300)]
git-p4: auto-delete named temporary file
Avoid double-open exceptions on Windows platform when
calculating for lfs compressed size threshold
(git-p4.largeFileCompressedThreshold) comparisons.
Take new approach using the NamedTemporaryFile()
file-like object as input to the ZipFile() which
auto-deletes after implicit close leaving with scope.
Original code had double-open exception on Windows
platform because file still open from NamedTemporaryFile()
using generated filename instead of object.
Thanks to Andrey for patiently suggesting several
iterations on this change for avoiding exceptions!
Also print error details after resulting IOError to make
debugging cause of exception less mysterious when it has
nothing to do with "git version recent enough."
Signed-off-by: Philip.McGraw <Philip.McGraw@bentley.com>
Reviewed-by: Andrey Mazo <ahippo@yandex.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 6 Oct 2019 03:25:51 +0000 (12:25 +0900)]
Fifth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 6 Oct 2019 03:25:17 +0000 (12:25 +0900)]
Merge branch 'cb/skip-utf8-check-with-pcre1'
Make sure the grep machinery does not abort when seeing a payload
that is not UTF-8 even when JIT is not in use with PCRE1.
* cb/skip-utf8-check-with-pcre1:
grep: skip UTF8 checks explicitly
Junio C Hamano [Sun, 6 Oct 2019 03:25:16 +0000 (12:25 +0900)]
Merge branch 'ma/user-manual-markup-update'
The markup used in user-manual has been updated to work better with
asciidoctor.
* ma/user-manual-markup-update:
user-manual.txt: render ASCII art correctly under Asciidoctor
asciidoctor-extensions.rb: handle "book" doctype in linkgit
user-manual.txt: change header notation
user-manual.txt: add missing section label
Junio C Hamano [Sun, 6 Oct 2019 03:25:16 +0000 (12:25 +0900)]
Merge branch 'bc/doc-use-docbook-5'
Start using DocBook 5 (instead of DocBook 4.5) as Asciidoctor 2.0
no longer works with the older one.
* bc/doc-use-docbook-5:
Documentation: fix build with Asciidoctor 2
Junio C Hamano [Sun, 6 Oct 2019 03:25:16 +0000 (12:25 +0900)]
Merge branch 'ma/asciidoctor-more-fixes'
Doc formatting updates.
* ma/asciidoctor-more-fixes:
gitweb.conf.txt: switch pluses to backticks to help Asciidoctor
git-merge-index.txt: wrap shell listing in "----"
git-receive-pack.txt: wrap shell [script] listing in "----"
git-ls-remote.txt: wrap shell listing in "----"
Documentation: wrap config listings in "----"
git-merge-base.txt: render indentations correctly under Asciidoctor
Documentation: wrap blocks with "--"
Junio C Hamano [Sun, 6 Oct 2019 03:25:15 +0000 (12:25 +0900)]
Merge branch 'ma/asciidoctor-refmiscinfo'
Update support for Asciidoctor documentation toolchain.
* ma/asciidoctor-refmiscinfo:
doc-diff: replace --cut-header-footer with --cut-footer
asciidoctor-extensions: provide `<refmiscinfo/>`
Doc/Makefile: give mansource/-version/-manual attributes
Junio C Hamano [Sun, 6 Oct 2019 03:25:15 +0000 (12:25 +0900)]
Merge branch 'am/mailmap-andrey-mazo'
* am/mailmap-andrey-mazo:
.mailmap: update email address of Andrey Mazo
Junio C Hamano [Sun, 6 Oct 2019 03:25:15 +0000 (12:25 +0900)]
Merge branch 'jc/git-gui-has-maintainer'
* jc/git-gui-has-maintainer:
SubmittingPatches: git-gui has a new maintainer
Pratyush Yadav [Sat, 5 Oct 2019 12:57:42 +0000 (18:27 +0530)]
Documentation: update the location of the git-gui repo
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Fri, 4 Oct 2019 19:25:50 +0000 (21:25 +0200)]
convert: fix handling of dashless UTF prefix in validate_encoding()
Strip "UTF" and an optional dash from the start of 'upper' without
passing a NULL pointer to skip_prefix() in the second call, as it cannot
handle that.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Tue, 1 Oct 2019 11:16:26 +0000 (04:16 -0700)]
ci: run `hdr-check` as part of the `Static Analysis` job
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 2 Oct 2019 15:32:07 +0000 (11:32 -0400)]
git_mkstemps_mode(): replace magic numbers with computed value
The magic number "6" appears several times in the function, and is
related to the size of the "XXXXXX" string we expect to find in the
template. Let's pull that "XXXXXX" into a constant array, whose size we
can get at compile time with ARRAY_SIZE().
Note that we probably can't just change this value, since callers will
be feeding us a certain number of X's, but it hopefully makes the
function itself easier to follow.
While we're here, let's do the same with the "letters" array (which we
_could_ modify if we wanted to include more characters).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexandr Miloslavskiy [Tue, 1 Oct 2019 11:41:05 +0000 (04:41 -0700)]
t0061: fix test for argv[0] with spaces (MINGW only)
The test was originally designed for the case where user reported
that setting GIT_SSH to a .bat file with spaces in path fails on
Windows: https://github.com/git-for-windows/git/issues/692
The test has two different problems:
1. It succeeds with AND without fix
eb7c7863 that addressed user's
problem. This happens because the core problem was misunderstood,
leading to conclusion that git is unable to start any programs with
spaces in path on Win7. But in fact
a) Bug only affected cmd.exe scripts, such as .bat scripts
b) Bug only happened when cmd.exe received at least two quoted args
c) Bug happened on any Windows (verified on Win10).
Therefore, correct test must involve .bat script and two quoted args.
2. In Visual Studio build, it fails to run, because 'test-fake-ssh.exe'
is copied away from its dependencies 'libiconv.dll' and 'zlib1.dll'.
Fix both problems by using .bat script instead of 'test-fake-ssh.exe'.
NOTE: With this change, the test now correctly fails without
eb7c7863.
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alex Henrie [Tue, 1 Oct 2019 02:29:36 +0000 (20:29 -0600)]
wrapper: use a loop instead of repetitive statements
A check into the history of this code revealed no particular reason for
the code to be written in this way. All popular compilers are capable of
unrolling loops if it benefits performance, and once this code is
replaced with a loop, the magic number 6 used in multiple places in this
function can be replaced with a named constant.
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Reviewed-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alex Henrie [Tue, 1 Oct 2019 02:29:35 +0000 (20:29 -0600)]
diffcore-break: use a goto instead of a redundant if statement
The condition "if (q->nr <= j)" checks whether the loop exited normally
or via a break statement. Avoid this check by replacing the jump out of
the inner loop with a jump to the end of the outer loop, which makes it
obvious that diff_q is not executed when the peer survives.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alex Henrie [Tue, 1 Oct 2019 02:29:34 +0000 (20:29 -0600)]
commit-graph: remove a duplicate assignment
Leave the variable 'g' uninitialized before it is set just before its
first use in front of a loop, which is a much more appropriate place to
indicate what it is used for.
Also initialize the variable 'num_commits' just before the loop instead
of at the beginning of the function for the same reason.
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ali Utku Selen [Mon, 30 Sep 2019 23:33:10 +0000 (01:33 +0200)]
shallow.c: don't free unallocated slabs
Fix possible segfault when cloning a submodule shallow.
Signed-off-by: Ali Utku Selen <auselen@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Emily Shaffer [Mon, 30 Sep 2019 22:03:55 +0000 (15:03 -0700)]
promisor-remote: skip move_to_tail when no-op
Previously, when promisor_remote_move_to_tail() is called for a
promisor_remote which is currently the final element in promisors, a
cycle is created in the promisors linked list. This cycle leads to a
double free later on in promisor_remote_clear() when the final element
of the promisors list is removed: promisors is set to promisors->next (a
no-op, as promisors->next == promisors); the previous value of promisors
is free()'d; then the new value of promisors (which is equal to the
previous value of promisors) is also free()'d. This double-free error
was unrecoverable for the user without removing the filter or re-cloning
the repo and hoping to miss this edge case.
Now, when promisor_remote_move_to_tail() would be a no-op, just do a
no-op. In cases of promisor_remote_move_to_tail() where r is not already
at the tail of the list, it works as before.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Mon, 30 Sep 2019 17:21:55 +0000 (10:21 -0700)]
diffcore_rename(): use a stable sort
During Git's rename detection, the file names are sorted. At the moment,
this job is performed by `qsort()`. As that function is not guaranteed
to implement a stable sort algorithm, this can lead to inconsistent
and/or surprising behavior: a rename might be detected differently
depending on the platform where Git was run.
The `qsort()` in MS Visual C's runtime does _not_ implement a stable
sort algorithm, and it even leads to an inconsistency leading to a test
failure in t3030.35 "merge-recursive remembers the names of all base
trees": a different code path than on Linux is taken in the rename
detection of an ambiguous rename between either `e` to `a` or
`a~Temporary merge branch 2_0` to `a` during a recursive merge,
unexpectedly resulting in a clean merge.
Let's use the stable sort provided by `git_stable_qsort()` to avoid this
inconsistency.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Mon, 30 Sep 2019 17:21:54 +0000 (10:21 -0700)]
Move git_sort(), a stable sort, into into libgit.a
The `qsort()` function is not guaranteed to be stable, i.e. it does not
promise to maintain the order of items it is told to consider equal. In
contrast, the `git_sort()` function we carry in `compat/qsort.c` _is_
stable, by virtue of implementing a merge sort algorithm.
In preparation for using a stable sort in Git's rename detection, move
the stable sort into `libgit.a` so that it is compiled in
unconditionally, and rename it to `git_stable_qsort()`.
Note: this also makes the hack obsolete that was introduced in
fe21c6b285d (mingw: reencode environment variables on the fly (UTF-16
<-> UTF-8), 2018-10-30), where we included `compat/qsort.c` directly in
`compat/mingw.c` to use the stable sort.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren [Tue, 1 Oct 2019 18:55:24 +0000 (11:55 -0700)]
dir: special case check for the possibility that pathspec is NULL
Commits
404ebceda01c ("dir: also check directories for matching
pathspecs", 2019-09-17) and
89a1f4aaf765 ("dir: if our pathspec might
match files under a dir, recurse into it", 2019-09-17) added calls to
match_pathspec() and do_match_pathspec() passing along their pathspec
parameter. Both match_pathspec() and do_match_pathspec() assume the
pathspec argument they are given is non-NULL. It turns out that
unpack-tree.c's verify_clean_subdirectory() calls read_directory() with
pathspec == NULL, and it is possible on case insensitive filesystems for
that NULL to make it to these new calls to match_pathspec() and
do_match_pathspec(). Add appropriate checks on the NULLness of pathspec
to avoid a segfault.
In case the negation throws anyone off (one of the calls was to
do_match_pathspec() while the other was to !match_pathspec(), yet no
negation of the NULLness of pathspec is used), there are two ways to
understand the differences:
* The code already handled the pathspec == NULL cases before this
series, and this series only tried to change behavior when there was
a pathspec, thus we only want to go into the if-block if pathspec is
non-NULL.
* One of the calls is for whether to recurse into a subdirectory, the
other is for after we've recursed into it for whether we want to
remove the subdirectory itself (i.e. the subdirectory didn't match
but something under it could have). That difference in situation
leads to the slight differences in logic used (well, that and the
slightly unusual fact that we don't want empty pathspecs to remove
untracked directories by default).
Denton found and analyzed one issue and provided the patch for the
match_pathspec() call, SZEDER figured out why the issue only reproduced
for some folks and not others and provided the testcase, and I looked
through the remainder of the series and noted the do_match_pathspec()
call that should have the same check.
Co-authored-by: Denton Liu <liu.denton@gmail.com>
Co-authored-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 30 Sep 2019 04:30:46 +0000 (13:30 +0900)]
Fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 30 Sep 2019 04:19:32 +0000 (13:19 +0900)]
Merge branch 'ds/commit-graph-on-fetch'
A configuration variable tells "git fetch" to write the commit
graph after finishing.
* ds/commit-graph-on-fetch:
fetch: add fetch.writeCommitGraph config setting
Junio C Hamano [Mon, 30 Sep 2019 04:19:32 +0000 (13:19 +0900)]
Merge branch 'bw/rebase-autostash-keep-current-branch'
"git rebase --autostash <upstream> <branch>", when <branch> is
different from the current branch, incorrectly moved the tip of the
current branch, which has been corrected.
* bw/rebase-autostash-keep-current-branch:
builtin/rebase.c: Remove pointless message
builtin/rebase.c: make sure the active branch isn't moved when autostashing
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)]
Merge branch 'ds/include-exclude'
The internal code originally invented for ".gitignore" processing
got reshuffled and renamed to make it less tied to "excluding" and
stress more that it is about "matching", as it has been reused for
things like sparse checkout specification that want to check if a
path is "included".
* ds/include-exclude:
unpack-trees: rename 'is_excluded_from_list()'
treewide: rename 'exclude' methods to 'pattern'
treewide: rename 'EXCL_FLAG_' to 'PATTERN_FLAG_'
treewide: rename 'struct exclude_list' to 'struct pattern_list'
treewide: rename 'struct exclude' to 'struct path_pattern'
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)]
Merge branch 'jh/trace2-pretty-output'
Output from trace2 subsystem is formatted more prettily now.
* jh/trace2-pretty-output:
trace2: cleanup whitespace in perf format
trace2: cleanup whitespace in normal format
quote: add sq_append_quote_argv_pretty()
trace2: trim trailing whitespace in normal format error message
trace2: remove dead code in maybe_add_string_va()
trace2: trim whitespace in region messages in perf target format
trace2: cleanup column alignment in perf target format
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)]
Merge branch 'dl/rebase-i-keep-base'
"git rebase --keep-base <upstream>" tries to find the original base
of the topic being rebased and rebase on top of that same base,
which is useful when running the "git rebase -i" (and its limited
variant "git rebase -x").
The command also has learned to fast-forward in more cases where it
can instead of replaying to recreate identical commits.
* dl/rebase-i-keep-base:
rebase: teach rebase --keep-base
rebase tests: test linear branch topology
rebase: fast-forward --fork-point in more cases
rebase: fast-forward --onto in more cases
rebase: refactor can_fast_forward into goto tower
t3432: test for --no-ff's interaction with fast-forward
t3432: distinguish "noop-same" v.s. "work-same" in "same head" tests
t3432: test rebase fast-forward behavior
t3431: add rebase --fork-point tests
Junio C Hamano [Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)]
Merge branch 'sg/clean-nested-repo-with-ignored'
A bug documentation.
* sg/clean-nested-repo-with-ignored:
t7300-clean: demonstrate deleting nested repo with an ignored file breakage
Junio C Hamano [Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)]
Merge branch 'dl/complete-cherry-pick-revert-skip'
The command line completion support (in contrib/) learned about the
"--skip" option of "git revert" and "git cherry-pick".
* dl/complete-cherry-pick-revert-skip:
status: mention --skip for revert and cherry-pick
completion: add --skip for cherry-pick and revert
completion: merge options for cherry-pick and revert
Junio C Hamano [Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)]
Merge branch 'dl/use-sq-from-test-lib'
Code cleanup.
* dl/use-sq-from-test-lib:
t: use common $SQ variable
Junio C Hamano [Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)]
Merge branch 'jk/misc-uninitialized-fixes'
Various fixes to codepaths gcc 9 had trouble following dataflow.
* jk/misc-uninitialized-fixes:
pack-objects: drop packlist index_pos optimization
test-read-cache: drop namelen variable
diff-delta: set size out-parameter to 0 for NULL delta
bulk-checkin: zero-initialize hashfile_checkpoint
pack-objects: use object_id in packlist_alloc()
git-am: handle missing "author" when parsing commit
Junio C Hamano [Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)]
Merge branch 'sg/git-test-boolean'
Fix an earlier regression in the test suite, which mistakenly
stopped running HTTPD tests.
* sg/git-test-boolean:
ci: restore running httpd tests
t/lib-git-svn.sh: check GIT_TEST_SVN_HTTPD when running SVN HTTP tests
Junio C Hamano [Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)]
Merge branch 'rs/get-tagged-oid'
Code cleanup.
* rs/get-tagged-oid:
use get_tagged_oid()
tag: factor out get_tagged_oid()
Junio C Hamano [Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)]
Merge branch 'en/filter-branch-deprecation'
Start discouraging the use of "git filter-branch".
* en/filter-branch-deprecation:
t9902: use a non-deprecated command for testing
Recommend git-filter-repo instead of git-filter-branch
t6006: simplify, fix, and optimize empty message test
Junio C Hamano [Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)]
Merge branch 'en/merge-options-ff-and-friends'
Doc update.
* en/merge-options-ff-and-friends:
merge-options.txt: clarify meaning of various ff-related options
Junio C Hamano [Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)]
Merge branch 'tg/push-all-in-mirror-forbidden'
Fix an earlier regression to "git push --all" which should have
been forbidden when the target remote repository is set to be a
mirror.
* tg/push-all-in-mirror-forbidden:
push: disallow --all and refspecs when remote.<name>.mirror is set
Junio C Hamano [Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)]
Merge branch 'dt/remote-helper-doc-re-lock-option'
Doc update.
* dt/remote-helper-doc-re-lock-option:
clarify documentation for remote helpers
Junio C Hamano [Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)]
Merge branch 'rs/help-unknown-ref-does-not-return'
Code cleanup.
* rs/help-unknown-ref-does-not-return:
help: make help_unknown_ref() NORETURN
Junio C Hamano [Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)]
Merge branch 'nd/switch-and-restore'
Resurrect a performance hack.
* nd/switch-and-restore:
checkout: add simple check for 'git checkout -b'
Junio C Hamano [Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)]
Merge branch 'tb/file-url-to-unc-path'
Windows update.
* tb/file-url-to-unc-path:
mingw: support UNC in git clone file://server/share/repo
Junio C Hamano [Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)]
Merge branch 'js/gitdir-at-unc-root'
On Windows, the root level of UNC share is now allowed to be used
just like any other directory.
* js/gitdir-at-unc-root:
setup_git_directory(): handle UNC root paths correctly
Fix .git/ discovery at the root of UNC shares
setup_git_directory(): handle UNC paths correctly
Junio C Hamano [Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)]
Merge branch 'ar/mingw-run-external-with-non-ascii-path'
Windows update.
* ar/mingw-run-external-with-non-ascii-path:
mingw: fix launching of externals from Unicode paths
Junio C Hamano [Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)]
Merge branch 'rs/parse-tree-indirect'
Code cleanup.
* rs/parse-tree-indirect:
tree: simplify parse_tree_indirect()
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)]
Merge branch 'jk/fast-import-history-bugfix'
The memory ownership model of the "git fast-import" got
straightened out.
* jk/fast-import-history-bugfix:
fast-import: duplicate into history rather than passing ownership
fast-import: duplicate parsed encoding string
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)]
Merge branch 'mh/notes-duplicate-entries'
A few implementation fixes in the notes API.
* mh/notes-duplicate-entries:
notes: avoid potential use-after-free during insertion
notes: avoid leaking duplicate entries
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)]
Merge branch 'tb/banned-vsprintf-namefix'
Error message fix.
* tb/banned-vsprintf-namefix:
banned.h: fix vsprintf()'s ban message
Junio C Hamano [Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)]
Merge branch 'mh/release-commit-memory-fix'
Leakfix.
* mh/release-commit-memory-fix:
commit: free the right buffer in release_commit_memory
Junio C Hamano [Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)]
Merge branch 'mh/http-urlmatch-cleanup'
Leakfix.
* mh/http-urlmatch-cleanup:
http: don't leak urlmatch_config.vars
Junio C Hamano [Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)]
Merge branch 'rs/strbuf-detach'
Straighten out the use of strbuf_detach() API function.
* rs/strbuf-detach:
grep: use return value of strbuf_detach()
log-tree: always use return value of strbuf_detach()
Junio C Hamano [Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)]
Merge branch 'rs/trace2-dst-warning'
Code cleanup.
* rs/trace2-dst-warning:
trace2: use warning() directly in tr2_dst_malformed_warning()