gitweb.git
Merge branch 'ab/drop-scripted-rebase'Junio C Hamano Tue, 16 Apr 2019 10:28:09 +0000 (19:28 +0900)

Merge branch 'ab/drop-scripted-rebase'

Retire scripted "git rebase" implementation.

* ab/drop-scripted-rebase:
rebase: remove the rebase.useBuiltin setting

Merge branch 'jk/perf-lib-tee'Junio C Hamano Tue, 16 Apr 2019 10:28:08 +0000 (19:28 +0900)

Merge branch 'jk/perf-lib-tee'

Code cleanup in the test framework.

* jk/perf-lib-tee:
perf-lib.sh: rely on test-lib.sh for --tee handling

Merge branch 'ab/doc-misc-typofixes'Junio C Hamano Tue, 16 Apr 2019 10:28:08 +0000 (19:28 +0900)

Merge branch 'ab/doc-misc-typofixes'

Typofixes.

* ab/doc-misc-typofixes:
doc: fix typos in man pages

Merge branch 'mh/pack-protocol-doc-fix'Junio C Hamano Tue, 16 Apr 2019 10:28:08 +0000 (19:28 +0900)

Merge branch 'mh/pack-protocol-doc-fix'

Docfix.

* mh/pack-protocol-doc-fix:
fix pack protocol example client/server communication

Merge branch 'tg/glossary-overlay'Junio C Hamano Tue, 16 Apr 2019 10:28:07 +0000 (19:28 +0900)

Merge branch 'tg/glossary-overlay'

Doc update.

* tg/glossary-overlay:
glossary: add definition for overlay

Merge branch 'nd/checkout-f-while-conflicted-fix'Junio C Hamano Tue, 16 Apr 2019 10:28:07 +0000 (19:28 +0900)

Merge branch 'nd/checkout-f-while-conflicted-fix'

"git checkout -f <branch>" while the index has an unmerged path
incorrectly left some paths in an unmerged state, which has been
corrected.

* nd/checkout-f-while-conflicted-fix:
unpack-trees: fix oneway_merge accidentally carry over stage index

Merge branch 'pw/rerere-autoupdate'Junio C Hamano Tue, 16 Apr 2019 10:28:07 +0000 (19:28 +0900)

Merge branch 'pw/rerere-autoupdate'

Doc updates.

* pw/rerere-autoupdate:
merge: tweak --rerere-autoupdate documentation
am/cherry-pick/rebase/revert: document --rerere-autoupdate

Merge branch 'jc/format-patch-error-check'Junio C Hamano Tue, 16 Apr 2019 10:28:06 +0000 (19:28 +0900)

Merge branch 'jc/format-patch-error-check'

"git format-patch" used overwrite an existing patch/cover-letter
file. A new "--no-clobber" option stops it.

* jc/format-patch-error-check:
format-patch: notice failure to open cover letter for writing
builtin/log: downcase the beginning of error messages

Merge branch 'js/get-short-oid-drop-cache'Junio C Hamano Tue, 16 Apr 2019 10:28:06 +0000 (19:28 +0900)

Merge branch 'js/get-short-oid-drop-cache'

A corner-case object name ambiguity while the sequencer machinery
is working (e.g. "rebase -i -x") has been (half) fixed.

* js/get-short-oid-drop-cache:
get_oid(): when an object was not found, try harder
sequencer: move stale comment into correct location
sequencer: improve error message when an OID could not be parsed
rebase -i: demonstrate obscure loose object cache bug

Merge branch 'dl/subtree-limit-to-one-rev'Junio C Hamano Tue, 16 Apr 2019 10:28:06 +0000 (19:28 +0900)

Merge branch 'dl/subtree-limit-to-one-rev'

"git subtree" (in contrib/) update.

* dl/subtree-limit-to-one-rev:
contrib/subtree: ensure only one rev is provided

Merge branch 'js/init-db-update-for-mingw'Junio C Hamano Tue, 16 Apr 2019 10:28:05 +0000 (19:28 +0900)

Merge branch 'js/init-db-update-for-mingw'

"git init" forgot to read platform-specific repository
configuration, which made Windows port to ignore settings of
core.hidedotfiles, for example.

* js/init-db-update-for-mingw:
mingw: respect core.hidedotfiles = false in git-init again

Merge branch 'js/remote-curl-i18n'Junio C Hamano Tue, 16 Apr 2019 10:28:05 +0000 (19:28 +0900)

Merge branch 'js/remote-curl-i18n'

Error messages given from the http transport have been updated so
that they can be localized.

* js/remote-curl-i18n:
remote-curl: mark all error messages for translation

Merge branch 'js/anonymize-remote-curl-diag'Junio C Hamano Tue, 16 Apr 2019 10:28:04 +0000 (19:28 +0900)

Merge branch 'js/anonymize-remote-curl-diag'

remote-http transport did not anonymize URLs reported in its error
messages at places.

* js/anonymize-remote-curl-diag:
curl: anonymize URLs in error messages and warnings

Merge branch 'ma/asciidoctor-fixes-more'Junio C Hamano Tue, 16 Apr 2019 10:28:04 +0000 (19:28 +0900)

Merge branch 'ma/asciidoctor-fixes-more'

Documentation mark-up fixes.

* ma/asciidoctor-fixes-more:
Documentation: turn middle-of-line tabs into spaces
git-svn.txt: drop escaping '\' that ends up being rendered
git.txt: remove empty line before list continuation
config/fsck.txt: avoid starting line with dash
config/diff.txt: drop spurious backtick

Merge branch 'ma/asciidoctor-fixes'Junio C Hamano Tue, 16 Apr 2019 10:28:03 +0000 (19:28 +0900)

Merge branch 'ma/asciidoctor-fixes'

Build fix around use of asciidoctor instead of asciidoc

* ma/asciidoctor-fixes:
asciidoctor-extensions: fix spurious space after linkgit
Documentation/Makefile: add missing dependency on asciidoctor-extensions
Documentation/Makefile: add missing xsl dependencies for manpages

Merge branch 'jt/test-protocol-version'Junio C Hamano Tue, 16 Apr 2019 10:28:03 +0000 (19:28 +0900)

Merge branch 'jt/test-protocol-version'

Help developers by making it easier to run most of the tests under
different versions of over-the-wire protocols.

* jt/test-protocol-version:
t5552: compensate for v2 filtering ref adv.
tests: fix protocol version for overspecifications
t5700: only run with protocol version 1
t5512: compensate for v0 only sending HEAD symrefs
t5503: fix overspecification of trace expectation
tests: always test fetch of unreachable with v0
t5601: check ssh command only with protocol v0
tests: define GIT_TEST_PROTOCOL_VERSION

Merge branch 'nd/diff-parseopt-3'Junio C Hamano Tue, 16 Apr 2019 10:28:03 +0000 (19:28 +0900)

Merge branch 'nd/diff-parseopt-3'

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

* nd/diff-parseopt-3:
diff-parseopt: convert --submodule
diff-parseopt: convert --ignore-submodules
diff-parseopt: convert --textconv
diff-parseopt: convert --ext-diff
diff-parseopt: convert --quiet
diff-parseopt: convert --exit-code
diff-parseopt: convert --color-words
diff-parseopt: convert --word-diff-regex
diff-parseopt: convert --word-diff
diff-parseopt: convert --[no-]color
diff-parseopt: convert --[no-]follow
diff-parseopt: convert -R
diff-parseopt: convert -a|--text
diff-parseopt: convert --full-index
diff-parseopt: convert --binary
diff-parseopt: convert --anchored
diff-parseopt: convert --diff-algorithm
diff-parseopt: convert --histogram
diff-parseopt: convert --patience
diff-parseopt: convert --[no-]indent-heuristic

The fourth batchJunio C Hamano Tue, 9 Apr 2019 17:19:09 +0000 (02:19 +0900)

The fourth batch

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

Merge branch 'jt/submodule-fetch-errmsg'Junio C Hamano Tue, 9 Apr 2019 17:14:26 +0000 (02:14 +0900)

Merge branch 'jt/submodule-fetch-errmsg'

Error message update.

* jt/submodule-fetch-errmsg:
submodule: explain first attempt failure clearly

Merge branch 'jk/sha1dc'Junio C Hamano Tue, 9 Apr 2019 17:14:26 +0000 (02:14 +0900)

Merge branch 'jk/sha1dc'

Build update for SHA-1 with collision detection.

* jk/sha1dc:
Makefile: fix unaligned loads in sha1dc with UBSan

Merge branch 'jk/promote-ggg'Junio C Hamano Tue, 9 Apr 2019 17:14:25 +0000 (02:14 +0900)

Merge branch 'jk/promote-ggg'

Suggest GitGitGadget instead of submitGit as a way to submit
patches based on GitHub PR to us.

* jk/promote-ggg:
point pull requesters to GitGitGadget

Merge branch 'ar/t4150-remove-cruft'Junio C Hamano Tue, 9 Apr 2019 17:14:25 +0000 (02:14 +0900)

Merge branch 'ar/t4150-remove-cruft'

Test cleanup.

* ar/t4150-remove-cruft:
t4150: remove unused variable

Merge branch 'js/rebase-deprecate-preserve-merges'Junio C Hamano Tue, 9 Apr 2019 17:14:24 +0000 (02:14 +0900)

Merge branch 'js/rebase-deprecate-preserve-merges'

"git rebase --rebase-merges" replaces its old "--preserve-merges"
option; the latter is now marked as deprecated.

* js/rebase-deprecate-preserve-merges:
rebase: deprecate --preserve-merges

Merge branch 'ms/worktree-add-atomic-mkdir'Junio C Hamano Tue, 9 Apr 2019 17:14:24 +0000 (02:14 +0900)

Merge branch 'ms/worktree-add-atomic-mkdir'

"git worktree add" used to do a "find an available name with stat
and then mkdir", which is race-prone. This has been fixed by using
mkdir and reacting to EEXIST in a loop.

* ms/worktree-add-atomic-mkdir:
worktree: fix worktree add race

Merge branch 'jk/line-log-with-patch'Junio C Hamano Tue, 9 Apr 2019 17:14:23 +0000 (02:14 +0900)

Merge branch 'jk/line-log-with-patch'

"git log -L<from>,<to>:<path>" with "-s" did not suppress the patch
output as it should. This has been corrected.

* jk/line-log-with-patch:
line-log: detect unsupported formats
line-log: suppress diff output with "-s"

Merge branch 'ra/t3600-test-path-funcs'Junio C Hamano Tue, 9 Apr 2019 17:14:23 +0000 (02:14 +0900)

Merge branch 'ra/t3600-test-path-funcs'

A GSoC micro.

* ra/t3600-test-path-funcs:
t3600: use helpers to replace test -d/f/e/s <path>
t3600: modernize style
test functions: add function `test_file_not_empty`

Merge branch 'nd/rewritten-ref-is-per-worktree'Junio C Hamano Tue, 9 Apr 2019 17:14:23 +0000 (02:14 +0900)

Merge branch 'nd/rewritten-ref-is-per-worktree'

"git rebase" uses the refs/rewritten/ hierarchy to store its
intermediate states, which inherently makes the hierarchy per
worktree, but it didn't quite work well.

* nd/rewritten-ref-is-per-worktree:
Make sure refs/rewritten/ is per-worktree
files-backend.c: reduce duplication in add_per_worktree_entries_to_dir()
files-backend.c: factor out per-worktree code in loose_fill_ref_dir()

Merge branch 'jh/resize-convert-scratch-buffer'Junio C Hamano Tue, 9 Apr 2019 17:14:22 +0000 (02:14 +0900)

Merge branch 'jh/resize-convert-scratch-buffer'

When the "clean" filter can reduce the size of a huge file in the
working tree down to a small "token" (a la Git LFS), there is no
point in allocating a huge scratch area upfront, but the buffer is
sized based on the original file size. The convert mechanism now
allocates very minimum and reallocates as it receives the output
from the clean filter process.

* jh/resize-convert-scratch-buffer:
convert: avoid malloc of original file size

Merge branch 'dl/ignore-docs'Junio C Hamano Tue, 9 Apr 2019 17:14:22 +0000 (02:14 +0900)

Merge branch 'dl/ignore-docs'

Doc update.

* dl/ignore-docs:
docs: move core.excludesFile from git-add to gitignore
git-clean.txt: clarify ignore pattern files

Merge branch 'ja/dir-rename-doc-markup-fix'Junio C Hamano Tue, 9 Apr 2019 17:14:21 +0000 (02:14 +0900)

Merge branch 'ja/dir-rename-doc-markup-fix'

Doc update.

* ja/dir-rename-doc-markup-fix:
Doc: fix misleading asciidoc formating

Merge branch 'dl/reset-doc-no-wrt-abbrev'Junio C Hamano Tue, 9 Apr 2019 17:14:20 +0000 (02:14 +0900)

Merge branch 'dl/reset-doc-no-wrt-abbrev'

Doc update.

* dl/reset-doc-no-wrt-abbrev:
git-reset.txt: clarify documentation

unpack-trees: fix oneway_merge accidentally carry over... Nguyễn Thái Ngọc Duy Mon, 18 Mar 2019 11:38:22 +0000 (18:38 +0700)

unpack-trees: fix oneway_merge accidentally carry over stage index

Phillip found out that 'git checkout -f <branch>' does not restore
conflict/unmerged files correctly. All tracked files should be taken
from <branch> and all non-zero stages removed. Most of this is true,
except that the final file could be in stage one instead of zero.

"checkout -f" (among other commands) does this with one-way merge, which
is supposed to take stat info from the index and everything else from
the given tree. The add_entry(.., old, ...) call in oneway_merge()
though will keep stage index from the index.

This is normally not a problem if the entry from the index is
normal (stage #0). But if there is a conflict, stage #0 does not exist
and we'll get stage #1 entry as "old" variable, which gets recorded in
the final index. Fix it by clearing stage mask.

This bug probably comes from b5b425074e (git-read-tree: make one-way
merge also honor the "update" flag, 2005-06-07). Before this commit, we
may create the final ("dst") index entry from the one in index, but we
do clear CE_STAGEMASK.

I briefly checked two- and three-way merge functions. I think we don't
have the same problem in those.

Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

The third batchJunio C Hamano Wed, 20 Mar 2019 06:19:48 +0000 (15:19 +0900)

The third batch

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

Merge branch 'br/commit-tree-parseopt'Junio C Hamano Wed, 20 Mar 2019 06:16:08 +0000 (15:16 +0900)

Merge branch 'br/commit-tree-parseopt'

The command line parser of "git commit-tree" has been rewritten to
use the parse-options API.

* br/commit-tree-parseopt:
commit-tree: utilize parse-options api

Merge branch 'jk/config-type-color-ends-with-lf'Junio C Hamano Wed, 20 Mar 2019 06:16:07 +0000 (15:16 +0900)

Merge branch 'jk/config-type-color-ends-with-lf'

"git config --type=color ..." is meant to replace "git config --get-color"
but there is a slight difference that wasn't documented, which is
now fixed.

* jk/config-type-color-ends-with-lf:
config: document --type=color output is a complete line

Merge branch 'ma/clear-repository-format'Junio C Hamano Wed, 20 Mar 2019 06:16:07 +0000 (15:16 +0900)

Merge branch 'ma/clear-repository-format'

The setup code has been cleaned up to avoid leaks around the
repository_format structure.

* ma/clear-repository-format:
setup: fix memory leaks with `struct repository_format`
setup: free old value before setting `work_tree`

Merge branch 'jk/virtual-objects-do-exist'Junio C Hamano Wed, 20 Mar 2019 06:16:07 +0000 (15:16 +0900)

Merge branch 'jk/virtual-objects-do-exist'

A recent update broke "is this object available to us?" check for
well-known objects like an empty tree (which should yield "yes",
even when there is no on-disk object for an empty tree), which has
been corrected.

* jk/virtual-objects-do-exist:
rev-list: allow cached objects in existence check

Merge branch 'jk/no-sigpipe-during-network-transport'Junio C Hamano Wed, 20 Mar 2019 06:16:06 +0000 (15:16 +0900)

Merge branch 'jk/no-sigpipe-during-network-transport'

On platforms where "git fetch" is killed with SIGPIPE (e.g. OSX),
the upload-pack that runs on the other end that hangs up after
detecting an error could cause "git fetch" to die with a signal,
which led to a flakey test. "git fetch" now ignores SIGPIPE during
the network portion of its operation (this is not a problem as we
check the return status from our write(2)s).

* jk/no-sigpipe-during-network-transport:
fetch: ignore SIGPIPE during network operation
fetch: avoid calling write_or_die()

Merge branch 'jk/fsck-doc'Junio C Hamano Wed, 20 Mar 2019 06:16:05 +0000 (15:16 +0900)

Merge branch 'jk/fsck-doc'

"git fsck --connectivity-only" omits computation necessary to sift
the objects that are not reachable from any of the refs into
unreachable and dangling. This is now enabled when dangling
objects are requested (which is done by default, but can be
overridden with the "--no-dangling" option).

* jk/fsck-doc:
fsck: always compute USED flags for unreachable objects
doc/fsck: clarify --connectivity-only behavior

Merge branch 'js/stress-test-ui-tweak'Junio C Hamano Wed, 20 Mar 2019 06:16:05 +0000 (15:16 +0900)

Merge branch 'js/stress-test-ui-tweak'

Dev support.

* js/stress-test-ui-tweak:
tests: introduce --stress-jobs=<N>
tests: let --stress-limit=<N> imply --stress

Merge branch 'js/rebase-orig-head-fix'Junio C Hamano Wed, 20 Mar 2019 06:16:05 +0000 (15:16 +0900)

Merge branch 'js/rebase-orig-head-fix'

"git rebase" that was reimplemented in C did not set ORIG_HEAD
correctly, which has been corrected.

* js/rebase-orig-head-fix:
built-in rebase: set ORIG_HEAD just once, before the rebase
built-in rebase: demonstrate that ORIG_HEAD is not set correctly
built-in rebase: use the correct reflog when switching branches
built-in rebase: no need to check out `onto` twice

Merge branch 'jk/bisect-final-output'Junio C Hamano Wed, 20 Mar 2019 06:16:04 +0000 (15:16 +0900)

Merge branch 'jk/bisect-final-output'

The final report from "git bisect" used to show the suspected
culprit using a raw "diff-tree", with which there is no output for
a merge commit. This has been updated to use a more modern and
human readable output that still is concise enough.

* jk/bisect-final-output:
bisect: make diff-tree output prettier
bisect: fix internal diff-tree config loading
bisect: use string arguments to feed internal diff-tree

Merge branch 'ab/makefile-help-devs-more'Junio C Hamano Wed, 20 Mar 2019 06:16:04 +0000 (15:16 +0900)

Merge branch 'ab/makefile-help-devs-more'

CFLAGS now can be tweaked when invoking Make while using
DEVELOPER=YesPlease; this did not work well before.

* ab/makefile-help-devs-more:
Makefile: allow for combining DEVELOPER=1 and CFLAGS="..."
Makefile: move the setting of *FLAGS closer to "include"
Makefile: Move *_LIBS assignment into its own section
Makefile: add/remove comments at top and tweak whitespace
Makefile: move "strip" assignment down from flags
Makefile: remove an out-of-date comment

rebase: remove the rebase.useBuiltin settingÆvar Arnfjörð Bjarmason Mon, 18 Mar 2019 11:01:52 +0000 (12:01 +0100)

rebase: remove the rebase.useBuiltin setting

Remove the rebase.useBuiltin setting, which was added as an escape
hatch to disable the builtin version of rebase first released with Git
2.20.

See [1] for the initial implementation of rebase.useBuiltin, and [2]
and [3] for the documentation and corresponding
GIT_TEST_REBASE_USE_BUILTIN option.

Carrying the legacy version is a maintenance burden as seen in
7e097e27d3 ("legacy-rebase: backport -C<n> and --whitespace=<option>
checks", 2018-11-20) and 9aea5e9286 ("rebase: fix regression in
rebase.useBuiltin=false test mode", 2019-02-13). Since the built-in
version has been shown to be stable enough let's remove the legacy
version.

As noted in [3] having use_builtin_rebase() shell out to get its
config doesn't make any sense anymore, that was done for the purposes
of spawning the legacy rebase without having modified any global
state. Let's instead handle this case in rebase_config().

There's still a bunch of references to git-legacy-rebase in po/*.po,
but those will be dealt with in time by the i18n effort.

Even though this configuration variable only existed two releases
let's not entirely delete the entry from the docs, but note its
absence. Individual versions of git tend to be around for a while due
to distro packaging timelines, so e.g. if we're "lucky" a given
version like 2.21 might be installed on say OSX for half a decade.

That'll mean some people probably setting this in config, and then
when they later wonder if it's needed they can Google search the
config option name or check it in git-config. It also allows us to
refer to the docs from the warning for details.

1. 55071ea248 ("rebase: start implementing it as a builtin",
2018-08-07)
2. d8d0a546f0 ("rebase doc: document rebase.useBuiltin", 2018-11-14)
3. 62c23938fa ("tests: add a special setup where rebase.useBuiltin is
off", 2018-11-14)
3. https://public-inbox.org/git/nycvar.QRO.7.76.6.1903141544110.41@tvgsbejvaqbjf.bet/

Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perf-lib.sh: rely on test-lib.sh for --tee handlingJeff King Fri, 15 Mar 2019 06:14:17 +0000 (02:14 -0400)

perf-lib.sh: rely on test-lib.sh for --tee handling

Since its inception, the perf-lib.sh script has manually handled the
"--tee" option (and other options which imply it, like "--valgrind")
with a cut-and-pasted block from test-lib.sh. That block has grown stale
over the years, and has at least three problems:

1. It uses $SHELL to re-exec the script, whereas the version in
test-lib.sh learned to use $TEST_SHELL_PATH.

2. It does an ad-hoc search of the "$*" string, whereas test-lib.sh
learned to carefully parse the arguments left to right.

3. It never learned about --verbose-log (which also implies --tee),
so it would not trigger for that option.

This last one was especially annoying, because t/perf/run uses the
GIT_TEST_OPTS from your config.mak to run the perf scripts. So if you've
set, say, "-x --verbose-log" there, it will be passed as part of most
perf runs. And while this script doesn't recognize the option, the
test-lib.sh that we source _does_, and the behavior ends up being much
more annoying:

- as the comment at the top of the block says, we have to run this
tee code early, before we start munging variables (it says
GIT_BUILD_DIR, but the problematic variable is actually
GIT_TEST_INSTALLED).

- since we don't recognize --verbose-log, we don't trigger the block.
We go on to munge GIT_TEST_INSTALLED, converting it from a relative
to an absolute path.

- then we source test-lib.sh, which _does_ recognize --verbose-log. It
re-execs the script, which runs again. But this time with an
absolute version of GIT_TEST_INSTALLED.

- As a result, we copy the absolute version of GIT_TEST_INSTALLED into
perf_results_prefix. Instead of writing our results to the expected
"test-results/build_1234abcd.p1234-whatever.times", we instead write
them to "test-results/_full_path_to_repo_t_perf_build_1234...".

The aggregate.perl script doesn't expect this, and so it prints
"<missing>" for each result (even though it spent considerable time
running the tests!).

We can solve all of these in one blow by just deleting our custom
handling, and relying on the inclusion of test-lib.sh to handle --tee,
--verbose-log, etc.

There's one catch, though. We want to handle GIT_TEST_INSTALLED after
we've included test-lib.sh, since we want it un-munged in the re-exec'd
version of the script. But if we want to convert it from a relative
to an absolute path, we must do so before we load test-lib.sh, since it
will change our working directory. So we compute the absolute directory
first, store it away, then include test-lib.sh, and finally assign to
GIT_TEST_INSTALLED as appropriate.

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

doc: fix typos in man pagesAlexander Blesius Sat, 16 Mar 2019 10:34:39 +0000 (11:34 +0100)

doc: fix typos in man pages

Signed-off-by: Alexander Blesius <alexander+git@blesius.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix pack protocol example client/server communicationMike Hommey Sat, 16 Mar 2019 08:57:07 +0000 (17:57 +0900)

fix pack protocol example client/server communication

The pkt-line formatted lines contained the wrong pkt-len.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: add definition for overlayThomas Gummerer Sun, 17 Mar 2019 20:19:56 +0000 (20:19 +0000)

glossary: add definition for overlay

Add a definition for what overlay means in the context of git, to
clarify the recently introduced overlay-mode in git checkout.

Helped-by: Elijah Newren <newren@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://ozlabs.org/~paulus/gitkJunio C Hamano Mon, 18 Mar 2019 02:18:49 +0000 (11:18 +0900)

Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
gitk: Update Bulgarian translation (317t)

merge: tweak --rerere-autoupdate documentationPhillip Wood Thu, 14 Mar 2019 19:12:33 +0000 (19:12 +0000)

merge: tweak --rerere-autoupdate documentation

Spell out --no-rerere-autoupdate explictly to make searching
easier. This matches the other --no options in the man page.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

am/cherry-pick/rebase/revert: document --rerere-autoupdatePhillip Wood Thu, 14 Mar 2019 19:12:32 +0000 (19:12 +0000)

am/cherry-pick/rebase/revert: document --rerere-autoupdate

This option was missing from the man pages of these commands.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Update Bulgarian translation (317t)Alexander Shopov Wed, 13 Mar 2019 12:06:33 +0000 (13:06 +0100)

gitk: Update Bulgarian translation (317t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

get_oid(): when an object was not found, try harderJohannes Schindelin Wed, 13 Mar 2019 10:16:34 +0000 (03:16 -0700)

get_oid(): when an object was not found, try harder

It is quite possible that the loose object cache gets stale when new
objects are written. In that case, get_oid() would potentially say that
it cannot find a given object, even if it should find it.

Let's blow away the loose object cache as well as the read packs and try
again in that case.

Note: this does *not* affect the code path that was introduced to help
avoid looking for the same non-existing objects (which made some
operations really expensive via NFS): that code path is handled by the
`OBJECT_INFO_QUICK` flag (which does not even apply to `get_oid()`,
which has no equivalent flag, at least at the time this patch was
written).

This incidentally fixes the problem identified earlier where an
interactive rebase wanted to re-read (and validate) the todo list after
an `exec` command modified it.

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

sequencer: move stale comment into correct locationJohannes Schindelin Wed, 13 Mar 2019 10:16:33 +0000 (03:16 -0700)

sequencer: move stale comment into correct location

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

sequencer: improve error message when an OID could... Johannes Schindelin Wed, 13 Mar 2019 10:16:32 +0000 (03:16 -0700)

sequencer: improve error message when an OID could not be parsed

The interactive rebase simply complains about an "invalid line" when the
object hash of, say, a `pick` line could not be parsed.

Let's tell the user what happened in a little more detail.

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

rebase -i: demonstrate obscure loose object cache bugJohannes Schindelin Wed, 13 Mar 2019 10:16:31 +0000 (03:16 -0700)

rebase -i: demonstrate obscure loose object cache bug

We specifically support `exec` commands in `git rebase -i`'s todo lists
to rewrite the very same todo list. Of course, we need to validate that
todo list when re-reading it.

It is also totally legitimate to extend the todo list by `pick` lines
using short names of commits that were created only after the rebase
started.

And this is where the loose object cache interferes with this feature:
if *some* loose object was read whose hash shares the same first two
digits with a commit that was not yet created when that loose object was
created, then we fail to find that new commit by its short name in
`get_oid()`, and the interactive rebase fails with an obscure error
message like:

error: invalid line 1: pick 6568fef
error: please fix this using 'git rebase --edit-todo'.

Let's first demonstrate that this is actually a bug in a new regression
test, in a separate commit so that other developers who do not believe
me can cherry-pick it to confirm the problem.

This new regression test generates two commits whose hashes share the
first two hex digits (so that their corresponding loose objects live in
the same subdirectory of .git/objects/, and are therefore supposed to be
in the same loose object cache bin).

It then picks the first, to make sure that the loose object cache is
initialized and cached that object directory, then generates the second
commit and picks it, too. Since the commit was generated in a different
process than the sequencer that wants to pick it, the loose object cache
had no chance of being updated in the meantime.

Technically, we would need only one `exec` command in this regression
test case, but for ease of implementation, it uses a pseudo-recursive
call to the same script.

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

submodule: explain first attempt failure clearlyJonathan Tan Wed, 13 Mar 2019 17:57:38 +0000 (10:57 -0700)

submodule: explain first attempt failure clearly

When cloning with --recurse-submodules a superproject with at least one
submodule with HEAD pointing to an unborn branch, the clone goes
something like this:

Cloning into 'test'...
<messages about cloning of superproject>
Submodule '<name>' (<uri>) registered for path '<submodule path>'
Cloning into '<submodule path>'...
fatal: Couldn't find remote ref HEAD
Unable to fetch in submodule path '<submodule path>'
<messages about fetching with SHA-1>
From <uri>
* branch <hash> -> FETCH_HEAD
Submodule path '<submodule path>': checked out '<hash>'

In other words, first, a fetch is done with no hash arguments (that is,
a fetch of HEAD) resulting in a "Couldn't find remote ref HEAD" error;
then, a fetch is done given a hash, which succeeds.

The fetch given a hash was added in fb43e31f2b ("submodule: try harder
to fetch needed sha1 by direct fetching sha1", 2016-02-24), and the
"Unable to fetch..." message was downgraded from a fatal error to a
notice in e30d833671 ("git-submodule.sh: try harder to fetch a
submodule", 2018-05-16).

This commit improves the notice to be clearer that we are retrying the
fetch, and that the previous messages (in particular, the fatal errors
from fetch) do not necessarily indicate that the whole command fails. In
other words:

- If the HEAD-fetch succeeds and we then have the commit we want,
git-submodule prints no explanation.
- If the HEAD-fetch succeeds and we do not have the commit we want, but
the hash-fetch succeeds, git-submodule prints no explanation.
- If the HEAD-fetch succeeds and we do not have the commit we want, but
the hash-fetch fails, git-submodule prints a fatal error.
- If the HEAD-fetch fails, fetch prints a fatal error, and
git-submodule informs the user that it will retry by fetching
specific commits by hash.
- If the hash-fetch then succeeds, git-submodule prints no
explanation (besides the ones already printed).
- If the HEAD-fetch then fails, git-submodule prints a fatal error.

It could be said that we should just eliminate the HEAD-fetch
altogether, but that changes some behavior (in particular, some refs
that were opportunistically updated would no longer be), so I have left
that alone for now.

There is an analogous situation with the fetching code in fetch_finish()
and surrounding functions. For now, I have added a NEEDSWORK.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: fix unaligned loads in sha1dc with UBSanJeff King Tue, 12 Mar 2019 21:06:26 +0000 (17:06 -0400)

Makefile: fix unaligned loads in sha1dc with UBSan

The sha1dc library uses unaligned loads on platforms that support them.
This is normally what you'd want for performance, but it does cause
UBSan to complain when we compile with SANITIZE=undefined. Just like we
set -DNO_UNALIGNED_LOADS for our own code in that case, we should set
-DSHA1DC_FORCE_ALIGNED_ACCESS.

Of course that does nothing without pulling in the patches from sha1dc
to respect that define. So let's do that, too, updating both the
submodule link and our in-tree copy (from the same commit).

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

t4150: remove unused variableAndrei Rybak Tue, 12 Mar 2019 14:38:04 +0000 (15:38 +0100)

t4150: remove unused variable

In commit 735285b403 ("am: fix signoff when other trailers are present",
2017-08-08) tests using variable $signoff were rewritten and it is no
longer used, so just remove it from the test setup.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

point pull requesters to GitGitGadgetJeff King Tue, 12 Mar 2019 21:32:46 +0000 (17:32 -0400)

point pull requesters to GitGitGadget

In the contributing guide and PR template seen by people who open pull
requests on GitHub, we mention the submitGit tool, which gives an
alternative to figuring out the mailing list. These days we also have
the similar GitGitGadget tool, and we should make it clear that this
is also an option.

We could continue to mention _both_ tools, but it's probably better to
pick one in order to avoid overwhelming the user with choice. After all,
one of the purposes here is to reduce friction for first-time or
infrequent contributors. And there are a few reasons to prefer GGG:

1. submitGit seems to still have a few rough edges. E.g., it doesn't
munge timestamps to help threaded mail readers handled out-of-order
delivery.

2. Subjectively, GGG seems to be more commonly used on the list these
days, especially by list regulars.

3. GGG seems to be under more active development (likely related to
point 2).

So let's actually swap out submitGit for GGG. While we're there, let's
put another link to the GGG page in the PR template, because that's
where users who are learning about it for the first time will want to go
to read more.

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

contrib/subtree: ensure only one rev is providedDenton Liu Mon, 11 Mar 2019 09:47:17 +0000 (02:47 -0700)

contrib/subtree: ensure only one rev is provided

While looking at the inline help for git-subtree.sh, I noticed that

git subtree split --prefix=<prefix> <commit...>

was given as an option. However, it only really makes sense to provide
one revision because of the way the commits are forwarded to rev-parse
so change "<commit...>" to "<commit>" to reflect this. In addition,
check the arguments to ensure that only one rev is provided for all
subcommands that accept a commit.

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

mingw: respect core.hidedotfiles = false in git-init... Johannes Schindelin Mon, 11 Mar 2019 20:10:58 +0000 (13:10 -0700)

mingw: respect core.hidedotfiles = false in git-init again

This is a brown paper bag. When adding the tests, we actually failed
to verify that the config variable is heeded in git-init at all. And
when changing the original patch that marked the .git/ directory as
hidden after reading the config, it was lost on this developer that
the new code would use the hide_dotfiles variable before the config
was read.

The fix is obvious: read the (limited, pre-init) config *before*
creating the .git/ directory.

Please note that we cannot remove the identical-looking `git_config()`
call from `create_default_files()`: we create the `.git/` directory
between those calls. If we removed it, and if the parent directory is
in a Git worktree, and if that worktree's `.git/config` contained any
`init.templatedir` setting, we would all of a sudden pick that up.

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

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

rebase: deprecate --preserve-mergesJohannes Schindelin Mon, 11 Mar 2019 19:57:35 +0000 (12:57 -0700)

rebase: deprecate --preserve-merges

We have something much better now: --rebase-merges (which is a
complete re-design --preserve-merges, with a lot of issues fixed such as
the inability to reorder commits with --preserve-merges).

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

worktree: fix worktree add raceMichal Suchanek Wed, 20 Feb 2019 16:16:48 +0000 (17:16 +0100)

worktree: fix worktree add race

Git runs a stat loop to find a worktree name that's available and
then does mkdir on the found name. Turn it to mkdir loop to avoid
another invocation of worktree add finding the same free name and
creating the directory first.

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

asciidoctor-extensions: fix spurious space after linkgitMartin Ågren Wed, 27 Feb 2019 18:17:54 +0000 (19:17 +0100)

asciidoctor-extensions: fix spurious space after linkgit

When we render, e.g., "linkgit:gitglossary[7]." with Asciidoctor, we get
"gitglossary(7) ." with a space between the linkgit macro expansion and
the punctuation. We can fix this by dropping the trailing newline after
we've turned `linkgit:foo[bar]` into `<citerefentry>..</citerefentry>`.

The diff produced by `USE_ASCIIDOCTOR=Yes ./doc-diff HEAD^ HEAD` is
almost 6000 lines large and shows how this fixes "git-foo(x) ,", "(see
git-bar(y) )" and so on. One might wonder whether this also turns, e.g.,
"see linkgit:foo[1] for more" into "see foo(1)for more", but no. We get
"...</citerefentry> for more" in the XML, see, e.g., git-am.xml, so the
space ends up in git-am.1 just fine. The same is true for the HTML output.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/Makefile: add missing dependency on ascii... Martin Ågren Wed, 27 Feb 2019 18:17:53 +0000 (19:17 +0100)

Documentation/Makefile: add missing dependency on asciidoctor-extensions

asciidoctor-extensions.rb has never changed, but when it does -- such as
in the next commit --, it helps if the xml-files depend on it. We're
casting the net a bit too wide here, since we'll be rebuilding even with
AsciiDoc, which won't look at this file. But since this file changes so
rarely, that should be ok. It's better than missing a dependency.

Similarly, most of the html-files are produced directly from ".txt';
make the html-files too depend on asciidoctor-extensions.rb, both
the HTMLified manual pages as well as the user-manual that does use
.xml intermediary.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

line-log: detect unsupported formatsJeff King Mon, 11 Mar 2019 03:54:33 +0000 (23:54 -0400)

line-log: detect unsupported formats

If you use "log -L" with an output format like "--raw" or "--stat",
we'll silently ignore the format and just output the normal patch.
Let's detect and complain about this, which at least tells the user
what's going on.

The tests here aren't exhaustive over the set of all formats, but it
should at least let us know if somebody breaks the format-checking.

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

The second batchJunio C Hamano Mon, 11 Mar 2019 07:18:22 +0000 (16:18 +0900)

The second batch

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

Sync with maintJunio C Hamano Mon, 11 Mar 2019 07:16:34 +0000 (16:16 +0900)

Sync with maint

* maint:
mingw: allow building with an MSYS2 runtime v3.x

Merge branch 'js/rebase-recreate-merge'Junio C Hamano Mon, 11 Mar 2019 07:16:26 +0000 (16:16 +0900)

Merge branch 'js/rebase-recreate-merge'

Docfix.

* js/rebase-recreate-merge:
rebase docs: fix "gitlink" typo

Merge branch 'js/untravis-windows'Junio C Hamano Mon, 11 Mar 2019 07:16:26 +0000 (16:16 +0900)

Merge branch 'js/untravis-windows'

Dev support.

* js/untravis-windows:
travis: remove the hack to build the Windows job on Azure Pipelines

Merge branch 'rd/gc-prune-doc-fix'Junio C Hamano Mon, 11 Mar 2019 07:16:26 +0000 (16:16 +0900)

Merge branch 'rd/gc-prune-doc-fix'

Doxfix.

* rd/gc-prune-doc-fix:
docs/git-gc: fix typo "--prune=all" to "--prune=now"

Merge branch 'js/find-lib-h-with-ls-files-when-possible'Junio C Hamano Mon, 11 Mar 2019 07:16:25 +0000 (16:16 +0900)

Merge branch 'js/find-lib-h-with-ls-files-when-possible'

The Makefile uses 'find' utility to enumerate all the *.h header
files, which is expensive on platforms with slow filesystems; it
now optionally uses "ls-files" if working within a repository,
which is a trick similar to how all sources are enumerated to run
ETAGS on.

* js/find-lib-h-with-ls-files-when-possible:
Makefile: use `git ls-files` to list header files, if possible

Merge branch 'rj/hdr-check-gcrypt-fix'Junio C Hamano Mon, 11 Mar 2019 07:16:25 +0000 (16:16 +0900)

Merge branch 'rj/hdr-check-gcrypt-fix'

The set of header files used by "make hdr-check" unconditionally
included sha256/gcrypt.h, even when it is not used, causing the
make target to fail. We now skip it when GCRYPT_SHA256 is not in
use.

* rj/hdr-check-gcrypt-fix:
Makefile: fix 'hdr-check' when GCRYPT not installed

Merge branch 'jk/guard-bswap-header'Junio C Hamano Mon, 11 Mar 2019 07:16:25 +0000 (16:16 +0900)

Merge branch 'jk/guard-bswap-header'

The include file compat/bswap.h has been updated so that it is safe
to (accidentally) include it more than once.

* jk/guard-bswap-header:
compat/bswap: add include header guards

Merge branch 'rd/attr.c-comment-typofix'Junio C Hamano Mon, 11 Mar 2019 07:16:24 +0000 (16:16 +0900)

Merge branch 'rd/attr.c-comment-typofix'

In-code comment typofix.

* rd/attr.c-comment-typofix:
attr.c: ".gitattribute" -> ".gitattributes" (comments)

Merge branch 'yb/utf-16le-bom-spellfix'Junio C Hamano Mon, 11 Mar 2019 07:16:24 +0000 (16:16 +0900)

Merge branch 'yb/utf-16le-bom-spellfix'

Doc update.

* yb/utf-16le-bom-spellfix:
gitattributes.txt: fix typo

Documentation/Makefile: add missing xsl dependencies... Martin Ågren Wed, 27 Feb 2019 18:17:52 +0000 (19:17 +0100)

Documentation/Makefile: add missing xsl dependencies for manpages

These stylesheets very rarely change, but when they do, it really helps
if the manpages depend on them. We're casting the net a bit too wide
here, since we'll only ever use a subset of the stylesheets, but since
these files change so rarely, that should be ok. It's better than
missing a dependency.

Observe that manpage-base-url.xsl is a generated file, so we need to
list it explicitly, besides the `wildcard` expression we're adding here.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: allow building with an MSYS2 runtime v3.xJohannes Schindelin Fri, 8 Mar 2019 15:51:19 +0000 (07:51 -0800)

mingw: allow building with an MSYS2 runtime v3.x

Recently the Git for Windows project started the upgrade process to
a MSYS2 runtime version based on Cygwin v3.x.

This has the very notable consequence that `$(uname -r)` no longer
reports a version starting with "2", but a version with "3".

That breaks our build, as df5218b4c30b (config.mak.uname: support MSys2,
2016-01-13) simply did not expect the version reported by `uname -r` to
depend on the underlying Cygwin version: it expected the reported
version to match the "2" in "MSYS2".

So let's invert that test case to test for *anything else* than a
version starting with "1" (for MSys). That should safeguard us for the
future, even if Cygwin ends up releasing versionsl like 314.272.65536.

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

t3600: use helpers to replace test -d/f/e/s <path>Rohit Ashiwal Mon, 4 Mar 2019 12:08:01 +0000 (17:38 +0530)

t3600: use helpers to replace test -d/f/e/s <path>

Take advantage of helper functions test_path_is_dir(),
test_path_is_missing(), etc. to replace `test -d|f|e|s` since the
functions make the code more readable and have better error
messages.

Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3600: modernize styleRohit Ashiwal Mon, 4 Mar 2019 12:08:00 +0000 (17:38 +0530)

t3600: modernize style

The tests in `t3600-rm.sh` were written long time ago, and has a lot
of style violations, including the mixed use of tabs and spaces, not
having the title and the opening quote of the body on the first line
of the tests, and other shell script style violations. Update it to
match the CodingGuidelines.

Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test functions: add function `test_file_not_empty`Rohit Ashiwal Mon, 4 Mar 2019 12:07:59 +0000 (17:37 +0530)

test functions: add function `test_file_not_empty`

Add a helper function to ensure that a given path is a non-empty file,
and give an error message when it is not.

Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make sure refs/rewritten/ is per-worktreeNguyễn Thái Ngọc Duy Thu, 7 Mar 2019 12:29:17 +0000 (19:29 +0700)

Make sure refs/rewritten/ is per-worktree

a9be29c981 (sequencer: make refs generated by the `label` command
worktree-local, 2018-04-25) adds refs/rewritten/ as per-worktree
reference space. Unfortunately (my bad) there are a couple places that
need update to make sure it's really per-worktree.

- add_per_worktree_entries_to_dir() is updated to make sure ref listing
look at per-worktree refs/rewritten/ instead of per-repo one [1]

- common_list[] is updated so that git_path() returns the correct
location. This includes "rev-parse --git-path".

This mess is created by me. I started trying to fix it with the
introduction of refs/worktree, where all refs will be per-worktree
without special treatments. Unfortunate refs/rewritten came before
refs/worktree so this is all we can do.

This also fixes logs/refs/worktree not being per-worktree.

[1] note that ref listing still works sometimes. For example, if you
have .git/worktrees/foo/refs/rewritten/bar AND the directory
.git/worktrees/refs/rewritten, refs/rewritten/bar will show up.
add_per_worktree_entries_to_dir() is only needed when the directory
.git/worktrees/refs/rewritten is missing.

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

files-backend.c: reduce duplication in add_per_worktree... Nguyễn Thái Ngọc Duy Thu, 7 Mar 2019 12:29:16 +0000 (19:29 +0700)

files-backend.c: reduce duplication in add_per_worktree_entries_to_dir()

This function is duplicated to handle refs/bisect/ and refs/worktree/
and a third prefix is coming. Time to clean up.

This also fixes incorrect "refs/worktrees/" length in this code. The
correct length is 14 not 11. The test in the next patch will also cover
this.

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

files-backend.c: factor out per-worktree code in loose_... Nguyễn Thái Ngọc Duy Thu, 7 Mar 2019 12:29:15 +0000 (19:29 +0700)

files-backend.c: factor out per-worktree code in loose_fill_ref_dir()

This is the first step for further cleaning up and extending this
function.

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

mingw: drop MakeMaker referenceJohannes Schindelin Mon, 25 Feb 2019 19:27:11 +0000 (11:27 -0800)

mingw: drop MakeMaker reference

In 20d2a30f8ffe (Makefile: replace perl/Makefile.PL with simple make
rules, 2017-12-10), Git stopped using MakeMaker. Therefore, that
definition in the MINGW-specific section became useless.

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

commit-tree: utilize parse-options apiBrandon Richardson Thu, 7 Mar 2019 15:44:09 +0000 (11:44 -0400)

commit-tree: utilize parse-options api

Rather than parse options manually, which is both difficult to
read and error prone, parse options supplied to commit-tree
using the parse-options api.

It was discovered that the --no-gpg-sign option was documented
but not implemented in commit 70ddbd7767 (commit-tree: add missing
--gpg-sign flag, 2019-01-19), and the existing implementation
would attempt to translate the option as a tree oid. It was also
suggested earlier in commit 55ca3f99ae (commit-tree: add and document
--no-gpg-sign, 2013-12-13) that commit-tree should be migrated to
utilize the parse-options api, which could help prevent mistakes
like this in the future. Hence this change.

Also update the documentation to better describe that mixing
`-m` and `-F` options will correctly compose commit log messages in the
order in which the options are given.

In the process, mark various strings for translation.

Signed-off-by: Brandon Richardson <brandon1024.br@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

line-log: suppress diff output with "-s"Jeff King Thu, 7 Mar 2019 19:45:15 +0000 (14:45 -0500)

line-log: suppress diff output with "-s"

When "-L" is in use, we ignore any diff output format that the user
provides to us, and just always print a patch (with extra context lines
covering the whole area of interest). It's not entirely clear what we
should do with all formats (e.g., should "--stat" show just the diffstat
of the touched lines, or the stat for the whole file?).

But "-s" is pretty clear: the user probably wants to see just the
commits that touched those lines, without any diff at all. Let's at
least make that work.

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

convert: avoid malloc of original file sizeJoey Hess Thu, 7 Mar 2019 19:56:57 +0000 (14:56 -0500)

convert: avoid malloc of original file size

We write the output of a "clean" filter into a strbuf. Rather than
growing the strbuf dynamically as we read its output, we make the
initial allocation as large as the original input file. This is a good
guess when the filter is just tweaking a few bytes, but it's disastrous
when the point of the filter is to condense a very large file into a
short identifier (e.g., the way git-lfs and git-annex do). We may ask to
allocate many gigabytes, causing the allocation to fail and Git to
die().

Instead, let's just let strbuf do its usual growth.

When the clean filter does output something around the same size as the
worktree file, the buffer will need to be reallocated until it fits,
starting at 8192 and doubling in size. Benchmarking indicates that
reallocation is not a significant overhead for outputs up to a
few MB in size.

Signed-off-by: Joey Hess <id@joeyh.name>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs: move core.excludesFile from git-add to gitignoreDenton Liu Thu, 7 Mar 2019 08:25:30 +0000 (00:25 -0800)

docs: move core.excludesFile from git-add to gitignore

A section in "git add" documentation mentions core.excludesFile and
explains how it works, but this is not specific to the command.

Move this description to gitignore.txt to be more generic.

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

git-clean.txt: clarify ignore pattern filesDenton Liu Thu, 7 Mar 2019 08:25:28 +0000 (00:25 -0800)

git-clean.txt: clarify ignore pattern files

In the git-clean documentation, -x and -e documented .gitignore,
$GIT_DIR/info/excludes but neglected to mention the file pointed to by
core.excludesFile.

Remove specific list of files and, instead, reference gitignore(5)
documentation so that information is consolidated and the git-clean
documentation is more precise.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Helped-by: Martin Ågren <martin.agren@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: document --type=color output is a complete... Jeff King Tue, 5 Mar 2019 04:20:51 +0000 (23:20 -0500)

config: document --type=color output is a complete line

Even though the newer "--type=color" option to "git config" is meant
to be upward compatible with the traditional "--get-color" option,
unlike the latter, its output is not an incomplete line that lack
the LF at the end. That makes it consistent with output of other
types like "git config --type=bool".

Document it, as it sometimes surprises unsuspecting users.

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

Start 2.22 cycleJunio C Hamano Thu, 7 Mar 2019 02:59:54 +0000 (11:59 +0900)

Start 2.22 cycle

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

t5552: compensate for v2 filtering ref adv.Jonathan Tan Mon, 25 Feb 2019 21:54:13 +0000 (13:54 -0800)

t5552: compensate for v2 filtering ref adv.

Protocol v2 filters the ref advertisement, but protocol v0 does not. A
test in t5552 uses the ref advertisement, so fix it to use protocol v0.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: fix protocol version for overspecificationsJonathan Tan Mon, 25 Feb 2019 21:54:12 +0000 (13:54 -0800)

tests: fix protocol version for overspecifications

These tests are also marked with a NEEDSWORK comment.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5700: only run with protocol version 1Jonathan Tan Mon, 25 Feb 2019 21:54:11 +0000 (13:54 -0800)

t5700: only run with protocol version 1

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5512: compensate for v0 only sending HEAD symrefsJonathan Tan Mon, 25 Feb 2019 21:54:10 +0000 (13:54 -0800)

t5512: compensate for v0 only sending HEAD symrefs

Protocol v2 supports sending non-HEAD symrefs, but this is not true of
protocol v0. Some tests expect protocol v0 behavior, so fix them to use
protocol v0.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5503: fix overspecification of trace expectationJonathan Tan Mon, 25 Feb 2019 21:54:09 +0000 (13:54 -0800)

t5503: fix overspecification of trace expectation

In order to extract the wants from a trace, a loop in t5503 currently
breaks if "0000" is found. This works for protocol v0 and v1, but not
v2. Instead, teach t5503 to look specifically for the "want" string,
which is compatible with all protocols.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: always test fetch of unreachable with v0Jonathan Tan Mon, 25 Feb 2019 21:54:08 +0000 (13:54 -0800)

tests: always test fetch of unreachable with v0

Some tests check that fetching an unreachable object fails, but protocol
v2 allows such fetches. Unset GIT_TEST_PROTOCOL_VERSION so that these
tests are always run using protocol v0.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5601: check ssh command only with protocol v0Jonathan Tan Mon, 25 Feb 2019 21:54:07 +0000 (13:54 -0800)

t5601: check ssh command only with protocol v0

When running the SSH command as part of a fetch, Git will write "SendEnv
GIT_PROTOCOL" as an option if protocol v1 or v2 is used, but not v0.
Update all tests that check this to run Git with
GIT_TEST_PROTOCOL_VERSION=0.

I chose not to do a more thorough fix (for example, checking the value of
GIT_TEST_PROTOCOL_VERSION to see if the SendEnv check needs to be done)
because a set of patches [1] that unifies the handling of SSH options,
including writing "SendEnv GIT_PROTOCOL" regardless of protocol version,
is in progress. When that is done, this patch should be reverted, since
the functionality in here is no longer needed.

As of this patch, all tests pass if GIT_TEST_PROTOCOL_VERSION is set to
1.

[1] https://public-inbox.org/git/cover.1545342797.git.steadmon@google.com/

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>