]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
5 years agocache: make hashcmp and hasheq work with larger hashes
brian m. carlson [Wed, 14 Nov 2018 04:09:30 +0000 (04:09 +0000)] 
cache: make hashcmp and hasheq work with larger hashes

In 183a638b7d ("hashcmp: assert constant hash size", 2018-08-23), we
modified hashcmp to assert that the hash size was always 20 to help it
optimize and inline calls to memcmp.  In a future series, we replaced
many calls to hashcmp and oidcmp with calls to hasheq and oideq to
improve inlining further.

However, we want to support hash algorithms other than SHA-1, namely
SHA-256.  When doing so, we must handle the case where these values are
32 bytes long as well as 20.  Adjust hashcmp to handle two cases:
20-byte matches, and maximum-size matches.  Therefore, when we include
SHA-256, we'll automatically handle it properly, while at the same time
teaching the compiler that there are only two possible options to
consider.  This will allow the compiler to write the most efficient
possible code.

Copy similar code into hasheq and perform an identical transformation.
At least with GCC 8.2.0, making hasheq defer to hashcmp when there are
two branches prevents the compiler from inlining the comparison, while
the code in this patch is inlined properly.  Add a comment to avoid an
accidental performance regression from well-intentioned refactoring.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agohex: introduce functions to print arbitrary hashes
brian m. carlson [Wed, 14 Nov 2018 04:09:29 +0000 (04:09 +0000)] 
hex: introduce functions to print arbitrary hashes

Currently, we have functions that turn an arbitrary SHA-1 value or an
object ID into hex format, either using a static buffer or with a
user-provided buffer.  Add variants of these functions that can handle
an arbitrary hash algorithm, specified by constant.  Update the
documentation as well.

While we're at it, remove the "extern" declaration from this family of
functions, since it's not needed and our style now recommends against
it.

We use the variant taking the algorithm structure pointer as the
internal variant, since taking an algorithm pointer is the easiest way
to handle all of the variants in use.

Note that we maintain these functions because there are hashes which
must change based on the hash algorithm in use but are not object IDs
(such as pack checksums).

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agosha1-file: provide functions to look up hash algorithms
brian m. carlson [Mon, 22 Oct 2018 02:43:32 +0000 (02:43 +0000)] 
sha1-file: provide functions to look up hash algorithms

There are several ways we might refer to a hash algorithm: by name, such
as in the config file; by format ID, such as in a pack; or internally,
by a pointer to the hash_algos array.  Provide functions to look up hash
algorithms based on these various forms and return the internal constant
used for them.  If conversion to another form is necessary, this
internal constant can be used to look up the proper data in the
hash_algos array.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agosha1-file: rename algorithm to "sha1"
brian m. carlson [Mon, 22 Oct 2018 02:43:31 +0000 (02:43 +0000)] 
sha1-file: rename algorithm to "sha1"

The transition plan anticipates us using a syntax such as "^{sha1}" for
disambiguation.  Since this is a syntax some people will be typing a
lot, it makes sense to provide a short, easy-to-type syntax.  Omitting
the dash doesn't create any ambiguity; however, it does make the syntax
shorter and easier to type, especially for touch typists.  In addition,
the transition plan already uses "sha1" in this context.

Rename the name of SHA-1 implementation to "sha1".

Note that this change creates no backwards compatibility concerns, since
we haven't yet used this field in any configuration settings.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoThird batch for 2.20
Junio C Hamano [Wed, 10 Oct 2018 03:38:03 +0000 (12:38 +0900)] 
Third batch for 2.20

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'ab/fsck-skiplist'
Junio C Hamano [Wed, 10 Oct 2018 03:37:16 +0000 (12:37 +0900)] 
Merge branch 'ab/fsck-skiplist'

Update fsck.skipList implementation and documentation.

* ab/fsck-skiplist:
  fsck: support comments & empty lines in skipList
  fsck: use oidset instead of oid_array for skipList
  fsck: use strbuf_getline() to read skiplist file
  fsck: add a performance test for skipList
  fsck: add a performance test
  fsck: document that skipList input must be unabbreviated
  fsck: document and test commented & empty line skipList input
  fsck: document and test sorted skipList input
  fsck tests: add a test for no skipList input
  fsck tests: setup of bogus commit object

5 years agoMerge branch 'ds/multi-pack-verify'
Junio C Hamano [Wed, 10 Oct 2018 03:37:16 +0000 (12:37 +0900)] 
Merge branch 'ds/multi-pack-verify'

"git multi-pack-index" learned to detect corruption in the .midx
file it uses, and this feature has been integrated into "git fsck".

* ds/multi-pack-verify:
  fsck: verify multi-pack-index
  multi-pack-index: report progress during 'verify'
  multi-pack-index: verify object offsets
  multi-pack-index: fix 32-bit vs 64-bit size check
  multi-pack-index: verify oid lookup order
  multi-pack-index: verify oid fanout order
  multi-pack-index: verify missing pack
  multi-pack-index: verify packname order
  multi-pack-index: verify corrupt chunk lookup table
  multi-pack-index: verify bad header
  multi-pack-index: add 'verify' verb

5 years agoMerge branch 'bc/hash-independent-tests'
Junio C Hamano [Wed, 10 Oct 2018 03:37:16 +0000 (12:37 +0900)] 
Merge branch 'bc/hash-independent-tests'

Various tests have been updated to make it easier to swap the
hash function used for object identification.

* bc/hash-independent-tests:
  t5318: use test_oid for HASH_LEN
  t1407: make hash size independent
  t1406: make hash-size independent
  t1405: make hash size independent
  t1400: switch hard-coded object ID to variable
  t1006: make hash size independent
  t0064: make hash size independent
  t0002: abstract away SHA-1 specific constants
  t0000: update tests for SHA-256
  t0000: use hash translation table
  t: add test functions to translate hash-related values

5 years agoMerge branch 'nd/test-tool'
Junio C Hamano [Wed, 10 Oct 2018 03:37:16 +0000 (12:37 +0900)] 
Merge branch 'nd/test-tool'

Test helper binaries clean-up.

* nd/test-tool:
  Makefile: add a hint about TEST_BUILTINS_OBJS
  t/helper: merge test-dump-fsmonitor into test-tool
  t/helper: merge test-parse-options into test-tool
  t/helper: merge test-pkt-line into test-tool
  t/helper: merge test-dump-untracked-cache into test-tool
  t/helper: keep test-tool command list sorted

5 years agoMerge branch 'nd/config-split'
Junio C Hamano [Wed, 10 Oct 2018 03:37:15 +0000 (12:37 +0900)] 
Merge branch 'nd/config-split'

Split Documentation/config.txt for easier maintenance.

* nd/config-split:
  config.txt: move submodule part out to a separate file
  config.txt: move sequence.editor out of "core" part
  config.txt: move sendemail part out to a separate file
  config.txt: move receive part out to a separate file
  config.txt: move push part out to a separate file
  config.txt: move pull part out to a separate file
  config.txt: move gui part out to a separate file
  config.txt: move gitcvs part out to a separate file
  config.txt: move format part out to a separate file
  config.txt: move fetch part out to a separate file
  config.txt: follow camelCase naming

5 years agoDeclare that the next one will be named 2.20
Junio C Hamano [Wed, 10 Oct 2018 00:20:03 +0000 (09:20 +0900)] 
Declare that the next one will be named 2.20

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSync with 2.19.1
Junio C Hamano [Thu, 27 Sep 2018 18:53:39 +0000 (11:53 -0700)] 
Sync with 2.19.1

* maint:
  Git 2.19.1
  Git 2.18.1
  Git 2.17.2
  fsck: detect submodule paths starting with dash
  fsck: detect submodule urls starting with dash
  Git 2.16.5
  Git 2.15.3
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options

5 years agoGit 2.19.1 v2.19.1
Junio C Hamano [Thu, 27 Sep 2018 18:52:33 +0000 (11:52 -0700)] 
Git 2.19.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSync with 2.18.1
Junio C Hamano [Thu, 27 Sep 2018 18:50:45 +0000 (11:50 -0700)] 
Sync with 2.18.1

* maint-2.18:
  Git 2.18.1
  Git 2.17.2
  fsck: detect submodule paths starting with dash
  fsck: detect submodule urls starting with dash
  Git 2.16.5
  Git 2.15.3
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options

5 years agoGit 2.18.1 v2.18.1
Junio C Hamano [Thu, 27 Sep 2018 18:48:19 +0000 (11:48 -0700)] 
Git 2.18.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSync with 2.17.2
Junio C Hamano [Thu, 27 Sep 2018 18:45:01 +0000 (11:45 -0700)] 
Sync with 2.17.2

* maint-2.17:
  Git 2.17.2
  fsck: detect submodule paths starting with dash
  fsck: detect submodule urls starting with dash
  Git 2.16.5
  Git 2.15.3
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options

5 years agoGit 2.17.2 v2.17.2
Junio C Hamano [Thu, 27 Sep 2018 18:44:07 +0000 (11:44 -0700)] 
Git 2.17.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agofsck: detect submodule paths starting with dash
Jeff King [Mon, 24 Sep 2018 08:42:19 +0000 (04:42 -0400)] 
fsck: detect submodule paths starting with dash

As with urls, submodule paths with dashes are ignored by
git, but may end up confusing older versions. Detecting them
via fsck lets us prevent modern versions of git from being a
vector to spread broken .gitmodules to older versions.

Compared to blocking leading-dash urls, though, this
detection may be less of a good idea:

  1. While such paths provide confusing and broken results,
     they don't seem to actually work as option injections
     against anything except "cd". In particular, the
     submodule code seems to canonicalize to an absolute
     path before running "git clone" (so it passes
     /your/clone/-sub).

  2. It's more likely that we may one day make such names
     actually work correctly. Even after we revert this fsck
     check, it will continue to be a hassle until hosting
     servers are all updated.

On the other hand, it's not entirely clear that the behavior
in older versions is safe. And if we do want to eventually
allow this, we may end up doing so with a special syntax
anyway (e.g., writing "./-sub" in the .gitmodules file, and
teaching the submodule code to canonicalize it when
comparing).

So on balance, this is probably a good protection.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agofsck: detect submodule urls starting with dash
Jeff King [Mon, 24 Sep 2018 08:37:17 +0000 (04:37 -0400)] 
fsck: detect submodule urls starting with dash

Urls with leading dashes can cause mischief on older
versions of Git. We should detect them so that they can be
rejected by receive.fsckObjects, preventing modern versions
of git from being a vector by which attacks can spread.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSync with 2.16.5
Junio C Hamano [Thu, 27 Sep 2018 18:41:02 +0000 (11:41 -0700)] 
Sync with 2.16.5

* maint-2.16:
  Git 2.16.5
  Git 2.15.3
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options

5 years agoGit 2.16.5 v2.16.5
Junio C Hamano [Thu, 27 Sep 2018 18:38:32 +0000 (11:38 -0700)] 
Git 2.16.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSync with 2.15.3
Junio C Hamano [Thu, 27 Sep 2018 18:35:43 +0000 (11:35 -0700)] 
Sync with 2.15.3

* maint-2.15:
  Git 2.15.3
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options

5 years agoGit 2.15.3 v2.15.3
Junio C Hamano [Thu, 27 Sep 2018 18:33:47 +0000 (11:33 -0700)] 
Git 2.15.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSync with Git 2.14.4
Junio C Hamano [Thu, 27 Sep 2018 18:20:22 +0000 (11:20 -0700)] 
Sync with Git 2.14.4

* maint-2.14:
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options

5 years agoGit 2.14.5 v2.14.5
Junio C Hamano [Thu, 27 Sep 2018 18:19:11 +0000 (11:19 -0700)] 
Git 2.14.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agosubmodule-config: ban submodule paths that start with a dash
Jeff King [Mon, 24 Sep 2018 08:39:55 +0000 (04:39 -0400)] 
submodule-config: ban submodule paths that start with a dash

We recently banned submodule urls that look like
command-line options. This is the matching change to ban
leading-dash paths.

As with the urls, this should not break any use cases that
currently work. Even with our "--" separator passed to
git-clone, git-submodule.sh gets confused. Without the code
portion of this patch, the clone of "-sub" added in t7417
would yield results like:

    /path/to/git-submodule: 410: cd: Illegal option -s
    /path/to/git-submodule: 417: cd: Illegal option -s
    /path/to/git-submodule: 410: cd: Illegal option -s
    /path/to/git-submodule: 417: cd: Illegal option -s
    Fetched in submodule path '-sub', but it did not contain b56243f8f4eb91b2f1f8109452e659f14dd3fbe4. Direct fetching of that commit failed.

Moreover, naively adding such a submodule doesn't work:

  $ git submodule add $url -sub
  The following path is ignored by one of your .gitignore files:
  -sub

even though there is no such ignore pattern (the test script
hacks around this with a well-placed "git mv").

Unlike leading-dash urls, though, it's possible that such a
path _could_ be useful if we eventually made it work. So
this commit should be seen not as recommending a particular
policy, but rather temporarily closing off a broken and
possibly dangerous code-path. We may revisit this decision
later.

There are two minor differences to the tests in t7416 (that
covered urls):

  1. We don't have a "./-sub" escape hatch to make this
     work, since the submodule code expects to be able to
     match canonical index names to the path field (so you
     are free to add submodule config with that path, but we
     would never actually use it, since an index entry would
     never start with "./").

  2. After this patch, cloning actually succeeds. Since we
     ignore the submodule.*.path value, we fail to find a
     config stanza for our submodule at all, and simply
     treat it as inactive. We still check for the "ignoring"
     message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agosubmodule-config: ban submodule urls that start with dash
Jeff King [Mon, 24 Sep 2018 08:36:30 +0000 (04:36 -0400)] 
submodule-config: ban submodule urls that start with dash

The previous commit taught the submodule code to invoke our
"git clone $url $path" with a "--" separator so that we
aren't confused by urls or paths that start with dashes.

However, that's just one code path. It's not clear if there
are others, and it would be an easy mistake to add one in
the future. Moreover, even with the fix in the previous
commit, it's quite hard to actually do anything useful with
such an entry. Any url starting with a dash must fall into
one of three categories:

 - it's meant as a file url, like "-path". But then any
   clone is not going to have the matching path, since it's
   by definition relative inside the newly created clone. If
   you spell it as "./-path", the submodule code sees the
   "/" and translates this to an absolute path, so it at
   least works (assuming the receiver has the same
   filesystem layout as you). But that trick does not apply
   for a bare "-path".

 - it's meant as an ssh url, like "-host:path". But this
   already doesn't work, as we explicitly disallow ssh
   hostnames that begin with a dash (to avoid option
   injection against ssh).

 - it's a remote-helper scheme, like "-scheme::data". This
   _could_ work if the receiver bends over backwards and
   creates a funny-named helper like "git-remote--scheme".
   But normally there would not be any helper that matches.

Since such a url does not work today and is not likely to do
anything useful in the future, let's simply disallow them
entirely. That protects the existing "git clone" path (in a
belt-and-suspenders way), along with any others that might
exist.

Our tests cover two cases:

  1. A file url with "./" continues to work, showing that
     there's an escape hatch for people with truly silly
     repo names.

  2. A url starting with "-" is rejected.

Note that we expect case (2) to fail, but it would have done
so even without this commit, for the reasons given above.
So instead of just expecting failure, let's also check for
the magic word "ignoring" on stderr. That lets us know that
we failed for the right reason.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agosubmodule--helper: use "--" to signal end of clone options
Jeff King [Mon, 24 Sep 2018 08:32:15 +0000 (04:32 -0400)] 
submodule--helper: use "--" to signal end of clone options

When we clone a submodule, we call "git clone $url $path".
But there's nothing to say that those components can't begin
with a dash themselves, confusing git-clone into thinking
they're options. Let's pass "--" to make it clear what we
expect.

There's no test here, because it's actually quite hard to
make these names work, even with "git clone" parsing them
correctly. And we're going to restrict these cases even
further in future commits. So we'll leave off testing until
then; this is just the minimal fix to prevent us from doing
something stupid with a badly formed entry.

Reported-by: joernchen <joernchen@phenoelit.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoSecond batch post 2.19
Junio C Hamano [Mon, 24 Sep 2018 17:31:26 +0000 (10:31 -0700)] 
Second batch post 2.19

5 years agoMerge branch 'tg/range-diff-corner-case-fix'
Junio C Hamano [Mon, 24 Sep 2018 17:30:53 +0000 (10:30 -0700)] 
Merge branch 'tg/range-diff-corner-case-fix'

Recently added "range-diff" had a corner-case bug to cause it
segfault, which has been corrected.

* tg/range-diff-corner-case-fix:
  linear-assignment: fix potential out of bounds memory access

5 years agoMerge branch 'sg/split-index-test'
Junio C Hamano [Mon, 24 Sep 2018 17:30:53 +0000 (10:30 -0700)] 
Merge branch 'sg/split-index-test'

Test updates.

* sg/split-index-test:
  t0090: disable GIT_TEST_SPLIT_INDEX for the test checking split index
  t1700-split-index: drop unnecessary 'grep'

5 years agoMerge branch 'en/update-ref-no-deref-stdin'
Junio C Hamano [Mon, 24 Sep 2018 17:30:53 +0000 (10:30 -0700)] 
Merge branch 'en/update-ref-no-deref-stdin'

"git update-ref" learned to make both "--no-deref" and "--stdin"
work at the same time.

* en/update-ref-no-deref-stdin:
  update-ref: allow --no-deref with --stdin
  update-ref: fix type of update_flags variable to match its usage

5 years agoMerge branch 'ms/remote-error-message-update'
Junio C Hamano [Mon, 24 Sep 2018 17:30:52 +0000 (10:30 -0700)] 
Merge branch 'ms/remote-error-message-update'

Update error messages given by "git remote" and make them consistent.

* ms/remote-error-message-update:
  builtin/remote: quote remote name on error to display empty name

5 years agoMerge branch 'jt/lazy-object-fetch-fix'
Junio C Hamano [Mon, 24 Sep 2018 17:30:52 +0000 (10:30 -0700)] 
Merge branch 'jt/lazy-object-fetch-fix'

The code to backfill objects in lazily cloned repository did not
work correctly, which has been corrected.

* jt/lazy-object-fetch-fix:
  fetch-object: set exact_oid when fetching
  fetch-object: unify fetch_object[s] functions

5 years agoMerge branch 'en/sequencer-empty-edit-result-aborts'
Junio C Hamano [Mon, 24 Sep 2018 17:30:52 +0000 (10:30 -0700)] 
Merge branch 'en/sequencer-empty-edit-result-aborts'

"git rebase" etc. in Git 2.19 fails to abort when given an empty
commit log message as result of editing, which has been corrected.

* en/sequencer-empty-edit-result-aborts:
  sequencer: fix --allow-empty-message behavior, make it smarter

5 years agoMerge branch 'ds/reachable'
Junio C Hamano [Mon, 24 Sep 2018 17:30:52 +0000 (10:30 -0700)] 
Merge branch 'ds/reachable'

Recent update broke the reachability algorithm when refs (e.g.
tags) that point at objects that are not commit were involved,
which has been fixed.

* ds/reachable:
  commit-reach: fix memory and flag leaks
  commit-reach: properly peel tags

5 years agoMerge branch 'nd/attr-pathspec-fix'
Junio C Hamano [Mon, 24 Sep 2018 17:30:51 +0000 (10:30 -0700)] 
Merge branch 'nd/attr-pathspec-fix'

"git add ':(attr:foo)'" is not supported and is supposed to be
rejected while the command line arguments are parsed, but we fail
to reject such a command line upfront.

* nd/attr-pathspec-fix:
  add: do not accept pathspec magic 'attr'

5 years agoMerge branch 'bw/protocol-v2'
Junio C Hamano [Mon, 24 Sep 2018 17:30:50 +0000 (10:30 -0700)] 
Merge branch 'bw/protocol-v2'

Doc fix.

* bw/protocol-v2:
  config: document value 2 for protocol.version

5 years agoMerge branch 'sb/string-list-remove-unused'
Junio C Hamano [Mon, 24 Sep 2018 17:30:50 +0000 (10:30 -0700)] 
Merge branch 'sb/string-list-remove-unused'

Code clean-up.

* sb/string-list-remove-unused:
  string-list: remove unused function print_string_list

5 years agoMerge branch 'jk/dev-build-format-security'
Junio C Hamano [Mon, 24 Sep 2018 17:30:49 +0000 (10:30 -0700)] 
Merge branch 'jk/dev-build-format-security'

Build tweak to help developers.

* jk/dev-build-format-security:
  config.mak.dev: add -Wformat-security

5 years agoMerge branch 'sg/t3701-tighten-trace'
Junio C Hamano [Mon, 24 Sep 2018 17:30:49 +0000 (10:30 -0700)] 
Merge branch 'sg/t3701-tighten-trace'

Test update.

* sg/t3701-tighten-trace:
  t3701-add-interactive: tighten the check of trace output

5 years agoMerge branch 'sb/diff-color-move-more'
Junio C Hamano [Mon, 24 Sep 2018 17:30:48 +0000 (10:30 -0700)] 
Merge branch 'sb/diff-color-move-more'

Bugfix.

* sb/diff-color-move-more:
  diff: fix --color-moved-ws=allow-indentation-change

5 years agoMerge branch 'en/rerere-multi-stage-1-fix'
Junio C Hamano [Mon, 24 Sep 2018 17:30:48 +0000 (10:30 -0700)] 
Merge branch 'en/rerere-multi-stage-1-fix'

A corner case bugfix in "git rerere" code.

* en/rerere-multi-stage-1-fix:
  rerere: avoid buffer overrun
  t4200: demonstrate rerere segfault on specially crafted merge

5 years agoMerge branch 'js/mingw-o-append'
Junio C Hamano [Mon, 24 Sep 2018 17:30:47 +0000 (10:30 -0700)] 
Merge branch 'js/mingw-o-append'

Further fix for O_APPEND emulation on Windows

* js/mingw-o-append:
  mingw: fix mingw_open_append to work with named pipes
  t0051: test GIT_TRACE to a windows named pipe

5 years agoMerge branch 'en/double-semicolon-fix'
Junio C Hamano [Mon, 24 Sep 2018 17:30:47 +0000 (10:30 -0700)] 
Merge branch 'en/double-semicolon-fix'

Code clean-up.

* en/double-semicolon-fix:
  Remove superfluous trailing semicolons

5 years agoMerge branch 'jk/reopen-tempfile-truncate'
Junio C Hamano [Mon, 24 Sep 2018 17:30:46 +0000 (10:30 -0700)] 
Merge branch 'jk/reopen-tempfile-truncate'

Fix for a long-standing bug that leaves the index file corrupt when
it shrinks during a partial commit.

* jk/reopen-tempfile-truncate:
  reopen_tempfile(): truncate opened file

5 years agoMerge branch 'bp/mv-submodules-with-fsmonitor'
Junio C Hamano [Mon, 24 Sep 2018 17:30:46 +0000 (10:30 -0700)] 
Merge branch 'bp/mv-submodules-with-fsmonitor'

When fsmonitor is in use, after operation on submodules updates
.gitmodules, we lost track of the fact that we did so and relied on
stale fsmonitor data.

* bp/mv-submodules-with-fsmonitor:
  git-mv: allow submodules and fsmonitor to work together

5 years agoMerge branch 'ds/format-patch-range-diff-test'
Junio C Hamano [Mon, 24 Sep 2018 17:30:45 +0000 (10:30 -0700)] 
Merge branch 'ds/format-patch-range-diff-test'

* ds/format-patch-range-diff-test:
  t3206-range-diff.sh: cover single-patch case

5 years agoMerge branch 'tb/void-check-attr'
Junio C Hamano [Mon, 24 Sep 2018 17:30:45 +0000 (10:30 -0700)] 
Merge branch 'tb/void-check-attr'

Code clean-up.

* tb/void-check-attr:
  Make git_check_attr() a void function

5 years agoMerge branch 'js/rebase-i-autosquash-fix'
Junio C Hamano [Mon, 24 Sep 2018 17:30:45 +0000 (10:30 -0700)] 
Merge branch 'js/rebase-i-autosquash-fix'

"git rebase -i" did not clear the state files correctly when a run
of "squash/fixup" is aborted and then the user manually amended the
commit instead, which has been corrected.

* js/rebase-i-autosquash-fix:
  rebase -i: be careful to wrap up fixup/squash chains
  rebase -i --autosquash: demonstrate a problem skipping the last squash

5 years agocommit-reach: fix memory and flag leaks
Derrick Stolee [Fri, 21 Sep 2018 15:05:27 +0000 (08:05 -0700)] 
commit-reach: fix memory and flag leaks

The can_all_from_reach_with_flag() method uses 'assign_flag' as a
value we can use to mark objects temporarily during our commit walk.
The intent is that these flags are removed from all objects before
returning. However, this is not the case.

The 'from' array could also contain objects that are not commits, and
we mark those objects with 'assign_flag'. Add a loop to the 'cleanup'
section that removes these markers.

Also, we forgot to free() the memory for 'list', so add that to the
'cleanup' section.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agocommit-reach: properly peel tags
Derrick Stolee [Fri, 21 Sep 2018 15:05:26 +0000 (08:05 -0700)] 
commit-reach: properly peel tags

The can_all_from_reach_with_flag() algorithm was refactored in 4fbcca4e
"commit-reach: make can_all_from_reach... linear" but incorrectly
assumed that all objects provided were commits. During a fetch
negotiation, ok_to_give_up() in upload-pack.c may provide unpeeled tags
to the 'from' array. The current code creates a segfault.

Add a direct call to can_all_from_reach_with_flag() in 'test-tool reach'
and add a test in t6600-test-reach.sh that demonstrates this segfault.

Correct the issue by peeling tags when investigating the initial list
of objects in the 'from' array.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoadd: do not accept pathspec magic 'attr'
Nguyễn Thái Ngọc Duy [Tue, 18 Sep 2018 17:31:59 +0000 (19:31 +0200)] 
add: do not accept pathspec magic 'attr'

Commit b0db704652 (pathspec: allow querying for attributes -
2017-03-13) adds new pathspec magic 'attr' but only with
match_pathspec(). "git add" has some pathspec related code that still
does not know about 'attr' and will bail out:

    $ git add ':(attr:foo)'
    fatal: BUG:dir.c:1584: unsupported magic 40

A better solution would be making this code support 'attr'. But I
don't know how much work is needed (I'm not familiar with this new
magic). For now, let's simply reject this magic with a friendlier
message:

    $ git add ':(attr:foo)'
    fatal: :(attr:foo): pathspec magic not supported by this command: 'attr'

Update t6135 so that the expected error message is from the
"graceful" rejection codepath, not "oops, we were supposed to reject
the request to trigger this magic" codepath.

Reported-by: smaudet@sebastianaudet.com
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'ab/fetch-tags-noclobber'
Junio C Hamano [Thu, 20 Sep 2018 21:51:43 +0000 (14:51 -0700)] 
Merge branch 'ab/fetch-tags-noclobber'

The rules used by "git push" and "git fetch" to determine if a ref
can or cannot be updated were inconsistent; specifically, fetching
to update existing tags were allowed even though tags are supposed
to be unmoving anchoring points.  "git fetch" was taught to forbid
updates to existing tags without the "--force" option.
This is a backward incompatible change but in a good way; it may
still need to be treated carefully.

* ab/fetch-tags-noclobber:
  fetch doc: correct grammar in --force docs
  push doc: add spacing between two words

5 years agoMerge branch 'bp/checkout-new-branch-optim'
Junio C Hamano [Thu, 20 Sep 2018 21:51:43 +0000 (14:51 -0700)] 
Merge branch 'bp/checkout-new-branch-optim'

"git checkout -b newbranch [HEAD]" should not have to do as much as
checking out a commit different from HEAD.  An attempt is made to
optimize this special case.

* bp/checkout-new-branch-optim:
  config doc: add missing list separator for checkout.optimizeNewBranch

5 years agofetch doc: correct grammar in --force docs
Ævar Arnfjörð Bjarmason [Tue, 18 Sep 2018 05:47:39 +0000 (05:47 +0000)] 
fetch doc: correct grammar in --force docs

Correct a grammar error (saying "the receiving" made no sense) in the
recently landed documentation added in my 0bc8d71b99 ("fetch: stop
clobbering existing tags without --force", 2018-08-31) by rephrasing
the sentence.  Also correct 'fetching work the same way' by s/work/&s/;

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agopush doc: add spacing between two words
Ævar Arnfjörð Bjarmason [Tue, 18 Sep 2018 05:47:38 +0000 (05:47 +0000)] 
push doc: add spacing between two words

Fix a formatting error introduced in my recently landed
fe802bd21e ("push doc: correct lies about how push refspecs work",
2018-08-31).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoconfig doc: add missing list separator for checkout.optimizeNewBranch
Ævar Arnfjörð Bjarmason [Tue, 18 Sep 2018 05:34:49 +0000 (05:34 +0000)] 
config doc: add missing list separator for checkout.optimizeNewBranch

The documentation added in fa655d8411 ("checkout: optimize "git
checkout -b <new_branch>"", 2018-08-16) didn't add the double-colon
needed for the labeled list separator, as a result the added
documentation all got squashed into one paragraph. Fix that by adding
the list separator.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoInitial batch post 2.19
Junio C Hamano [Mon, 17 Sep 2018 21:15:00 +0000 (14:15 -0700)] 
Initial batch post 2.19

5 years agoMerge branch 'nd/bisect-show-list-fix'
Junio C Hamano [Mon, 17 Sep 2018 20:54:00 +0000 (13:54 -0700)] 
Merge branch 'nd/bisect-show-list-fix'

Debugging aid update.

* nd/bisect-show-list-fix:
  bisect.c: make show_list() build again

5 years agoMerge branch 'ab/fetch-tags-noclobber'
Junio C Hamano [Mon, 17 Sep 2018 20:54:00 +0000 (13:54 -0700)] 
Merge branch 'ab/fetch-tags-noclobber'

The rules used by "git push" and "git fetch" to determine if a ref
can or cannot be updated were inconsistent; specifically, fetching
to update existing tags were allowed even though tags are supposed
to be unmoving anchoring points.  "git fetch" was taught to forbid
updates to existing tags without the "--force" option.

* ab/fetch-tags-noclobber:
  fetch: stop clobbering existing tags without --force
  fetch: document local ref updates with/without --force
  push doc: correct lies about how push refspecs work
  push doc: move mention of "tag <tag>" later in the prose
  push doc: remove confusing mention of remote merger
  fetch tests: add a test for clobbering tag behavior
  push tests: use spaces in interpolated string
  push tests: make use of unused $1 in test description
  fetch: change "branch" to "reference" in --force -h output

5 years agoMerge branch 'es/worktree-forced-ops-fix'
Junio C Hamano [Mon, 17 Sep 2018 20:53:59 +0000 (13:53 -0700)] 
Merge branch 'es/worktree-forced-ops-fix'

Fix a bug in which the same path could be registered under multiple
worktree entries if the path was missing (for instance, was removed
manually).  Also, as a convenience, expand the number of cases in
which --force is applicable.

* es/worktree-forced-ops-fix:
  doc-diff: force worktree add
  worktree: delete .git/worktrees if empty after 'remove'
  worktree: teach 'remove' to override lock when --force given twice
  worktree: teach 'move' to override lock when --force given twice
  worktree: teach 'add' to respect --force for registered but missing path
  worktree: disallow adding same path multiple times
  worktree: prepare for more checks of whether path can become worktree
  worktree: generalize delete_git_dir() to reduce code duplication
  worktree: move delete_git_dir() earlier in file for upcoming new callers
  worktree: don't die() in library function find_worktree()

5 years agoMerge branch 'sg/doc-trace-appends'
Junio C Hamano [Mon, 17 Sep 2018 20:53:59 +0000 (13:53 -0700)] 
Merge branch 'sg/doc-trace-appends'

Docfix.

* sg/doc-trace-appends:
  Documentation/git.txt: clarify that GIT_TRACE=/path appends

5 years agoMerge branch 'jk/diff-rendered-docs'
Junio C Hamano [Mon, 17 Sep 2018 20:53:59 +0000 (13:53 -0700)] 
Merge branch 'jk/diff-rendered-docs'

Dev doc update.

* jk/diff-rendered-docs:
  Revert "doc/Makefile: drop doc-diff worktree and temporary files on "make clean""
  doc/Makefile: drop doc-diff worktree and temporary files on "make clean"
  doc-diff: add --clean mode to remove temporary working gunk
  doc-diff: fix non-portable 'man' invocation
  doc-diff: always use oids inside worktree
  SubmittingPatches: mention doc-diff

5 years agoMerge branch 'jk/patch-corrupted-delta-fix'
Junio C Hamano [Mon, 17 Sep 2018 20:53:58 +0000 (13:53 -0700)] 
Merge branch 'jk/patch-corrupted-delta-fix'

Malformed or crafted data in packstream can make our code attempt
to read or write past the allocated buffer and abort, instead of
reporting an error, which has been fixed.

* jk/patch-corrupted-delta-fix:
  t5303: use printf to generate delta bases
  patch-delta: handle truncated copy parameters
  patch-delta: consistently report corruption
  patch-delta: fix oob read
  t5303: test some corrupt deltas
  test-delta: read input into a heap buffer

5 years agoMerge branch 'ds/commit-graph-tests'
Junio C Hamano [Mon, 17 Sep 2018 20:53:58 +0000 (13:53 -0700)] 
Merge branch 'ds/commit-graph-tests'

We can now optionally run tests with commit-graph enabled.

* ds/commit-graph-tests:
  commit-graph: define GIT_TEST_COMMIT_GRAPH

5 years agoMerge branch 'jk/pack-objects-with-bitmap-fix'
Junio C Hamano [Mon, 17 Sep 2018 20:53:58 +0000 (13:53 -0700)] 
Merge branch 'jk/pack-objects-with-bitmap-fix'

Hotfix of the base topic.

* jk/pack-objects-with-bitmap-fix:
  pack-bitmap: drop "loaded" flag
  traverse_bitmap_commit_list(): don't free result
  t5310: test delta reuse with bitmaps
  bitmap_has_sha1_in_uninteresting(): drop BUG check

5 years agoMerge branch 'rs/mailinfo-format-flowed'
Junio C Hamano [Mon, 17 Sep 2018 20:53:57 +0000 (13:53 -0700)] 
Merge branch 'rs/mailinfo-format-flowed'

"git mailinfo" used in "git am" learned to make a best-effort
recovery of a patch corrupted by MUA that sends text/plain with
format=flawed option.

* rs/mailinfo-format-flowed:
  mailinfo: support format=flowed

5 years agoMerge branch 'jk/cocci'
Junio C Hamano [Mon, 17 Sep 2018 20:53:57 +0000 (13:53 -0700)] 
Merge branch 'jk/cocci'

spatch transformation to replace boolean uses of !hashcmp() to
newly introduced oideq() is added, and applied, to regain
performance lost due to support of multiple hash algorithms.

* jk/cocci:
  show_dirstat: simplify same-content check
  read-cache: use oideq() in ce_compare functions
  convert hashmap comparison functions to oideq()
  convert "hashcmp() != 0" to "!hasheq()"
  convert "oidcmp() != 0" to "!oideq()"
  convert "hashcmp() == 0" to hasheq()
  convert "oidcmp() == 0" to oideq()
  introduce hasheq() and oideq()
  coccinelle: use <...> for function exclusion

5 years agoMerge branch 'tg/rerere-doc-updates'
Junio C Hamano [Mon, 17 Sep 2018 20:53:56 +0000 (13:53 -0700)] 
Merge branch 'tg/rerere-doc-updates'

Clarify a part of technical documentation for rerere.

* tg/rerere-doc-updates:
  rerere: add note about files with existing conflict markers
  rerere: mention caveat about unmatched conflict markers

5 years agoMerge branch 'es/format-patch-rangediff'
Junio C Hamano [Mon, 17 Sep 2018 20:53:56 +0000 (13:53 -0700)] 
Merge branch 'es/format-patch-rangediff'

"git format-patch" learned a new "--range-diff" option to explain
the difference between this version and the previous attempt in
the cover letter (or after the tree-dashes as a comment).

* es/format-patch-rangediff:
  format-patch: allow --range-diff to apply to a lone-patch
  format-patch: add --creation-factor tweak for --range-diff
  format-patch: teach --range-diff to respect -v/--reroll-count
  format-patch: extend --range-diff to accept revision range
  format-patch: add --range-diff option to embed diff in cover letter
  range-diff: relieve callers of low-level configuration burden
  range-diff: publish default creation factor
  range-diff: respect diff_option.file rather than assuming 'stdout'

5 years agoMerge branch 'es/format-patch-interdiff'
Junio C Hamano [Mon, 17 Sep 2018 20:53:55 +0000 (13:53 -0700)] 
Merge branch 'es/format-patch-interdiff'

"git format-patch" learned a new "--interdiff" option to explain
the difference between this version and the previous atttempt in
the cover letter (or after the tree-dashes as a comment).

* es/format-patch-interdiff:
  format-patch: allow --interdiff to apply to a lone-patch
  log-tree: show_log: make commentary block delimiting reusable
  interdiff: teach show_interdiff() to indent interdiff
  format-patch: teach --interdiff to respect -v/--reroll-count
  format-patch: add --interdiff option to embed diff in cover letter
  format-patch: allow additional generated content in make_cover_letter()

5 years agoMerge branch 'cc/delta-islands'
Junio C Hamano [Mon, 17 Sep 2018 20:53:55 +0000 (13:53 -0700)] 
Merge branch 'cc/delta-islands'

Lift code from GitHub to restrict delta computation so that an
object that exists in one fork is not made into a delta against
another object that does not appear in the same forked repository.

* cc/delta-islands:
  pack-objects: move 'layer' into 'struct packing_data'
  pack-objects: move tree_depth into 'struct packing_data'
  t5320: tests for delta islands
  repack: add delta-islands support
  pack-objects: add delta-islands support
  pack-objects: refactor code into compute_layer_order()
  Add delta-islands.{c,h}

5 years agoMerge branch 'jk/trailer-fixes'
Junio C Hamano [Mon, 17 Sep 2018 20:53:54 +0000 (13:53 -0700)] 
Merge branch 'jk/trailer-fixes'

"git interpret-trailers" and its underlying machinery had a buggy
code that attempted to ignore patch text after commit log message,
which triggered in various codepaths that will always get the log
message alone and never get such an input.

* jk/trailer-fixes:
  append_signoff: use size_t for string offsets
  sequencer: ignore "---" divider when parsing trailers
  pretty, ref-filter: format %(trailers) with no_divider option
  interpret-trailers: allow suppressing "---" divider
  interpret-trailers: tighten check for "---" patch boundary
  trailer: pass process_trailer_opts to trailer_info_get()
  trailer: use size_t for iterating trailer list
  trailer: use size_t for string offsets

5 years agoMerge branch 'sb/range-diff-colors'
Junio C Hamano [Mon, 17 Sep 2018 20:53:54 +0000 (13:53 -0700)] 
Merge branch 'sb/range-diff-colors'

The color output support for recently introduced "range-diff"
command got tweaked a bit.

* sb/range-diff-colors:
  range-diff: indent special lines as context
  range-diff: make use of different output indicators
  diff.c: add --output-indicator-{new, old, context}
  diff.c: rewrite emit_line_0 more understandably
  diff.c: omit check for line prefix in emit_line_0
  diff: use emit_line_0 once per line
  diff.c: add set_sign to emit_line_0
  diff.c: reorder arguments for emit_line_ws_markup
  diff.c: simplify caller of emit_line_0
  t3206: add color test for range-diff --dual-color
  test_decode_color: understand FAINT and ITALIC

5 years agoMerge branch 'jk/pack-delta-reuse-with-bitmap'
Junio C Hamano [Mon, 17 Sep 2018 20:53:53 +0000 (13:53 -0700)] 
Merge branch 'jk/pack-delta-reuse-with-bitmap'

When creating a thin pack, which allows objects to be made into a
delta against another object that is not in the resulting pack but
is known to be present on the receiving end, the code learned to
take advantage of the reachability bitmap; this allows the server
to send a delta against a base beyond the "boundary" commit.

* jk/pack-delta-reuse-with-bitmap:
  pack-objects: reuse on-disk deltas for thin "have" objects
  pack-bitmap: save "have" bitmap from walk
  t/perf: add perf tests for fetches from a bitmapped server
  t/perf: add infrastructure for measuring sizes
  t/perf: factor out percent calculations
  t/perf: factor boilerplate out of test_perf

5 years agoMerge branch 'nd/unpack-trees-with-cache-tree'
Junio C Hamano [Mon, 17 Sep 2018 20:53:53 +0000 (13:53 -0700)] 
Merge branch 'nd/unpack-trees-with-cache-tree'

The unpack_trees() API used in checking out a branch and merging
walks one or more trees along with the index.  When the cache-tree
in the index tells us that we are walking a tree whose flattened
contents is known (i.e. matches a span in the index), as linearly
scanning a span in the index is much more efficient than having to
open tree objects recursively and listing their entries, the walk
can be optimized, which is done in this topic.

* nd/unpack-trees-with-cache-tree:
  Document update for nd/unpack-trees-with-cache-tree
  cache-tree: verify valid cache-tree in the test suite
  unpack-trees: add missing cache invalidation
  unpack-trees: reuse (still valid) cache-tree from src_index
  unpack-trees: reduce malloc in cache-tree walk
  unpack-trees: optimize walking same trees with cache-tree
  unpack-trees: add performance tracing
  trace.h: support nested performance tracing

5 years agoMerge branch 'ds/reachable'
Junio C Hamano [Mon, 17 Sep 2018 20:53:52 +0000 (13:53 -0700)] 
Merge branch 'ds/reachable'

The code for computing history reachability has been shuffled,
obtained a bunch of new tests to cover them, and then being
improved.

* ds/reachable:
  commit-reach: correct accidental #include of C file
  commit-reach: use can_all_from_reach
  commit-reach: make can_all_from_reach... linear
  commit-reach: replace ref_newer logic
  test-reach: test commit_contains
  test-reach: test can_all_from_reach_with_flags
  test-reach: test reduce_heads
  test-reach: test get_merge_bases_many
  test-reach: test is_descendant_of
  test-reach: test in_merge_bases
  test-reach: create new test tool for ref_newer
  commit-reach: move can_all_from_reach_with_flags
  upload-pack: generalize commit date cutoff
  upload-pack: refactor ok_to_give_up()
  upload-pack: make reachable() more generic
  commit-reach: move commit_contains from ref-filter
  commit-reach: move ref_newer from remote.c
  commit.h: remove method declarations
  commit-reach: move walk methods from commit.c

5 years agoMerge branch 'sb/submodule-update-in-c'
Junio C Hamano [Mon, 17 Sep 2018 20:53:51 +0000 (13:53 -0700)] 
Merge branch 'sb/submodule-update-in-c'

"git submodule update" is getting rewritten piece-by-piece into C.

* sb/submodule-update-in-c:
  submodule--helper: introduce new update-module-mode helper
  submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree
  builtin/submodule--helper: factor out method to update a single submodule
  builtin/submodule--helper: store update_clone information in a struct
  builtin/submodule--helper: factor out submodule updating
  git-submodule.sh: rename unused variables
  git-submodule.sh: align error reporting for update mode to use path

5 years agoMerge branch 'tg/rerere'
Junio C Hamano [Mon, 17 Sep 2018 20:53:51 +0000 (13:53 -0700)] 
Merge branch 'tg/rerere'

Fixes to "git rerere" corner cases, especially when conflict
markers cannot be parsed in the file.

* tg/rerere:
  rerere: recalculate conflict ID when unresolved conflict is committed
  rerere: teach rerere to handle nested conflicts
  rerere: return strbuf from handle path
  rerere: factor out handle_conflict function
  rerere: only return whether a path has conflicts or not
  rerere: fix crash with files rerere can't handle
  rerere: add documentation for conflict normalization
  rerere: mark strings for translation
  rerere: wrap paths in output in sq
  rerere: lowercase error messages
  rerere: unify error messages when read_cache fails

5 years agoMerge branch 'ds/multi-pack-index'
Junio C Hamano [Mon, 17 Sep 2018 20:53:50 +0000 (13:53 -0700)] 
Merge branch 'ds/multi-pack-index'

When there are too many packfiles in a repository (which is not
recommended), looking up an object in these would require
consulting many pack .idx files; a new mechanism to have a single
file that consolidates all of these .idx files is introduced.

* ds/multi-pack-index: (32 commits)
  pack-objects: consider packs in multi-pack-index
  midx: test a few commands that use get_all_packs
  treewide: use get_all_packs
  packfile: add all_packs list
  midx: fix bug that skips midx with alternates
  midx: stop reporting garbage
  midx: mark bad packed objects
  multi-pack-index: store local property
  multi-pack-index: provide more helpful usage info
  midx: clear midx on repack
  packfile: skip loading index if in multi-pack-index
  midx: prevent duplicate packfile loads
  midx: use midx in approximate_object_count
  midx: use existing midx when writing new one
  midx: use midx in abbreviation calculations
  midx: read objects from multi-pack-index
  config: create core.multiPackIndex setting
  midx: write object offsets
  midx: write object id fanout chunk
  midx: write object ids in a chunk
  ...

5 years agoMerge branch 'jk/branch-l-1-repurpose'
Junio C Hamano [Mon, 17 Sep 2018 20:53:50 +0000 (13:53 -0700)] 
Merge branch 'jk/branch-l-1-repurpose'

Updated plan to repurpose the "-l" option to "git branch".

* jk/branch-l-1-repurpose:
  doc/git-branch: remove obsolete "-l" references
  branch: make "-l" a synonym for "--list"

5 years agoMerge branch 'tg/conflict-marker-size'
Junio C Hamano [Mon, 17 Sep 2018 20:53:49 +0000 (13:53 -0700)] 
Merge branch 'tg/conflict-marker-size'

Developer aid.

* tg/conflict-marker-size:
  .gitattributes: add conflict-marker-size for relevant files

5 years agoMerge branch 'ts/doc-build-manpage-xsl-quietly'
Junio C Hamano [Mon, 17 Sep 2018 20:53:49 +0000 (13:53 -0700)] 
Merge branch 'ts/doc-build-manpage-xsl-quietly'

Build tweak.

* ts/doc-build-manpage-xsl-quietly:
  Documentation/Makefile: make manpage-base-url.xsl generation quieter

5 years agoMerge branch 'jk/rev-list-stdin-noop-is-ok'
Junio C Hamano [Mon, 17 Sep 2018 20:53:48 +0000 (13:53 -0700)] 
Merge branch 'jk/rev-list-stdin-noop-is-ok'

"git rev-list --stdin </dev/null" used to be an error; it now shows
no output without an error.  "git rev-list --stdin --default HEAD"
still falls back to the given default when nothing is given on the
standard input.

* jk/rev-list-stdin-noop-is-ok:
  rev-list: make empty --stdin not an error

5 years agoMerge branch 'bp/checkout-new-branch-optim'
Junio C Hamano [Mon, 17 Sep 2018 20:53:48 +0000 (13:53 -0700)] 
Merge branch 'bp/checkout-new-branch-optim'

"git checkout -b newbranch [HEAD]" should not have to do as much as
checking out a commit different from HEAD.  An attempt is made to
optimize this special case.

* bp/checkout-new-branch-optim:
  checkout: optimize "git checkout -b <new_branch>"

5 years agoMerge branch 'sg/t1404-update-ref-test-timeout'
Junio C Hamano [Mon, 17 Sep 2018 20:53:47 +0000 (13:53 -0700)] 
Merge branch 'sg/t1404-update-ref-test-timeout'

An attempt to unflake a test a bit.

* sg/t1404-update-ref-test-timeout:
  t1404: increase core.packedRefsTimeout to avoid occasional test failure

5 years agoMerge branch 'nd/clone-case-smashing-warning'
Junio C Hamano [Mon, 17 Sep 2018 20:53:47 +0000 (13:53 -0700)] 
Merge branch 'nd/clone-case-smashing-warning'

Running "git clone" against a project that contain two files with
pathnames that differ only in cases on a case insensitive
filesystem would result in one of the files lost because the
underlying filesystem is incapable of holding both at the same
time.  An attempt is made to detect such a case and warn.

* nd/clone-case-smashing-warning:
  clone: report duplicate entries on case-insensitive filesystems

5 years agoMerge branch 'mk/http-backend-content-length'
Junio C Hamano [Mon, 17 Sep 2018 20:53:46 +0000 (13:53 -0700)] 
Merge branch 'mk/http-backend-content-length'

Test update.

* mk/http-backend-content-length:
  http-backend test: make empty CONTENT_LENGTH test more realistic

5 years agofsck: verify multi-pack-index
Derrick Stolee [Thu, 13 Sep 2018 18:02:27 +0000 (11:02 -0700)] 
fsck: verify multi-pack-index

When core.multiPackIndex is true, we may have a multi-pack-index
in our object directory. Add calls to 'git multi-pack-index verify'
at the end of 'git fsck' if so.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: report progress during 'verify'
Derrick Stolee [Thu, 13 Sep 2018 18:02:26 +0000 (11:02 -0700)] 
multi-pack-index: report progress during 'verify'

When verifying a multi-pack-index, the only action that takes
significant time is checking the object offsets. For example,
to verify a multi-pack-index containing 6.2 million objects in
the Linux kernel repository takes 1.3 seconds on my machine.
99% of that time is spent looking up object offsets in each of
the packfiles and comparing them to the multi-pack-index offset.

Add a progress indicator for that section of the 'verify' verb.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify object offsets
Derrick Stolee [Thu, 13 Sep 2018 18:02:25 +0000 (11:02 -0700)] 
multi-pack-index: verify object offsets

The 'git multi-pack-index verify' command must verify the object
offsets stored in the multi-pack-index are correct. There are two
ways the offset chunk can be incorrect: the pack-int-id and the
object offset.

Replace the BUG() statement with a die() statement, now that we
may hit a bad pack-int-id during a 'verify' command on a corrupt
multi-pack-index, and it is covered by a test.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: fix 32-bit vs 64-bit size check
Derrick Stolee [Thu, 13 Sep 2018 18:02:23 +0000 (11:02 -0700)] 
multi-pack-index: fix 32-bit vs 64-bit size check

When loading a 64-bit offset, we intend to check that off_t can store
the resulting offset. However, the condition accidentally checks the
32-bit offset to see if it is smaller than a 64-bit value. Fix it,
and this will be covered by a test in the 'git multi-pack-index verify'
command in a later commit.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify oid lookup order
Derrick Stolee [Thu, 13 Sep 2018 18:02:22 +0000 (11:02 -0700)] 
multi-pack-index: verify oid lookup order

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify oid fanout order
Derrick Stolee [Thu, 13 Sep 2018 18:02:20 +0000 (11:02 -0700)] 
multi-pack-index: verify oid fanout order

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify missing pack
Derrick Stolee [Thu, 13 Sep 2018 18:02:19 +0000 (11:02 -0700)] 
multi-pack-index: verify missing pack

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify packname order
Derrick Stolee [Thu, 13 Sep 2018 18:02:18 +0000 (11:02 -0700)] 
multi-pack-index: verify packname order

The final check we make while loading a multi-pack-index is that
the packfile names are in lexicographical order. Make this error
be a die() instead.

In order to test this condition, we need multiple packfiles.
Earlier in t5319-multi-pack-index.sh, we tested the interaction with
'git repack' but this limits us to one packfile in our object dir.
Move these repack tests until after the 'verify' tests.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify corrupt chunk lookup table
Derrick Stolee [Thu, 13 Sep 2018 18:02:16 +0000 (11:02 -0700)] 
multi-pack-index: verify corrupt chunk lookup table

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: verify bad header
Derrick Stolee [Thu, 13 Sep 2018 18:02:15 +0000 (11:02 -0700)] 
multi-pack-index: verify bad header

When verifying if a multi-pack-index file is valid, we want the
command to fail to signal an invalid file. Previously, we wrote
an error to stderr and continued as if we had no multi-pack-index.
Now, die() instead of error().

Add tests that check corrupted headers in a few ways:

* Bad signature
* Bad file version
* Bad hash version
* Truncated hash count
* Extended hash count

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomulti-pack-index: add 'verify' verb
Derrick Stolee [Thu, 13 Sep 2018 18:02:13 +0000 (11:02 -0700)] 
multi-pack-index: add 'verify' verb

The multi-pack-index builtin writes multi-pack-index files, and
uses a 'write' verb to do so. Add a 'verify' verb that checks this
file matches the contents of the pack-indexes it replaces.

The current implementation is a no-op, but will be extended in
small increments in later commits.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>