git/git.git
19 months agoMerge branch 'jc/denoise-rm-to-resolve'
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

19 months agoMerge branch 'js/clean-report-too-long-a-path'
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

19 months agoMerge branch 'tg/stash-keep-index-with-removed-paths'
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

19 months agoMerge branch 'sr/gpg-interface-stop-at-the-end'
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

19 months agoMerge branch 'js/mingw-spawn-with-spaces-in-path'
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

19 months agoMerge branch 'jc/post-c89-rules-doc'
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

19 months agoMerge branch 'mt/dir-iterator-updates'
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

19 months agoMerge branch 'vn/xmmap-gently'
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

19 months agoMerge branch 'ac/log-use-mailmap-by-default-transition'
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

19 months agoMerge branch 'es/local-atomic-push-failure-with-http'
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

19 months agoMerge branch 'rm/gpg-program-doc-fix'
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

19 months agoMerge branch 'js/unmap-before-ext-diff'
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

19 months agoMerge branch 'tg/range-diff-output-update'
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

19 months agoMerge branch 'ab/test-env'
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

19 months agoThe sixth batch
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>
19 months agoMerge branch 'ma/ref-filter-leakfix'
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()`

19 months agoMerge branch 'js/trace2-signo-typofix'
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

19 months agoMerge branch 'kb/mingw-set-home'
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

19 months agoMerge branch 'ea/merge-code-cleanup'
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

19 months agoMerge branch 'jl/status-reduce-vertical-blank'
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

19 months agoMerge branch 'pw/rebase-progress-test-cleanup'
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

19 months agoMerge branch 'pw/prompt-cherry-pick-revert-fix'
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

19 months agoMerge branch 'ew/repack-with-bitmaps-by-default'
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

19 months agoMerge branch 'jk/check-connected-with-alternates'
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

19 months agoMerge branch 'nd/tree-walk-with-repo'
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()

19 months agoMerge branch 'ra/cherry-pick-revert-skip'
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

19 months agoMerge branch 'tb/ref-filter-multiple-patterns'
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

19 months agoMerge branch 'pw/status-with-corrupt-sequencer-state'
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

19 months agoMerge branch 'ds/commit-graph-incremental'
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

19 months agoMerge branch 'br/blame-ignore'
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()

19 months agoMerge branch 'cc/test-oidmap'
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

19 months agoMerge branch 'ds/midx-expire-repack'
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

19 months agoclean: show an error message when the path is too long
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>
19 months agoCodingGuidelines: spell out post-C89 rules
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>
19 months agorm: resolving by removal is not a warning-worthy event
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>
19 months agotransport-helper: avoid var decl in for () loop control
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>
19 months agostash: fix handling removed files with --keep-index
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>
19 months agomingw: support spawning programs containing spaces in their names
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>
19 months agogpg-interface: do not scan past the end of buffer
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>
19 months agotests: defang pager tests by explicitly disabling the log.mailmap warning
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>
19 months agodocumentation: mention --no-use-mailmap and log.mailmap false setting
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>
19 months agolog: add warning for unspecified log.mailmap setting
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>
19 months agoread-cache.c: do not die if mmap fails
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>
19 months agogpg(docs): use correct --verify syntax
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>
19 months agotransport-helper: enforce atomic in push_refs_with_push
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>
19 months agoThe fifth batch
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>
19 months agoMerge branch 'js/mingw-use-utf8'
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

19 months agoMerge branch 'sg/ci-brew-gcc-workaround'
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

19 months agoMerge branch 'kb/windows-force-utf8'
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

19 months agoMerge branch 'dr/progress-i18n'
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

19 months agoMerge branch 'qn/clone-doc-use-long-form'
Junio C Hamano [Thu, 11 Jul 2019 22:16:48 +0000 (15:16 -0700)]
Merge branch 'qn/clone-doc-use-long-form'

The "git clone" documentation refers to command line options in its
description in the short form; they have been replaced with long
forms to make them more recognisable.

* qn/clone-doc-use-long-form:
  docs: git-clone: list short form of options first
  docs: git-clone: refer to long form of options

19 months agoMerge branch 'js/rebase-reschedule-applies-only-to-interactive'
Junio C Hamano [Thu, 11 Jul 2019 22:16:48 +0000 (15:16 -0700)]
Merge branch 'js/rebase-reschedule-applies-only-to-interactive'

The configuration variable rebase.rescheduleFailedExec should be
effective only while running an interactive rebase and should not
affect anything when running an non-interactive one, which was not
the case.  This has been corrected.

* js/rebase-reschedule-applies-only-to-interactive:
  rebase --am: ignore rebase.rescheduleFailedExec

19 months agoMerge branch 'sg/git-C-empty-doc'
Junio C Hamano [Thu, 11 Jul 2019 22:16:48 +0000 (15:16 -0700)]
Merge branch 'sg/git-C-empty-doc'

Doc update.

* sg/git-C-empty-doc:
  Document that 'git -C ""' works and doesn't change directory

19 months agoMerge branch 'jt/t5551-test-chunked'
Junio C Hamano [Thu, 11 Jul 2019 22:16:47 +0000 (15:16 -0700)]
Merge branch 'jt/t5551-test-chunked'

Update smart-http test.

* jt/t5551-test-chunked:
  t5551: test usage of chunked encoding explicitly

19 months agoMerge branch 'js/mingw-gcc-stack-protect'
Junio C Hamano [Thu, 11 Jul 2019 22:16:47 +0000 (15:16 -0700)]
Merge branch 'js/mingw-gcc-stack-protect'

Windows update.

* js/mingw-gcc-stack-protect:
  mingw: enable stack smashing protector

19 months agoMerge branch 'cb/windows-manifest'
Junio C Hamano [Thu, 11 Jul 2019 22:16:47 +0000 (15:16 -0700)]
Merge branch 'cb/windows-manifest'

Windows update.

* cb/windows-manifest:
  mingw: embed a manifest to trick UAC into Doing The Right Thing

19 months agoenv--helper: mark a file-local symbol as static
Ramsay Jones [Thu, 11 Jul 2019 17:06:13 +0000 (18:06 +0100)]
env--helper: mark a file-local symbol as static

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: add headers to the outer hunk header
Thomas Gummerer [Thu, 11 Jul 2019 16:08:51 +0000 (17:08 +0100)]
range-diff: add headers to the outer hunk header

Add the section headers/hunk headers we introduced in the previous
commits to the outer diff's hunk headers.  This makes it easier to
understand which change we are actually looking at.  For example an
outer hunk header might now look like:

    @@  Documentation/config/interactive.txt

while previously it would have only been

    @@

which doesn't give a lot of context for the change that follows.

For completeness also add section headers for the commit metadata and
the commit message, although they are arguably less important.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: add filename to inner diff
Thomas Gummerer [Thu, 11 Jul 2019 16:08:50 +0000 (17:08 +0100)]
range-diff: add filename to inner diff

In a range-diff it's not always clear which file a certain funcname of
the inner diff belongs to, because the diff header (or section header
as added in a previous commit) is not always visible in the
range-diff.

Add the filename to the inner diffs header, so it's always visible to
users.

This also allows us to add the filename + the funcname to the outer
diffs hunk headers using a custom userdiff pattern, which will be done
in the next commit.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: add section header instead of diff header
Thomas Gummerer [Thu, 11 Jul 2019 16:08:49 +0000 (17:08 +0100)]
range-diff: add section header instead of diff header

Currently range-diff keeps the diff header of the inner diff
intact (apart from stripping lines starting with index).  This diff
header is somewhat useful, especially when files get different
names in different ranges.

However there is no real need to keep the whole diff header for that.
The main reason we currently do that is probably because it is easy to
do.

Introduce a new range diff hunk header, that's enclosed by "##",
similar to how line numbers in diff hunks are enclosed by "@@", and
give human readable information of what exactly happened to the file,
including the file name.

This improves the readability of the range-diff by giving more concise
information to the users.  For example if a file was renamed in one
iteration, but not in another, the diff of the headers would be quite
noisy.  However the diff of a single line is concise and should be
easier to understand.

Additionally, this allows us to add these range diff section headers to
the outer diffs hunk headers using a custom userdiff pattern, which
should help making the range-diff more readable.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: suppress line count in outer diff
Thomas Gummerer [Thu, 11 Jul 2019 16:08:48 +0000 (17:08 +0100)]
range-diff: suppress line count in outer diff

The line count in the outer diff's hunk headers of a range diff is not
all that interesting.  It merely shows how far along the inner diff
are on both sides.  That number is of no use for human readers, and
range-diffs are not meant to be machine readable.

In a subsequent commit we're going to add some more contextual
information such as the filename corresponding to the diff to the hunk
headers.  Remove the unnecessary information, and just keep the "@@"
to indicate that a new hunk of the outer diff is starting.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: don't remove funcname from inner diff
Thomas Gummerer [Thu, 11 Jul 2019 16:08:47 +0000 (17:08 +0100)]
range-diff: don't remove funcname from inner diff

When postprocessing the inner diff in range-diff, we currently replace
the whole hunk header line with just "@@".  This matches how 'git
tbdiff' used to handle hunk headers as well.

Most likely this is being done because line numbers in the hunk header
are not relevant without other changes.  They can for example easily
change if a range is rebased, and lines are added/removed before a
change that we actually care about in our ranges.

However it can still be useful to have the function name that 'git
diff' extracts as additional context for the change.

Note that it is not guaranteed that the hunk header actually shows up
in the range-diff, and this change only aims to improve the case where
a hunk header would already be included in the final output.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: split lines manually
Thomas Gummerer [Thu, 11 Jul 2019 16:08:46 +0000 (17:08 +0100)]
range-diff: split lines manually

Currently range-diff uses the 'strbuf_getline()' function for doing
its line by line processing.  In a future patch we want to do parts of
that parsing using the 'parse_git_diff_header()' function.  That
function does its own line by line reading of the input, and doesn't
use strbufs.  This doesn't match with how we do the line-by-line
processing in range-diff currently.

Switch range-diff to do our own line by line parsing, so we can re-use
the 'parse_git_diff_header()' function later.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agorange-diff: fix function parameter indentation
Thomas Gummerer [Thu, 11 Jul 2019 16:08:45 +0000 (17:08 +0100)]
range-diff: fix function parameter indentation

Fix the indentation of the function parameters for a couple of
functions, to match the style in the rest of the file.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoapply: make parse_git_diff_header public
Thomas Gummerer [Thu, 11 Jul 2019 16:08:44 +0000 (17:08 +0100)]
apply: make parse_git_diff_header public

Make 'parse_git_header()' (renamed to 'parse_git_diff_header()') a
"public" function in apply.h, so we can re-use it in range-diff in a
subsequent commit.  We're renaming the function to make it clearer in
other parts of the codebase that we're talking about a diff header and
not just any header.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoapply: only pass required data to gitdiff_* functions
Thomas Gummerer [Thu, 11 Jul 2019 16:08:43 +0000 (17:08 +0100)]
apply: only pass required data to gitdiff_* functions

Currently the 'gitdiff_*()' functions take 'struct apply_state' as
parameter, even though they only needs the root, linenr and p_value
from that struct.

These functions are in the callchain of 'parse_git_header()', which we
want to make more generally useful in a subsequent commit.  To make
that happen we only want to pass in the required data to
'parse_git_header()', and not the whole 'struct apply_state', and thus
we want functions in the callchain of 'parse_git_header()' to only
take arguments they really need.

As these functions are called in a loop using their function pointers,
each function needs to be passed all the parameters even if only one
of the functions actually needs it.  We therefore pass this data along
in a struct to avoid adding too many unused parameters to each
function and making the code very verbose in the process.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoclone: replace strcmp by fspathcmp
Matheus Tavares [Wed, 10 Jul 2019 23:59:04 +0000 (20:59 -0300)]
clone: replace strcmp by fspathcmp

Replace the use of strcmp by fspathcmp at copy_or_link_directory, which
is more permissive/friendly to case-insensitive file systems.

Suggested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoclone: use dir-iterator to avoid explicit dir traversal
Matheus Tavares [Wed, 10 Jul 2019 23:59:03 +0000 (20:59 -0300)]
clone: use dir-iterator to avoid explicit dir traversal

Replace usage of opendir/readdir/closedir API to traverse directories
recursively, at copy_or_link_directory function, by the dir-iterator
API. This simplifies the code and avoids recursive calls to
copy_or_link_directory.

This process also makes copy_or_link_directory call die() in case of an
error on readdir or stat inside dir_iterator_advance. Previously it
would just print a warning for errors on stat and ignore errors on
readdir, which isn't nice because a local git clone could succeed even
though the .git/objects copy didn't fully succeed.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoclone: extract function from copy_or_link_directory
Matheus Tavares [Wed, 10 Jul 2019 23:59:02 +0000 (20:59 -0300)]
clone: extract function from copy_or_link_directory

Extract dir creation code snippet from copy_or_link_directory to its own
function named mkdir_if_missing. This change will help to remove
copy_or_link_directory's explicit recursion, which will be done in a
following patch. Also makes the code more readable.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoclone: copy hidden paths at local clone
Matheus Tavares [Wed, 10 Jul 2019 23:59:01 +0000 (20:59 -0300)]
clone: copy hidden paths at local clone

Make the copy_or_link_directory function no longer skip hidden
directories. This function, used to copy .git/objects, currently skips
all hidden directories but not hidden files, which is an odd behaviour.
The reason for that could be unintentional: probably the intention was
to skip '.' and '..' only but it ended up accidentally skipping all
directories starting with '.'. Besides being more natural, the new
behaviour is more permissive to the user.

Also adjust tests to reflect this behaviour change.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Co-authored-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agodir-iterator: add flags parameter to dir_iterator_begin
Matheus Tavares [Wed, 10 Jul 2019 23:59:00 +0000 (20:59 -0300)]
dir-iterator: add flags parameter to dir_iterator_begin

Add the possibility of giving flags to dir_iterator_begin to initialize
a dir-iterator with special options.

Currently possible flags are:
- DIR_ITERATOR_PEDANTIC, which makes dir_iterator_advance abort
immediately in the case of an error, instead of keep looking for the
next valid entry;
- DIR_ITERATOR_FOLLOW_SYMLINKS, which makes the iterator follow
symlinks and include linked directories' contents in the iteration.

These new flags will be used in a subsequent patch.

Also add tests for the flags' usage and adjust refs/files-backend.c to
the new dir_iterator_begin signature.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agodir-iterator: refactor state machine model
Matheus Tavares [Wed, 10 Jul 2019 23:58:59 +0000 (20:58 -0300)]
dir-iterator: refactor state machine model

dir_iterator_advance() is a large function with two nested loops. Let's
improve its readability factoring out three functions and simplifying
its mechanics. The refactored model will no longer depend on
level.initialized and level.dir_state to keep track of the iteration
state and will perform on a single loop.

Also, dir_iterator_begin() currently does not check if the given string
represents a valid directory path. Since the refactored model will have
to stat() the given path at initialization, let's also check for this
kind of error and make dir_iterator_begin() return NULL, on failures,
with errno appropriately set. And add tests for this new behavior.

Improve documentation at dir-iteration.h and code comments at
dir-iterator.c to reflect the changes and eliminate possible
ambiguities.

Finally, adjust refs/files-backend.c to check for now possible
dir_iterator_begin() failures.

Original-patch-by: Daniel Ferreira <bnmvco@gmail.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agodir-iterator: use warning_errno when possible
Matheus Tavares [Wed, 10 Jul 2019 23:58:58 +0000 (20:58 -0300)]
dir-iterator: use warning_errno when possible

Change warning(..., strerror(errno)) by warning_errno(...). This helps
to unify warning display besides simplifying a bit the code. Also,
improve warning messages by surrounding paths with quotation marks and
using more meaningful statements.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agodir-iterator: add tests for dir-iterator API
Daniel Ferreira [Wed, 10 Jul 2019 23:58:57 +0000 (20:58 -0300)]
dir-iterator: add tests for dir-iterator API

Create t/helper/test-dir-iterator.c, which prints relevant information
about a directory tree iterated over with dir-iterator.

Create t/t0066-dir-iterator.sh, which tests that dir-iterator does
iterate through a whole directory tree as expected.

Signed-off-by: Daniel Ferreira <bnmvco@gmail.com>
[matheus.bernardino: update to use test-tool and some minor aesthetics]
Helped-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoclone: better handle symlinked files at .git/objects/
Matheus Tavares [Wed, 10 Jul 2019 23:58:56 +0000 (20:58 -0300)]
clone: better handle symlinked files at .git/objects/

There is currently an odd behaviour when locally cloning a repository
with symlinks at .git/objects: using --no-hardlinks all symlinks are
dereferenced but without it, Git will try to hardlink the files with the
link() function, which has an OS-specific behaviour on symlinks. On OSX
and NetBSD, it creates a hardlink to the file pointed by the symlink
whilst on GNU/Linux, it creates a hardlink to the symlink itself.

On Manjaro GNU/Linux:
    $ touch a
    $ ln -s a b
    $ link b c
    $ ls -li a b c
    155 [...] a
    156 [...] b -> a
    156 [...] c -> a

But on NetBSD:
    $ ls -li a b c
    2609160 [...] a
    2609164 [...] b -> a
    2609160 [...] c

It's not good to have the result of a local clone to be OS-dependent and
besides that, the current behaviour on GNU/Linux may result in broken
symlinks. So let's standardize this by making the hardlinks always point
to dereferenced paths, instead of the symlinks themselves. Also, add
tests for symlinked files at .git/objects/.

Note: Git won't create symlinks at .git/objects itself, but it's better
to handle this case and be friendly with users who manually create them.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Co-authored-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoclone: test for our behavior on odd objects/* content
Ævar Arnfjörð Bjarmason [Wed, 10 Jul 2019 23:58:55 +0000 (20:58 -0300)]
clone: test for our behavior on odd objects/* content

Add tests for what happens when we perform a local clone on a repo
containing odd files at .git/object directory, such as symlinks to other
dirs, or unknown files.

I'm bending over backwards here to avoid a SHA-1 dependency. See [1]
for an earlier and simpler version that hardcoded SHA-1s.

This behavior has been the same for a *long* time, but hasn't been
tested for.

There's a good post-hoc argument to be made for copying over unknown
things, e.g. I'd like a git version that doesn't know about the
commit-graph to copy it under "clone --local" so a newer git version
can make use of it.

In follow-up commits we'll look at changing some of this behavior, but
for now, let's just assert it as-is so we'll notice what we'll change
later.

1. https://public-inbox.org/git/20190226002625.13022-5-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
[matheus.bernardino: improved and split tests in more than one patch]
Helped-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agodiff: munmap() file contents before running external diff
Johannes Schindelin [Thu, 11 Jul 2019 08:23:41 +0000 (01:23 -0700)]
diff: munmap() file contents before running external diff

When running an external diff from, say, a diff tool, it is safe to
assume that we want to write the files in question. On Windows, that
means that there cannot be any other process holding an open handle to
said files, or even just a mapped region.

So let's make sure that `git diff` itself is not holding any open handle
to the files in question.

In fact, we will just release the file pair right away, as the external
diff uses the files we just wrote, so we do not need to hold the file
contents in memory anymore.

This fixes https://github.com/git-for-windows/git/issues/1315

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoref-filter: fix memory leak in `free_array_item()`
Martin Ågren [Wed, 10 Jul 2019 18:36:39 +0000 (20:36 +0200)]
ref-filter: fix memory leak in `free_array_item()`

We treat the `value` pointer as a pointer to a struct and free its `s`
field. But `value` is in fact an array of structs. As a result, we only
free the first `s` out of `used_atom_cnt`-many and leak the rest. Make
sure we free all items in `value`.

In the caller, `ref_array_clear()`, this means we need to be careful not
to zero `used_atom_cnt` until after we've called `free_array_item()`. We
could move just a single line, but let's keep related things close
together instead, by first handling `array`, then `used_atom`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agotrace2: correct trace2 field name documentation
Josh Steadmon [Tue, 9 Jul 2019 23:09:01 +0000 (16:09 -0700)]
trace2: correct trace2 field name documentation

Correct the api-trace2 documentation, which lists "signal" as an
expected field for the signal event type, but which actually outputs
"signo" as the field name.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoThe fourth batch 623/head
Junio C Hamano [Tue, 9 Jul 2019 22:48:36 +0000 (15:48 -0700)]
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoMerge branch 'ds/fetch-disable-force-notice'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)]
Merge branch 'ds/fetch-disable-force-notice'

"git fetch" and "git pull" reports when a fetch results in
non-fast-forward updates to let the user notice unusual situation.
The commands learned "--no-shown-forced-updates" option to disable
this safety feature.

* ds/fetch-disable-force-notice:
  pull: add --[no-]show-forced-updates passthrough
  fetch: warn about forced updates in branch listing
  fetch: add --[no-]show-forced-updates argument

19 months agoMerge branch 'jh/status-aheadbehind'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)]
Merge branch 'jh/status-aheadbehind'

"git status" can be told a non-standard default value for the
"--[no-]ahead-behind" option with a new configuration variable
status.aheadBehind.

* jh/status-aheadbehind:
  status: ignore status.aheadbehind in porcelain formats
  status: warn when a/b calculation takes too long
  status: add status.aheadbehind setting

19 months agoMerge branch 'sg/t5551-fetch-smart-error-is-translated'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)]
Merge branch 'sg/t5551-fetch-smart-error-is-translated'

Test update.

* sg/t5551-fetch-smart-error-is-translated:
  t5551: use 'test_i18ngrep' to check translated output

19 months agoMerge branch 'ms/submodule-foreach-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)]
Merge branch 'ms/submodule-foreach-fix'

"git submodule foreach" did not protect command line options passed
to the command to be run in each submodule correctly, when the
"--recursive" option was in use.

* ms/submodule-foreach-fix:
  submodule foreach: fix recursion of options

19 months agoMerge branch 'jh/msvc'
Junio C Hamano [Tue, 9 Jul 2019 22:25:45 +0000 (15:25 -0700)]
Merge branch 'jh/msvc'

Support to build with MSVC has been updated.

* jh/msvc:
  msvc: ignore .dll and incremental compile output
  msvc: avoid debug assertion windows in Debug Mode
  msvc: do not pretend to support all signals
  msvc: add pragmas for common warnings
  msvc: add a compile-time flag to allow detailed heap debugging
  msvc: support building Git using MS Visual C++
  msvc: update Makefile to allow for spaces in the compiler path
  msvc: fix detect_msys_tty()
  msvc: define ftello()
  msvc: do not re-declare the timespec struct
  msvc: mark a variable as non-const
  msvc: define O_ACCMODE
  msvc: include sigset_t definition
  msvc: fix dependencies of compat/msvc.c
  mingw: replace mingw_startup() hack
  obstack: fix compiler warning
  cache-tree/blame: avoid reusing the DEBUG constant
  t0001 (mingw): do not expect a specific order of stdout/stderr
  Mark .bat files as requiring CR/LF endings
  mingw: fix a typo in the msysGit-specific section

19 months agoMerge branch 'sg/rebase-progress'
Junio C Hamano [Tue, 9 Jul 2019 22:25:45 +0000 (15:25 -0700)]
Merge branch 'sg/rebase-progress'

Use "Erase in Line" CSI sequence that is already used in the editor
support to clear cruft in the progress output.

* sg/rebase-progress:
  progress: use term_clear_line()
  rebase: fix garbled progress display with '-x'
  pager: add a helper function to clear the last line in the terminal
  t3404: make the 'rebase.missingCommitsCheck=ignore' test more focused
  t3404: modernize here doc style

19 months agoMerge branch 'jw/gitweb-sample-update'
Junio C Hamano [Tue, 9 Jul 2019 22:25:45 +0000 (15:25 -0700)]
Merge branch 'jw/gitweb-sample-update'

Doc update.

* jw/gitweb-sample-update:
  doc: don't use git.kernel.org as example gitweb URL

19 months agoMerge branch 'js/t0001-case-insensitive'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)]
Merge branch 'js/t0001-case-insensitive'

Test update.

* js/t0001-case-insensitive:
  t0001: fix on case-insensitive filesystems

19 months agoMerge branch 'cc/first-contrib-tutorial'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)]
Merge branch 'cc/first-contrib-tutorial'

Update docs used in a tutorial.

* cc/first-contrib-tutorial:
  doc: improve usage string in MyFirstContribution

19 months agoMerge branch 'ab/fail-prereqs-in-test'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)]
Merge branch 'ab/fail-prereqs-in-test'

Test updates.

* ab/fail-prereqs-in-test:
  tests: mark two failing tests under FAIL_PREREQS

19 months agoMerge branch 'nd/switch-and-restore'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)]
Merge branch 'nd/switch-and-restore'

Two new commands "git switch" and "git restore" are introduced to
split "checking out a branch to work on advancing its history" and
"checking out paths out of the index and/or a tree-ish to work on
advancing the current history" out of the single "git checkout"
command.

* nd/switch-and-restore: (46 commits)
  completion: disable dwim on "git switch -d"
  switch: allow to switch in the middle of bisect
  t2027: use test_must_be_empty
  Declare both git-switch and git-restore experimental
  help: move git-diff and git-reset to different groups
  doc: promote "git restore"
  user-manual.txt: prefer 'merge --abort' over 'reset --hard'
  completion: support restore
  t: add tests for restore
  restore: support --patch
  restore: replace --force with --ignore-unmerged
  restore: default to --source=HEAD when only --staged is specified
  restore: reject invalid combinations with --staged
  restore: add --worktree and --staged
  checkout: factor out worktree checkout code
  restore: disable overlay mode by default
  restore: make pathspec mandatory
  restore: take tree-ish from --source option instead
  checkout: split part of it to new command 'restore'
  doc: promote "git switch"
  ...

19 months agoMerge branch 'nd/fetch-capability-tweak'
Junio C Hamano [Tue, 9 Jul 2019 22:25:43 +0000 (15:25 -0700)]
Merge branch 'nd/fetch-capability-tweak'

Protocol capabilities that go over wire should never be translated,
but it was incorrectly marked for translation, which has been
corrected.  The output of protocol capabilities for debugging has
been tweaked a bit.

* nd/fetch-capability-tweak:
  fetch-pack: print server version at the top in -v -v
  fetch-pack: print all relevant supported capabilities with -v -v
  fetch-pack: move capability names out of i18n strings

19 months agoMerge branch 'jk/oidhash'
Junio C Hamano [Tue, 9 Jul 2019 22:25:43 +0000 (15:25 -0700)]
Merge branch 'jk/oidhash'

Code clean-up to remove hardcoded SHA-1 hash from many places.

* jk/oidhash:
  hashmap: convert sha1hash() to oidhash()
  hash.h: move object_id definition from cache.h
  khash: rename oid helper functions
  khash: drop sha1-specific map types
  pack-bitmap: convert khash_sha1 maps into kh_oid_map
  delta-islands: convert island_marks khash to use oids
  khash: rename kh_oid_t to kh_oid_set
  khash: drop broken oid_map typedef
  object: convert create_object() to use object_id
  object: convert internal hash_obj() to object_id
  object: convert lookup_object() to use object_id
  object: convert lookup_unknown_object() to use object_id
  pack-objects: convert locate_object_entry_hash() to object_id
  pack-objects: convert packlist_find() to use object_id
  pack-bitmap-write: convert some helpers to use object_id
  upload-pack: rename a "sha1" variable to "oid"
  describe: fix accidental oid/hash type-punning

19 months agoMerge branch 'jk/delta-islands-progress-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:43 +0000 (15:25 -0700)]
Merge branch 'jk/delta-islands-progress-fix'

The codepath to compute delta islands used to spew progress output
without giving the callers any way to squelch it, which has been
fixed.

* jk/delta-islands-progress-fix:
  delta-islands: respect progress flag

19 months agoMerge branch 'md/sort-detached-head-first'
Junio C Hamano [Tue, 9 Jul 2019 22:25:42 +0000 (15:25 -0700)]
Merge branch 'md/sort-detached-head-first'

"git branch --list" learned to always output the detached HEAD as
the first item (when the HEAD is detached, of course), regardless
of the locale.

* md/sort-detached-head-first:
  ref-filter: sort detached HEAD lines firstly

19 months agoMerge branch 'nd/fetch-multi-gc-once'
Junio C Hamano [Tue, 9 Jul 2019 22:25:42 +0000 (15:25 -0700)]
Merge branch 'nd/fetch-multi-gc-once'

"git fetch" that grabs from a group of remotes learned to run the
auto-gc only once at the very end.

* nd/fetch-multi-gc-once:
  fetch: only run 'gc' once when fetching multiple remotes

19 months agoMerge branch 'es/rev-list-no-object-names'
Junio C Hamano [Tue, 9 Jul 2019 22:25:42 +0000 (15:25 -0700)]
Merge branch 'es/rev-list-no-object-names'

"git rev-list --objects" learned with "--no-object-names" option to
squelch the path to the object that is used as a grouping hint for
pack-objects.

* es/rev-list-no-object-names:
  rev-list: teach --no-object-names to enable piping

19 months agoMerge branch 'rs/config-unit-parsing'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)]
Merge branch 'rs/config-unit-parsing'

The code to parse scaled numbers out of configuration files has
been made more robust and also easier to follow.

* rs/config-unit-parsing:
  config: simplify parsing of unit factors
  config: don't multiply in parse_unit_factor()
  config: use unsigned_mult_overflows to check for overflows

19 months agoMerge branch 'js/gcc-8-and-9'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)]
Merge branch 'js/gcc-8-and-9'

Code clean-up for new compilers.

* 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

19 months agoMerge branch 'dl/includeif-onbranch'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)]
Merge branch 'dl/includeif-onbranch'

The conditional inclusion mechanism learned to base the choice on
the branch the HEAD currently is on.

* dl/includeif-onbranch:
  config: learn the "onbranch:" includeIf condition