gitweb.git
archive-tar.c: mark more strings for translationNguyễn Thái Ngọc Duy Sat, 21 Jul 2018 07:49:20 +0000 (09:49 +0200)

archive-tar.c: mark more strings for translation

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

Update messages in preparation for i18nNguyễn Thái Ngọc Duy Sat, 21 Jul 2018 07:49:19 +0000 (09:49 +0200)

Update messages in preparation for i18n

Many messages will be marked for translation in the following
commits. This commit updates some of them to be more consistent and
reduce diff noise in those commits. Changes are

- keep the first letter of die(), error() and warning() in lowercase
- no full stop in die(), error() or warning() if it's single sentence
messages
- indentation
- some messages are turned to BUG(), or prefixed with "BUG:" and will
not be marked for i18n
- some messages are improved to give more information
- some messages are broken down by sentence to be i18n friendly
(on the same token, combine multiple warning() into one big string)
- the trailing \n is converted to printf_ln if possible, or deleted
if not redundant
- errno_errno() is used instead of explicit strerror()

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

xdiff/histogram: remove tail recursionStefan Beller Thu, 19 Jul 2018 22:19:42 +0000 (15:19 -0700)

xdiff/histogram: remove tail recursion

When running the same reproduction script as the previous patch,
it turns out the stack is too small, which can be easily avoided.

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

clone: send ref-prefixes when using protocol v2Brandon Williams Fri, 20 Jul 2018 22:07:54 +0000 (15:07 -0700)

clone: send ref-prefixes when using protocol v2

Teach clone to send a list of ref-prefixes, when using protocol v2, to
allow the server to filter out irrelevant references from the
ref-advertisement. This reduces wasted time and bandwidth when cloning
repositories with a larger number of references.

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

Documentation/git-interpret-trailers: explain possible... Stefan Beller Fri, 20 Jul 2018 21:53:49 +0000 (14:53 -0700)

Documentation/git-interpret-trailers: explain possible values

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

t9300: wait for background fast-import process to die... SZEDER Gábor Thu, 19 Jul 2018 22:26:41 +0000 (00:26 +0200)

t9300: wait for background fast-import process to die after killing it

The five new tests added to 't9300-fast-import.sh' in 30e215a65c
(fast-import: checkpoint: dump branches/tags/marks even if
object_count==0, 2017-09-28), all with the prefix "V:" in their test
description, run 'git fast-import' in the background and then 'kill'
it as part of a 'test_when_finished' cleanup command. When this test
script is executed with Bash, some or even all of these tests tend to
pollute the test script's stderr, and messages about terminated
processes end up on the terminal:

$ bash ./t9300-fast-import.sh
<... snip ...>
ok 179 - V: checkpoint helper does not get stuck with extra output
/<...>/test-lib-functions.sh: line 388: 28383 Terminated git fast-import $options 0<&8 1>&9
ok 180 - V: checkpoint updates refs after reset
./t9300-fast-import.sh: line 3210: 28401 Terminated git fast-import $options 0<&8 1>&9
ok 181 - V: checkpoint updates refs and marks after commit
ok 182 - V: checkpoint updates refs and marks after commit (no new objects)
./test-lib.sh: line 634: line 3250: 28485 Terminated git fast-import $options 0<&8 1>&9
ok 183 - V: checkpoint updates tags after tag
./t9300-fast-import.sh: line 3264: 28510 Terminated git fast-import $options 0<&8 1>&9

After a background child process terminates, its parent Bash process
always outputs a message like those above to stderr, even when in
non-interactive mode.

But how do some of these messages end up on the test script's stderr,
why don't we get them from all five tests, and why do they come from
different file/line locations? Well, after sending the TERM signal to
the background child process, it takes a little while until that
process receives the signal and terminates, and then it takes another
while until the parent process notices it. During this time the
parent Bash process is continuing execution, and by the time it
notices that its child terminated it might have already left
'test_eval_inner_' and its stderr is not redirected to /dev/null
anymore. That's why such a message can appear on the test script's
stderr, while other times, when the child terminates fast and/or the
parent shell is slow enough, the message ends up in /dev/null, just
like any other output of the test does. Bash always adds the file
name and line number of the code location it was about to execute when
it notices the termination of its child process as a prefix to that
message, hence the varying and sometimes totally unrelated location
prefixes in those messages (e.g. line 388 in 'test-lib-functions.sh'
is 'test_verify_prereq', and I saw such a message pointing to
'say_color' as well).

Prevent these messages from appearing on the test script's stderr by
'wait'-ing on the pid of the background 'git fast-import' process
after sending it the TERM signal. This ensures that the executing
shell's stderr is still redirected when the shell notices the
termination of its child process in the background, and that these
messages get a consistent file/line location prefix.

Note that this is not an issue when the test script is run with Bash
and '-v', because then these messages are supposed to go to the test
script's stderr anyway, and indeed all of them do; though the
sometimes seemingly random file/line prefixes could be confusing
still. Similarly, it's not an issue with Bash and '--verbose-log'
either, because then all messages go to the log file as they should.
Finally, it's not an issue with some other shells (I tried dash, ksh,
ksh93 and mksh) even without any of the verbose options, because they
don't print messages like these in non-interactive mode in the first
place.

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

gpg-interface t: extend the existing GPG tests with... Henning Schild Fri, 20 Jul 2018 08:28:07 +0000 (10:28 +0200)

gpg-interface t: extend the existing GPG tests with GPGSM

Add test cases to cover the new X509/gpgsm support. Most of them
resemble existing ones. They just switch the format to x509 and set the
signingkey when creating signatures. Validation of signatures does not
need any configuration of git, it does need gpgsm to be configured to
trust the key(-chain).
Several of the testcases build on top of existing gpg testcases.
The commit ships a self-signed key for committer@example.com and
configures gpgsm to trust it.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff/xhistogram: move index allocation into find_lcsStefan Beller Thu, 19 Jul 2018 18:56:20 +0000 (11:56 -0700)

xdiff/xhistogram: move index allocation into find_lcs

This fixes a memory issue when recursing a lot, which can be reproduced as

seq 1 100000 >one
seq 1 4 100000 >two
git diff --no-index --histogram one two

Before this patch, histogram_diff would call itself recursively before
calling free_index, which would mean a lot of memory is allocated during
the recursion and only freed afterwards. By moving the memory allocation
(and its free call) into find_lcs, the memory is free'd before we recurse,
such that memory is reused in the next step of the recursion instead of
using new memory.

This addresses only the memory pressure, not the run time complexity,
that is also awful for the corner case outlined above.

Helpful in understanding the code (in addition to the sparse history of
this file), was https://stackoverflow.com/a/32367597 which reproduces
most of the code comments of the JGit implementation.

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

xdiff/xhistogram: factor out memory cleanup into free_i... Stefan Beller Thu, 19 Jul 2018 18:56:19 +0000 (11:56 -0700)

xdiff/xhistogram: factor out memory cleanup into free_index()

This will be useful in the next patch as we'll introduce multiple
callers.

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

xdiff/xhistogram: pass arguments directly to fall_back_... Stefan Beller Thu, 19 Jul 2018 18:56:18 +0000 (11:56 -0700)

xdiff/xhistogram: pass arguments directly to fall_back_to_classic_diff

By passing the 'xpp' and 'env' argument directly to the function
'fall_back_to_classic_diff', we eliminate an occurrence of the 'index'
in histogram_diff, which will prove useful in a bit.

While at it, move it up in the file. This will make the diff of
one of the next patches more legible.

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

diff.c: offer config option to control ws handling... Stefan Beller Wed, 18 Jul 2018 19:31:56 +0000 (12:31 -0700)

diff.c: offer config option to control ws handling in move detection

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

diff.c: add white space mode to move detection that... Stefan Beller Wed, 18 Jul 2018 19:31:55 +0000 (12:31 -0700)

diff.c: add white space mode to move detection that allows indent changes

The option of --color-moved has proven to be useful as observed on the
mailing list. However when refactoring sometimes the indentation changes,
for example when partitioning a functions into smaller helper functions
the code usually mostly moved around except for a decrease in indentation.

To just review the moved code ignoring the change in indentation, a mode
to ignore spaces in the move detection as implemented in a previous patch
would be enough. However the whole move coloring as motivated in commit
2e2d5ac (diff.c: color moved lines differently, 2017-06-30), brought
up the notion of the reviewer being able to trust the move of a "block".

As there are languages such as python, which depend on proper relative
indentation for the control flow of the program, ignoring any white space
change in a block would not uphold the promises of 2e2d5ac that allows
reviewers to pay less attention to the inside of a block, as inside
the reviewer wants to assume the same program flow.

This new mode of white space ignorance will take this into account and will
only allow the same white space changes per line in each block. This patch
even allows only for the same change at the beginning of the lines.

As this is a white space mode, it is made exclusive to other white space
modes in the move detection.

This patch brings some challenges, related to the detection of blocks.
We need a wide net to catch the possible moved lines, but then need to
narrow down to check if the blocks are still intact. Consider this
example (ignoring block sizes):

- A
- B
- C
+ A
+ B
+ C

At the beginning of a block when checking if there is a counterpart
for A, we have to ignore all space changes. However at the following
lines we have to check if the indent change stayed the same.

Checking if the indentation change did stay the same, is done by computing
the indentation change by the difference in line length, and then assume
the change is only in the beginning of the longer line, the common tail
is the same. That is why the test contains lines like:

- <TAB> A
...
+ A <TAB>
...

As the first line starting a block is caught using a compare function that
ignores white spaces unlike the rest of the block, where the white space
delta is taken into account for the comparison, we also have to think about
the following situation:

- A
- B
- A
- B
+ A
+ B
+ A
+ B

When checking if the first A (both in the + and - lines) is a start of
a block, we have to check all 'A' and record all the white space deltas
such that we can find the example above to be just one block that is
indented.

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

add core.usereplacerefs config optionJeff King Wed, 18 Jul 2018 20:45:25 +0000 (16:45 -0400)

add core.usereplacerefs config option

We can already disable replace refs using a command line
option or environment variable, but those are awkward to
apply universally. Let's add a config option to do the same
thing.

That raises the question of why one might want to do so
universally. The answer is that replace refs violate the
immutability of objects. For instance, if you wanted to
cache the diff between commit XYZ and its parent, then in
theory that never changes; the hash XYZ represents the total
state. But replace refs violate that; pushing up a new ref
may create a completely new diff.

The obvious "if it hurts, don't do it" answer is not to
create replace refs if you're doing this kind of caching.
But for a site hosting arbitrary repositories, they may want
to allow users to share replace refs with each other, but
not actually respect them on the site (because the caching
is more important than the replace feature).

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

check_replace_refs: rename to read_replace_refsJeff King Wed, 18 Jul 2018 20:45:20 +0000 (16:45 -0400)

check_replace_refs: rename to read_replace_refs

This was added as a NEEDSWORK in c3c36d7de2 (replace-object:
check_replace_refs is safe in multi repo environment, 2018-04-11),
waiting for a calmer period. Since doing so now doesn't conflict
with anything in 'pu', it seems as good a time as any.

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

check_replace_refs: fix outdated commentJeff King Wed, 18 Jul 2018 20:44:49 +0000 (16:44 -0400)

check_replace_refs: fix outdated comment

Commit afc711b8e1 (rename read_replace_refs to
check_replace_refs, 2014-02-18) added a comment mentioning
that check_replace_refs is set in two ways:

- from user intent via --no-replace-objects, etc

- after seeing there are no replace refs to respect

Since c3c36d7de2 (replace-object: check_replace_refs is safe
in multi repo environment, 2018-04-11) the second is no
longer true. Let's drop that part of the comment.

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

Third batch for 2.19 cycleJunio C Hamano Wed, 18 Jul 2018 19:24:17 +0000 (12:24 -0700)

Third batch for 2.19 cycle

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

Merge branch 'js/enhanced-version-info'Junio C Hamano Wed, 18 Jul 2018 19:20:35 +0000 (12:20 -0700)

Merge branch 'js/enhanced-version-info'

Build fix.

* js/enhanced-version-info:
Makefile: fix the "built from commit" code

Merge branch 'sb/mailmap'Junio C Hamano Wed, 18 Jul 2018 19:20:35 +0000 (12:20 -0700)

Merge branch 'sb/mailmap'

* sb/mailmap:
.mailmap: merge different spellings of names

Merge branch 'ms/core-icase-doc'Junio C Hamano Wed, 18 Jul 2018 19:20:35 +0000 (12:20 -0700)

Merge branch 'ms/core-icase-doc'

Clarify that setting core.ignoreCase to deviate from reality would
not turn a case-incapable filesystem into a case-capable one.

* ms/core-icase-doc:
Documentation: declare "core.ignoreCase" as internal variable

Merge branch 'ds/commit-graph'Junio C Hamano Wed, 18 Jul 2018 19:20:34 +0000 (12:20 -0700)

Merge branch 'ds/commit-graph'

Docfix.

* ds/commit-graph:
commit-graph: fix documentation inconsistencies

Merge branch 'tz/exclude-doc-smallfixes'Junio C Hamano Wed, 18 Jul 2018 19:20:34 +0000 (12:20 -0700)

Merge branch 'tz/exclude-doc-smallfixes'

Doc updates.

* tz/exclude-doc-smallfixes:
dir.c: fix typos in core.excludesfile comment
gitignore.txt: clarify default core.excludesfile path

Merge branch 'js/rebase-recreate-merge'Junio C Hamano Wed, 18 Jul 2018 19:20:33 +0000 (12:20 -0700)

Merge branch 'js/rebase-recreate-merge'

Docfix.

* js/rebase-recreate-merge:
rebase: fix documentation formatting

Merge branch 'en/rebase-i-microfixes'Junio C Hamano Wed, 18 Jul 2018 19:20:33 +0000 (12:20 -0700)

Merge branch 'en/rebase-i-microfixes'

* en/rebase-i-microfixes:
git-rebase--merge: modernize "git-$cmd" to "git $cmd"
Fix use of strategy options with interactive rebases
t3418: add testcase showing problems with rebase -i and strategy options

Merge branch 'mb/filter-branch-optim'Junio C Hamano Wed, 18 Jul 2018 19:20:32 +0000 (12:20 -0700)

Merge branch 'mb/filter-branch-optim'

"git filter-branch" when used with the "--state-branch" option
still attempted to rewrite the commits whose filtered result is
known from the previous attempt (which is recorded on the state
branch); the command has been corrected not to waste cycles doing
so.

* mb/filter-branch-optim:
filter-branch: skip commits present on --state-branch

Merge branch 'dj/runtime-prefix'Junio C Hamano Wed, 18 Jul 2018 19:20:32 +0000 (12:20 -0700)

Merge branch 'dj/runtime-prefix'

POSIX portability fix in Makefile to fix a glitch introduced a few
releases ago.

* dj/runtime-prefix:
Makefile: tweak sed invocation

Merge branch 'ao/config-from-gitmodules'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'ao/config-from-gitmodules'

Tighten the API to make it harder to misuse in-tree .gitmodules
file, even though it shares the same syntax with configuration
files, to read random configuration items from it.

* ao/config-from-gitmodules:
submodule-config: reuse config_from_gitmodules in repo_read_gitmodules
submodule-config: pass repository as argument to config_from_gitmodules
submodule-config: make 'config_from_gitmodules' private
submodule-config: add helper to get 'update-clone' config from .gitmodules
submodule-config: add helper function to get 'fetch' config from .gitmodules
config: move config_from_gitmodules to submodule-config.c

Merge branch 'jk/branch-l-0-deprecation'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'jk/branch-l-0-deprecation'

The "-l" option in "git branch -l" is an unfortunate short-hand for
"--create-reflog", but many users, both old and new, somehow expect
it to be something else, perhaps "--list". This step warns when "-l"
is used as a short-hand for "--create-reflog" and warns about the
future repurposing of the it when it is used.

* jk/branch-l-0-deprecation:
branch: deprecate "-l" option
t: switch "branch -l" to "branch --create-reflog"
t3200: unset core.logallrefupdates when testing reflog creation

Merge branch 'tb/grep-column'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'tb/grep-column'

"git grep" learned the "--column" option that gives not just the
line number but the column number of the hit.

* tb/grep-column:
contrib/git-jump/git-jump: jump to exact location
grep.c: add configuration variables to show matched option
builtin/grep.c: add '--column' option to 'git-grep(1)'
grep.c: display column number of first match
grep.[ch]: extend grep_opt to allow showing matched column
grep.c: expose {,inverted} match column in match_line()
Documentation/config.txt: camel-case lineNumber for consistency

Merge branch 'vs/typofixes'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'vs/typofixes'

Doc fix.

* vs/typofixes:
Documentation: spelling and grammar fixes

Merge branch 'bw/protocol-v2'Junio C Hamano Wed, 18 Jul 2018 19:20:30 +0000 (12:20 -0700)

Merge branch 'bw/protocol-v2'

Doc fix.

* bw/protocol-v2:
protocol-v2 doc: put HTTP headers after request

Merge branch 'jt/remove-pack-bitmap-global'Junio C Hamano Wed, 18 Jul 2018 19:20:30 +0000 (12:20 -0700)

Merge branch 'jt/remove-pack-bitmap-global'

The effort to move globals to per-repository in-core structure
continues.

* jt/remove-pack-bitmap-global:
pack-bitmap: add free function
pack-bitmap: remove bitmap_git global variable

Merge branch 'bw/config-refer-to-gitsubmodules-doc'Junio C Hamano Wed, 18 Jul 2018 19:20:30 +0000 (12:20 -0700)

Merge branch 'bw/config-refer-to-gitsubmodules-doc'

Docfix.

* bw/config-refer-to-gitsubmodules-doc:
docs: link to gitsubmodules

Merge branch 'xy/format-patch-prereq-patch-id-fix'Junio C Hamano Wed, 18 Jul 2018 19:20:29 +0000 (12:20 -0700)

Merge branch 'xy/format-patch-prereq-patch-id-fix'

Recently added "--base" option to "git format-patch" command did
not correctly generate prereq patch ids.

* xy/format-patch-prereq-patch-id-fix:
format-patch: clear UNINTERESTING flag before prepare_bases

Merge branch 'pw/rebase-i-keep-reword-after-conflict'Junio C Hamano Wed, 18 Jul 2018 19:20:29 +0000 (12:20 -0700)

Merge branch 'pw/rebase-i-keep-reword-after-conflict'

Bugfix for "rebase -i" corner case regression.

* pw/rebase-i-keep-reword-after-conflict:
sequencer: do not squash 'reword' commits when we hit conflicts

Merge branch 'ld/p423'Junio C Hamano Wed, 18 Jul 2018 19:20:29 +0000 (12:20 -0700)

Merge branch 'ld/p423'

Code preparation to make "git p4" closer to be usable with Python 3.

* ld/p423:
git-p4: python3: fix octal constants
git-p4: python3: use print() function
git-p4: python3: basestring workaround
git-p4: python3: remove backticks
git-p4: python3: replace dict.has_key(k) with "k in dict"
git-p4: python3: replace <> with !=

Merge branch 'ds/ewah-cleanup'Junio C Hamano Wed, 18 Jul 2018 19:20:28 +0000 (12:20 -0700)

Merge branch 'ds/ewah-cleanup'

Remove unused function definitions and declarations from ewah
bitmap subsystem.

* ds/ewah-cleanup:
ewah: delete unused 'rlwit_discharge_empty()'
ewah: drop ewah_serialize_native function
ewah: drop ewah_deserialize function
ewah_io: delete unused 'ewah_serialize()'
ewah_bitmap: delete unused 'ewah_or()'
ewah_bitmap: delete unused 'ewah_not()'
ewah_bitmap: delete unused 'ewah_and_not()'
ewah_bitmap: delete unused 'ewah_and()'
ewah/bitmap.c: delete unused 'bitmap_each_bit()'
ewah/bitmap.c: delete unused 'bitmap_clear()'

Merge branch 'sb/submodule-core-worktree'Junio C Hamano Wed, 18 Jul 2018 19:20:28 +0000 (12:20 -0700)

Merge branch 'sb/submodule-core-worktree'

"git submodule" did not correctly adjust core.worktree setting that
indicates whether/where a submodule repository has its associated
working tree across various state transitions, which has been
corrected.

* sb/submodule-core-worktree:
submodule deinit: unset core.worktree
submodule: ensure core.worktree is set after update
submodule: unset core.worktree if no working tree is present

Merge branch 'sb/object-store-grafts'Junio C Hamano Wed, 18 Jul 2018 19:20:27 +0000 (12:20 -0700)

Merge branch 'sb/object-store-grafts'

The conversion to pass "the_repository" and then "a_repository"
throughout the object access API continues.

* sb/object-store-grafts:
commit: allow lookup_commit_graft to handle arbitrary repositories
commit: allow prepare_commit_graft to handle arbitrary repositories
shallow: migrate shallow information into the object parser
path.c: migrate global git_path_* to take a repository argument
cache: convert get_graft_file to handle arbitrary repositories
commit: convert read_graft_file to handle arbitrary repositories
commit: convert register_commit_graft to handle arbitrary repositories
commit: convert commit_graft_pos() to handle arbitrary repositories
shallow: add repository argument to is_repository_shallow
shallow: add repository argument to check_shallow_file_for_update
shallow: add repository argument to register_shallow
shallow: add repository argument to set_alternate_shallow_file
commit: add repository argument to lookup_commit_graft
commit: add repository argument to prepare_commit_graft
commit: add repository argument to read_graft_file
commit: add repository argument to register_commit_graft
commit: add repository argument to commit_graft_pos
object: move grafts to object parser
object-store: move object access functions to object-store.h

Merge branch 'en/merge-recursive-cleanup'Junio C Hamano Wed, 18 Jul 2018 19:20:27 +0000 (12:20 -0700)

Merge branch 'en/merge-recursive-cleanup'

Code cleanup.

* en/merge-recursive-cleanup:
merge-recursive: add pointer about unduly complex looking code
merge-recursive: rename conflict_rename_*() family of functions
merge-recursive: clarify the rename_dir/RENAME_DIR meaning
merge-recursive: align labels with their respective code blocks
merge-recursive: fix numerous argument alignment issues
merge-recursive: fix miscellaneous grammar error in comment

Documentation: fix --color option formattingAndrei Rybak Wed, 18 Jul 2018 17:37:48 +0000 (19:37 +0200)

Documentation: fix --color option formatting

Add missing colon in two places to fix formatting of options.

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

gpg-interface: introduce new signature format "x509... Henning Schild Tue, 17 Jul 2018 12:50:12 +0000 (14:50 +0200)

gpg-interface: introduce new signature format "x509" using gpgsm

This commit allows git to create and check x509 type signatures using
gpgsm.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface: introduce new config to select per gpg... Henning Schild Tue, 17 Jul 2018 12:50:11 +0000 (14:50 +0200)

gpg-interface: introduce new config to select per gpg format program

Supporting multiple signing formats we will have the need to configure a
custom program each. Add a new config value to cater for that.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface: do not hardcode the key string len anymoreHenning Schild Tue, 17 Jul 2018 12:50:10 +0000 (14:50 +0200)

gpg-interface: do not hardcode the key string len anymore

gnupg does print the keyid followed by a space and the signer comes
next. The same pattern is also used in gpgsm, but there the key length
would be 40 instead of 16. Instead of hardcoding the expected length,
find the first space and calculate it.
Input that does not match the expected format will be ignored now,
before we jumped to found+17 which might have been behind the end of an
unexpected string.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface: introduce an abstraction for multiple... Henning Schild Tue, 17 Jul 2018 12:50:09 +0000 (14:50 +0200)

gpg-interface: introduce an abstraction for multiple gpg formats

Create a struct that holds the format details for the supported formats.
At the moment that is still just "openpgp". This commit prepares for the
introduction of more formats, that might use other programs and match
other signatures.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7510: check the validation of the new config gpg... Henning Schild Wed, 18 Jul 2018 09:30:10 +0000 (11:30 +0200)

t/t7510: check the validation of the new config gpg.format

Test setting gpg.format to both invalid and valid values.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-graph: add repo arg to graph readersJonathan Tan Wed, 11 Jul 2018 22:42:42 +0000 (15:42 -0700)

commit-graph: add repo arg to graph readers

Add a struct repository argument to the functions in commit-graph.h that
read the commit graph. (This commit does not affect functions that write
commit graphs.)

Because the commit graph functions can now read the commit graph of any
repository, the global variable core_commit_graph has been removed.
Instead, the config option core.commitGraph is now read on the first
time in a repository that a commit is attempted to be parsed using its
commit graph.

This commit includes a test that exercises the functionality on an
arbitrary repository that is not the_repository.

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

commit-graph: store graph in struct object_storeJonathan Tan Wed, 11 Jul 2018 22:42:41 +0000 (15:42 -0700)

commit-graph: store graph in struct object_store

Instead of storing commit graphs in static variables, store them in
struct object_store. There are no changes to the signatures of existing
functions - they all still only support the_repository, and support for
other instances of struct repository will be added in a subsequent
commit.

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

commit-graph: add free_commit_graphJonathan Tan Wed, 11 Jul 2018 22:42:40 +0000 (15:42 -0700)

commit-graph: add free_commit_graph

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

commit-graph: add missing forward declarationJonathan Tan Wed, 11 Jul 2018 22:42:39 +0000 (15:42 -0700)

commit-graph: add missing forward declaration

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

object-store: add missing includeJonathan Tan Wed, 11 Jul 2018 22:42:38 +0000 (15:42 -0700)

object-store: add missing include

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

commit-graph: refactor preparing commit graphJonathan Tan Wed, 11 Jul 2018 22:42:37 +0000 (15:42 -0700)

commit-graph: refactor preparing commit graph

Two functions in the code (1) check if the repository is configured for
commit graphs, (2) call prepare_commit_graph(), and (3) check if the
graph exists. Move (1) and (3) into prepare_commit_graph(), reducing
duplication of code.

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

Merge branch 'ds/commit-graph-fsck' into jt/commit... Junio C Hamano Tue, 17 Jul 2018 22:46:19 +0000 (15:46 -0700)

Merge branch 'ds/commit-graph-fsck' into jt/commit-graph-per-object-store

* ds/commit-graph-fsck: (23 commits)
coccinelle: update commit.cocci
commit-graph: update design document
gc: automatically write commit-graph files
commit-graph: add '--reachable' option
commit-graph: use string-list API for input
fsck: verify commit-graph
commit-graph: verify contents match checksum
commit-graph: test for corrupted octopus edge
commit-graph: verify commit date
commit-graph: verify generation number
commit-graph: verify parent list
commit-graph: verify root tree OIDs
commit-graph: verify objects exist
commit-graph: verify corrupt OID fanout and lookup
commit-graph: verify required chunks are present
commit-graph: verify catches corrupt signature
commit-graph: add 'verify' subcommand
commit-graph: load a root tree from specific graph
commit: force commit to parse from object database
commit-graph: parse commit from chosen graph
...

gpg-interface: add new config to select how to sign... Henning Schild Tue, 17 Jul 2018 12:50:07 +0000 (14:50 +0200)

gpg-interface: add new config to select how to sign a commit

Add "gpg.format" where the user can specify which type of signature to
use for commits. At the moment only "openpgp" is supported and the value is
not even used. This commit prepares for a new types of signatures.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: factor advance_or_nullify out of mark_color_as_... Stefan Beller Mon, 16 Jul 2018 23:05:41 +0000 (16:05 -0700)

diff.c: factor advance_or_nullify out of mark_color_as_moved

This moves the part of code that checks if we're still in a block
into its own function. We'll need a different approach on advancing
the blocks in a later patch, so having it as a separate function will
prove useful.

While at it rename the variable `p` to `prev` to indicate that it refers
to the previous line. This is as pmb[i] was assigned in the last iteration
of the outmost for loop.

Further rename `pnext` to `cur` to indicate that this should match up with
the current line of the outmost for loop.

Also replace the advancement of pmb[i] to reuse `cur` instead of
using `p->next` (which is how the name for pnext could be explained.

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

diff.c: decouple white space treatment from move detect... Stefan Beller Mon, 16 Jul 2018 23:05:40 +0000 (16:05 -0700)

diff.c: decouple white space treatment from move detection algorithm

In the original implementation of the move detection logic the choice for
ignoring white space changes is the same for the move detection as it is
for the regular diff. Some cases came up where different treatment would
have been nice.

Allow the user to specify that white space should be ignored differently
during detection of moved lines than during generation of added and removed
lines. This is done by providing analogs to the --ignore-space-at-eol,
-b, and -w options by introducing the option --color-moved-ws=<modes>
with the modes named "ignore-space-at-eol", "ignore-space-change" and
"ignore-all-space", which is used only during the move detection phase.

As we change the default, we'll adjust the tests.

For now we do not infer any options to treat white spaces in the move
detection from the generic white space options given to diff.
This can be tuned later to reasonable default.

As we plan on adding more white space related options in a later patch,
that interferes with the current white space options, use a flag field
and clamp it down to XDF_WHITESPACE_FLAGS, as that (a) allows to easily
check at parse time if we give invalid combinations and (b) can reuse
parts of this patch.

By having the white space treatment in its own option, we'll also
make it easier for a later patch to have an config option for
spaces in the move detection.

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

diff.c: add a blocks mode for moved code detectionStefan Beller Mon, 16 Jul 2018 23:05:39 +0000 (16:05 -0700)

diff.c: add a blocks mode for moved code detection

The new "blocks" mode provides a middle ground between plain and zebra.
It is as intuitive (few colors) as plain, but still has the requirement
for a minimum of lines/characters to count a block as moved.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
(https://public-inbox.org/git/87o9j0uljo.fsf@evledraar.gmail.com/)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: adjust hash function signature to match hashmap... Stefan Beller Mon, 16 Jul 2018 23:05:38 +0000 (16:05 -0700)

diff.c: adjust hash function signature to match hashmap expectation

This makes the follow up patch easier.

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

diff.c: do not pass diff options as keydata to hashmapStefan Beller Mon, 16 Jul 2018 23:05:37 +0000 (16:05 -0700)

diff.c: do not pass diff options as keydata to hashmap

When we initialize the hashmap, we give it a pointer to the
diff_options, which it then passes along to each call of the
hashmap_cmp_fn function. There's no need to pass it a second time as
the "keydata" parameter, and our comparison functions never look at
keydata.

This was a mistake left over from an earlier round of 2e2d5ac184
(diff.c: color moved lines differently, 2017-06-30), before hashmap
learned to pass the data pointer for us.

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

t4015: avoid git as a pipe inputStefan Beller Mon, 16 Jul 2018 23:05:36 +0000 (16:05 -0700)

t4015: avoid git as a pipe input

In t4015 we have a pattern of

git diff [<options, related to color>] |
grep -v "index" |
test_decode_color >actual &&

to produce output that we want to test against. This pattern was introduced
in 86b452e2769 (diff.c: add dimming to moved line detection, 2017-06-30)
as then the focus on getting the colors right. However the pattern used
is not best practice as we do care about the exit code of Git. So let's
not have Git as the upstream of a pipe. Piping the output of grep to
some function is fine as we assume grep to be un-flawed in our test suite.

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

xdiff/xdiffi.c: remove unneeded function declarationsStefan Beller Mon, 16 Jul 2018 23:05:35 +0000 (16:05 -0700)

xdiff/xdiffi.c: remove unneeded function declarations

There is no need to forward-declare these functions, as they are used
after their implementation only.

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

xdiff/xdiff.h: remove unused flagsStefan Beller Mon, 16 Jul 2018 23:05:34 +0000 (16:05 -0700)

xdiff/xdiff.h: remove unused flags

These flags were there since the beginning (3443546f6e (Use a *real*
built-in diff generator, 2006-03-24), but were never used. Remove them.

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

t/chainlint: add chainlint "specialized" test casesEric Sunshine Wed, 11 Jul 2018 06:46:42 +0000 (02:46 -0400)

t/chainlint: add chainlint "specialized" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "complex" test casesEric Sunshine Wed, 11 Jul 2018 06:46:41 +0000 (02:46 -0400)

t/chainlint: add chainlint "complex" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "cuddled" test casesEric Sunshine Wed, 11 Jul 2018 06:46:40 +0000 (02:46 -0400)

t/chainlint: add chainlint "cuddled" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "loop" and "conditional... Eric Sunshine Wed, 11 Jul 2018 06:46:39 +0000 (02:46 -0400)

t/chainlint: add chainlint "loop" and "conditional" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "nested subshell" test casesEric Sunshine Wed, 11 Jul 2018 06:46:38 +0000 (02:46 -0400)

t/chainlint: add chainlint "nested subshell" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "one-liner" test casesEric Sunshine Wed, 11 Jul 2018 06:46:37 +0000 (02:46 -0400)

t/chainlint: add chainlint "one-liner" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "whitespace" test casesEric Sunshine Wed, 11 Jul 2018 06:46:36 +0000 (02:46 -0400)

t/chainlint: add chainlint "whitespace" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/chainlint: add chainlint "basic" test casesEric Sunshine Wed, 11 Jul 2018 06:46:35 +0000 (02:46 -0400)

t/chainlint: add chainlint "basic" test cases

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection. The
heuristics handle a range of stylistic variations in existing tests
(evolved over the years), however, they are still best-guesses. As such,
it is possible for future changes to accidentally break assumptions upon
which the heuristics are based. Protect against this possibility by
adding tests which check the linter itself for correctness.

In addition to protecting against regressions, these tests help document
(for humans) expected behavior, which is important since the linter's
implementation language ('sed') does not necessarily lend itself to easy
comprehension.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/Makefile: add machinery to check correctness of chain... Eric Sunshine Wed, 11 Jul 2018 06:46:34 +0000 (02:46 -0400)

t/Makefile: add machinery to check correctness of chainlint.sed

The --chain-lint option uses heuristics and knowledge of shell syntax to
detect broken &&-chains in subshells by pure textual inspection.
Although the heuristics work well, they are still best-guesses and
future changes could accidentally break assumptions upon which they are
based. To protect against this possibility, tests checking correctness
of the linter itself will be added. As preparation, add a new makefile
"check-chainlint" target and associated machinery.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/test-lib: teach --chain-lint to detect broken &&... Eric Sunshine Wed, 11 Jul 2018 06:46:33 +0000 (02:46 -0400)

t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

The --chain-lint option detects broken &&-chains by forcing the test to
exit early (as the very first step) with a sentinel value. If that
sentinel is the test's overall exit code, then the &&-chain is intact;
if not, then the chain is broken. Unfortunately, this detection does not
extend to &&-chains within subshells even when the subshell itself is
properly linked into the outer &&-chain.

Address this shortcoming by feeding the body of the test to a
lightweight "linter" which can peer inside subshells and identify broken
&&-chains by pure textual inspection. Although the linter does not
actually parse shell scripts, it has enough knowledge of shell syntax to
reliably deal with formatting style variations (as evolved over the
years) and to avoid being fooled by non-shell content (such as inside
here-docs and multi-line strings). It recognizes modern subshell
formatting:

statement1 &&
(
statement2 &&
statement3
) &&
statement4

as well as old-style:

statement1 &&
(statement2 &&
statement3) &&
statement4

Heuristics are employed to properly identify the extent of a subshell
formatted in the old-style since a number of legitimate constructs may
superficially appear to close the subshell even though they don't. For
example, it understands that neither "x=$(command)" nor "case $x in *)"
end a subshell, despite the ")" at the end of line.

Due to limitations of the tool used ('sed') and its inherent
line-by-line processing, only subshells one level deep are handled, as
well as one-liner subshells one level below that. Subshells deeper than
that or multi-line subshells at level two are passed through as-is, thus
&&-chains in their bodies are not checked.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5608: fix broken &&-chainSZEDER Gábor Thu, 12 Jul 2018 12:37:29 +0000 (14:37 +0200)

t5608: fix broken &&-chain

This was missed by the previous clean-ups.

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

send-email: fix tls AUTH when sending batchJules Maselbas Sat, 14 Jul 2018 08:58:48 +0000 (10:58 +0200)

send-email: fix tls AUTH when sending batch

The variable smtp_encryption must keep it's value between two batches.
Otherwise the authentication is skipped after the first batch.

Signed-off-by: Jules Maselbas <jules.maselbas@grenoble-inp.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/check-non-portable-shell: detect "FOO=bar shell_func"Eric Sunshine Fri, 13 Jul 2018 05:52:05 +0000 (01:52 -0400)

t/check-non-portable-shell: detect "FOO=bar shell_func"

One-shot environment variable assignments, such as 'FOO' in
"FOO=bar cmd", exist only during the invocation of 'cmd'. However, if
'cmd' happens to be a shell function, then 'FOO' is assigned in the
executing shell itself, and that assignment remains until the process
exits (unless explicitly unset). Since this side-effect of
"FOO=bar shell_func" is unlikely to be intentional, detect and report
such usage.

To distinguish shell functions from other commands, perform a pre-scan
of shell scripts named as input, gleaning a list of function names by
recognizing lines of the form (loosely matching whitespace):

shell_func () {

and later report suspect lines of the form (loosely matching quoted
values):

FOO=bar [BAR=foo ...] shell_func

Also take care to stitch together incomplete lines (those ending with
"\") since suspect invocations may be split over multiple lines:

FOO=bar BAR=foo \
shell_func

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/check-non-portable-shell: make error messages more... Eric Sunshine Fri, 13 Jul 2018 05:52:04 +0000 (01:52 -0400)

t/check-non-portable-shell: make error messages more compact

Error messages emitted by this linting script are long and noisy,
consisting of several sections:

<test-script>:<line#>: error: <explanation>: <failed-shell-text>

The line of failed shell text, usually coming from within a test body,
is often indented by one or two TABs, with the result that the actual
(important) text is separated from <explanation> by a good deal of empty
space. This can make for a difficult read, especially on typical
80-column terminals.

Make the messages more compact and perhaps a bit easier to digest by
folding out the leading whitespace from <failed-shell-text>.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/check-non-portable-shell: stop being so politeEric Sunshine Fri, 13 Jul 2018 05:52:03 +0000 (01:52 -0400)

t/check-non-portable-shell: stop being so polite

Error messages emitted by this linting script are long and noisy,
consisting of several sections:

<test-script>:<line#>: error: <explanation>: <failed-shell-text>

Many problem explanations ask the reader to "please" use a suggested
alternative, however, such politeness is unnecessary and just adds to
the noise and length of the line, so drop "please" to make the message a
bit more concise.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6046/t9833: fix use of "VAR=VAL cmd" with a shell... Eric Sunshine Fri, 13 Jul 2018 05:52:02 +0000 (01:52 -0400)

t6046/t9833: fix use of "VAR=VAL cmd" with a shell function

Unlike "FOO=bar cmd" one-shot environment variable assignments
which exist only for the invocation of 'cmd', those assigned by
"FOO=bar shell_func" exist within the running shell and continue to
do so until the process exits (or are explicitly unset). It is
unlikely that this behavior was intended by the test author.

In these particular tests, the "FOO=bar shell_func" invocations are
already in subshells, so the assignments don't last too long, don't
appear to harm subsequent commands in the same subshells, and don't
affect other tests in the same scripts, however, the usage is
nevertheless misleading and poor practice, so fix the tests to assign
and export the environment variables in the usual fashion.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/t3404-one-shot-export-fix' into es... Junio C Hamano Mon, 16 Jul 2018 21:54:55 +0000 (14:54 -0700)

Merge branch 'jc/t3404-one-shot-export-fix' into es/test-lint-one-shot-export

* jc/t3404-one-shot-export-fix:
t3404: fix use of "VAR=VAL cmd" with a shell function

negotiator/skipping: skip commits during fetchJonathan Tan Mon, 16 Jul 2018 18:44:01 +0000 (11:44 -0700)

negotiator/skipping: skip commits during fetch

Introduce a new negotiation algorithm used during fetch that skips
commits in an effort to find common ancestors faster. The skips grow
similarly to the Fibonacci sequence as the commit walk proceeds further
away from the tips. The skips may cause unnecessary commits to be
included in the packfile, but the negotiation step typically ends more
quickly.

Usage of this algorithm is guarded behind the configuration flag
fetch.negotiationAlgorithm.

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

t9119: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:24:05 +0000 (20:24 -0400)

t9119: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9000-t9999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:24:04 +0000 (20:24 -0400)

t9000-t9999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7000-t7999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:24:03 +0000 (20:24 -0400)

t7000-t7999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6000-t6999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:24:02 +0000 (20:24 -0400)

t6000-t6999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5000-t5999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:24:01 +0000 (20:24 -0400)

t5000-t5999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4000-t4999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:24:00 +0000 (20:24 -0400)

t4000-t4999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3030: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:23:59 +0000 (20:23 -0400)

t3030: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3000-t3999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:23:58 +0000 (20:23 -0400)

t3000-t3999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t2000-t2999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:23:57 +0000 (20:23 -0400)

t2000-t2999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1000-t1999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:23:56 +0000 (20:23 -0400)

t1000-t1999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0000-t0999: fix broken &&-chainsEric Sunshine Mon, 2 Jul 2018 00:23:55 +0000 (20:23 -0400)

t0000-t0999: fix broken &&-chains

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9814: simplify convoluted check that command correctly... Eric Sunshine Mon, 2 Jul 2018 00:23:54 +0000 (20:23 -0400)

t9814: simplify convoluted check that command correctly errors out

This test uses a convoluted method to verify that "p4 help" errors
out when asked for help about an unknown command. In doing so, it
intentionally breaks the &&-chain. Simplify by employing the typical
"! command" idiom and a normal &&-chain instead.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9001: fix broken "invoke hook" testEric Sunshine Mon, 2 Jul 2018 00:23:53 +0000 (20:23 -0400)

t9001: fix broken "invoke hook" test

This test has been dysfunctional since it was added by 6489660b4b
(send-email: support validate hook, 2017-05-12), however, the problem
went unnoticed due to a broken &&-chain late in the test.

The test wants to verify that a non-zero exit code from the
'sendemail-validate' hook causes git-send-email to abort with a
particular error message. A command which is expected to fail should be
run with 'test_must_fail', however, the test neglects to do so.

Fix this problem, as well as the broken &&-chain behind which the
problem hid.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7810: use test_expect_code() instead of hand-rolled... Eric Sunshine Mon, 2 Jul 2018 00:23:52 +0000 (20:23 -0400)

t7810: use test_expect_code() instead of hand-rolled comparison

This test manually checks the exit code of git-grep for a particular
value. In doing so, it intentionally breaks the &&-chain. Modernize the
test by taking advantage of test_expect_code() and a normal &&-chain.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7400: fix broken "submodule add/reconfigure --force... Eric Sunshine Mon, 2 Jul 2018 00:23:51 +0000 (20:23 -0400)

t7400: fix broken "submodule add/reconfigure --force" test

This test has been dysfunctional since it was added by 619acfc78c
(submodule add: extend force flag to add existing repos, 2016-10-06),
however, two problems early in the test went unnoticed due to a broken
&&-chain later in the test.

First, it tries configuring the submodule with repository "bogus-url",
however, "git submodule add" insists that the repository be either an
absolute URL or a relative pathname requiring prefix "./" or "../" (this
is true even with --force), but "bogus-url" does not meet those
criteria, thus the command fails.

Second, it then tries configuring a submodule with a path which is
.gitignore'd, which is disallowed. This restriction can be overridden
with --force, but the test neglects to use that option.

Fix both problems, as well as the broken &&-chain behind which they hid.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcbuild/README: update to accommodate for missing commo... Johannes Schindelin Fri, 22 Jun 2018 11:09:11 +0000 (13:09 +0200)

vcbuild/README: update to accommodate for missing common-cmds.h

In 60f487ac0ef (Remove common-cmds.h, 2018-05-10), we forgot to adjust
this README when removing the common-cmds.h file.

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

pretty: switch hard-coded constants to the_hash_algobrian m. carlson Mon, 16 Jul 2018 01:28:08 +0000 (01:28 +0000)

pretty: switch hard-coded constants to the_hash_algo

Switch several hard-coded constants into expressions based either on
GIT_MAX_HEXSZ or the_hash_algo.

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

sha1-file: convert constants to uses of the_hash_algobrian m. carlson Mon, 16 Jul 2018 01:28:07 +0000 (01:28 +0000)

sha1-file: convert constants to uses of the_hash_algo

Convert one use of 20 and several uses of GIT_SHA1_HEXSZ into references
to the_hash_algo.

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

log-tree: switch GIT_SHA1_HEXSZ to the_hash_algo->hexszbrian m. carlson Mon, 16 Jul 2018 01:28:06 +0000 (01:28 +0000)

log-tree: switch GIT_SHA1_HEXSZ to the_hash_algo->hexsz

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

diff: switch GIT_SHA1_HEXSZ to use the_hash_algobrian m. carlson Mon, 16 Jul 2018 01:28:05 +0000 (01:28 +0000)

diff: switch GIT_SHA1_HEXSZ to use the_hash_algo

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

builtin/merge-recursive: make hash independentbrian m. carlson Mon, 16 Jul 2018 01:28:04 +0000 (01:28 +0000)

builtin/merge-recursive: make hash independent

Use GIT_MAX_HEXSZ instead of GIT_SHA1_HEXSZ for an allocation so that it
is sufficiently large. Switch a comparison to use the_hash_algo to
determine the length of a hex object ID.

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