1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-08 19:06:20 +02:00
Commit Graph

60033 Commits

Author SHA1 Message Date
Taylor Blau ab14d0676c commit-graph: pass a 'struct repository *' in more places
In a future commit, some commit-graph internals will want access to
'r->settings', but we only have the 'struct object_directory *'
corresponding to that repository.

Add an additional parameter to pass the repository around in more
places.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09 12:51:48 -07:00
Taylor Blau 025d52943e t4216: use an '&&'-chain
In a759bfa9ee (t4216: add end to end tests for git log with Bloom
filters, 2020-04-06), a 'rm' invocation was added without a
corresponding '&&' chain.

When 'trace.perf' already exists, everything works fine. However, the
function can be executed without 'trace.perf' on disk (eg., when the
subset of tests run is altered with '--run'), and so the bare 'rm'
complains about a missing file.

To remove some noise from the test log, invoke 'rm' with '-f', at which
point it is sensible to place the 'rm -f' in an '&&'-chain, which is
both (1) our usual style, and (2) avoids a broken chain in the future if
more commands are added at the beginning of the function.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09 12:51:48 -07:00
Taylor Blau 4f3644056a commit-graph: introduce 'get_bloom_filter_settings()'
Many places in the code often need a pointer to the commit-graph's
'struct bloom_filter_settings', in which case they often take the value
from the top-most commit-graph.

In the non-split case, this works as expected. In the split case,
however, things get a little tricky. Not all layers in a chain of
incremental commit-graphs are required to themselves have Bloom data,
and so whether or not some part of the code uses Bloom filters depends
entirely on whether or not the top-most level of the commit-graph chain
has Bloom filters.

This has been the behavior since Bloom filters were introduced, and has
been codified into the tests since a759bfa9ee (t4216: add end to end
tests for git log with Bloom filters, 2020-04-06). In fact, t4216.130
requires that Bloom filters are not used in exactly the case described
earlier.

There is no reason that this needs to be the case, since it is perfectly
valid for commits in an earlier layer to have Bloom filters when commits
in a newer layer do not.

Since Bloom settings are guaranteed in practice to be the same for any
layer in a chain that has Bloom data, it is sufficient to traverse the
'->base_graph' pointer until either (1) a non-null 'struct
bloom_filter_settings *' is found, or (2) until we are at the root of
the commit-graph chain.

Introduce a 'get_bloom_filter_settings()' function that does just this,
and use it instead of purely dereferencing the top-most graph's
'->bloom_filter_settings' pointer.

While we're at it, add an additional test in t5324 to guard against code
in the commit-graph writing machinery that doesn't correctly handle a
NULL 'struct bloom_filter *'.

Co-authored-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-09 12:51:48 -07:00
Junio C Hamano dc04167d37 Fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-04 13:53:58 -07:00
Junio C Hamano 5b137e8441 Merge branch 'jt/pretend-object-never-come-from-elsewhere'
The pretend-object mechanism checks if the given object already
exists in the object store before deciding to keep the data
in-core, but the check would have triggered lazy fetching of such
an object from a promissor remote.

* jt/pretend-object-never-come-from-elsewhere:
  sha1-file: make pretend_object_file() not prefetch
2020-08-04 13:53:58 -07:00
Junio C Hamano 5c454b3825 Merge branch 'jt/pack-objects-prefetch-in-batch'
While packing many objects in a repository with a promissor remote,
lazily fetching missing objects from the promissor remote one by
one may be inefficient---the code now attempts to fetch all the
missing objects in batch (obviously this won't work for a lazy
clone that lazily fetches tree objects as you cannot even enumerate
what blobs are missing until you learn which trees are missing).

* jt/pack-objects-prefetch-in-batch:
  pack-objects: prefetch objects to be packed
  pack-objects: refactor to oid_object_info_extended
2020-08-04 13:53:57 -07:00
Junio C Hamano a1315123e2 Merge branch 'mp/complete-show-color-moved'
Command line completion (in contrib/) update.

* mp/complete-show-color-moved:
  completion: add show --color-moved[-ws]
2020-08-04 13:53:56 -07:00
Junio C Hamano 85b4e0a6dc Third batch
A couple of brown-paper-bag fixes, plus the other "The branch
'master' no longer is special" fix.

Now we are ready to rewind 'next'.
2020-08-01 13:49:14 -07:00
Junio C Hamano 4083971673 Merge branch 'cc/pretty-contents-size' into master
Brown-paper-bag fix.

* cc/pretty-contents-size:
  t6300: fix issues related to %(contents:size)
2020-08-01 13:49:14 -07:00
Junio C Hamano dc3c6fb565 Merge branch 'hn/reftable' into master
Brown-paper-bag fix.

* hn/reftable:
  refs: move the logic to add \t to reflog to the files backend
2020-08-01 13:49:13 -07:00
Junio C Hamano 341a196ab6 Merge branch 'jc/fmt-merge-msg-suppress-destination' into master
"git merge" learned to selectively omit " into <branch>" at the end
of the title of default merge message with merge.suppressDest
configuration.

* jc/fmt-merge-msg-suppress-destination:
  fmt-merge-msg: allow merge destination to be omitted again
  Revert "fmt-merge-msg: stop treating `master` specially"
2020-08-01 13:49:13 -07:00
Alban Gruin 3db796c1c0 t6300: fix issues related to %(contents:size)
b6839fda68 (ref-filter: add support for %(contents:size), 2020-07-16)
added a new format for ref-filter, and added a function to generate
tests for this new feature in t6300.  Unfortunately, it tries to run
`test_expect_sucess' instead of `test_expect_success', and writes
$expect to `expected', but tries to read `expect'.  Those two issues
were probably unnoticed because the script only printed errors, but did
not crash.  This fixes these issues.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-31 13:26:19 -07:00
Han-Wen Nienhuys 25429fed5c refs: move the logic to add \t to reflog to the files backend
523fa69c (reflog: cleanse messages in the refs.c layer, 2020-07-10)
centralized reflog normalizaton.  However, the normalizaton added a
leading "\t" to the message. This is an artifact of the reflog
storage format in the files backend, so it should be added there.

Routines that parse back the reflog (such as grab_nth_branch_switch)
expect the "\t" to not be in the message, so without this fix, git
with reftable cannot process the "@{-1}" syntax.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-31 10:21:51 -07:00
Junio C Hamano e8ab941b67 The second batch -- mostly minor typofixes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30 21:34:32 -07:00
Junio C Hamano d61aed07bd Merge branch 'jb/doc-packfile-name' into master
Doc update.

* jb/doc-packfile-name:
  pack-write/docs: update regarding pack naming
2020-07-30 21:34:32 -07:00
Junio C Hamano 06df6b5fd9 Merge branch 'sg/ci-git-path-fix-with-pyenv' into master
CI fixup---tests of Python scripts didn't use the version of Git
that is being tested.

* sg/ci-git-path-fix-with-pyenv:
  ci: use absolute PYTHON_PATH in the Linux jobs
2020-07-30 21:34:30 -07:00
Junio C Hamano 5d4e13f6df Merge branch 'en/typofixes' into master
* en/typofixes:
  hashmap: fix typo in usage docs
  Remove doubled words in various comments
2020-07-30 21:34:30 -07:00
Junio C Hamano add0a35caa Merge branch 'rs/grep-simpler-parse-object-or-die-call' into master
* rs/grep-simpler-parse-object-or-die-call:
  grep: avoid using oid_to_hex() with parse_object_or_die()
2020-07-30 21:34:30 -07:00
Junio C Hamano 5942edb4ed Merge branch 'ar/help-guides-doc' into master
* ar/help-guides-doc:
  git-help.txt: fix mentions of option --guides
2020-07-30 21:34:29 -07:00
Junio C Hamano 8a111fc01f Merge branch 'sk/typofixes' into master
* sk/typofixes:
  comment: fix spelling mistakes inside comments
2020-07-30 21:34:29 -07:00
Junio C Hamano 79bcaf0062 First batch post 2.28
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30 13:20:36 -07:00
Junio C Hamano 82fafc77ba Merge branch 'en/fill-directory-exponential' into master
Fix to a regression introduced during 2.27 cycle.

* en/fill-directory-exponential:
  dir: check pathspecs before returning `path_excluded`
2020-07-30 13:20:36 -07:00
Junio C Hamano be2dab9c80 Merge branch 'ct/mv-unmerged-path-error' into master
"git mv src dst", when src is an unmerged path, errored out
correctly but with an incorrect error message to claim that src is
not tracked, which has been clarified.

* ct/mv-unmerged-path-error:
  git-mv: improve error message for conflicted file
2020-07-30 13:20:35 -07:00
Junio C Hamano c2796ac1c2 Merge branch 'bc/push-cas-cquoted-refname' into master
Pushing a ref whose name contains non-ASCII character with the
"--force-with-lease" option did not work over smart HTTP protocol,
which has been corrected.

* bc/push-cas-cquoted-refname:
  remote-curl: make --force-with-lease work with non-ASCII ref names
2020-07-30 13:20:34 -07:00
Junio C Hamano be537062af Merge branch 'cc/pretty-contents-size' into master
"git for-each-ref --format=<>" learned %(contents:size).

* cc/pretty-contents-size:
  ref-filter: add support for %(contents:size)
  t6300: test refs pointing to tree and blob
  Documentation: clarify %(contents:XXXX) doc
2020-07-30 13:20:33 -07:00
Junio C Hamano a20e20e4c8 Merge branch 'rs/add-index-entry-optim-fix' into master
Fix to an ancient bug caused by an over-eager attempt for
optimization.

* rs/add-index-entry-optim-fix:
  read-cache: remove bogus shortcut
2020-07-30 13:20:33 -07:00
Junio C Hamano 37f382a924 Merge branch 'jt/avoid-lazy-fetching-upon-have-check' into master
Fetching from a lazily cloned repository resulted at the server
side in attempts to lazy fetch objects that the client side has,
many of which will not be available from the third-party anyway.

* jt/avoid-lazy-fetching-upon-have-check:
  upload-pack: do not lazy-fetch "have" objects
2020-07-30 13:20:33 -07:00
Junio C Hamano e163cff400 Merge branch 'dl/test-must-fail-fixes-6' into master
Dev support to limit the use of test_must_fail to only git commands.

* dl/test-must-fail-fixes-6:
  test-lib-functions: restrict test_must_fail usage
  t9400: don't use test_must_fail with cvs
  t9834: remove use of `test_might_fail p4`
  t7107: don't use test_must_fail()
  t5324: reorder `run_with_limited_open_files test_might_fail`
  t3701: stop using `env` in force_color()
2020-07-30 13:20:32 -07:00
Junio C Hamano c28a2d0c12 Merge branch 'jk/reject-newer-extensions-in-v0' into master
With the base fix to 2.27 regresion, any new extensions in a v0
repository would still be silently honored, which is not quite
right.  Instead, complain and die loudly.

* jk/reject-newer-extensions-in-v0:
  verify_repository_format(): complain about new extensions in v0 repo
2020-07-30 13:20:32 -07:00
Junio C Hamano 3161cc6e6b Merge branch 'hn/reftable' into master
Preliminary clean-up of the refs API in preparation for adding a
new refs backend "reftable".

* hn/reftable:
  reflog: cleanse messages in the refs.c layer
  bisect: treat BISECT_HEAD as a pseudo ref
  t3432: use git-reflog to inspect the reflog for HEAD
  lib-t6000.sh: write tag using git-update-ref
2020-07-30 13:20:32 -07:00
Junio C Hamano f175e9b845 Merge branch 'bw/fail-cloning-into-non-empty' into master
"git clone --separate-git-dir=$elsewhere" used to stomp on the
contents of the existing directory $elsewhere, which has been
taught to fail when $elsewhere is not an empty directory.

* bw/fail-cloning-into-non-empty:
  git clone: don't clone into non-empty directory
2020-07-30 13:20:32 -07:00
Junio C Hamano 5ca82e339e Merge branch 'pb/log-rev-list-doc' into master
"git help log" has been enhanced by sharing more material from the
documentation for the underlying "git rev-list" command.

* pb/log-rev-list-doc:
  git-log.txt: include rev-list-description.txt
  git-rev-list.txt: move description to separate file
  git-rev-list.txt: tweak wording in set operations
  git-rev-list.txt: fix Asciidoc syntax
  revisions.txt: describe 'rev1 rev2 ...' meaning for ranges
  git-log.txt: add links to 'rev-list' and 'diff' docs
2020-07-30 13:20:32 -07:00
Junio C Hamano 6fc5542564 Merge branch 'jk/tests-timestamp-fix' into master
The test framework has been updated so that most tests will run
with predictable (artificial) timestamps.

* jk/tests-timestamp-fix:
  t9100: stop depending on commit timestamps
  test-lib: set deterministic default author/committer date
  t9100: explicitly unset GIT_COMMITTER_DATE
  t5539: make timestamp requirements more explicit
  t9700: loosen ident timezone regex
  t6000: use test_tick consistently
2020-07-30 13:20:31 -07:00
Junio C Hamano 70cdbbe3a7 Merge branch 'ds/commit-graph-bloom-updates' into master
Updates to the changed-paths bloom filter.

* ds/commit-graph-bloom-updates:
  commit-graph: check all leading directories in changed path Bloom filters
  revision: empty pathspecs should not use Bloom filters
  revision.c: fix whitespace
  commit-graph: check chunk sizes after writing
  commit-graph: simplify chunk writes into loop
  commit-graph: unify the signatures of all write_graph_chunk_*() functions
  commit-graph: persist existence of changed-paths
  bloom: fix logic in get_bloom_filter()
  commit-graph: change test to die on parse, not load
  commit-graph: place bloom_settings in context
2020-07-30 13:20:31 -07:00
Junio C Hamano de6dda0dc3 Merge branch 'sg/commit-graph-cleanups' into master
The changed-path Bloom filter is improved using ideas from an
independent implementation.

* sg/commit-graph-cleanups:
  commit-graph: simplify write_commit_graph_file() #2
  commit-graph: simplify write_commit_graph_file() #1
  commit-graph: simplify parse_commit_graph() #2
  commit-graph: simplify parse_commit_graph() #1
  commit-graph: clean up #includes
  diff.h: drop diff_tree_oid() & friends' return value
  commit-slab: add a function to deep free entries on the slab
  commit-graph-format.txt: all multi-byte numbers are in network byte order
  commit-graph: fix parsing the Chunk Lookup table
  tree-walk.c: don't match submodule entries for 'submod/anything'
2020-07-30 13:20:30 -07:00
Junio C Hamano 6e6029a82a fmt-merge-msg: allow merge destination to be omitted again
In Git 2.28, we stopped special casing 'master' when producing the
default merge message by just removing the code to squelch "into
'master'" at the end of the message.

Introduce multi-valued merge.suppressDest configuration variable
that gives a set of globs to match against the name of the branch
into which the merge is being made, to let users specify for which
branch fmt-merge-msg's output should be shortened.  When it is not
set, 'master' is used as the sole value of the variable by default.

The above move mostly reverts the pre-2.28 default in repositories
that have no relevant configuration.

Add a few tests to protect the behaviour with the new configuration
variable from future regression.

Helped-by: Linus Torvalds <torvalds@linux-foundation.org>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30 12:43:10 -07:00
Junio C Hamano 21531927e4 Revert "fmt-merge-msg: stop treating `master` specially"
This reverts commit 489947cee5, which
stopped treating merges into the 'master' branch as special when
preparing the default merge message.  As the goal was not to have
any single branch designated as special, it solved it by leaving the
"into <branchname>" at the end of the title of the default merge
message for any and all branches.  An obvious and easy alternative
to treat everybody equally could have been to remove it for every
branch, but that involves loss of information.

We'll introduce a new mechanism to let end-users specify merges into
which branches would omit the "into <branchname>" from the title of
the default merge message, and make the mechanism, when unconfigured,
treat the traditional 'master' special again, so all the changes to
the tests we made earlier will become unnecessary, as these tests
will be run without configuring the said new mechanism.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-30 12:41:49 -07:00
Steve Kemp 84544f2ea3 comment: fix spelling mistakes inside comments
This commit fixes a couple of minor spelling mistakes inside
comments.

Signed-off-by: Steve Kemp <steve@steve.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-29 11:39:40 -07:00
Andrei Rybak b17f411ab5 git-help.txt: fix mentions of option --guides
Fix typos introduced in commit a133737b80 ("doc: include --guide option
description for "git help"", 2013-04-02).

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-29 11:28:14 -07:00
René Scharfe 98c6871fad grep: avoid using oid_to_hex() with parse_object_or_die()
parse_object_or_die() is passed an object ID and a name to show if the
object cannot be parsed.  If the name is NULL then it shows the
hexadecimal object ID.  Use that feature instead of preparing and
passing the hexadecimal representation to the function proactively.
That's shorter and a bit more efficient.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-28 15:26:12 -07:00
Elijah Newren 861c4ce141 hashmap: fix typo in usage docs
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-28 14:28:15 -07:00
Elijah Newren 6d12b533b7 Remove doubled words in various comments
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-28 14:28:14 -07:00
Junio C Hamano 47ae905ffb Git 2.28
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-26 18:01:43 -07:00
Junio C Hamano 5c06d60fc5 l10n-2.28.0-rnd1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAl8dqyoACgkQk24VDd1F
 MtXdPQ//aSYf0cbPq9oqRIP+DevGiUMQ8D0khHe9xwp3NMyRLBLxvae7KgIS3NYY
 aKErD3lFBq1tgrm+9OzRXpVOzjKjMcIeSzuSIotVJB2IZt52UMvmh5fNkgcUXiz8
 Dl1EEmU8Jxl9fSAKImrWLMs5yEYCqy9pA1os3MqhU0ksDuOBcAyMVJAE6wTjfZq8
 02ka02IN60jhrdTkAM1yT1X7EuzXmnIHm/k3i0fIqb78+NC8n/aw1zOkQUp8A3HF
 c/1cwHylMo6SCT53ZQUdeUIHZIbBLhdsG0zVpCGCaDvZSPO3DdGvTW5d0Slh5ZAh
 Nc/xp0rBsuBFANiUREC1sqBGszEtE7mHRqSJlrYbyL59Ff+qFQoqyJpveowtfFI3
 E+1tsLSUj93D3ALWEzCrNAvFJyQnUrMV7bStkTNz+/9BqjLfFtz8L7O4WPPE9MHg
 hHzxHq+edeYn+T8N/2hgRe3eVsOm7097ZnEpK1+EGPexmFoy5i71vIHc8s07s+J0
 NcucUIxkd1fiDwqV/54M2JP+f/2KCF9ScL2c5Tt/Hsjcg0xK/IfBvC5LaIGMongo
 Ua5qhjZGPpmPUWtrnwIRNEgRaaE8uY+UHr6IM1NolDO4gPEp8rUEm7DK9ETxDLym
 uQD+0KNWTx4j0vvyfTyoj9vlO8WCjXXIy+A8+f19gVQYiKbHxNw=
 =UWGH
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.28.0-rnd1' of https://www.github.com/git-l10n/git-po into master

l10n-2.28.0-rnd1

* tag 'l10n-2.28.0-rnd1' of https://www.github.com/git-l10n/git-po:
  l10n: es: 2.28.0 round 1
  l10n: de.po: Update German translation for Git v2.28.0
  l10n: de.po: fix grammar
  l10n: zh_CN: for git v2.28.0 l10n round 1
  l10n: zh_TW.po: v2.28.0 round 1 (0 untranslated)
  l10n: vi.po: correct "ident line" translation
  l10n: vi.po(4931t): Updated translation for v2.28.0
  l10n: fr v2.28.0 round 1
  l10n: sv.po: Update Swedish translation (4931t0f0u)
  l10n: it.po: update the Italian translation for Git 2.28.0 round 1
  l10n: tr: v2.28.0 round 1
  l10n: git.pot: v2.28.0 round 1 (70 new, 14 removed)
  l10n: Update Catalan translation
2020-07-26 09:48:11 -07:00
Jiang Xin 05b3a3d730 Merge branch 'master' of github.com:Softcatala/git-po
* 'master' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2020-07-27 00:05:41 +08:00
Christopher Diaz Riveros 7b0e326ba9 l10n: es: 2.28.0 round 1
Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
2020-07-26 10:12:01 -05:00
Junio C Hamano 418cca9555 Merge branch 'ps/ref-transaction-hook' into master
A new hook.

* ps/ref-transaction-hook:
  githooks.txt: use correct "reference-transaction" hook name
2020-07-24 15:54:06 -07:00
Bojun Chen 6c18d03eb8 githooks.txt: use correct "reference-transaction" hook name
The "reference transaction" hook was introduced in commit 6754159767
(refs: implement reference transaction hook, 2020-06-19). The name of
the hook is declared as "reference-transaction" in "refs.c" and
testcases, but the name declared in "githooks.txt" is different.

Signed-off-by: Bojun Chen <bojun.cbj@alibaba-inc.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-24 13:53:58 -07:00
Matthias Rüster 45f83df1b5 l10n: de.po: Update German translation for Git v2.28.0
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2020-07-24 20:35:30 +02:00
Ralf Thielow 7112e051c7 l10n: de.po: fix grammar
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2020-07-24 20:33:38 +02:00