gitweb.git
Prepare for 2.14.2Junio C Hamano Wed, 23 Aug 2017 21:36:03 +0000 (14:36 -0700)

Prepare for 2.14.2

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

Merge branch 'jt/t1450-fsck-corrupt-packfile' into... Junio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jt/t1450-fsck-corrupt-packfile' into maint

A test update.

* jt/t1450-fsck-corrupt-packfile:
tests: ensure fsck fails on corrupt packfiles

Merge branch 'jb/t8008-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jb/t8008-cleanup' into maint

Code clean-up.

* jb/t8008-cleanup:
t8008: rely on rev-parse'd HEAD instead of sha1 value

Merge branch 'jt/subprocess-handshake' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jt/subprocess-handshake' into maint

Code cleanup.

* jt/subprocess-handshake:
sub-process: refactor handshake to common function
Documentation: migrate sub-process docs to header
convert: add "status=delayed" to filter process protocol
convert: refactor capabilities negotiation
convert: move multiple file filter error handling to separate function
convert: put the flags field before the flag itself for consistent style
t0021: write "OUT <size>" only on success
t0021: make debug log file name configurable
t0021: keep filter log files on comparison

Merge branch 'dc/fmt-merge-msg-microcleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'dc/fmt-merge-msg-microcleanup' into maint

Code cleanup.

* dc/fmt-merge-msg-microcleanup:
fmt-merge-msg: fix coding style

Merge branch 'ah/doc-wserrorhighlight' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:51 +0000 (14:33 -0700)

Merge branch 'ah/doc-wserrorhighlight' into maint

Doc update.

* ah/doc-wserrorhighlight:
doc: add missing values "none" and "default" for diff.wsErrorHighlight

Merge branch 'cc/ref-is-hidden-microcleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:50 +0000 (14:33 -0700)

Merge branch 'cc/ref-is-hidden-microcleanup' into maint

Code cleanup.

* cc/ref-is-hidden-microcleanup:
refs: use skip_prefix() in ref_is_hidden()

Merge branch 'js/run-process-parallel-api-fix' into... Junio C Hamano Wed, 23 Aug 2017 21:33:49 +0000 (14:33 -0700)

Merge branch 'js/run-process-parallel-api-fix' into maint

API fix.

* js/run-process-parallel-api-fix:
run_processes_parallel: change confusing task_cb convention

Merge branch 'rs/pack-objects-pbase-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)

Merge branch 'rs/pack-objects-pbase-cleanup' into maint

Code clean-up.

* rs/pack-objects-pbase-cleanup:
pack-objects: remove unnecessary NULL check

Merge branch 'jt/fsck-code-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)

Merge branch 'jt/fsck-code-cleanup' into maint

Code clean-up.

* jt/fsck-code-cleanup:
fsck: cleanup unused variable
object: remove "used" field from struct object
fsck: remove redundant parse_tree() invocation

Merge branch 'rs/stat-data-unaligned-reads-fix' into... Junio C Hamano Wed, 23 Aug 2017 21:33:47 +0000 (14:33 -0700)

Merge branch 'rs/stat-data-unaligned-reads-fix' into maint

Code clean-up.

* rs/stat-data-unaligned-reads-fix:
dir: support platforms that require aligned reads

Merge branch 'rs/move-array' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:46 +0000 (14:33 -0700)

Merge branch 'rs/move-array' into maint

Code clean-up.

* rs/move-array:
ls-files: don't try to prune an empty index
apply: use COPY_ARRAY and MOVE_ARRAY in update_image()
use MOVE_ARRAY
add MOVE_ARRAY

Merge branch 'rs/bswap-ubsan-fix' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:46 +0000 (14:33 -0700)

Merge branch 'rs/bswap-ubsan-fix' into maint

Code clean-up.

* rs/bswap-ubsan-fix:
bswap: convert get_be16, get_be32 and put_be32 to inline functions
bswap: convert to unsigned before shifting in get_be32

Merge branch 'dl/credential-cache-socket-in-xdg-cache... Junio C Hamano Wed, 23 Aug 2017 21:33:45 +0000 (14:33 -0700)

Merge branch 'dl/credential-cache-socket-in-xdg-cache' into maint

A recently added test for the "credential-cache" helper revealed
that EOF detection done around the time the connection to the cache
daemon is torn down were flaky. This was fixed by reacting to
ECONNRESET and behaving as if we got an EOF.

* dl/credential-cache-socket-in-xdg-cache:
credential-cache: interpret an ECONNRESET as an EOF

Merge branch 'hb/gitweb-project-list' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:44 +0000 (14:33 -0700)

Merge branch 'hb/gitweb-project-list' into maint

When a directory is not readable, "gitweb" fails to build the
project list. Work this around by skipping such a directory.

It might end up hiding a problem under the rug and a better
solution might be to loudly complain to the administrator pointing
out the problematic directory, but this will at least make it
"work".

* hb/gitweb-project-list:
gitweb: skip unreadable subdirectories

Merge branch 'ks/commit-abort-on-empty-message-fix... Junio C Hamano Wed, 23 Aug 2017 21:33:44 +0000 (14:33 -0700)

Merge branch 'ks/commit-abort-on-empty-message-fix' into maint

"git commit" when seeing an totally empty message said "you did not
edit the message", which is clearly wrong. The message has been
corrected.

* ks/commit-abort-on-empty-message-fix:
commit: check for empty message before the check for untouched template

Merge branch 'jk/reflog-walk' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:43 +0000 (14:33 -0700)

Merge branch 'jk/reflog-walk' into maint

Numerous bugs in walking of reflogs via "log -g" and friends have
been fixed.

* jk/reflog-walk:
reflog-walk: apply --since/--until to reflog dates
reflog-walk: stop using fake parents
rev-list: check reflog_info before showing usage
get_revision_1(): replace do-while with an early return
log: do not free parents when walking reflog
log: clarify comment about reflog cycles
revision: disallow reflog walking with revs->limited
t1414: document some reflog-walk oddities

Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths... Junio C Hamano Wed, 23 Aug 2017 21:33:43 +0000 (14:33 -0700)

Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths' into maint

The http.{sslkey,sslCert} configuration variables are to be
interpreted as a pathname that honors "~[username]/" prefix, but
weren't, which has been fixed.

* jc/http-sslkey-and-ssl-cert-are-paths:
http.c: http.sslcert and http.sslkey are both pathnames

Merge branch 'jk/ref-filter-colors' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:42 +0000 (14:33 -0700)

Merge branch 'jk/ref-filter-colors' into maint

"%C(color name)" in the pretty print format always produced ANSI
color escape codes, which was an early design mistake. They now
honor the configuration (e.g. "color.ui = never") and also tty-ness
of the output medium.

* jk/ref-filter-colors:
ref-filter: consult want_color() before emitting colors
pretty: respect color settings for %C placeholders
rev-list: pass diffopt->use_colors through to pretty-print
for-each-ref: load config earlier
color: check color.ui in git_default_config()
ref-filter: pass ref_format struct to atom parsers
ref-filter: factor out the parsing of sorting atoms
ref-filter: make parse_ref_filter_atom a private function
ref-filter: provide a function for parsing sort options
ref-filter: move need_color_reset_at_eol into ref_format
ref-filter: abstract ref format into its own struct
ref-filter: simplify automatic color reset
t: use test_decode_color rather than literal ANSI codes
docs/for-each-ref: update pointer to color syntax
check return value of verify_ref_format()

Merge branch 'js/git-gui-msgfmt-on-windows' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:42 +0000 (14:33 -0700)

Merge branch 'js/git-gui-msgfmt-on-windows' into maint

Because recent Git for Windows do come with a real msgfmt, the
build procedure for git-gui has been updated to use it instead of a
hand-rolled substitute.

* js/git-gui-msgfmt-on-windows:
git-gui (MinGW): make use of MSys2's msgfmt
git gui: allow for a long recentrepo list
git gui: de-dup selected repo from recentrepo history
git gui: cope with duplicates in _get_recentrepo
git-gui: remove duplicate entries from .gitconfig's gui.recentrepo

vcs-svn: move remaining repo_tree functions to fast_exp... Jonathan Nieder Wed, 23 Aug 2017 00:04:47 +0000 (17:04 -0700)

vcs-svn: move remaining repo_tree functions to fast_export.h

These used to be for manipulating the in-memory repo_tree structure,
but nowadays they are convenience wrappers to handle a few git-vs-svn
mismatches:

1. Git does not track empty directories but Subversion does. When
looking up a path in git that Subversion thinks exists and finding
nothing, we can safely assume that the path represents a
directory. This is needed when a later Subversion revision
modifies that directory.

2. Subversion allows deleting a file by copying. In Git fast-import
we have to handle that more explicitly as a deletion.

These are details of the tool's interaction with git fast-import.
Move them to fast_export.c, where other such details are handled.

This way the function names do not start with a repo_ prefix that
would clash with the repository object introduced in
v2.14.0-rc0~38^2~16 (repository: introduce the repository object,
2017-06-22) or an svn_ prefix that would clash with libsvn (in case
someone wants to link this code with libsvn some day).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: remove repo_delete wrapper functionJonathan Nieder Wed, 23 Aug 2017 00:02:15 +0000 (17:02 -0700)

vcs-svn: remove repo_delete wrapper function

Since v1.7.10-rc0~118^2~4^2~4^2~3 (vcs-svn: pass paths through to
fast-import, 2010-12-13) this is an alias for fast_export_delete.
Remove the unnecessary layer of indirection.

No functional change intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: remove custom mode constantsJonathan Nieder Wed, 23 Aug 2017 00:01:34 +0000 (17:01 -0700)

vcs-svn: remove custom mode constants

In the rest of Git, these modes are spelled as S_IFDIR,
S_IFREG | 0644, S_IFREG | 0755, and S_IFLNK. Use the same constants
in svn-fe for simplicity and consistency.

No functional change intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: remove more unused prototypes and declarationsJonathan Nieder Wed, 23 Aug 2017 00:00:57 +0000 (17:00 -0700)

vcs-svn: remove more unused prototypes and declarations

I forgot to remove these in v1.7.10-rc0~118^2~4^2~5^2~4 (vcs-svn:
eliminate repo_tree structure, 2010-12-10).

This finishes what was started in commit 36f63b50 (vcs-svn: remove
unused prototypes, 2017-08-21).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Doc: clarify that pack-objects makes packs, pluralJonathan Tan Wed, 23 Aug 2017 00:40:10 +0000 (17:40 -0700)

Doc: clarify that pack-objects makes packs, plural

The documentation for pack-objects describes that it creates "a packed
archive of objects", which is confusing because it may create multiple
packs if --max-pack-size is set. Update the documentation to clarify
this, and explaining in which cases such a feature would be useful.

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

merge: save merge state earlierMichael J Gruber Wed, 23 Aug 2017 12:10:45 +0000 (14:10 +0200)

merge: save merge state earlier

If the `git merge` process is killed while waiting for the editor to
finish, the merge state is lost but the prepared merge msg and tree is kept.
So, a subsequent `git commit` creates a squashed merge even when the
user asked for proper merge commit originally.

Demonstrate the problem with a test crafted after the in t7502. The test
requires EXECKEEPSPID (thus does not run under MINGW).

Save the merge state earlier (in the non-squash case) so that it does
not get lost. This makes the test pass.

Reported-by: hIpPy <hippy2981@gmail.com>
Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: split write_merge_state in twoMichael J Gruber Wed, 23 Aug 2017 12:10:44 +0000 (14:10 +0200)

merge: split write_merge_state in two

write_merge_state() writes out the merge heads, mode, and msg. But we
may want to write out heads, mode without the msg. So, split out heads
(+mode) into a separate function write_merge_heads() that is called by
write_merge_state().

No funtional change so far, except when these non-atomic writes are
interrupted: we write heads-mode-msg now when we used to write
heads-msg-mode.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: clarify call chainMichael J Gruber Wed, 23 Aug 2017 12:10:43 +0000 (14:10 +0200)

merge: clarify call chain

prepare_to_commit() cannot be reached in the non-squash case:
It is called by merge_trivial() and finish_automerge() only, but the
calls to the latter are somewhat hard to track:

If option_commit is not set, the code in cmd_merge() uses a fake
conflict return code (ret=1) to avoid writing the tree, which also
avoids setting automerge_was_ok (just as in the proper ret==1 case), so
that finish_automerge() is not called.

To ensure that no code change breaks that assumption, safe-guard
prepare_to_commit() by a BUG() statement.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-merge: explain --continueMichael J Gruber Mon, 21 Aug 2017 12:53:14 +0000 (14:53 +0200)

Documentation/git-merge: explain --continue

Currently, 'git merge --continue' is mentioned but not explained.

Explain it.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: rename repo functions to "svn_repo"brian m. carlson Mon, 21 Aug 2017 00:00:18 +0000 (00:00 +0000)

vcs-svn: rename repo functions to "svn_repo"

There were several functions in the Subversion code that started with
"repo_". This namespace is also used by the Git struct repository code.
Rename these functions to start with "svn_repo" to avoid any future
conflicts.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: remove unused prototypesbrian m. carlson Mon, 21 Aug 2017 00:00:17 +0000 (00:00 +0000)

vcs-svn: remove unused prototypes

The Subversion code had prototypes for several functions which were not
ever defined or used. These functions all had names starting with
"repo_", some of which conflict with those in repository.h. To avoid
the conflict, remove those unused prototypes.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix typo in sendemail.identityJeff King Sun, 20 Aug 2017 09:46:57 +0000 (05:46 -0400)

doc: fix typo in sendemail.identity

Saying "the this" is an obvious typo. But while we're here,
let's polish the English on the second half of the sentence,
too.

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

apply: file commited with CRLF should roundtrip diff... Torsten Bögershausen Sat, 19 Aug 2017 11:28:01 +0000 (13:28 +0200)

apply: file commited with CRLF should roundtrip diff and apply

When a file had been commited with CRLF but now .gitattributes say
"* text=auto" (or core.autocrlf is true), the following does not
roundtrip, `git apply` fails:

printf "Added line\r\n" >>file &&
git diff >patch &&
git checkout -- . &&
git apply patch

Before applying the patch, the file from working tree is converted
into the index format (clean filter, CRLF conversion, ...). Here,
when commited with CRLF, the line endings should not be converted.

Note that `git apply --index` or `git apply --cache` doesn't call
convert_to_git() because the source material is already in index
format.

Analyze the patch if there is a) any context line with CRLF, or b)
if any line with CRLF is to be removed. In this case the patch file
`patch` has mixed line endings, for a) it looks like this:

diff --git a/one b/one
index 533790e..c30dea8 100644
--- a/one
+++ b/one
@@ -1 +1,2 @@
a\r
+b\r

And for b) it looks like this:

diff --git a/one b/one
index 533790e..485540d 100644
--- a/one
+++ b/one
@@ -1 +1 @@
-a\r
+b\r

If `git apply` detects that the patch itself has CRLF, (look at the
line " a\r" or "-a\r" above), the new flag crlf_in_old is set in
"struct patch" and two things will happen:

- read_old_data() will not convert CRLF into LF by calling
convert_to_git(..., SAFE_CRLF_KEEP_CRLF);
- The WS_CR_AT_EOL bit is set in the "white space rule",
CRLF are no longer treated as white space.

While at there, make it clear that read_old_data() in apply.c knows
what it wants convert_to_git() to do with respect to CRLF. In fact,
this codepath is about applying a patch to a file in the filesystem,
which may not exist in the index, or may exist but may not match
what is recorded in the index, or in the extreme case, we may not
even be in a Git repository. If convert_to_git() peeked at the
index while doing its work, it *would* be a bug.

Pass NULL instead of &the_index to convert_to_git() to make sure we
catch future bugs to clarify this.

Update the test in t4124: split one test case into 3:

- Detect the " a\r" line in the patch
- Detect the "-a\r" line in the patch
- Use LF in repo and CLRF in the worktree.

Reported-by: Anthony Sottile <asottile@umich.edu>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: remove unused inline function single_parent()René Scharfe Sat, 19 Aug 2017 08:12:45 +0000 (10:12 +0200)

commit: remove unused inline function single_parent()

53b2c823f6 (revision walker: mini clean-up) added the function in 2007,
but it was never used, so we should be able to get rid of it now.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: don't queue excluded directoriesRené Scharfe Sat, 19 Aug 2017 05:32:37 +0000 (07:32 +0200)

archive: don't queue excluded directories

Reject directories with the attribute export-ignore already while
queuing them. This prevents read_tree_recursive() from descending into
them and this avoids write_archive_entry() rejecting them later on,
which queue_or_write_archive_entry() is not prepared for.

Borrow the existing strbuf to build the full path to avoid string
copies and extra allocations; just make sure we restore the original
value before moving on.

Keep checking any other attributes in write_archive_entry() as before,
but avoid checking them twice.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: factor out helper functions for handling attri... René Scharfe Sat, 19 Aug 2017 05:29:43 +0000 (07:29 +0200)

archive: factor out helper functions for handling attributes

Add helpers for accessing attributes that encapsulate the details of how
to retrieve their values.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5001: add tests for export-ignore attributes and exclu... René Scharfe Sat, 19 Aug 2017 05:28:54 +0000 (07:28 +0200)

t5001: add tests for export-ignore attributes and exclude pathspecs

Demonstrate mishandling of the attribute export-ignore by git archive
when used together with pathspecs. Wildcard pathspecs can even cause it
to abort. And a directory excluded without a wildcard is still included
as an empty folder in the archive.

Test-case-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-for-each-ref: clarify peeling of... Michael J Gruber Fri, 18 Aug 2017 14:51:23 +0000 (16:51 +0200)

Documentation/git-for-each-ref: clarify peeling of tags for --format

`*` in format strings means peeling of tag objects so that object field
names refer to the object that the tag object points at, instead of the
tag object itself.

Currently, this is documented using grammar that is clearly inspired by
classical latin, though missing more than an article in order to be
classical english.

Try and straighten that explanation out a bit.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: use proper wording for ref format stringsMichael J Gruber Fri, 18 Aug 2017 14:51:22 +0000 (16:51 +0200)

Documentation: use proper wording for ref format strings

Various commands list refs and allow to use a format string for the
output that interpolates from the ref as well as the object it points
at (for-each-ref; branch and tag in list mode).

Currently, the documentation talks about interpolating from the object.
This is confusing because a ref points to an object but not vice versa,
so the object cannot possible know %(refname), for example. Thus, this is
wrong independent of refs being objects (one day, maybe) or not.

Change the wording to make this clearer (and distinguish it from formats
for the log family).

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-grep: correct exit code with --quiet and -LAnthony Sottile Fri, 18 Aug 2017 01:38:51 +0000 (18:38 -0700)

git-grep: correct exit code with --quiet and -L

The handling of `status_only` no longer interferes with the handling of
`unmatch_name_only`. `--quiet` no longer affects the exit code when using
`-L`/`--files-without-match`.

Signed-off-by: Anthony Sottile <asottile@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5526: fix some broken && chainsHeiko Voigt Thu, 17 Aug 2017 10:36:13 +0000 (12:36 +0200)

t5526: fix some broken && chains

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule.sh: remove unused variableStefan Beller Wed, 16 Aug 2017 22:50:42 +0000 (15:50 -0700)

submodule.sh: remove unused variable

This could have been part of 48308681b0 (git submodule update: have a
dedicated helper for cloning, 2016-02-29).

Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

convert: add SAFE_CRLF_KEEP_CRLFTorsten Bögershausen Sun, 13 Aug 2017 08:51:04 +0000 (10:51 +0200)

convert: add SAFE_CRLF_KEEP_CRLF

When convert_to_git() is called, the caller may want to keep CRLF to
be kept as CRLF (and not converted into LF).

This will be used in the next commit, when apply works with files
that have CRLF and patches are applied onto these files.

Add the new value "SAFE_CRLF_KEEP_CRLF" to safe_crlf.

Prepare convert_to_git() to be able to run the clean filter, skip
the CRLF conversion and run the ident filter.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sub-process: print the cmd when a capability is unsupportedChristian Couder Wed, 16 Aug 2017 12:40:36 +0000 (14:40 +0200)

sub-process: print the cmd when a capability is unsupported

In handshake_capabilities() we use warning() when a capability
is not supported, so the exit code of the function is 0 and no
further error is shown. This is a problem because the warning
message doesn't tell us which subprocess cmd failed.

On the contrary if we cannot write a packet from this function,
we use error() and then subprocess_start() outputs:

initialization for subprocess '<cmd>' failed

so we can know which subprocess cmd failed.

Let's improve the warning() message, so that we can know which
subprocess cmd failed.

Helped-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: make read_info_alternates staticStefan Beller Tue, 15 Aug 2017 20:13:19 +0000 (13:13 -0700)

sha1_file: make read_info_alternates static

read_info_alternates is not used from outside, so let's make it static.

We have to declare the function before link_alt_odb_entry instead of
moving the code around, link_alt_odb_entry calls read_info_alternates,
which in turn calls link_alt_odb_entry.

Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1002: stop using sum(1)René Scharfe Mon, 14 Aug 2017 20:16:34 +0000 (22:16 +0200)

t1002: stop using sum(1)

sum(1) is a command for calculating checksums of the contents of files.
It was part of early editions of Unix ("Research Unix", 1972/1973, [1]).
cksum(1) appeared in 4.4BSD (1993) as a replacement [2], and became part
of POSIX.1-2008 [3]. OpenBSD 5.6 (2014) removed sum(1).

We only use sum(1) in t1002 to check for changes in three files. On
MinGW we use md5sum(1) instead. We could switch to the standard command
cksum(1) for all platforms; MinGW comes with GNU coreutils now, which
provides sum(1), cksum(1) and md5sum(1). Use our standard method for
checking for file changes instead: test_cmp.

It's more convenient because it shows differences nicely, it's faster on
MinGW because we have a special implementation there based only on
shell-internal commands, it's simpler as it allows us to avoid stripping
out unnecessary entries from the checksum file using grep(1), and it's
more consistent with the rest of the test suite.

We already compare changed files with their expected new contents using
diff(1), so we don't need to check with "test_must_fail test_cmp" if
they differ from their original state. A later patch could convert the
direct diff(1) calls to test_cmp as well.

With all sum(1) calls gone, remove the MinGW-specific implementation
from test-lib.sh as well.

[1] http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/sum.1
[2] http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/share/man/cat1/cksum.0
[3] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cksum.html

Signed-off-by: René Scharfe <l.s.r@web.de>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: clarify "config --bool" behaviour with empty stringAndreas Heiduk Mon, 14 Aug 2017 22:12:18 +0000 (00:12 +0200)

doc: clarify "config --bool" behaviour with empty string

`git config --bool xxx.yyy` returns `true` for `[xxx]yyy` but
`false` for `[xxx]yyy=` or `[xxx]yyy=""`. This is tested in
t1300-repo-config.sh since 09bc098c2.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: prevent warning about null bytes in inputKevin Daudt Mon, 14 Aug 2017 21:43:33 +0000 (23:43 +0200)

stash: prevent warning about null bytes in input

The `no_changes` function calls the `untracked_files` function through
command substitution. `untracked_files` will return null bytes because it
runs ls-files with the '-z' option.

Bash since version 4.4 warns about these null bytes. As they are not
required for the test that is being done, make sure `untracked_files`
does not output null bytes when not required.

This is achieved by adding a parameter to the `untracked_files` function to
specify wither `-z` should be passed to ls-files or not.

This warning is triggered when running git stash save -u resulting in
two warnings:

git-stash: line 43: warning: command substitution: ignored null byte
in input

Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: release delta_stack on error in unpack_entry()René Scharfe Thu, 10 Aug 2017 09:42:21 +0000 (11:42 +0200)

sha1_file: release delta_stack on error in unpack_entry()

When unpack_entry() encounters a broken packed object, it returns early.
It adjusts the reference count of the pack window, but leaks the buffer
for a big delta stack in case the small automatic one was not enough.
Jump to the cleanup code at end instead, which takes care of that.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: free buffers on error in fsck_obj()René Scharfe Thu, 10 Aug 2017 09:42:10 +0000 (11:42 +0200)

fsck: free buffers on error in fsck_obj()

Move the code for releasing tree buffers and commit buffers in
fsck_obj() to the end of the function and make sure it's executed no
matter of an error is encountered or not.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

strbuf: clear errno before calling getdelim(3)René Scharfe Thu, 10 Aug 2017 20:56:40 +0000 (22:56 +0200)

strbuf: clear errno before calling getdelim(3)

getdelim(3) returns -1 at the end of the file and if it encounters an
error, but sets errno only in the latter case. Set errno to zero before
calling it to avoid misdiagnosing an out-of-memory condition due to a
left-over value from some other function call.

Reported-by: Yaroslav Halchenko <yoh@onerussian.com>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

win32: plug memory leak on realloc() failure in syslog()René Scharfe Thu, 10 Aug 2017 10:23:45 +0000 (12:23 +0200)

win32: plug memory leak on realloc() failure in syslog()

If realloc() fails then the original buffer is still valid. Free it
before exiting the function.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: use skip_prefix()René Scharfe Thu, 10 Aug 2017 16:47:55 +0000 (18:47 +0200)

merge: use skip_prefix()

Get rid of a magic string length constant by using skip_prefix() instead
of starts_with().

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: drop experimental GIT_USE_LOOKUP searchJeff King Wed, 9 Aug 2017 10:14:32 +0000 (06:14 -0400)

sha1_file: drop experimental GIT_USE_LOOKUP search

Long ago in 628522ec14 (sha1-lookup: more memory efficient
search in sorted list of SHA-1, 2007-12-29) we added
sha1_entry_pos(), a binary search that uses the uniform
distribution of sha1s to scale the selection of mid-points.
As this was a performance experiment, we tied it to the
GIT_USE_LOOKUP environment variable and never enabled it by
default.

This code was successful in reducing the number of steps in
each search. But the overhead of the scaling ends up making
it slower when the cache is warm. Here are best-of-five
timings for running rev-list on linux.git, which will have
to look up every object:

$ time git rev-list --objects --all >/dev/null
real 0m35.357s
user 0m35.016s
sys 0m0.340s

$ time GIT_USE_LOOKUP=1 git rev-list --objects --all >/dev/null
real 0m37.364s
user 0m37.045s
sys 0m0.316s

The USE_LOOKUP version might have more benefit on a cold
cache, as the time to fault in each page would dominate. But
that would be for a single lookup. In practice, most
operations tend to look up many objects, and the whole pack
.idx will end up warm.

It's possible that the code could be better optimized to
compete with a naive binary search for the warm-cache case,
and we could have the best of both worlds. But over the
years nobody has done so, and this is largely dead code that
is rarely run outside of the test suite. Let's drop it in
the name of simplicity.

This lets us remove sha1_entry_pos() entirely, as the .idx
lookup code was the only caller. Note that sha1-lookup.c
still contains sha1_pos(), which differs from
sha1_entry_pos() in two ways:

- it has a different interface; it uses a function pointer
to access sha1 entries rather than a size/offset pair
describing the table's memory layout

- it only scales the initial selection of "mi", rather
than each iteration of the search

We can't get rid of this function, as it's called from
several places. It may be that we could replace it with a
simple binary search, but that's out of scope for this patch
(and would need benchmarking).

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

hashcmp: use memcmp instead of open-coded loopJeff King Wed, 9 Aug 2017 10:16:45 +0000 (06:16 -0400)

hashcmp: use memcmp instead of open-coded loop

In 1a812f3a70 (hashcmp(): inline memcmp() by hand to
optimize, 2011-04-28), it was reported that an open-coded
loop outperformed memcmp() for comparing sha1s.

Discussion[1] a few years later in 2013 showed that this
depends on your libc's version of memcmp(). In particular,
glibc 2.13 optimized their memcmp around 2011. Here are
current timings with glibc 2.24 (best-of-five, on
linux.git):

[before this patch, open-coded]
$ time git rev-list --objects --all
real 0m35.357s
user 0m35.016s
sys 0m0.340s

[after this patch, memcmp]
real 0m32.930s
user 0m32.630s
sys 0m0.300s

Now that we've had 6 years for that version of glibc to
make its way onto people's machines, it's worth revisiting
our benchmarks and switching to memcmp().

It may be that there are other non-glibc systems where
memcmp() isn't as well optimized. But since our single data
point in favor of open-coding was on a now-ancient glibc, we
should probably assume the system memcmp is good unless
proven otherwise. We may end up with a SLOW_MEMCMP Makefile
knob, but we can hold off on that until we actually find
such a system in practice.

[1] https://public-inbox.org/git/20130318073229.GA5551@sigill.intra.peff.net/

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

apply: remove prefix_length member from apply_stateRené Scharfe Wed, 9 Aug 2017 15:54:46 +0000 (17:54 +0200)

apply: remove prefix_length member from apply_state

Use a NULL-and-NUL check to see if we have a prefix and consistently use
C string functions on it instead of storing its length in a member of
struct apply_state. This avoids strlen() calls and simplifies the code.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/add: add detail to a 'cannot chmod' error messageRamsay Jones Wed, 9 Aug 2017 00:51:23 +0000 (01:51 +0100)

builtin/add: add detail to a 'cannot chmod' error message

In addition to adding the missing newline, add the x-ecutable bit
'mode change' character to the error message. This message now has
the same form as similar messages output by 'update-index'.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: avoid comparison if no packed hash matches... René Scharfe Tue, 8 Aug 2017 22:07:30 +0000 (00:07 +0200)

sha1_file: avoid comparison if no packed hash matches the first byte

find_pack_entry_one() uses the fan-out table of pack indexes to find out
which entries match the first byte of the searched hash and does a
binary search on this subset of the main index table.

If there are no matching entries then lo and hi will have the same
value. The binary search still starts and compares the hash of the
following entry (which has a non-matching first byte, so won't cause any
trouble), or whatever comes after the sorted list of entries.

The probability of that stray comparison matching by mistake is low, but
let's not take any chances and check when entering the binary search
loop if we're actually done already.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4062: use less than 256 repetitions in regexRené Scharfe Wed, 9 Aug 2017 14:15:10 +0000 (16:15 +0200)

t4062: use less than 256 repetitions in regex

OpenBSD's regex library has a repetition limit (RE_DUP_MAX) of 255.
That's the minimum acceptable value according to POSIX. In t4062 we use
4096 repetitions in the test "-G matches", though, causing it to fail.
Combine two repetition operators, both less than 256, to arrive at 4096
zeros instead of using a single one, to fix the test on OpenBSD.

Original-patch-by: David Coppa <dcoppa@openbsd.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3700: fix broken test under !POSIXPERMRené Scharfe Tue, 8 Aug 2017 19:21:41 +0000 (21:21 +0200)

t3700: fix broken test under !POSIXPERM

76e368c378 (t3700: fix broken test under !SANITY) explains that the test
'git add --chmod=[+-]x changes index with already added file' can fail
if xfoo3 is still present as a symlink from a previous test and deletes
it with rm(1). That still leaves it present in the index, which causes
the test to fail if POSIXPERM is not defined. Get rid of it by calling
"git reset --hard" as well, as 76e368c378 already mentioned in passing.

Helped-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

am: fix signoff when other trailers are presentPhillip Wood Tue, 8 Aug 2017 10:25:33 +0000 (11:25 +0100)

am: fix signoff when other trailers are present

If there was no 'Signed-off-by:' trailer but another trailer such as
'Reported-by:' then 'git am --signoff' would add a blank line between
the existing trailers and the added 'Signed-off-by:' line. e.g.

Rebase accepts '--rerere-autoupdate' as an option but only honors
it if '-m' is also given. Fix it for a non-interactive rebase by
passing on the option to 'git am' and 'git cherry-pick'.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Fix by using the code provided for this purpose in sequencer.c.
Change the tests so that they check the formatting of the
'Signed-off-by:' lines rather than just grepping for them.

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

git svn fetch: Create correct commit timestamp when... Urs Thuermann Sat, 5 Aug 2017 00:12:15 +0000 (02:12 +0200)

git svn fetch: Create correct commit timestamp when using --localtime

In parse_svn_date() prepend the correct UTC offset to the timestamp
returned. This is the offset in effect at the commit time instead of
the offset in effect at calling time.

Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
Reviewed-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perl/Git.pm: typofix in a commentJunio C Hamano Mon, 7 Aug 2017 22:15:57 +0000 (15:15 -0700)

perl/Git.pm: typofix in a comment

No change of behaviour intended.

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

scripts: use "git foo" not "git-foo"Michael Forney Sat, 5 Aug 2017 06:49:05 +0000 (23:49 -0700)

scripts: use "git foo" not "git-foo"

We want to make sure that people who copy & paste code would see
fewer instances of "git-foo". The use of these dashed forms have
been discouraged since v1.6.0 days.

Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-path-utils: handle const parameter of basename... René Scharfe Mon, 7 Aug 2017 13:57:31 +0000 (15:57 +0200)

test-path-utils: handle const parameter of basename and dirname

The parameter to basename(3) and dirname(3) traditionally had the type
"char *", but on OpenBSD it's been "const char *" for years. That
causes (at least) Clang to throw an incompatible-pointer-types warning
for test-path-utils, where we try to pass around pointers to these
functions.

Avoid this warning (which is fatal in DEVELOPER mode) by ignoring the
promise of OpenBSD's implementations to keep input strings unmodified
and enclosing them in POSIX-compatible wrappers.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0001: skip test with restrictive permissions if getpwd... René Scharfe Mon, 7 Aug 2017 11:04:18 +0000 (13:04 +0200)

t0001: skip test with restrictive permissions if getpwd(3) respects them

The sub-test "init in long base path" in t0001 checks the ability to
handle long base paths with restrictive permissions (--x). On OpenBSD
getcwd(3) fails in that case even for short paths. Check the two
aspects separately by trying to use a long base path both with and
without execute-only permissions. Only attempt the former if we know
that getcwd(3) doesn't care.

Original-patch-by: David Coppa <dcoppa@openbsd.org>
Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: don't give unportable ">" to "test" built-in... Ævar Arnfjörð Bjarmason Sun, 6 Aug 2017 23:38:50 +0000 (23:38 +0000)

tests: don't give unportable ">" to "test" built-in, use -gt

Change an argument to test_line_count (which'll ultimately be turned
into a "test" expression) to use "-gt" instead of ">" for an
arithmetic test.

This broken on e.g. OpenBSD as of v2.13.0 with my commit
ac3f5a3468 ("ref-filter: add --no-contains option to
tag/branch/for-each-ref", 2017-03-24).

Downstream just worked around it by patching git and didn't tell us
about it, I discovered this when reading various Git packaging
implementations: https://github.com/openbsd/ports/commit/7e48bf88a20

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

Git 2.14.1 v2.14.1Junio C Hamano Fri, 4 Aug 2017 19:41:48 +0000 (12:41 -0700)

Git 2.14.1

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

Merge tag 'v2.13.5' into maintJunio C Hamano Fri, 4 Aug 2017 19:40:37 +0000 (12:40 -0700)

Merge tag 'v2.13.5' into maint

Git 2.14 v2.14.0Junio C Hamano Fri, 4 Aug 2017 16:31:12 +0000 (09:31 -0700)

Git 2.14

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

Merge branch 'ah/patch-id-doc'Junio C Hamano Fri, 4 Aug 2017 16:29:15 +0000 (09:29 -0700)

Merge branch 'ah/patch-id-doc'

Docfix.

* ah/patch-id-doc:
doc: remove unsupported parameter from patch-id

Merge branch 'as/diff-options-grammofix'Junio C Hamano Fri, 4 Aug 2017 16:29:14 +0000 (09:29 -0700)

Merge branch 'as/diff-options-grammofix'

A grammofix.

* as/diff-options-grammofix:
diff-options doc: grammar fix

clone: teach recursive clones to respect -qBrandon Williams Thu, 3 Aug 2017 22:25:44 +0000 (15:25 -0700)

clone: teach recursive clones to respect -q

Teach 'git clone --recurse-submodules' to respect the '-q' option by
passing down the quiet flag to the process which handles cloning of
submodules.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git.c: ignore pager.* when launching builtin as dashed... Martin Ågren Wed, 2 Aug 2017 19:40:55 +0000 (21:40 +0200)

git.c: ignore pager.* when launching builtin as dashed external

When running, e.g., `git -c alias.bar=foo bar`, we expand the alias and
execute `git-foo` as a dashed external. This is true even if git foo is
a builtin. That is on purpose, and is motivated in a comment which was
added in commit 441981bc ("git: simplify environment save/restore
logic", 2016-01-26).

Shortly before we launch a dashed external, and unless we have already
found out whether we should use a pager, we check `pager.foo`. This was
added in commit 92058e4d ("support pager.* for external commands",
2011-08-18). If the dashed external is a builtin, this does not match
that commit's intention and is arguably wrong, since it would be cleaner
if we let the "dashed external builtin" handle `pager.foo`.

This has not mattered in practice, but a recent patch taught `git-tag`
to ignore `pager.tag` under certain circumstances. But, when started
using an alias, it doesn't get the chance to do so, as outlined above.
That recent patch added a test to document this breakage.

Do not check `pager.foo` before launching a builtin as a dashed
external, i.e., if we recognize the name of the external as a builtin.
Change the test to use `test_expect_success`.

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

tag: change default of `pager.tag` to "on"Martin Ågren Wed, 2 Aug 2017 19:40:54 +0000 (21:40 +0200)

tag: change default of `pager.tag` to "on"

The previous patch taught `git tag` to only respect `pager.tag` in
list-mode. That patch left the default value of `pager.tag` at "off".

After that patch, it makes sense to let the default value be "on"
instead, since it will help with listing many tags, but will not hurt
users of `git tag -a` as it would have before. Make that change. Update
documentation and tests.

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

tag: respect `pager.tag` in list-mode onlyMartin Ågren Wed, 2 Aug 2017 19:40:53 +0000 (21:40 +0200)

tag: respect `pager.tag` in list-mode only

Using, e.g., `git -c pager.tag tag -a new-tag` results in errors such as
"Vim: Warning: Output is not to a terminal" and a garbled terminal.
Someone who makes use of both `git tag -a` and `git tag -l` will
probably not set `pager.tag`, so that `git tag -a` will actually work,
at the cost of not paging output of `git tag -l`.

Use the mechanisms introduced in two earlier patches to ignore
`pager.tag` in git.c and let the `git tag` builtin handle it on its own.
Only respect `pager.tag` when running in list-mode.

There is a window between where the pager is started before and after
this patch. This means that early errors can behave slightly different
before and after this patch. Since operation-parsing has to happen
inside this window, this can be seen with `git -c pager.tag="echo pager
is used" tag -l --unknown-option`. This change in paging-behavior should
be acceptable since it only affects erroneous usages.

Update the documentation and update tests.

If an alias is used to run `git tag -a`, then `pager.tag` will still be
respected. Document this known breakage. It will be fixed in a later
commit. Add a similar test for `-l`, which works.

Noticed-by: Anatoly Borodin <anatoly.borodin@gmail.com>
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7006: add tests for how git tag paginatesMartin Ågren Wed, 2 Aug 2017 19:40:52 +0000 (21:40 +0200)

t7006: add tests for how git tag paginates

Using, e.g., `git -c pager.tag tag -a new-tag` results in errors such as
"Vim: Warning: Output is not to a terminal" and a garbled terminal.
Someone who makes use of both `git tag -a` and `git tag -l` will
probably not set `pager.tag`, so that `git tag -a` will actually work,
at the cost of not paging output of `git tag -l`.

Since we're about to change how `git tag` respects `pager.tag`, add tests
around this, including how the configuration is ignored if --no-pager or
--paginate are used.

Construct tests with a few different subcommands. First, use -l. Second,
use "no arguments" and --contains, since those imply -l. (There are
more arguments which imply -l, but using these two should be enough.)

Third, use -a as a representative for "not -l". Actually, the tests use
`git tag -am` so no editor is launched, but that is irrelevant, since we
just want to see whether the pager is used or not. Make one of the tests
demonstrate the broken behavior mentioned above, where `git tag -a`
respects `pager.tag`.

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

git.c: provide setup_auto_pager()Martin Ågren Wed, 2 Aug 2017 19:40:51 +0000 (21:40 +0200)

git.c: provide setup_auto_pager()

The previous patch introduced a way for builtins to declare that they
will take responsibility for handling the `pager.foo`-config item. (See
the commit message of that patch for why that could be useful.)

Provide setup_auto_pager(), which builtins can call in order to handle
`pager.<cmd>`, including possibly starting the pager. Make this function
don't do anything if a pager has already been started, as indicated by
use_pager or pager_in_use().

Whenever this function is called from a builtin, git.c will already have
called commit_pager_choice(). Since commit_pager_choice() treats the
special value -1 as "punt" or "not yet decided", it is not a problem
that we might end up calling commit_pager_choice() once in git.c and
once (or more) in the builtin. Make the new function use -1 in the same
way and document it as "punt".

Don't add any users of setup_auto_pager just yet, one will follow in
a later patch.

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

git.c: let builtins opt for handling `pager.foo` themselvesMartin Ågren Wed, 2 Aug 2017 19:40:50 +0000 (21:40 +0200)

git.c: let builtins opt for handling `pager.foo` themselves

Before launching a builtin git foo and unless mechanisms with precedence
are in use, we check for and handle the `pager.foo` config. This is done
without considering exactly how git foo is being used, and indeed, git.c
cannot (and should not) know what the arguments to git foo are supposed
to achieve.

In practice this means that, e.g., `git -c pager.tag tag -a new-tag`
results in errors such as "Vim: Warning: Output is not to a terminal"
and a garbled terminal. Someone who makes use of both `git tag -a` and
`git tag -l` will probably not set `pager.tag`, so that `git tag -a`
will actually work, at the cost of not paging output of `git tag -l`.

To allow individual builtins to make more informed decisions about when
to respect `pager.foo`, introduce a flag DELAY_PAGER_CONFIG. If the flag
is set, do not check `pager.foo`.

Do not check for DELAY_PAGER_CONFIG in `execv_dashed_external()`. That
call site is arguably wrong, although in a way that is not yet visible,
and will be changed in a slightly different direction in a later patch.

Don't add any users of DELAY_PAGER_CONFIG just yet, one will follow in a
later patch.

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

builtin.h: take over documentation from api-builtin.txtMartin Ågren Wed, 2 Aug 2017 19:40:49 +0000 (21:40 +0200)

builtin.h: take over documentation from api-builtin.txt

Delete Documentation/technical/api-builtin.txt and move its content
into builtin.h. Format it as a comment. Remove a '+' which was needed
when the information was formatted for AsciiDoc. Similarly, change
"::" to ":".

Document SUPPORT_SUPER_PREFIX, thereby bringing the documentation up to
date with the available flags.

While at it, correct '3 more things to do' to '4 more things to do'.

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

revision: do not fallback to default when rev_input_giv... Jeff King Wed, 2 Aug 2017 22:30:19 +0000 (18:30 -0400)

revision: do not fallback to default when rev_input_given is set

If revs->def is set (as it is in "git log") and there are no
pending objects after parsing the user's input, then we show
whatever is in "def". But if the user _did_ ask for some
input that just happened to be empty (e.g., "--glob" that
does not match anything), showing the default revision is
confusing. We should just show nothing, as that is what the
user's request yielded.

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

rev-list: don't show usage when we see empty ref patternsJeff King Wed, 2 Aug 2017 22:26:06 +0000 (18:26 -0400)

rev-list: don't show usage when we see empty ref patterns

If the user gives us no starting point for a traversal, we
want to complain with our normal usage message. But if they
tried to do so with "--all" or "--glob", but that happened
not to match any refs, the usage message isn't helpful. We
should just give them the empty output they asked for
instead.

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

revision: add rev_input_given flagJeff King Wed, 2 Aug 2017 22:25:27 +0000 (18:25 -0400)

revision: add rev_input_given flag

Normally a caller that invokes setup_revisions() has to
check rev.pending to see if anything was actually queued for
the traversal. But they can't tell the difference between
two cases:

1. The user gave us no tip from which to start a
traversal.

2. The user tried to give us tips via --glob, --all, etc,
but their patterns ended up being empty.

Let's set a flag in the rev_info struct that callers can use
to tell the difference. We can set this from the
init_all_refs_cb() function. That's a little funny because
it's not exactly about initializing the "cb" struct itself.
But that function is the common setup place for doing
pattern traversals that is used by --glob, --all, etc.

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

t6018: flesh out empty input/output rev-list testsJeff King Wed, 2 Aug 2017 22:24:51 +0000 (18:24 -0400)

t6018: flesh out empty input/output rev-list tests

In 751a2ac6e (rev-list --exclude: tests, 2013-11-01), we
added a few tests for handling "empty" inputs with rev-list
(i.e., where the user gave us some pattern but it turned out
not to queue any objects for traversal), all of which were
marked as failing.

In preparation for working on this area of the code, let's
give each test a more descriptive name. Let's also include
one more case which we should cover: feeding a --glob
pattern that doesn't match anything.

We can also drop the explanatory comment; we'll be
converting these to expect_success in the next few patches,
so the discussion isn't necessary.

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

cherry-pick/revert: reject --rerere-autoupdate when... Phillip Wood Wed, 2 Aug 2017 10:44:20 +0000 (11:44 +0100)

cherry-pick/revert: reject --rerere-autoupdate when continuing

cherry-pick and revert should not accept --[no-]rerere-autoupdate once
they have started.

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

cherry-pick/revert: remember --rerere-autoupdatePhillip Wood Wed, 2 Aug 2017 10:44:19 +0000 (11:44 +0100)

cherry-pick/revert: remember --rerere-autoupdate

When continuing after conflicts, cherry-pick forgot if the user had specified
'--rerere-autoupdate'.

Redo the cherry-pick rerere tests to check --rerere-autoupdate works
as expected.

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

t3504: use test_commitPhillip Wood Wed, 2 Aug 2017 10:44:18 +0000 (11:44 +0100)

t3504: use test_commit

Using test_commit is simpler than chaining echo && git add &&
test_tick && commit. Also having tags makes it clearer which commit
is being selecting by reset.

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

rebase -i: honor --rerere-autoupdatePhillip Wood Wed, 2 Aug 2017 10:44:17 +0000 (11:44 +0100)

rebase -i: honor --rerere-autoupdate

Interactive rebase was ignoring '--rerere-autoupdate'. Fix this by
reading it appropriate file when restoring the sequencer state for an
interactive rebase and passing '--rerere-autoupdate' to merge and
cherry-pick when rebasing with '--preserve-merges'.

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

rebase: honor --rerere-autoupdatePhillip Wood Wed, 2 Aug 2017 10:44:16 +0000 (11:44 +0100)

rebase: honor --rerere-autoupdate

Rebase accepts '--rerere-autoupdate' as an option but only honors it
if '-m' is also given. Fix it for a non-interactive rebase by passing
on the option to 'git am' and 'git cherry-pick'. Rework the tests so
that they can be used for each rebase flavor and extend them.

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

am: remember --rerere-autoupdate settingPhillip Wood Wed, 2 Aug 2017 10:44:15 +0000 (11:44 +0100)

am: remember --rerere-autoupdate setting

Save the rerere-autoupdate setting so that it is remembered after
stopping for the user to resolve conflicts.

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

Merge tag 'l10n-2.14.0-rnd2' of git://github.com/git... Junio C Hamano Wed, 2 Aug 2017 17:52:33 +0000 (10:52 -0700)

Merge tag 'l10n-2.14.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.14.0 round 2

* tag 'l10n-2.14.0-rnd2' of git://github.com/git-l10n/git-po:
l10n: zh_CN: review for git v2.14.0 l10n
l10n: ko.po: Update Korean translation
l10n: zh_CN: for git v2.14.0 l10n round 2
l10n: de.po: various fixes in German translation
l10n: ru.po: update Russian translation
l10n: fr.po v2.14.0 rnd 2
l10n: fr.po Fix some french typos
l10n: fr.po Fix typo
l10n: fr.po Fix some translations
l10n: de.po: update German translation
l10n: vi.po (3213t): Updated 9 new strings
l10n: Update Catalan translation
l10n: bg.po: Updated Bulgarian translation (3213t)

l10n: zh_CN: review for git v2.14.0 l10nJiang Xin Wed, 2 Aug 2017 00:02:37 +0000 (08:02 +0800)

l10n: zh_CN: review for git v2.14.0 l10n

Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Git 2.13.5 v2.13.5Junio C Hamano Tue, 1 Aug 2017 19:30:00 +0000 (12:30 -0700)

Git 2.13.5

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

Merge tag 'v2.12.4' into maintJunio C Hamano Tue, 1 Aug 2017 19:27:31 +0000 (12:27 -0700)

Merge tag 'v2.12.4' into maint

Sync with v2.13.4Junio C Hamano Tue, 1 Aug 2017 18:46:51 +0000 (11:46 -0700)

Sync with v2.13.4

Git 2.13.4 v2.13.4Junio C Hamano Tue, 1 Aug 2017 18:45:17 +0000 (11:45 -0700)

Git 2.13.4

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

l10n: ko.po: Update Korean translationChangwoo Ryu Tue, 1 Aug 2017 03:32:00 +0000 (12:32 +0900)

l10n: ko.po: Update Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>

l10n: zh_CN: for git v2.14.0 l10n round 2Jiang Xin Sun, 11 Jun 2017 03:28:31 +0000 (11:28 +0800)

l10n: zh_CN: for git v2.14.0 l10n round 2

Translate new l10n messages for git 2.14.0, and update translations on
"stash".

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Sync with maintJunio C Hamano Mon, 31 Jul 2017 20:52:53 +0000 (13:52 -0700)

Sync with maint

* maint:
Preparation for 2.13.4 continues

Preparation for 2.13.4 continuesJunio C Hamano Mon, 31 Jul 2017 20:52:40 +0000 (13:52 -0700)

Preparation for 2.13.4 continues

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