gitweb.git
diff.c: flush stdout before printing rename warningsNguyễn Thái Ngọc Duy Tue, 16 Jan 2018 09:23:49 +0000 (16:23 +0700)

diff.c: flush stdout before printing rename warnings

The diff output is buffered in a FILE object and could still be
partially buffered when we print these warnings (directly to fd 2).
The output is messed up like this

worktree.c | 138 +-
worktree.h warning: inexact rename detection was skipped due to too many files.
| 12 +-
wrapper.c | 83 +-

It gets worse if the warning is printed after color codes for the graph
part are already printed. You'll get a warning in green or red.

Flush stdout first, so we can get something like this instead:

xdiff/xutils.c | 42 +-
xdiff/xutils.h | 4 +-
1033 files changed, 150824 insertions(+), 69395 deletions(-)
warning: inexact rename detection was skipped due to too many files.

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

hashmap.h: remove unused variableRandall S. Becker Sun, 14 Jan 2018 18:07:48 +0000 (13:07 -0500)

hashmap.h: remove unused variable

In 'hashmap_enable_item_counting()', item is assigned but never
used. This causes a warning on HP NonStop. As the variable is
never used, fix this by just removing it.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Helped-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

describe: use strbuf_add_unique_abbrev() for adding... René Scharfe Mon, 15 Jan 2018 17:10:32 +0000 (18:10 +0100)

describe: use strbuf_add_unique_abbrev() for adding short hashes

Call strbuf_add_unique_abbrev() to add an abbreviated hash to a strbuf
instead of taking a detour through find_unique_abbrev() and its static
buffer. This is shorter and a bit more efficient.

Patch generated by Coccinelle (and contrib/coccinelle/strbuf.cocci).

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

read-cache.c: move tempfile creation/cleanup out of... Nguyễn Thái Ngọc Duy Sun, 14 Jan 2018 10:18:19 +0000 (17:18 +0700)

read-cache.c: move tempfile creation/cleanup out of write_shared_index

For one thing, we have more consistent cleanup procedure now and always
keep errno intact.

The real purpose is the ability to break out of write_locked_index()
early when mks_tempfile() fails in the next patch. It's more awkward to
do it if this mks_tempfile() is still inside write_shared_index().

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

read-cache.c: change type of "temp" in write_shared_index()Nguyễn Thái Ngọc Duy Sun, 14 Jan 2018 10:18:18 +0000 (17:18 +0700)

read-cache.c: change type of "temp" in write_shared_index()

This local variable 'temp' will be passed in from the caller in the next
patch. To reduce patch noise, let's change its type now while it's still
a local variable and get all the trival conversion out of the next patch.

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

convert_to_git(): safe_crlf/checksafe becomes int conv_... Torsten Bögershausen Sat, 13 Jan 2018 22:49:31 +0000 (23:49 +0100)

convert_to_git(): safe_crlf/checksafe becomes int conv_flags

When calling convert_to_git(), the checksafe parameter defined what
should happen if the EOL conversion (CRLF --> LF --> CRLF) does not
roundtrip cleanly. In addition, it also defined if line endings should
be renormalized (CRLF --> LF) or kept as they are.

checksafe was an safe_crlf enum with these values:
SAFE_CRLF_FALSE: do nothing in case of EOL roundtrip errors
SAFE_CRLF_FAIL: die in case of EOL roundtrip errors
SAFE_CRLF_WARN: print a warning in case of EOL roundtrip errors
SAFE_CRLF_RENORMALIZE: change CRLF to LF
SAFE_CRLF_KEEP_CRLF: keep all line endings as they are

In some cases the integer value 0 was passed as checksafe parameter
instead of the correct enum value SAFE_CRLF_FALSE. That was no problem
because SAFE_CRLF_FALSE is defined as 0.

FALSE/FAIL/WARN are different from RENORMALIZE and KEEP_CRLF. Therefore,
an enum is not ideal. Let's use a integer bit pattern instead and rename
the parameter to conv_flags to make it more generically usable. This
allows us to extend the bit pattern in a subsequent commit.

Reported-By: Randall S. Becker <rsbecker@nexbridge.com>
Helped-By: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add--interactive: ignore submodule changes except HEADNguyễn Thái Ngọc Duy Sat, 13 Jan 2018 12:10:38 +0000 (19:10 +0700)

add--interactive: ignore submodule changes except HEAD

For 'add -i' and 'add -p', the only action we can take on a dirty
submodule entry is update the index with a new value from its HEAD. The
content changes inside (from its own index, untracked files...) do not
matter, at least until 'git add -i' learns about launching a new
interactive add session inside a submodule.

Ignore all other submodules changes except HEAD. This reduces the number
of entries the user has to check through in 'git add -i', and the number
of 'no' they have to answer to 'git add -p' when dirty submodules are
present.

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

trace.c: move strbuf_release() out of print_trace_line()Nguyễn Thái Ngọc Duy Mon, 15 Jan 2018 10:59:45 +0000 (17:59 +0700)

trace.c: move strbuf_release() out of print_trace_line()

The function is about printing a trace line, not releasing the buffer it
receives too. Move strbuf_release() back outside. This makes it easier
to see how strbuf is managed.

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

trace: avoid unnecessary quotingJeff King Mon, 15 Jan 2018 10:59:44 +0000 (17:59 +0700)

trace: avoid unnecessary quoting

Trace output which contains arbitrary strings (e.g., the
arguments to commands which we are running) is always passed
through sq_quote_buf(). That function always adds
single-quotes, even if the output consists of vanilla
characters. This can make the output a bit hard to read.

Let's avoid the quoting if there are no characters which a
shell would interpret. Trace output doesn't necessarily need
to be shell-compatible, but:

- the shell language is a good ballpark for what humans
consider readable (well, humans versed in command line
tools)

- the run_command bits can be cut-and-pasted to a shell,
and we'll keep that property

- it covers any cases which would make the output
visually ambiguous (e.g., embedded whitespace or quotes)

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

sq_quote_argv: drop maxlen parameterJeff King Mon, 15 Jan 2018 10:59:43 +0000 (17:59 +0700)

sq_quote_argv: drop maxlen parameter

No caller passes anything but "0" for this parameter, which
requests that the function ignore it completely. In fact, in
all of history there was only one such caller, and it went
away in 7f51f8bc2b (alias: use run_command api to execute
aliases, 2011-01-07).

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

Doc/git-submodule: improve readability and grammar... Kaartic Sivaraam Sun, 14 Jan 2018 17:37:37 +0000 (23:07 +0530)

Doc/git-submodule: improve readability and grammar of a sentence

While at it, correctly quote important words.

Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Doc/gitsubmodules: make some changes to improve readabi... Kaartic Sivaraam Sun, 14 Jan 2018 17:37:36 +0000 (23:07 +0530)

Doc/gitsubmodules: make some changes to improve readability and syntax

* Only mention porcelain commands in examples

* Split a sentence for better readability

* Add missing apostrophes

* Clearly specify the advantages of using submodules

* Avoid abbreviations

* Use "Git" consistently

* Improve readability of certain lines

* Clarify when a submodule is considered active

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: port submodule subcommand 'deinit' from... Prathamesh Chavan Sun, 14 Jan 2018 21:15:29 +0000 (02:45 +0530)

submodule: port submodule subcommand 'deinit' from shell to C

The same mechanism is used even for porting this submodule
subcommand, as used in the ported subcommands till now.
The function cmd_deinit in split up after porting into four
functions: module_deinit(), for_each_listed_submodule(),
deinit_submodule() and deinit_submodule_cb().

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: port submodule subcommand 'sync' from shell... Prathamesh Chavan Sun, 14 Jan 2018 21:15:28 +0000 (02:45 +0530)

submodule: port submodule subcommand 'sync' from shell to C

Port the submodule subcommand 'sync' from shell to C using the same
mechanism as that used for porting submodule subcommand 'status'.
Hence, here the function cmd_sync() is ported from shell to C.
This is done by introducing four functions: module_sync(),
sync_submodule(), sync_submodule_cb() and print_default_remote().

The function print_default_remote() is introduced for getting
the default remote as stdout.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: translate 72 new messagesRalf Thielow Tue, 2 Jan 2018 09:14:40 +0000 (10:14 +0100)

l10n: de.po: translate 72 new messages

Translate 72 new messages came from git.pot update in 18a907225 (l10n:
git.pot: v2.16.0 round 1 (64 new, 25 removed)) and 005c62fe4 (l10n:
git.pot: v2.16.0 round 2 (8 new, 4 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthias Rüster <matthias.ruester@gmail.com>

l10n: de.po: improve messages when a branch starts... Ralf Thielow Sat, 16 Dec 2017 19:32:16 +0000 (20:32 +0100)

l10n: de.po: improve messages when a branch starts to track another ref

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

RelNotes: minor typofixSZEDER Gábor Fri, 12 Jan 2018 10:47:36 +0000 (11:47 +0100)

RelNotes: minor typofix

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9001: use existing helper in send-email testChristian Ludwig Fri, 12 Jan 2018 10:37:24 +0000 (11:37 +0100)

t9001: use existing helper in send-email test

Use the wrapper function around the sed statement like everywhere
else in the test. Unfortunately the wrapper function is defined
pretty late.

Move the wrapper to the top of the test file, so future users have it
available right away.

Signed-off-by: Christian Ludwig <chrissicool@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.16-rc2 v2.16.0-rc2Junio C Hamano Thu, 11 Jan 2018 21:20:41 +0000 (13:20 -0800)

Git 2.16-rc2

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

Merge branch 'jh/object-filtering'Junio C Hamano Thu, 11 Jan 2018 21:16:37 +0000 (13:16 -0800)

Merge branch 'jh/object-filtering'

Hotfix for a topic already in 'master'.

* jh/object-filtering:
oidset: don't return value from oidset_init

Merge branch 'tg/worktree-create-tracking'Junio C Hamano Thu, 11 Jan 2018 21:16:36 +0000 (13:16 -0800)

Merge branch 'tg/worktree-create-tracking'

Doc hotfix.

* tg/worktree-create-tracking:
Documentation/git-worktree.txt: add missing `

Merge branch 'js/test-with-ws-in-path'Junio C Hamano Thu, 11 Jan 2018 21:16:36 +0000 (13:16 -0800)

Merge branch 'js/test-with-ws-in-path'

Hot fix to a test.

* js/test-with-ws-in-path:
t3900: add some more quotes

l10n: bg.po: Updated Bulgarian translation (3288t)Alexander Shopov Thu, 11 Jan 2018 20:59:37 +0000 (21:59 +0100)

l10n: bg.po: Updated Bulgarian translation (3288t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

Documentation/git-worktree.txt: add missing `Ralf Thielow Thu, 11 Jan 2018 18:18:21 +0000 (19:18 +0100)

Documentation/git-worktree.txt: add missing `

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cat-file doc: document that -e will return some outputÆvar Arnfjörð Bjarmason Wed, 10 Jan 2018 12:55:53 +0000 (12:55 +0000)

cat-file doc: document that -e will return some output

The -e option added in 7950571ad7 ("A few more options for
git-cat-file", 2005-12-03) has always errored out with message on
stderr saying that the provided object is malformed, like this:

$ git cat-file -e malformed; echo $?
fatal: Not a valid object name malformed
128

A reader of this documentation may be misled into thinking that

if ! git cat-file -e "$object" [...]

as opposed to:

if ! git cat-file -e "$object" 2>/dev/null [...]

is sufficient to implement a truly silent test that checks whether
some arbitrary $object string was both valid, and pointed to an
object that exists.

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

t3900: add some more quotesBeat Bolli Wed, 10 Jan 2018 09:58:32 +0000 (10:58 +0100)

t3900: add some more quotes

In 89a70b80 ("t0302 & t3900: add forgotten quotes", 2018-01-03), quotes
were added to protect against spaces in $HOME. In the test_when_finished
command, two files are deleted which must be quoted individually.

[jc: with \$HOME in the test_when_finished command quoted, as
pointed out by j6t].

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes update before -rc2Junio C Hamano Wed, 10 Jan 2018 22:01:50 +0000 (14:01 -0800)

RelNotes update before -rc2

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

Merge branch 'js/perl-path-workaround-in-tests'Junio C Hamano Wed, 10 Jan 2018 22:01:31 +0000 (14:01 -0800)

Merge branch 'js/perl-path-workaround-in-tests'

* js/perl-path-workaround-in-tests:
mingw: handle GITPERLLIB in t0021 in a Windows-compatible way

Merge branch 'ew/empty-merge-with-dirty-index'Junio C Hamano Wed, 10 Jan 2018 22:01:25 +0000 (14:01 -0800)

Merge branch 'ew/empty-merge-with-dirty-index'

"git merge -s recursive" did not correctly abort when the index is
dirty, if the merged tree happened to be the same as the current
HEAD, which has been fixed.

* ew/empty-merge-with-dirty-index:
merge-recursive: do not look at the index during recursive merge

Merge branch 'ma/bisect-leakfix'Junio C Hamano Wed, 10 Jan 2018 22:01:25 +0000 (14:01 -0800)

Merge branch 'ma/bisect-leakfix'

A hotfix for a recent update that broke 'git bisect'.

* ma/bisect-leakfix:
bisect: fix a regression causing a segfault

Merge branch 'js/fix-merge-arg-quoting-in-rebase-p'Junio C Hamano Wed, 10 Jan 2018 22:01:24 +0000 (14:01 -0800)

Merge branch 'js/fix-merge-arg-quoting-in-rebase-p'

"git rebase -p -X<option>" did not propagate the option properly
down to underlying merge strategy backend.

* js/fix-merge-arg-quoting-in-rebase-p:
rebase -p: fix quoting when calling `git merge`

mingw: handle GITPERLLIB in t0021 in a Windows-compatib... Johannes Schindelin Sat, 6 Jan 2018 22:01:22 +0000 (23:01 +0100)

mingw: handle GITPERLLIB in t0021 in a Windows-compatible way

Git's assumption that all path lists are colon-separated is not only
wrong on Windows, it is not even an assumption that is compatible with
POSIX.

In the interest of time, let's not try to fix this properly but simply
work around the obvious breakage on Windows, where the MSYS2 Bash used
by Git for Windows to interpret the Git's Unix shell scripts will
automagically convert path lists in the environment to
semicolon-separated lists of Windows paths (with drive letter and the
corresponding colon and all that jazz).

In other words, we simply look whether there is a semicolon in
GITPERLLIB and split by semicolons if found instead of colons. This is
not fool-proof, of course, as the path list could consist of a single
path. But that is not the case in Git for Windows' test suite, there are
always two paths in GITPERLLIB.

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

l10n: TEAMS: add zh_CN team membersJiang Xin Tue, 9 Jan 2018 01:55:12 +0000 (09:55 +0800)

l10n: TEAMS: add zh_CN team members

Add Fangyi Zhou to zh_CN l10n team members.

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

l10n: zh_CN: for git v2.16.0 l10n round 2Jiang Xin Sun, 31 Dec 2017 02:50:17 +0000 (10:50 +0800)

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

Translate 72 messages (3288t0f0u) for git v2.16.0-rc1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: 依云 <lilydjwg@gmail.com>
Reviewed-by: Fangyi Zhou <fangyi.zhou@yuriko.moe>

Merge branch 'master' of git://github.com/nafmo/git... Jiang Xin Wed, 10 Jan 2018 03:30:04 +0000 (11:30 +0800)

Merge branch 'master' of git://github.com/nafmo/git-l10n-sv

* 'master' of git://github.com/nafmo/git-l10n-sv:
l10n: sv.po: Update Swedish translation (3288t0f0u)

Merge branch 'russian-l10n' of https://github.com/DJm00... Jiang Xin Wed, 10 Jan 2018 03:28:56 +0000 (11:28 +0800)

Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru

* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
l10n: ru.po: update Russian translation

Merge branch 'jk/doc-diff-options'Junio C Hamano Tue, 9 Jan 2018 22:32:57 +0000 (14:32 -0800)

Merge branch 'jk/doc-diff-options'

Doc update.

* jk/doc-diff-options:
docs/diff-options: clarify scope of diff-filter types

Merge branch 'bw/protocol-v1'Junio C Hamano Tue, 9 Jan 2018 22:32:56 +0000 (14:32 -0800)

Merge branch 'bw/protocol-v1'

Test fix for a topic already in 'master'.

* bw/protocol-v1:
http: fix v1 protocol tests with apache httpd < 2.4

Merge branch 'sg/travis-check-untracked'Junio C Hamano Tue, 9 Jan 2018 22:32:55 +0000 (14:32 -0800)

Merge branch 'sg/travis-check-untracked'

* sg/travis-check-untracked:
travis-ci: check that all build artifacts are .gitignore-d
travis-ci: don't store P4 and Git LFS in the working tree

Merge branch 'js/test-with-ws-in-path'Junio C Hamano Tue, 9 Jan 2018 22:32:55 +0000 (14:32 -0800)

Merge branch 'js/test-with-ws-in-path'

Test fixes.

* js/test-with-ws-in-path:
t0302 & t3900: add forgotten quotes
Allow the test suite to pass in a directory whose name contains spaces

Merge branch 'bc/submitting-patches-in-asciidoc'Junio C Hamano Tue, 9 Jan 2018 22:32:54 +0000 (14:32 -0800)

Merge branch 'bc/submitting-patches-in-asciidoc'

Doc readability update.

* bc/submitting-patches-in-asciidoc:
doc/SubmittingPatches: improve text formatting

Merge branch 'sg/travis-skip-identical-test'Junio C Hamano Tue, 9 Jan 2018 22:32:54 +0000 (14:32 -0800)

Merge branch 'sg/travis-skip-identical-test'

Avoid repeatedly testing the same tree in TravisCI that have been
tested successfully already.

* sg/travis-skip-identical-test:
travis-ci: record and skip successfully built trees
travis-ci: create the cache directory early in the build process
travis-ci: print the "tip of branch is exactly at tag" message in color

Merge branch 'ab/dc-sha1-loose-ends'Junio C Hamano Tue, 9 Jan 2018 22:32:53 +0000 (14:32 -0800)

Merge branch 'ab/dc-sha1-loose-ends'

Tying loose ends for the recent integration work of
collision-detecting SHA-1 implementation.

* ab/dc-sha1-loose-ends:
Makefile: NO_OPENSSL=1 should no longer imply BLK_SHA1=1

Merge branch 'sg/travis-fixes'Junio C Hamano Tue, 9 Jan 2018 22:32:53 +0000 (14:32 -0800)

Merge branch 'sg/travis-fixes'

Assorted updates for TravisCI integration.

* sg/travis-fixes:
travis-ci: only print test failures if there are test results available
travis-ci: save prove state for the 32 bit Linux build
travis-ci: don't install default addon packages for the 32 bit Linux build
travis-ci: fine tune the use of 'set -x' in 'ci/*' scripts

doc/read-tree: remove obsolete remarkAndreas G. Schacker Tue, 9 Jan 2018 15:30:34 +0000 (16:30 +0100)

doc/read-tree: remove obsolete remark

Earlier versions of `git read-tree` required the `--prefix` option value
to end with a slash. This restriction was eventually lifted without a
corresponding amendment to the documentation.

Signed-off-by: Andreas G. Schacker <andreas.schacker@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: sv.po: Update Swedish translation (3288t0f0u)Peter Krefting Tue, 9 Jan 2018 19:10:14 +0000 (20:10 +0100)

l10n: sv.po: Update Swedish translation (3288t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

Merge branch 'js/misc-git-gui-stuff' of ../git-guiJunio C Hamano Tue, 9 Jan 2018 19:07:03 +0000 (11:07 -0800)

Merge branch 'js/misc-git-gui-stuff' of ../git-gui

* 'js/misc-git-gui-stuff' of ../git-gui:
git-gui: allow Ctrl+T to toggle multiple paths
git-gui: fix exception when trying to stage with empty file list
git-gui: avoid exception upon Ctrl+T in an empty list
git gui: fix staging a second line to a 1-line file

git-gui: allow Ctrl+T to toggle multiple pathsJohannes Schindelin Tue, 9 Jan 2018 14:33:04 +0000 (15:33 +0100)

git-gui: allow Ctrl+T to toggle multiple paths

It is possible to select multiple files in the "Unstaged Changes" and
the "Staged Changes" lists. But when hitting Ctrl+T, surprisingly only
one entry is handled, not all selected ones.

Let's just use the same code path as for the "Stage To Commit" and the
"Unstage From Commit" menu items.

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

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

git-gui: fix exception when trying to stage with empty... Johannes Schindelin Tue, 9 Jan 2018 14:33:01 +0000 (15:33 +0100)

git-gui: fix exception when trying to stage with empty file list

If there is nothing to stage, there is nothing to stage. Let's not try
to, even if the file list contains nothing at all.

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

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

git-gui: avoid exception upon Ctrl+T in an empty listJohannes Schindelin Tue, 9 Jan 2018 14:32:58 +0000 (15:32 +0100)

git-gui: avoid exception upon Ctrl+T in an empty list

Previously unstaged files can be staged by clicking on them and then
pressing Ctrl+T. Conveniently, the next unstaged file is selected
automatically so that the unstaged files can be staged by repeatedly
pressing Ctrl+T.

When a user hits Ctrl+T one time too many, though, Git GUI used to throw
this exception:

expected number but got ""
expected number but got ""
while executing
"expr {int([lindex [$w tag ranges in_diff] 0])}"
(procedure "toggle_or_diff" line 13)
invoked from within
"toggle_or_diff toggle .vpane.files.workdir.list "
(command bound to event)

Let's just avoid that by skipping the operation when there are no more
files to stage.

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

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

git gui: fix staging a second line to a 1-line fileJohannes Schindelin Tue, 9 Jan 2018 14:32:54 +0000 (15:32 +0100)

git gui: fix staging a second line to a 1-line file

When a 1-line file is augmented by a second line, and the user tries to
stage that single line via the "Stage Line" context menu item, we do not
want to see "apply: corrupt patch at line 5".

The reason for this error was that the hunk header looks like this:

@@ -1 +1,2 @@

but the existing code expects the original range always to contain a
comma. This problem is easily fixed by cutting the string "1 +1,2"
(that Git GUI formerly mistook for the starting line) at the space.

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

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

bisect: debug: convert struct object to object_idYasushi SHOJI Tue, 9 Jan 2018 11:03:56 +0000 (20:03 +0900)

bisect: debug: convert struct object to object_id

The commit f2fd0760 ("Convert struct object to object_id",
2015-11-10) converted struct object to object_id but forgot to
adjust a few callers in a debug function show_list(), which is
ifdef'ed to noop, in bisect.c.

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

Merge branch 'ew/empty-merge-with-dirty-index-maint... Junio C Hamano Tue, 9 Jan 2018 18:41:37 +0000 (10:41 -0800)

Merge branch 'ew/empty-merge-with-dirty-index-maint' into ew/empty-merge-with-dirty-index

* ew/empty-merge-with-dirty-index-maint:
merge-recursive: do not look at the index during recursive merge

merge-recursive: do not look at the index during recurs... Junio C Hamano Tue, 9 Jan 2018 18:05:51 +0000 (10:05 -0800)

merge-recursive: do not look at the index during recursive merge

When merging another branch into ours, if their tree is the same as
the common ancestor's, we can declare that our tree represents the
result of three-way merge. In such a case, the recursive merge
backend incorrectly used to create a commit out of our index, even
when the index has changes.

A recent fix attempted to prevent this by adding a comparison
between "our" tree and the index, but forgot that this check must be
restricted only to the outermost merge. Inner merges performed by
the recursive backend across merge bases are by definition made from
scratch without having any local changes added to the index. The
call to index_has_changes() during an inner merge is working on the
index that has no relation to the merge being performed, preventing
legitimate merges from getting carried out.

Fix it by limiting the check to the outermost merge.

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

l10n: ru.po: update Russian translationDimitriy Ryazantcev Tue, 9 Jan 2018 10:21:52 +0000 (12:21 +0200)

l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>

l10n: TEAMS: Add ko team membersChangwoo Ryu Tue, 9 Jan 2018 02:32:47 +0000 (11:32 +0900)

l10n: TEAMS: Add ko team members

Add Gwan-gyeong Mun and Sihyeon Jang.

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

Merge branch 'ko/merge-l10n' of https://github.com... Jiang Xin Tue, 9 Jan 2018 01:47:11 +0000 (09:47 +0800)

Merge branch 'ko/merge-l10n' of https://github.com/git-l10n-ko/git-l10n-ko

* 'ko/merge-l10n' of https://github.com/git-l10n-ko/git-l10n-ko:
l10n: ko.po: Update Korean translation

oidset: don't return value from oidset_initThomas Gummerer Sun, 7 Jan 2018 23:04:04 +0000 (23:04 +0000)

oidset: don't return value from oidset_init

c3a9ad3117 ("oidset: add iterator methods to oidset", 2017-11-21)
introduced a 'oidset_init()' function in oidset.h, which has void as
return type, but returns an expression.

This makes the solaris compiler fail with:

"oidset.h", line 30: void function cannot return value

As the return type is void, and even the return type of the expression
we're trying to return (oidmap_init) is void just remove the return
statement to fix the compiler error.

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

stash: don't delete untracked files that match pathspecThomas Gummerer Sat, 6 Jan 2018 00:24:20 +0000 (00:24 +0000)

stash: don't delete untracked files that match pathspec

Currently when 'git stash push -- <pathspec>' is used, untracked files
that match the pathspec will be deleted, even though they do not end up
in a stash anywhere.

This is because the original commit introducing the pathspec feature in
git stash push (df6bba0937 ("stash: teach 'push' (and 'create_stash') to
honor pathspec", 2017-02-28)) used the sequence of 'git reset <pathspec>
&& git ls-files --modified <pathspec> | git checkout-index && git clean
<pathspec>'.

The intention was to emulate what 'git reset --hard -- <pathspec>' would
do. The call to 'git clean' was supposed to clean up the files that
were unstaged by 'git reset'. This would work fine if the pathspec
doesn't match any files that were untracked before 'git stash push --
<pathspec>'. However if <pathspec> matches a file that was untracked
before invoking the 'stash' command, all untracked files matching the
pathspec would inadvertently be deleted as well, even though they
wouldn't end up in the stash, and are therefore lost.

This behaviour was never what was intended, only blobs that also end up
in the stash should be reset to their state in HEAD, previously
untracked files should be left alone.

To achieve this, first match what's in the index and what's in the
working tree by adding all changes to the index, ask diff-index what
changed between HEAD and the current index, and then apply that patch in
reverse to get rid of the changes, which includes removal of added
files and resurrection of removed files.

Reported-by: Reid Price <reid.price@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>

send-email: add test for Linux's get_maintainer.plAlex Bennée Mon, 8 Jan 2018 10:34:34 +0000 (11:34 +0100)

send-email: add test for Linux's get_maintainer.pl

We had a regression that broke Linux's get_maintainer.pl. Using
Mail::Address to parse email addresses fixed it, but let's protect
against future regressions.

Note that we need --cc-cmd to be relative because this option doesn't
accept spaces in script names (probably to allow --cc-cmd="executable
--option"), while --smtp-server needs to be absolute.

Patch-edited-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perl/Git: remove now useless email-address parsing... Matthieu Moy Mon, 8 Jan 2018 10:34:33 +0000 (11:34 +0100)

perl/Git: remove now useless email-address parsing code

We now use Mail::Address unconditionaly, hence parse_mailboxes is now
dead code. Remove it and its tests.

Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: ko.po: Update Korean translationChangwoo Ryu Mon, 8 Jan 2018 01:25:27 +0000 (10:25 +0900)

l10n: ko.po: Update Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>
Signed-off-by: Sihyeon Jang <uneedsihyeon@gmail.com>
Signed-off-by: Gwan-gyeong Mun <elongbug@gmail.com>
Reviewed-by: Changwoo Ryu <cwryu@debian.org>

Merge branch '2.16' of https://github.com/ChrisADR... Jiang Xin Mon, 8 Jan 2018 02:59:24 +0000 (10:59 +0800)

Merge branch '2.16' of https://github.com/ChrisADR/git-po

* '2.16' of https://github.com/ChrisADR/git-po:
l10n: es.po: Spanish translation 2.16.0 round 2

Merge branch 'fr_2.16-rc1' of git://github.com/jnavila/gitJiang Xin Mon, 8 Jan 2018 01:17:24 +0000 (09:17 +0800)

Merge branch 'fr_2.16-rc1' of git://github.com/jnavila/git

* 'fr_2.16-rc1' of git://github.com/jnavila/git:
l10n: fr.po 2.16 round 2

l10n: fr.po 2.16 round 2Jean-Noel Avila Sun, 7 Jan 2018 17:57:48 +0000 (18:57 +0100)

l10n: fr.po 2.16 round 2

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>

l10n: es.po: Spanish translation 2.16.0 round 2Christopher Díaz Riveros Sun, 7 Jan 2018 17:15:35 +0000 (12:15 -0500)

l10n: es.po: Spanish translation 2.16.0 round 2

Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>

l10n: vi.po(3288t): Updated Vietnamese translation... Tran Ngoc Quan Sun, 7 Jan 2018 01:20:27 +0000 (08:20 +0700)

l10n: vi.po(3288t): Updated Vietnamese translation for v2.16.0 round 2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>

l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)Jiang Xin Sat, 6 Jan 2018 23:50:31 +0000 (07:50 +0800)

l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)

Generate po/git.pot from v2.16.0-rc1 for git v2.16.0 l10n round 2.

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

Merge branch 'master' of git://github.com/git-l10n... Jiang Xin Sat, 6 Jan 2018 23:49:43 +0000 (07:49 +0800)

Merge branch 'master' of git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
l10n: es.po: Update Spanish Translation v2.16.0
l10n: fr.po v2.16.0 round 1
l10n: bg.po: Updated Bulgarian translation (3284t)
l10n: sv.po: Update Swedish translation (3284t0f0u)
l10n: fr.po: "worktree list" mistranslated as prune
l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed)
l10n: fixes to German translation
l10n: Update Spanish translation
l10n: zh_CN translate parameter name
l10n: zh_CN Fix typo
l10n: Fixes to Catalan translation

Merge branch '2.16' of https://github.com/ChrisADR... Jiang Xin Sat, 6 Jan 2018 02:26:30 +0000 (10:26 +0800)

Merge branch '2.16' of https://github.com/ChrisADR/git-po

* '2.16' of https://github.com/ChrisADR/git-po:
l10n: es.po: Update Spanish Translation v2.16.0

Merge branch 'fr_2.16' of git://github.com/jnavila/gitJiang Xin Sat, 6 Jan 2018 02:24:52 +0000 (10:24 +0800)

Merge branch 'fr_2.16' of git://github.com/jnavila/git

* 'fr_2.16' of git://github.com/jnavila/git:
l10n: fr.po v2.16.0 round 1
l10n: fr.po: "worktree list" mistranslated as prune

Git 2.16-rc1 v2.16.0-rc1Junio C Hamano Fri, 5 Jan 2018 21:45:17 +0000 (13:45 -0800)

Git 2.16-rc1

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

Merge branch 'js/sequencer-cleanups'Junio C Hamano Fri, 5 Jan 2018 21:28:11 +0000 (13:28 -0800)

Merge branch 'js/sequencer-cleanups'

Code cleanup.

* js/sequencer-cleanups:
sequencer: do not invent whitespace when transforming OIDs
sequencer: report when noop has an argument
sequencer: remove superfluous conditional
sequencer: strip bogus LF at end of error messages
rebase: do not continue when the todo list generation failed

Merge branch 'jh/memihash-opt'Junio C Hamano Fri, 5 Jan 2018 21:28:11 +0000 (13:28 -0800)

Merge branch 'jh/memihash-opt'

Squelch compiler warning.

* jh/memihash-opt:
t/helper/test-lazy-name-hash: fix compilation

Merge branch 'tb/test-lint-wc-l'Junio C Hamano Fri, 5 Jan 2018 21:28:11 +0000 (13:28 -0800)

Merge branch 'tb/test-lint-wc-l'

Test update.

* tb/test-lint-wc-l:
check-non-portable-shell.pl: `wc -l` may have leading WS

Merge branch 'rs/use-argv-array-in-child-process'Junio C Hamano Fri, 5 Jan 2018 21:28:10 +0000 (13:28 -0800)

Merge branch 'rs/use-argv-array-in-child-process'

Code cleanup.

* rs/use-argv-array-in-child-process:
send-pack: use internal argv_array of struct child_process
http: use internal argv_array of struct child_process

Merge branch 'ld/p4-multiple-shelves'Junio C Hamano Fri, 5 Jan 2018 21:28:10 +0000 (13:28 -0800)

Merge branch 'ld/p4-multiple-shelves'

"git p4" update.

* ld/p4-multiple-shelves:
git-p4: update multiple shelved change lists

Merge branch 'jd/fix-strbuf-add-urlencode-bytes'Junio C Hamano Fri, 5 Jan 2018 21:28:10 +0000 (13:28 -0800)

Merge branch 'jd/fix-strbuf-add-urlencode-bytes'

Bytes with high-bit set were encoded incorrectly and made
credential helper fail.

* jd/fix-strbuf-add-urlencode-bytes:
strbuf: fix urlencode format string on signed char

Merge branch 'ew/empty-merge-with-dirty-index'Junio C Hamano Fri, 5 Jan 2018 21:28:09 +0000 (13:28 -0800)

Merge branch 'ew/empty-merge-with-dirty-index'

"git merge -s recursive" did not correctly abort when the index is
dirty, if the merged tree happened to be the same as the current
HEAD, which has been fixed.

* ew/empty-merge-with-dirty-index:
merge-recursive: avoid incorporating uncommitted changes in a merge
move index_has_changes() from builtin/am.c to merge.c for reuse
t6044: recursive can silently incorporate dirty changes in a merge

Merge branch 'db/doc-config-section-names-with-bs'Junio C Hamano Fri, 5 Jan 2018 21:28:09 +0000 (13:28 -0800)

Merge branch 'db/doc-config-section-names-with-bs'

Doc update.

* db/doc-config-section-names-with-bs:
config.txt: document behavior of backslashes in subsections

Merge branch 'jk/test-suite-tracing'Junio C Hamano Fri, 5 Jan 2018 21:28:09 +0000 (13:28 -0800)

Merge branch 'jk/test-suite-tracing'

Assorted fixes around running tests with "-x" tracing option.

* jk/test-suite-tracing:
t/Makefile: introduce TEST_SHELL_PATH
test-lib: make "-x" work with "--verbose-log"
t5615: avoid re-using descriptor 4
test-lib: silence "-x" cleanup under bash

submodule: submodule_move_head omits old argument in... Stefan Beller Fri, 5 Jan 2018 20:03:04 +0000 (12:03 -0800)

submodule: submodule_move_head omits old argument in forced case

When using hard reset or forced checkout with the option to recurse into
submodules, the submodules need to be reset, too.

It turns out that we need to omit the duplicate old argument to read-tree
in all forced cases to omit the 2 way merge and use the more assertive
behavior of reading the specific new tree into the index and updating
the working tree.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: oneway_merge to update submodulesStefan Beller Fri, 5 Jan 2018 20:03:03 +0000 (12:03 -0800)

unpack-trees: oneway_merge to update submodules

When there is a one way merge, each submodule needs to be one way merged
as well, if we're asked to recurse into submodules.

In case of a submodule, check if it is up-to-date, otherwise set the
flag CE_UPDATE, which will trigger an update of it in the phase updating
the tree later.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-submodule-update.sh: fix test ignoring ignored... Stefan Beller Fri, 5 Jan 2018 20:03:02 +0000 (12:03 -0800)

t/lib-submodule-update.sh: fix test ignoring ignored files in submodules

It turns out that the test replacing a submodule with a file with
the submodule containing an ignored file is incorrectly titled,
because the test put the file in place, but never ignored that file.
When having an untracked file Instead of an ignored file in the
submodule, git should refuse to remove the submodule, but that is
a bug in the implementation of recursing into submodules, such that
the test just passed, removing the untracked file.

Fix the test first; in a later patch we'll fix gits behavior,
that will make sure untracked files are not deleted.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-submodule-update.sh: clarify testStefan Beller Fri, 5 Jan 2018 20:03:01 +0000 (12:03 -0800)

t/lib-submodule-update.sh: clarify test

Keep the local branch name as the upstream branch name to avoid confusion.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perf/run: read GIT_PERF_REPO_NAME from perf.repoNameChristian Couder Fri, 5 Jan 2018 09:12:26 +0000 (10:12 +0100)

perf/run: read GIT_PERF_REPO_NAME from perf.repoName

The GIT_PERF_REPO_NAME env variable is used in
the `aggregate.perl` script to set the 'environment'
field in the JSON Codespeed output.

Let's make it easy to set this variable by setting it
in a config file.

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

perf/run: learn to send output to codespeed serverChristian Couder Fri, 5 Jan 2018 09:12:25 +0000 (10:12 +0100)

perf/run: learn to send output to codespeed server

Let's make it possible to set in a config file the URL of
a codespeed server. And then let's make the `run` script
send the perf test results to this URL at the end of the
tests.

This should make is possible to easily automate the process
of running perf tests and having their results available in
Codespeed.

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

perf/run: learn about perf.codespeedOutputChristian Couder Fri, 5 Jan 2018 09:12:24 +0000 (10:12 +0100)

perf/run: learn about perf.codespeedOutput

Let's make it possible to set in a config file the output
format (regular or codespeed) of the perf tests.

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

perf/run: add conf_opts argument to get_var_from_env_or... Christian Couder Fri, 5 Jan 2018 09:12:23 +0000 (10:12 +0100)

perf/run: add conf_opts argument to get_var_from_env_or_config()

Let's make it possible to use `git config` type specifiers like
`--int` or `--bool`, so that config values are converted to the
canonical form and easier to use.

This additional argument is now the fourth argument of
get_var_from_env_or_config() instead of the fifth because we
want the default value argument to be unset if it is not
passed, and this is simpler if it is the last argument.

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

perf/aggregate: implement codespeed JSON outputChristian Couder Fri, 5 Jan 2018 09:12:22 +0000 (10:12 +0100)

perf/aggregate: implement codespeed JSON output

Codespeed (https://github.com/tobami/codespeed/) is an open source
project that can be used to track how some software performs over
time. It stores performance test results in a database and can show
nice graphs and charts on a web interface.

As it can be interesting to use Codespeed to see how Git performance
evolves over time and releases, let's implement a Codespeed output
in "perf/aggregate.perl".

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perf/aggregate: refactor printing resultsChristian Couder Fri, 5 Jan 2018 09:12:21 +0000 (10:12 +0100)

perf/aggregate: refactor printing results

As we want to implement another kind of output than
the current output for the perf test results, let's
refactor the existing code that outputs the results
in its own print_default_results() function.

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

perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION}Christian Couder Fri, 5 Jan 2018 09:12:20 +0000 (10:12 +0100)

perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION}

The way we check ENV{GIT_PERF_SUBSECTION} could trigger
comparison between undef and "" that may be flagged by
use of strict & warnings. Let's fix that.

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

rebase -p: fix quoting when calling `git merge`Johannes Schindelin Thu, 4 Jan 2018 21:31:52 +0000 (22:31 +0100)

rebase -p: fix quoting when calling `git merge`

It has been reported that strategy arguments are not passed to `git
merge` correctly when rebasing interactively, preserving merges.

The reason is that the strategy arguments are already quoted, and then
quoted again.

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

Original-patch-by: Kim Gybels <kgybels@infogroep.be>
Also-reported-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: add and use a local copy of Mail::AddressMatthieu Moy Fri, 5 Jan 2018 18:36:51 +0000 (19:36 +0100)

send-email: add and use a local copy of Mail::Address

We used to have two versions of the email parsing code. Our
parse_mailboxes (in Git.pm), and Mail::Address which we used if
installed. Unfortunately, both versions have different sets of bugs, and
changing the behavior of git depending on whether Mail::Address is
installed was a bad idea.

A first attempt to solve this was cc90750 (send-email: don't use
Mail::Address, even if available, 2017-08-23), but it turns out our
parse_mailboxes is too buggy for some uses. For example the lack of
nested comments support breaks get_maintainer.pl in the Linux kernel
tree:

https://public-inbox.org/git/20171116154814.23785-1-alex.bennee@linaro.org/

This patch goes the other way: use Mail::Address anyway, but have a
local copy from CPAN as a fallback, when the system one is not
available.

The duplicated script is small (276 lines of code) and stable in time.
Maintaining the local copy should not be an issue, and will certainly be
less burden than maintaining our own parse_mailboxes.

Another option would be to consider Mail::Address as a hard dependency,
but it's easy enough to save the trouble of extra-dependency to the end
user or packager.

Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: use HAS_MULTI_BITS instead of counting bits manuallyStefan Beller Thu, 4 Jan 2018 22:50:44 +0000 (14:50 -0800)

diff: use HAS_MULTI_BITS instead of counting bits manually

This aligns the style to the previous patch.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: properly error out when combining multiple pickax... Stefan Beller Thu, 4 Jan 2018 22:50:43 +0000 (14:50 -0800)

diff: properly error out when combining multiple pickaxe options

In f506b8e8b5 (git log/diff: add -G<regexp> that greps in the patch text,
2010-08-23) we were hesitant to check if the user requests both -S and
-G at the same time. Now that the pickaxe family also offers --find-object,
which looks slightly more different than the former two, let's add a check
that those are not used at the same time.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore: add a pickaxe option to find a specific blobStefan Beller Thu, 4 Jan 2018 22:50:42 +0000 (14:50 -0800)

diffcore: add a pickaxe option to find a specific blob

Sometimes users are given a hash of an object and they want to
identify it further (ex.: Use verify-pack to find the largest blobs,
but what are these? or [1])

One might be tempted to extend git-describe to also work with blobs,
such that `git describe <blob-id>` gives a description as
'<commit-ish>:<path>'. This was implemented at [2]; as seen by the sheer
number of responses (>110), it turns out this is tricky to get right.
The hard part to get right is picking the correct 'commit-ish' as that
could be the commit that (re-)introduced the blob or the blob that
removed the blob; the blob could exist in different branches.

Junio hinted at a different approach of solving this problem, which this
patch implements. Teach the diff machinery another flag for restricting
the information to what is shown. For example:

$ ./git log --oneline --find-object=v2.0.0:Makefile
b2feb64309 Revert the whole "ask curl-config" topic for now
47fbfded53 i18n: only extract comments marked with "TRANSLATORS:"

we observe that the Makefile as shipped with 2.0 was appeared in
v1.9.2-471-g47fbfded53 and in v2.0.0-rc1-5-gb2feb6430b. The
reason why these commits both occur prior to v2.0.0 are evil
merges that are not found using this new mechanism.

[1] https://stackoverflow.com/questions/223678/which-commit-has-this-blob
[2] https://public-inbox.org/git/20171028004419.10139-1-sbeller@google.com/

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: introduce DIFF_PICKAXE_KINDS_MASKStefan Beller Thu, 4 Jan 2018 22:50:41 +0000 (14:50 -0800)

diff: introduce DIFF_PICKAXE_KINDS_MASK

Currently the check whether to perform pickaxing is done via checking
`diffopt->pickaxe`, which contains the command line argument that we
want to pickaxe for. Soon we'll introduce a new type of pickaxing, that
will not store anything in the `.pickaxe` field, so let's migrate the
check to be dependent on pickaxe_opts.

It is not enough to just replace the check for pickaxe by pickaxe_opts,
because flags might be set, but pickaxing was not requested ('-i').
To cope with that, introduce a mask to check only for the bits indicating
the modes of operation.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: migrate diff_flags.pickaxe_ignore_case to a picka... Stefan Beller Thu, 4 Jan 2018 22:50:40 +0000 (14:50 -0800)

diff: migrate diff_flags.pickaxe_ignore_case to a pickaxe_opts bit

Currently flags for pickaxing are found in different places. Unify the
flags into the `pickaxe_opts` field, which will contain any pickaxe related
flags.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.h: make pickaxe_opts an unsigned bit fieldStefan Beller Thu, 4 Jan 2018 22:50:39 +0000 (14:50 -0800)

diff.h: make pickaxe_opts an unsigned bit field

This variable is used as a bit field[1], and as we are about to add more
fields, indicate its usage as a bit field by making it unsigned.

[1] containing the bits

#define DIFF_PICKAXE_ALL 1
#define DIFF_PICKAXE_REGEX 2
#define DIFF_PICKAXE_KIND_S 4
#define DIFF_PICKAXE_KIND_G 8

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>