gitweb.git
Merge branch 'nd/format-patch-cover-letter-stat-width'Junio C Hamano Mon, 19 Nov 2018 07:24:40 +0000 (16:24 +0900)

Merge branch 'nd/format-patch-cover-letter-stat-width'

"git format-patch --stat=<width>" can be used to specify the width
used by the diffstat (shown in the cover letter).

* nd/format-patch-cover-letter-stat-width:
format-patch: respect --stat in cover letter's diffstat

Merge branch 'ds/push-squelch-ambig-warning'Junio C Hamano Mon, 19 Nov 2018 07:24:40 +0000 (16:24 +0900)

Merge branch 'ds/push-squelch-ambig-warning'

"git push" used to check ambiguities between object-names and
refnames while processing the list of refs' old and new values,
which was unnecessary (as it knew that it is feeding raw object
names). This has been optimized out.

* ds/push-squelch-ambig-warning:
pack-objects: ignore ambiguous object warnings

Merge branch 'ab/dynamic-gettext-poison'Junio C Hamano Mon, 19 Nov 2018 07:24:39 +0000 (16:24 +0900)

Merge branch 'ab/dynamic-gettext-poison'

Our testing framework uses a special i18n "poisoned localization"
feature to find messages that ought to stay constant but are
incorrectly marked to be translated. This feature has been made
into a runtime option (it used to be a compile-time option).

* ab/dynamic-gettext-poison:
Makefile: ease dynamic-gettext-poison transition
i18n: make GETTEXT_POISON a runtime option

RelNotes: name the release properlyJunio C Hamano Sun, 18 Nov 2018 23:23:09 +0000 (08:23 +0900)

RelNotes: name the release properly

In the title, we should state for which version this release notes
document is about.

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

Git 2.20-rc0 v2.20.0-rc0Junio C Hamano Sun, 18 Nov 2018 09:24:49 +0000 (18:24 +0900)

Git 2.20-rc0

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

Merge branch 'jk/close-duped-fd-before-unlock-for-bundle'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'jk/close-duped-fd-before-unlock-for-bundle'

When "git bundle" aborts due to an empty commit ranges
(i.e. resulting in an empty pack), it left a file descriptor to an
lockfile open, which resulted in leftover lockfile on Windows where
you cannot remove a file with an open file descriptor. This has
been corrected.

* jk/close-duped-fd-before-unlock-for-bundle:
bundle: dup() output descriptor closer to point-of-use

Merge branch 'ab/rebase-in-c-escape-hatch'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'ab/rebase-in-c-escape-hatch'

The recently merged "rebase in C" has an escape hatch to use the
scripted version when necessary, but it hasn't been documented,
which has been corrected.

* ab/rebase-in-c-escape-hatch:
tests: add a special setup where rebase.useBuiltin is off
rebase doc: document rebase.useBuiltin

Merge branch 'js/rebase-am-options'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'js/rebase-am-options'

The way "git rebase" parses and forwards the command line options
meant for underlying "git am" has been revamped, which fixed for
options with parameters that were not passed correctly.

* js/rebase-am-options:
rebase: validate -C<n> and --whitespace=<mode> parameters early
rebase: really just passthru the `git am` options

Merge branch 'sg/ref-filter-wo-repository'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'sg/ref-filter-wo-repository'

"git ls-remote --sort=<thing>" can feed an object that is not yet
available into the comparison machinery and segfault, which has
been corrected to check such a request upfront and reject it.

* sg/ref-filter-wo-repository:
ref-filter: don't look for objects when outside of a repository

Merge branch 'nd/doc-extensions'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'nd/doc-extensions'

Doc update.

* nd/doc-extensions:
doc: move extensions.worktreeConfig to the right place

Merge branch 'js/fuzz-cxxflags'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'js/fuzz-cxxflags'

The build procedure to link for fuzzing test has been made
customizable with a new Makefile variable.

* js/fuzz-cxxflags:
Makefile: use FUZZ_CXXFLAGS for linking fuzzers

Merge branch 'js/mingw-msdn-url'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'js/mingw-msdn-url'

The URL to an MSDN page in a comment has been updated.

* js/mingw-msdn-url:
mingw: replace an obsolete link with the superseding one

Merge branch 'js/mingw-create-hard-link'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'js/mingw-create-hard-link'

Windows update.

* js/mingw-create-hard-link:
mingw: use `CreateHardLink()` directly

Merge branch 'js/config-sequence'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'js/config-sequence'

A sanity check for start-up sequence has been added in the config
API codepath.

* js/config-sequence:
config: report a bug if git_dir exists without commondir

Merge branch 'lj/mingw-pthread-cond'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'lj/mingw-pthread-cond'

Code simplification.

* lj/mingw-pthread-cond:
win32: replace pthread_cond_*() with much simpler code

Merge branch 'nd/command-list-gen-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'nd/command-list-gen-fix'

Build tweak.

* nd/command-list-gen-fix:
build: fix broken command-list.h generation with core.autocrlf

Merge branch 'ag/p3400-force-checkout'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'ag/p3400-force-checkout'

Perf test tweak.

* ag/p3400-force-checkout:
p3400: replace calls to `git checkout -b' by `git checkout -B'

Merge branch 'cb/notes-freeing-always-null-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'cb/notes-freeing-always-null-fix'

Code cleanup.

* cb/notes-freeing-always-null-fix:
builtin/notes: remove unnecessary free

Merge branch 'js/rebase-r-and-merge-head'Junio C Hamano Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)

Merge branch 'js/rebase-r-and-merge-head'

Bugfix for the recently graduated "git rebase --rebase-merges".

* js/rebase-r-and-merge-head:
status: rebase and merge can be in progress at the same time
built-in rebase --skip/--abort: clean up stale .git/<name> files
rebase -i: include MERGE_HEAD into files to clean up
rebase -r: do not write MERGE_HEAD unless needed
rebase -r: demonstrate bug with conflicting merges

Merge branch 'js/apply-recount-allow-noop'Junio C Hamano Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)

Merge branch 'js/apply-recount-allow-noop'

When editing a patch in a "git add -i" session, a hunk could be
made to no-op. The "git apply" program used to reject a patch with
such a no-op hunk to catch user mistakes, but it is now updated to
explicitly allow a no-op hunk in an edited patch.

* js/apply-recount-allow-noop:
apply --recount: allow "no-op hunks"

Merge branch 'ra/rev-parse-exclude-glob'Junio C Hamano Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)

Merge branch 'ra/rev-parse-exclude-glob'

"rev-parse --exclude=<pattern> --branches=<pattern>" etc. did not
quite work, which has been corrected.

* ra/rev-parse-exclude-glob:
refs: fix some exclude patterns being ignored
refs: show --exclude failure with --branches/tags/remotes=glob

Merge branch 'js/builtin-rebase-perf-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:55 +0000 (18:23 +0900)

Merge branch 'js/builtin-rebase-perf-fix'

Code clean-up with correction to make the reimplemented "git
rebase" a more faithful rewrite of the original, which also regains
performance.

* js/builtin-rebase-perf-fix:
built-in rebase: reinstate `checkout -q` behavior where appropriate
rebase: prepare reset_head() for more flags
rebase: consolidate clean-up code before leaving reset_head()

Merge branch 'js/mailmap'Junio C Hamano Sun, 18 Nov 2018 09:23:55 +0000 (18:23 +0900)

Merge branch 'js/mailmap'

Update the mailmap to unify multiple entries for the authors with
commits since v2.10.

* js/mailmap:
Update .mailmap

Merge branch 'js/rebase-autostash-detach-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:55 +0000 (18:23 +0900)

Merge branch 'js/rebase-autostash-detach-fix'

"git rebase --autostash" did not correctly re-attach the HEAD at times.

* js/rebase-autostash-detach-fix:
built-in rebase --autostash: leave the current branch alone if possible
built-in rebase: demonstrate regression with --autostash

Merge branch 'ab/range-diff-no-patch'Junio C Hamano Sun, 18 Nov 2018 09:23:54 +0000 (18:23 +0900)

Merge branch 'ab/range-diff-no-patch'

The "--no-patch" option, which can be used to get a high-level
overview without the actual line-by-line patch difference shown, of
the "range-diff" command was earlier broken, which has been
corrected.

* ab/range-diff-no-patch:
range-diff: make diff option behavior (e.g. --stat) consistent
range-diff: fix regression in passing along diff options
range-diff doc: add a section about output stability

Merge branch 'jk/verify-sig-merge-into-void'Junio C Hamano Sun, 18 Nov 2018 09:23:54 +0000 (18:23 +0900)

Merge branch 'jk/verify-sig-merge-into-void'

"git merge" and "git pull" that merges into an unborn branch used
to completely ignore "--verify-signatures", which has been
corrected.

* jk/verify-sig-merge-into-void:
pull: handle --verify-signatures for unborn branch
merge: handle --verify-signatures for unborn branch
merge: extract verify_merge_signature() helper

Merge branch 'js/mingw-res-rebuild'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'js/mingw-res-rebuild'

Windows build update.

* js/mingw-res-rebuild:
Windows: force-recompile git.res for differing architectures

Merge branch 'jk/unused-parameter-fixes'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'jk/unused-parameter-fixes'

Various functions have been audited for "-Wunused-parameter" warnings
and bugs in them got fixed.

* jk/unused-parameter-fixes:
midx: double-check large object write loop
assert NOARG/NONEG behavior of parse-options callbacks
parse-options: drop OPT_DATE()
apply: return -1 from option callback instead of calling exit(1)
cat-file: report an error on multiple --batch options
tag: mark "--message" option with NONEG
show-branch: mark --reflog option as NONEG
format-patch: mark "--no-numbered" option with NONEG
status: mark --find-renames option with NONEG
cat-file: mark batch options with NONEG
pack-objects: mark index-version option as NONEG
ls-files: mark exclude options as NONEG
am: handle --no-patch-format option
apply: mark include/exclude options as NONEG

Merge branch 'jk/curl-ldflags'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'jk/curl-ldflags'

The way -lcurl library gets linked has been simplified by taking
advantage of the fact that we can just ask curl-config command how.

* jk/curl-ldflags:
build: link with curl-defined linker flags

Merge branch 'mg/gpg-fingerprint-test'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'mg/gpg-fingerprint-test'

Add a few tests for a topic already in 'master'.

* mg/gpg-fingerprint-test:
t/t7510-signed-commit.sh: add signing subkey to Eris Discordia key
t/t7510-signed-commit.sh: Add %GP to custom format checks

Merge branch 'nd/pthreads'Junio C Hamano Sun, 18 Nov 2018 09:23:52 +0000 (18:23 +0900)

Merge branch 'nd/pthreads'

The codebase has been cleaned up to reduce "#ifndef NO_PTHREADS".

* nd/pthreads:
Clean up pthread_create() error handling
read-cache.c: initialize copy_len to shut up gcc 8
read-cache.c: reduce branching based on HAVE_THREADS
read-cache.c: remove #ifdef NO_PTHREADS
pack-objects: remove #ifdef NO_PTHREADS
preload-index.c: remove #ifdef NO_PTHREADS
grep: clean up num_threads handling
grep: remove #ifdef NO_PTHREADS
attr.c: remove #ifdef NO_PTHREADS
name-hash.c: remove #ifdef NO_PTHREADS
index-pack: remove #ifdef NO_PTHREADS
send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
run-command.h: include thread-utils.h instead of pthread.h
thread-utils: macros to unconditionally compile pthreads API

Merge branch 'ds/reachable-topo-order'Junio C Hamano Sun, 18 Nov 2018 09:23:52 +0000 (18:23 +0900)

Merge branch 'ds/reachable-topo-order'

The revision walker machinery learned to take advantage of the
commit generation numbers stored in the commit-graph file.

* ds/reachable-topo-order:
t6012: make rev-list tests more interesting
revision.c: generation-based topo-order algorithm
commit/revisions: bookkeeping before refactoring
revision.c: begin refactoring --topo-order logic
test-reach: add rev-list tests
test-reach: add run_three_modes method
prio-queue: add 'peek' operation

bundle: dup() output descriptor closer to point-of-useJeff King Fri, 16 Nov 2018 09:43:59 +0000 (04:43 -0500)

bundle: dup() output descriptor closer to point-of-use

When writing a bundle to a file, the bundle code actually creates
"your.bundle.lock" using our lockfile interface. We feed that output
descriptor to a child git-pack-objects via run-command, which has the
quirk that it closes the output descriptor in the parent.

To avoid confusing the lockfile code (which still thinks the descriptor
is valid), we dup() it, and operate on the duplicate.

However, this has a confusing side effect: after the dup() but before we
call pack-objects, we have _two_ descriptors open to the lockfile. If we
call die() during that time, the lockfile code will try to clean up the
partially-written file. It knows to close() the file before unlinking,
since on some platforms (i.e., Windows) the open file would block the
deletion. But it doesn't know about the duplicate descriptor. On
Windows, triggering an error at the right part of the code will result
in the cleanup failing and the lockfile being left in the filesystem.

We can solve this by moving the dup() much closer to start_command(),
shrinking the window in which we have the second descriptor open. It's
easy to place this in such a way that no die() is possible. We could
still die due to a signal in the exact wrong moment, but we already
tolerate races there (e.g., a signal could come before we manage to put
the file on the cleanup list in the first place).

As a bonus, this shields create_bundle() itself from the duplicate-fd
trick, and we can simplify its error handling (note that the lock
rollback now happens unconditionally, but that's OK; it's a noop if we
didn't open the lock in the first place).

The included test uses an empty bundle to cause a failure at the right
spot in the code, because that's easy to trigger (the other likely
errors are write() problems like ENOSPC). Note that it would already
pass on non-Windows systems (because they are happy to unlink an
already-open file).

Based-on-a-patch-by: Gaël Lhez <gael.lhez@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: add a special setup where rebase.useBuiltin... Ævar Arnfjörð Bjarmason Wed, 14 Nov 2018 09:15:06 +0000 (09:15 +0000)

tests: add a special setup where rebase.useBuiltin is off

Add a GIT_TEST_REBASE_USE_BUILTIN=false test mode which is equivalent
to running with rebase.useBuiltin=false. This is needed to spot that
we're not introducing any regressions in the legacy rebase version
while we're carrying both it and the new builtin version.

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

rebase doc: document rebase.useBuiltinÆvar Arnfjörð Bjarmason Wed, 14 Nov 2018 09:15:05 +0000 (09:15 +0000)

rebase doc: document rebase.useBuiltin

The rebase.useBuiltin variable introduced in 55071ea248 ("rebase:
start implementing it as a builtin", 2018-08-07) was turned on by
default in 5541bd5b8f ("rebase: default to using the builtin rebase",
2018-08-08), but had no documentation.

Let's document it so that users who run into any stability issues with
the C rewrite know there's an escape hatch[1], and make it clear that
needing to turn off builtin rebase means you've found a bug in git.

1. https://public-inbox.org/git/87y39w1wc2.fsf@evledraar.gmail.com/

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

mingw: replace an obsolete link with the superseding oneJohannes Schindelin Thu, 15 Nov 2018 11:22:40 +0000 (03:22 -0800)

mingw: replace an obsolete link with the superseding one

The MSDN documentation has been superseded by Microsoft Docs (which is
backed by a repository on GitHub containing many, many files in Markdown
format).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: use FUZZ_CXXFLAGS for linking fuzzersJosh Steadmon Wed, 14 Nov 2018 19:41:47 +0000 (11:41 -0800)

Makefile: use FUZZ_CXXFLAGS for linking fuzzers

OSS-Fuzz requires C++-specific flags to link fuzzers. Passing these in
CFLAGS causes lots of build warnings. Using separate FUZZ_CXXFLAGS
avoids this.

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

doc: move extensions.worktreeConfig to the right placeNguyễn Thái Ngọc Duy Wed, 14 Nov 2018 16:02:47 +0000 (17:02 +0100)

doc: move extensions.worktreeConfig to the right place

All config extensions are described in technical/repository-version.txt.
I made a mistake of adding it in config.txt instead. This patch moves
it back to where it belongs.

Since repository-version.txt is not part of officially generated
documents (it's not even part of DOC_HTML target), it's only visible
to developers who read plain .txt files. Let's include it in
gitrepository-layout.5 for more visibility. Some minor asciidoc fixes
are required in repository-version.txt to make this happen.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref-filter: don't look for objects when outside of... SZEDER Gábor Wed, 14 Nov 2018 12:27:25 +0000 (13:27 +0100)

ref-filter: don't look for objects when outside of a repository

The command 'git ls-remote --sort=authordate <remote>' segfaults when
run outside of a repository, ever since the introduction of its
'--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option,
2018-04-09).

While in general the 'git ls-remote' command can be run outside of a
repository just fine, its '--sort=<key>' option with certain keys does
require access to the referenced objects. This sorting is implemented
using the generic ref-filter sorting facility, which already handles
missing objects gracefully with the appropriate 'missing object
deadbeef for HEAD' message. However, being generic means that it
checks replace refs while trying to retrieve an object, and while
doing so it accesses the 'git_replace_ref_base' variable, which has
not been initialized and is still a NULL pointer when outside of a
repository, thus causing the segfault.

Make ref-filter more careful upfront while parsing the format string,
and make it error out when encountering a format atom requiring object
access when we are not in a repository. Also add a test to ensure
that 'git ls-remote --sort' fails gracefully when executed outside of
a repository.

Reported-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: report a bug if git_dir exists without commondirJohannes Schindelin Wed, 14 Nov 2018 13:59:02 +0000 (05:59 -0800)

config: report a bug if git_dir exists without commondir

This did happen at some stage, and was fixed relatively quickly. Make
sure that we detect very quickly, too, should that happen again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: validate -C<n> and --whitespace=<mode> paramete... Johannes Schindelin Wed, 14 Nov 2018 16:25:31 +0000 (08:25 -0800)

rebase: validate -C<n> and --whitespace=<mode> parameters early

It is a good idea to error out early upon seeing, say, `-Cbad`, rather
than starting the rebase only to have the `--am` backend complain later.

Let's do this.

The only options accepting parameters which we pass through to `git am`
(which may, or may not, forward them to `git apply`) are `-C` and
`--whitespace`. The other options we pass through do not accept
parameters, so we do not have to validate them here.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: really just passthru the `git am` optionsJohannes Schindelin Wed, 14 Nov 2018 16:25:29 +0000 (08:25 -0800)

rebase: really just passthru the `git am` options

Currently, we parse the options intended for `git am` as if we wanted to
handle them in `git rebase`, and then reconstruct them painstakingly to
define the `git_am_opt` variable.

However, there is a much better way (that I was unaware of, at the time
when I mentored Pratik to implement these options): OPT_PASSTHRU_ARGV.
It is intended for exactly this use case, where command-line options
want to be parsed into a separate `argv_array`.

Let's use this feature.

Incidentally, this also allows us to address a bug discovered by Phillip
Wood, where the built-in rebase failed to understand that the `-C`
option takes an optional argument.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

range-diff: make diff option behavior (e.g. --stat... Ævar Arnfjörð Bjarmason Tue, 13 Nov 2018 18:55:58 +0000 (18:55 +0000)

range-diff: make diff option behavior (e.g. --stat) consistent

Make the behavior when diff options (e.g. "--stat") are passed
consistent with how "diff" behaves.

Before 73a834e9e2 ("range-diff: relieve callers of low-level
configuration burden", 2018-07-22) running range-diff with "--stat"
would produce stat output and the diff output, as opposed to how
"diff" behaves where once "--stat" is specified "--patch" also needs
to be provided to emit the patch output.

As noted in a previous change ("range-diff doc: add a section about
output stability", 2018-11-07) the "--stat" output with "range-diff"
is useless at the moment.

But we should behave consistently with "diff" in anticipation of such
output being useful in the future, because it would make for confusing
UI if "diff" and "range-diff" behaved differently when it came to how
they interpret diff options.

The new behavior is also consistent with the existing documentation
added in ba931edd28 ("range-diff: populate the man page",
2018-08-13). See "[...]also accepts the regular diff options[...]" in
git-range-diff(1).

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

win32: replace pthread_cond_*() with much simpler codeLoo Rong Jie Tue, 13 Nov 2018 18:52:35 +0000 (10:52 -0800)

win32: replace pthread_cond_*() with much simpler code

The Win32 CONDITION_VARIABLE has better performance and is easier to
maintain, as the code is a lot shorter now (the semantics of the
CONDITION_VARIABLE matches the pthread_cond_t very well).

Note: CONDITION_VARIABLE is not available in Windows XP and below,
but the declared minimal Windows version required to build and run
Git for Windows is Windows Vista (which is also beyond its
end-of-life, but for less long than Windows XP), so that's okay.

Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: use `CreateHardLink()` directlyJohannes Schindelin Tue, 13 Nov 2018 14:37:02 +0000 (06:37 -0800)

mingw: use `CreateHardLink()` directly

The function `CreateHardLink()` is available in all supported Windows
versions (even since Windows XP), so there is no more need to resolve it
at runtime.

Helped-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tenth batch for 2.20Junio C Hamano Tue, 13 Nov 2018 13:13:52 +0000 (22:13 +0900)

Tenth batch for 2.20

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

Merge branch 'nd/complete-format-patch'Junio C Hamano Tue, 13 Nov 2018 13:37:28 +0000 (22:37 +0900)

Merge branch 'nd/complete-format-patch'

The support for format-patch (and send-email) by the command-line
completion script (in contrib/) has been simplified a bit.

* nd/complete-format-patch:
completion: use __gitcomp_builtin for format-patch

Merge branch 'nd/tree-walk-path-exclusion'Junio C Hamano Tue, 13 Nov 2018 13:37:28 +0000 (22:37 +0900)

Merge branch 'nd/tree-walk-path-exclusion'

Pathspec matching against a tree object were buggy when negative
pathspec elements were involved, which has been fixed.

* nd/tree-walk-path-exclusion:
tree-walk.c: fix overoptimistic inclusion in :(exclude) matching

Merge branch 'sg/travis-install-dependencies'Junio C Hamano Tue, 13 Nov 2018 13:37:27 +0000 (22:37 +0900)

Merge branch 'sg/travis-install-dependencies'

The procedure to install dependencies before testing at Travis CI
is getting revamped for both simplicity and flexibility, taking
advantage of the recent move to the vm-based environment.

* sg/travis-install-dependencies:
travis-ci: install packages in 'ci/install-dependencies.sh'

Merge branch 'bp/add-diff-files-optim'Junio C Hamano Tue, 13 Nov 2018 13:37:27 +0000 (22:37 +0900)

Merge branch 'bp/add-diff-files-optim'

"git add" needs to internally run "diff-files" equivalent, and the
codepath learned the same optimization as "diff-files" has to run
lstat(2) in parallel to find which paths have been updated in the
working tree.

* bp/add-diff-files-optim:
add: speed up cmd_add() by utilizing read_cache_preload()

Merge branch 'jk/xdiff-interface'Junio C Hamano Tue, 13 Nov 2018 13:37:27 +0000 (22:37 +0900)

Merge branch 'jk/xdiff-interface'

The interface into "xdiff" library used to discover the offset and
size of a generated patch hunk by first formatting it into the
textual hunk header "@@ -n,m +k,l @@" and then parsing the numbers
out. A new interface has been introduced to allow callers a more
direct access to them.

* jk/xdiff-interface:
xdiff-interface: drop parse_hunk_header()
range-diff: use a hunk callback
diff: convert --check to use a hunk callback
combine-diff: use an xdiff hunk callback
diff: use hunk callback for word-diff
diff: discard hunk headers for patch-ids earlier
diff: avoid generating unused hunk header lines
xdiff-interface: provide a separate consume callback for hunks
xdiff: provide a separate emit callback for hunks

Merge branch 'jk/misc-unused-fixes'Junio C Hamano Tue, 13 Nov 2018 13:37:26 +0000 (22:37 +0900)

Merge branch 'jk/misc-unused-fixes'

Assorted fixes for bugs found while auditing -Wunused-parameter
warnings.

* jk/misc-unused-fixes:
approxidate: fix NULL dereference in date_time()
pathspec: handle non-terminated strings with :(attr)
approxidate: handle pending number for "specials"
rev-list: handle flags for --indexed-objects

Merge branch 'nd/per-worktree-ref-iteration'Junio C Hamano Tue, 13 Nov 2018 13:37:26 +0000 (22:37 +0900)

Merge branch 'nd/per-worktree-ref-iteration'

The code to traverse objects for reachability, used to decide what
objects are unreferenced and expendable, have been taught to also
consider per-worktree refs of other worktrees as starting points to
prevent data loss.

* nd/per-worktree-ref-iteration:
git-worktree.txt: correct linkgit command name
reflog expire: cover reflog from all worktrees
fsck: check HEAD and reflog from other worktrees
fsck: move fsck_head_link() to get_default_heads() to avoid some globals
revision.c: better error reporting on ref from different worktrees
revision.c: correct a parameter name
refs: new ref types to make per-worktree refs visible to all worktrees
Add a place for (not) sharing stuff between worktrees
refs.c: indent with tabs, not spaces

Merge branch 'bp/refresh-index-using-preload'Junio C Hamano Tue, 13 Nov 2018 13:37:25 +0000 (22:37 +0900)

Merge branch 'bp/refresh-index-using-preload'

The helper function to refresh the cached stat information in the
in-core index has learned to perform the lstat() part of the
operation in parallel on multi-core platforms.

* bp/refresh-index-using-preload:
refresh_index: remove unnecessary calls to preload_index()
speed up refresh_index() by utilizing preload_index()

Merge branch 'ag/rebase-i-in-c'Junio C Hamano Tue, 13 Nov 2018 13:37:25 +0000 (22:37 +0900)

Merge branch 'ag/rebase-i-in-c'

Code clean-up for a topic already in 'master'.

* ag/rebase-i-in-c:
sequencer.c: remove a stray semicolon

Merge branch 'al/send-email-auto-cte-fixup'Junio C Hamano Tue, 13 Nov 2018 13:37:25 +0000 (22:37 +0900)

Merge branch 'al/send-email-auto-cte-fixup'

"git send-email --transfer-encoding=..." in recent versions of Git
sometimes produced an empty "Content-Transfer-Encoding:" header,
which has been corrected.

* al/send-email-auto-cte-fixup:
send-email: avoid empty transfer encoding header

Merge branch 'ds/add-missing-tags'Junio C Hamano Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)

Merge branch 'ds/add-missing-tags'

The history traversal used to implement the tag-following has been
optimized by introducing a new helper.

* ds/add-missing-tags:
remote: make add_missing_tags() linear
test-reach: test get_reachable_subset
commit-reach: implement get_reachable_subset

Merge branch 'sh/mingw-safer-compat-poll'Junio C Hamano Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)

Merge branch 'sh/mingw-safer-compat-poll'

Windows fix.

* sh/mingw-safer-compat-poll:
poll: use GetTickCount64() to avoid wrap-around issues

Merge branch 'js/rebase-p-tests'Junio C Hamano Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)

Merge branch 'js/rebase-p-tests'

In preparation to the day when we can deprecate and remove the
"rebase -p", make sure we can skip and later remove tests for
it.

* js/rebase-p-tests:
tests: optionally skip `git rebase -p` tests
t3418: decouple test cases from a previous `rebase -p` test case
t3404: decouple some test cases from outcomes of previous test cases

Merge branch 'pw/am-rebase-read-author-script'Junio C Hamano Tue, 13 Nov 2018 13:37:23 +0000 (22:37 +0900)

Merge branch 'pw/am-rebase-read-author-script'

Unify code to read the author-script used in "git am" and the
commands that use the sequencer machinery, e.g. "git rebase -i".

* pw/am-rebase-read-author-script:
sequencer: use read_author_script()
add read_author_script() to libgit
am: rename read_author_script()
am: improve author-script error reporting
am: don't die in read_author_script()

Merge branch 'jc/war-on-string-list'Junio C Hamano Tue, 13 Nov 2018 13:37:23 +0000 (22:37 +0900)

Merge branch 'jc/war-on-string-list'

Replace three string-list instances used as look-up tables in "git
fetch" with hashmaps.

* jc/war-on-string-list:
fetch: replace string-list used as a look-up table with a hashmap

Merge branch 'ag/rev-parse-all-exclude-fix'Junio C Hamano Tue, 13 Nov 2018 13:37:23 +0000 (22:37 +0900)

Merge branch 'ag/rev-parse-all-exclude-fix'

"git rev-parse --exclude=* --branches --branches" (i.e. first
saying "add only things that do not match '*' out of all branches"
and then adding all branches, without any exclusion this time")
worked as expected, but "--exclude=* --all --all" did not work the
same way, which has been fixed.

* ag/rev-parse-all-exclude-fix:
rev-parse: clear --exclude list after 'git rev-parse --all'

Merge branch 'jt/tighten-fetch-proto-v2-response'Junio C Hamano Tue, 13 Nov 2018 13:37:22 +0000 (22:37 +0900)

Merge branch 'jt/tighten-fetch-proto-v2-response'

"git fetch" was a bit loose in parsing resposes from the other side
when talking over the protocol v2.

* jt/tighten-fetch-proto-v2-response:
fetch-pack: be more precise in parsing v2 response

Merge branch 'ao/submodule-wo-gitmodules-checked-out'Junio C Hamano Tue, 13 Nov 2018 13:37:22 +0000 (22:37 +0900)

Merge branch 'ao/submodule-wo-gitmodules-checked-out'

The submodule support has been updated to read from the blob at
HEAD:.gitmodules when the .gitmodules file is missing from the
working tree.

* ao/submodule-wo-gitmodules-checked-out:
t/helper: add test-submodule-nested-repo-config
submodule: support reading .gitmodules when it's not in the working tree
submodule: add a helper to check if it is safe to write to .gitmodules
t7506: clean up .gitmodules properly before setting up new scenario
submodule: use the 'submodule--helper config' command
submodule--helper: add a new 'config' subcommand
t7411: be nicer to future tests and really clean things up
t7411: merge tests 5 and 6
submodule: factor out a config_set_in_gitmodules_file_gently function
submodule: add a print_config_from_gitmodules() helper

Merge branch 'nb/worktree-api-doc'Junio C Hamano Tue, 13 Nov 2018 13:37:21 +0000 (22:37 +0900)

Merge branch 'nb/worktree-api-doc'

Code readability fix.

* nb/worktree-api-doc:
worktree: rename is_worktree_locked to worktree_lock_reason
worktree: update documentation for lock_reason and lock_reason_valid

Merge branch 'ma/sequencer-do-reset-saner-loop-termination'Junio C Hamano Tue, 13 Nov 2018 13:37:21 +0000 (22:37 +0900)

Merge branch 'ma/sequencer-do-reset-saner-loop-termination'

Code readability fix.

* ma/sequencer-do-reset-saner-loop-termination:
sequencer: break out of loop explicitly

Merge branch 'js/mingw-utf8-env'Junio C Hamano Tue, 13 Nov 2018 13:37:21 +0000 (22:37 +0900)

Merge branch 'js/mingw-utf8-env'

Windows fix.

* js/mingw-utf8-env:
mingw: reencode environment variables on the fly (UTF-16 <-> UTF-8)
t7800: fix quoting

Merge branch 'js/mingw-perl5lib'Junio C Hamano Tue, 13 Nov 2018 13:37:20 +0000 (22:37 +0900)

Merge branch 'js/mingw-perl5lib'

Windows fix.

* js/mingw-perl5lib:
mingw: unset PERL5LIB by default
config: move Windows-specific config settings into compat/mingw.c
config: allow for platform-specific core.* config settings
config: rename `dummy` parameter to `cb` in git_default_config()

Merge branch 'js/mingw-isatty-and-dup2'Junio C Hamano Tue, 13 Nov 2018 13:37:20 +0000 (22:37 +0900)

Merge branch 'js/mingw-isatty-and-dup2'

Windows fix.

* js/mingw-isatty-and-dup2:
mingw: fix isatty() after dup2()

Merge branch 'ab/pack-tests-cleanup'Junio C Hamano Tue, 13 Nov 2018 13:37:20 +0000 (22:37 +0900)

Merge branch 'ab/pack-tests-cleanup'

A couple of tests used to leave the repository in a state that is
deliberately corrupt, which have been corrected.

* ab/pack-tests-cleanup:
index-pack tests: don't leave test repo dirty at end
pack-objects tests: don't leave test .git corrupt at end
pack-objects test: modernize style

Merge branch 'ds/test-multi-pack-index'Junio C Hamano Tue, 13 Nov 2018 13:37:19 +0000 (22:37 +0900)

Merge branch 'ds/test-multi-pack-index'

Tests for the recently introduced multi-pack index machinery.

* ds/test-multi-pack-index:
packfile: close multi-pack-index in close_all_packs
multi-pack-index: define GIT_TEST_MULTI_PACK_INDEX
midx: close multi-pack-index on repack
midx: fix broken free() in close_midx()

Merge branch 'nd/wildmatch-double-asterisk'Junio C Hamano Tue, 13 Nov 2018 13:37:19 +0000 (22:37 +0900)

Merge branch 'nd/wildmatch-double-asterisk'

A pattern with '**' that does not have a slash on either side used
to be an invalid one, but the code now treats such double-asterisks
the same way as two normal asterisks that happen to be adjacent to
each other.

* nd/wildmatch-double-asterisk:
wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

Merge branch 'nd/per-worktree-config'Junio C Hamano Tue, 13 Nov 2018 13:37:18 +0000 (22:37 +0900)

Merge branch 'nd/per-worktree-config'

A fourth class of configuration files (in addition to the
traditional "system wide", "per user in the $HOME directory" and
"per repository in the $GIT_DIR/config") has been introduced so
that different worktrees that share the same repository (hence the
same $GIT_DIR/config file) can use different customization.

* nd/per-worktree-config:
worktree: add per-worktree config files
t1300: extract and use test_cmp_config()

Merge branch 'jk/stream-pack-non-delta-clarification'Junio C Hamano Tue, 13 Nov 2018 13:37:18 +0000 (22:37 +0900)

Merge branch 'jk/stream-pack-non-delta-clarification'

Additional comment on a tricky piece of code to help developers.

* jk/stream-pack-non-delta-clarification:
read_istream_pack_non_delta(): document input handling

Merge branch 'jk/proto-v2-ref-prefix-fix'Junio C Hamano Tue, 13 Nov 2018 13:37:17 +0000 (22:37 +0900)

Merge branch 'jk/proto-v2-ref-prefix-fix'

"git ls-remote $there foo" was broken by recent update for the
protocol v2 and stopped showing refs that match 'foo' that are not
refs/{heads,tags}/foo, which has been fixed.

* jk/proto-v2-ref-prefix-fix:
ls-remote: pass heads/tags prefixes to transport
ls-remote: do not send ref prefixes for patterns

Merge branch 'jk/detect-truncated-zlib-input'Junio C Hamano Tue, 13 Nov 2018 13:37:17 +0000 (22:37 +0900)

Merge branch 'jk/detect-truncated-zlib-input'

A regression in Git 2.12 era made "git fsck" fall into an infinite
loop while processing truncated loose objects.

* jk/detect-truncated-zlib-input:
cat-file: handle streaming failures consistently
check_stream_sha1(): handle input underflow
t1450: check large blob in trailing-garbage test

Merge branch 'nd/config-split'Junio C Hamano Tue, 13 Nov 2018 13:37:16 +0000 (22:37 +0900)

Merge branch 'nd/config-split'

Split the overly large Documentation/config.txt file into million
little pieces. This potentially allows each individual piece
included into the manual page of the command it affects more easily.

* nd/config-split: (81 commits)
config.txt: remove config/dummy.txt
config.txt: move worktree.* to a separate file
config.txt: move web.* to a separate file
config.txt: move versionsort.* to a separate file
config.txt: move user.* to a separate file
config.txt: move url.* to a separate file
config.txt: move uploadpack.* to a separate file
config.txt: move uploadarchive.* to a separate file
config.txt: move transfer.* to a separate file
config.txt: move tag.* to a separate file
config.txt: move submodule.* to a separate file
config.txt: move stash.* to a separate file
config.txt: move status.* to a separate file
config.txt: move splitIndex.* to a separate file
config.txt: move showBranch.* to a separate file
config.txt: move sequencer.* to a separate file
config.txt: move sendemail-config.txt to config/
config.txt: move reset.* to a separate file
config.txt: move rerere.* to a separate file
config.txt: move repack.* to a separate file
...

format-patch: respect --stat in cover letter's diffstatNguyễn Thái Ngọc Duy Sat, 10 Nov 2018 05:46:24 +0000 (06:46 +0100)

format-patch: respect --stat in cover letter's diffstat

Commit 43662b23ab (format-patch: keep cover-letter diffstat wrapped in
72 columns - 2018-01-24) uncondtionally sets stat width to 72 when
generating diffstat for the cover letter, ignoring --stat from command
line. But it should only do so when stat width is still default
(i.e. stat_width == 0).

In order to fix this, we should only set stat_width if stat_width is
zero. But it will never be. Commit 071dd0ba43 (format-patch: reduce
patch diffstat width to 72 - 2018-02-01) makes sure that default stat
width will be 72 (ignoring $COLUMNS, but could still be overriden by
--stat). So all we need to do here is drop the assignment.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Helped-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

built-in rebase: reinstate `checkout -q` behavior where... Johannes Schindelin Mon, 12 Nov 2018 11:44:32 +0000 (03:44 -0800)

built-in rebase: reinstate `checkout -q` behavior where appropriate

When we converted a `git checkout -q $onto^0` call to use
`reset_head()`, we inadvertently incurred a change from a twoway_merge
to a oneway_merge, as if we wanted a `git reset --hard` instead.

This has performance ramifications under certain, though, as the
oneway_merge needs to lstat() every single index entry whereas
twoway_merge does not.

So let's go back to the old behavior.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: prepare reset_head() for more flagsJohannes Schindelin Mon, 12 Nov 2018 11:44:31 +0000 (03:44 -0800)

rebase: prepare reset_head() for more flags

Currently, we only accept the flag indicating whether the HEAD should be
detached not. In the next commit, we want to introduce another flag: to
toggle between emulating `reset --hard` vs `checkout -q`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: consolidate clean-up code before leaving reset_... Johannes Schindelin Mon, 12 Nov 2018 11:44:30 +0000 (03:44 -0800)

rebase: consolidate clean-up code before leaving reset_head()

The same clean-up code is repeated quite a few times; Let's DRY up the
code some.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: fix some exclude patterns being ignoredRafael Ascensão Mon, 12 Nov 2018 13:25:44 +0000 (13:25 +0000)

refs: fix some exclude patterns being ignored

`--exclude` from rev-list and rev-parse fails to exclude references if
the next `--branches`, `--tags` or `--remotes` use the optional
inclusive glob because those options are implemented as particular cases
of `--glob=`, which itself requires that exclude patterns begin with
'refs/'.

But it makes sense for `--branches=glob` and friends to be aware that
exclusions patterns for them shouldn't be 'refs/<type>/' prefixed, the
same way exclude patterns for `--branches` and friends (without the
optional glob) already are.

Let's record in 'refs.c:struct ref_filter' which context the exclude
pattern is tied to, so refs.c:filter_refs() can decide if it should
ignore the prefix when trying to match.

Signed-off-by: Rafael Ascensão <rafa.almas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: show --exclude failure with --branches/tags/remot... Rafael Ascensão Mon, 12 Nov 2018 13:25:43 +0000 (13:25 +0000)

refs: show --exclude failure with --branches/tags/remotes=glob

The documentation of `--exclude=` option from rev-list and rev-parse
explicitly states that exclude patterns *should not* start with 'refs/'
when used with `--branches`, `--tags` or `--remotes`.

However, following this advice results in refereces not being excluded
if the next `--branches`, `--tags`, `--remotes` use the optional
inclusive glob.

Demonstrate this failure.

Signed-off-by: Rafael Ascensão <rafa.almas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply --recount: allow "no-op hunks"Johannes Schindelin Mon, 12 Nov 2018 20:54:49 +0000 (12:54 -0800)

apply --recount: allow "no-op hunks"

When editing patches e.g. in `git add -e`, it is quite common that a
hunk ends up having no -/+ lines, i.e. it is now supposed to do nothing.

This use case was broken by ad6e8ed37bc1 (apply: reject a hunk that does
not do anything, 2015-06-01) with the good intention of catching a very
real, different issue in hand-edited patches.

So let's use the `--recount` option as the tell-tale whether the user
would actually be okay with no-op hunks.

Add a test case to make sure that this use case does not regress again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

status: rebase and merge can be in progress at the... Johannes Schindelin Mon, 12 Nov 2018 23:26:02 +0000 (15:26 -0800)

status: rebase and merge can be in progress at the same time

Since `git rebase -r` was introduced, that is possible. But our
machinery did not think that possible, and failed to say anything about
the rebase in progress when in the middle of a merge.

Let's work around that in the minimal fashion.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

built-in rebase --skip/--abort: clean up stale .git... Johannes Schindelin Mon, 12 Nov 2018 23:26:01 +0000 (15:26 -0800)

built-in rebase --skip/--abort: clean up stale .git/<name> files

The scripted version of the rebase used to execute `git reset --hard`
when skipping or aborting. When we ported this to C, we did update the
worktree and some reflogs, but we failed to imitate `git reset --hard`'s
behavior regarding files in .git/ such as MERGE_HEAD.

Let's address this oversight.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: include MERGE_HEAD into files to clean upJohannes Schindelin Mon, 12 Nov 2018 23:25:59 +0000 (15:25 -0800)

rebase -i: include MERGE_HEAD into files to clean up

Every once in a while, the interactive rebase makes sure that no stale
files are lying around. These days, we need to include MERGE_HEAD into
that set of files, as the `merge` command will generate them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -r: do not write MERGE_HEAD unless neededJohannes Schindelin Mon, 12 Nov 2018 23:25:58 +0000 (15:25 -0800)

rebase -r: do not write MERGE_HEAD unless needed

When we detect that a `merge` can be skipped because the merged commit
is already an ancestor of HEAD, we do not need to commit, therefore
writing the MERGE_HEAD file is useless.

It is actually worse than useless: a subsequent `git commit` will pick
it up and think that we want to merge that commit, still.

To avoid that, move the code that writes the MERGE_HEAD file to a
location where we already know that the `merge` cannot be skipped.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -r: demonstrate bug with conflicting mergesJohannes Schindelin Mon, 12 Nov 2018 23:25:57 +0000 (15:25 -0800)

rebase -r: demonstrate bug with conflicting merges

When calling `merge` on a branch that has already been merged, that
`merge` is skipped quietly, but currently a MERGE_HEAD file is being
left behind and will then be grabbed by the next `pick` (that did
not want to create a *merge* commit).

Demonstrate this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: remove unnecessary freeCarlo Marcelo Arenas Belón Sun, 11 Nov 2018 09:49:33 +0000 (01:49 -0800)

builtin/notes: remove unnecessary free

511726e4b1 ("builtin/notes: fix premature failure when trying to add
the empty blob", 2014-11-09) removed the check for !len but left a
call to free the buffer that will be otherwise NULL

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p3400: replace calls to `git checkout -b' by `git check... Alban Gruin Fri, 9 Nov 2018 21:19:23 +0000 (22:19 +0100)

p3400: replace calls to `git checkout -b' by `git checkout -B'

p3400 makes a copy of the current repository to test git-rebase
performance, and creates new branches in the copy with `git checkout
-b'. If the original repository has branches with the same name as the
script is trying to create, this operation will fail.

This replaces these calls by `git checkout -B' to force the creation and
update of these branches.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

build: fix broken command-list.h generation with core... Nguyễn Thái Ngọc Duy Sat, 10 Nov 2018 18:23:23 +0000 (19:23 +0100)

build: fix broken command-list.h generation with core.autocrlf

The script generate-cmdlist.sh needs input text files in UNIX line
ending to work correctly. It's been fine even with core.autocrlf set
because Documentation/git-*.txt is forced LF conversion.

But this leaves out gitk.txt and also Documentation/*config.txt that
recently becomes new input for this script. Update the attribute file
to force LF on all *.txt files to be on the safe side.

For more details, please see 00ddc9d13c (Fix build with
core.autocrlf=true - 2017-05-09)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update .mailmapJohannes Schindelin Fri, 9 Nov 2018 11:31:14 +0000 (03:31 -0800)

Update .mailmap

This patch makes the output of `git shortlog -nse v2.10.0..master`
duplicate-free by taking/guessing the current and preferred
addresses for authors that appear with more than one address.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

range-diff: fix regression in passing along diff optionsÆvar Arnfjörð Bjarmason Fri, 9 Nov 2018 10:18:02 +0000 (10:18 +0000)

range-diff: fix regression in passing along diff options

In 73a834e9e2 ("range-diff: relieve callers of low-level configuration
burden", 2018-07-22) we broke passing down options like --no-patch,
--stat etc.

Fix that regression, and add a test asserting the pre-73a834e9e2
behavior for some of these diff options.

As noted in a change leading up to this ("range-diff doc: add a
section about output stability", 2018-11-07) the output is not meant
to be stable. So this regression test will likely need to be tweaked
once we get a "proper" --stat option.

See
https://public-inbox.org/git/nycvar.QRO.7.76.6.1811071202480.39@tvgsbejvaqbjf.bet/
for a further explanation of the regression. The fix here is not the
same as in Johannes's on-list patch, for reasons that'll be explained
in a follow-up commit.

The quoting of "EOF" here mirrors that of an earlier test. Perhaps
that should be fixed, but let's leave that up to a later cleanup
change.

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

range-diff doc: add a section about output stabilityÆvar Arnfjörð Bjarmason Fri, 9 Nov 2018 10:18:01 +0000 (10:18 +0000)

range-diff doc: add a section about output stability

The range-diff command is already advertised as porcelain, but let's
make it really clear that the output is completely subject to change,
particularly when it comes to diff options such as --stat. Right now
that option doesn't work, but fixing that is the subject of a later
change.

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

Makefile: ease dynamic-gettext-poison transitionJunio C Hamano Thu, 8 Nov 2018 21:15:30 +0000 (21:15 +0000)

Makefile: ease dynamic-gettext-poison transition

Earlier we made the entire build to fail when GETTEXT_POISON=Yes is
given to make, to notify those who did not notice that text poisoning
is now a runtime behaviour.

It turns out that this is too irritating for those who need to build
and test different versions of Git that cross the boundary between
history with and without this topic to switch between two
environment variables. Demote the error to a warning, so that you
can say something like

make GETTEXT_POISON=Yes GIT_TEST_GETTEXT_POISON=Yes test

during the transition period, without having to worry about whether
exact version you are testing has or does not have this topic.

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

i18n: make GETTEXT_POISON a runtime optionÆvar Arnfjörð Bjarmason Thu, 8 Nov 2018 21:15:29 +0000 (21:15 +0000)

i18n: make GETTEXT_POISON a runtime option

Change the GETTEXT_POISON compile-time + runtime GIT_GETTEXT_POISON
test parameter to only be a GIT_TEST_GETTEXT_POISON=<non-empty?>
runtime parameter, to be consistent with other parameters documented
in "Running tests with special setups" in t/README.

When I added GETTEXT_POISON in bb946bba76 ("i18n: add GETTEXT_POISON
to simulate unfriendly translator", 2011-02-22) I was concerned with
ensuring that the _() function would get constant folded if NO_GETTEXT
was defined, and likewise that GETTEXT_POISON would be compiled out
unless it was defined.

But as the benchmark in my [1] shows doing a one-off runtime
getenv("GIT_TEST_[...]") is trivial, and since GETTEXT_POISON was
originally added the GIT_TEST_* env variables have become the common
idiom for turning on special test setups.

So change GETTEXT_POISON to work the same way. Now the
GETTEXT_POISON=YesPlease compile-time option is gone, and running the
tests with GIT_TEST_GETTEXT_POISON=[YesPlease|] can be toggled on/off
without recompiling.

This allows for conditionally amending tests to test with/without
poison, similar to what 859fdc0c3c ("commit-graph: define
GIT_TEST_COMMIT_GRAPH", 2018-08-29) did for GIT_TEST_COMMIT_GRAPH. Do
some of that, now we e.g. always run the t0205-gettext-poison.sh test.

I did enough there to remove the GETTEXT_POISON prerequisite, but its
inverse C_LOCALE_OUTPUT is still around, and surely some tests using
it can be converted to e.g. always set GIT_TEST_GETTEXT_POISON=.

Notes on the implementation:

* We still compile a dedicated GETTEXT_POISON build in Travis
CI. Perhaps this should be revisited and integrated into the
"linux-gcc" build, see ae59a4e44f ("travis: run tests with
GIT_TEST_SPLIT_INDEX", 2018-01-07) for prior art in that area. Then
again maybe not, see [2].

* We now skip a test in t0000-basic.sh under
GIT_TEST_GETTEXT_POISON=YesPlease that wasn't skipped before. This
test relies on C locale output, but due to an edge case in how the
previous implementation of GETTEXT_POISON worked (reading it from
GIT-BUILD-OPTIONS) wasn't enabling poison correctly. Now it does,
and needs to be skipped.

* The getenv() function is not reentrant, so out of paranoia about
code of the form:

printf(_("%s"), getenv("some-env"));

call use_gettext_poison() in our early setup in git_setup_gettext()
so we populate the "poison_requested" variable in a codepath that's
won't suffer from that race condition.

* We error out in the Makefile if you're still saying
GETTEXT_POISON=YesPlease to prompt users to change their
invocation.

* We should not print out poisoned messages during the test
initialization itself to keep it more readable, so the test library
hides the variable if set in $GIT_TEST_GETTEXT_POISON_ORIG during
setup. See [3].

See also [4] for more on the motivation behind this patch, and the
history of the GETTEXT_POISON facility.

1. https://public-inbox.org/git/871s8gd32p.fsf@evledraar.gmail.com/
2. https://public-inbox.org/git/20181102163725.GY30222@szeder.dev/
3. https://public-inbox.org/git/20181022202241.18629-2-szeder.dev@gmail.com/
4. https://public-inbox.org/git/878t2pd6yu.fsf@evledraar.gmail.com/

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

built-in rebase --autostash: leave the current branch... Johannes Schindelin Wed, 7 Nov 2018 14:00:50 +0000 (06:00 -0800)

built-in rebase --autostash: leave the current branch alone if possible

When we converted a `git reset --hard` call in the original Unix shell
script to built-in code, we asked to reset the worktree and the index
and explicitly *not* to detach the HEAD. By mistake, though, we still
did. Let's fix this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

built-in rebase: demonstrate regression with --autostashJohannes Schindelin Wed, 7 Nov 2018 14:00:48 +0000 (06:00 -0800)

built-in rebase: demonstrate regression with --autostash

An unnamed colleague of Ævar Arnfjörð Bjarmason reported a breakage
where a `pull --rebase` (which did not really need to do anything but
stash, see that nothing was changed, and apply the stash again) also
detached the HEAD.

This patch adds a minimal reproducer for this regression.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: force-recompile git.res for differing architec... Johannes Schindelin Tue, 6 Nov 2018 14:55:50 +0000 (06:55 -0800)

Windows: force-recompile git.res for differing architectures

When git.rc is compiled into git.res, the result is actually dependent
on the architecture. That is, you cannot simply link a 32-bit git.res
into a 64-bit git.exe.

Therefore, to allow 32-bit and 64-bit builds in the same directory, we
let git.res depend on GIT-PREFIX so that it gets recompiled when
compiling for a different architecture (this works because the exec path
changes based on the architecture: /mingw32/libexec/git-core for 32-bit
and /mingw64/libexec/git-core for 64-bit).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>