]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 years agoMerge branch 'tb/t5318-cleanup'
Junio C Hamano [Thu, 18 Jun 2020 04:54:00 +0000 (21:54 -0700)] 
Merge branch 'tb/t5318-cleanup'

Code cleanup.

* tb/t5318-cleanup:
  t5318: test that '--stdin-commits' respects '--[no-]progress'
  t5318: use 'test_must_be_empty'

3 years agoMerge branch 'jk/diff-memuse-optim-with-stat-unmatch'
Junio C Hamano [Thu, 18 Jun 2020 04:54:00 +0000 (21:54 -0700)] 
Merge branch 'jk/diff-memuse-optim-with-stat-unmatch'

Reduce memory usage during "diff --quiet" in a worktree with too
many stat-unmatched paths.

* jk/diff-memuse-optim-with-stat-unmatch:
  diff: discard blob data from stat-unmatched pairs

3 years agoMerge branch 'hn/refs-cleanup'
Junio C Hamano [Fri, 12 Jun 2020 20:57:13 +0000 (13:57 -0700)] 
Merge branch 'hn/refs-cleanup'

Preliminary clean-ups around refs API, plus file format
specification documentation for the reftable backend.

* hn/refs-cleanup:
  reftable: define version 2 of the spec to accomodate SHA256
  reftable: clarify how empty tables should be written
  reftable: file format documentation
  refs: improve documentation for ref iterator
  t: use update-ref and show-ref to reading/writing refs
  refs.h: clarify reflog iteration order

3 years agoreftable: define version 2 of the spec to accomodate SHA256
Han-Wen Nienhuys [Wed, 20 May 2020 17:36:12 +0000 (17:36 +0000)] 
reftable: define version 2 of the spec to accomodate SHA256

Version appends a hash ID to the file header, making it slightly larger.

This commit also changes "SHA-1" into "object ID" in many places.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoreftable: clarify how empty tables should be written
Han-Wen Nienhuys [Wed, 20 May 2020 17:36:11 +0000 (17:36 +0000)] 
reftable: clarify how empty tables should be written

The format allows for some ambiguity, as a lone footer also starts
with a valid file header. However, the current JGit code will barf on
this. This commit codifies this behavior into the standard.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoreftable: file format documentation
Jonathan Nieder [Wed, 20 May 2020 17:36:10 +0000 (17:36 +0000)] 
reftable: file format documentation

Shawn Pearce explains:

Some repositories contain a lot of references (e.g. android at 866k,
rails at 31k). The reftable format provides:

- Near constant time lookup for any single reference, even when the
  repository is cold and not in process or kernel cache.
- Near constant time verification if a SHA-1 is referred to by at least
  one reference (for allow-tip-sha1-in-want).
- Efficient lookup of an entire namespace, such as `refs/tags/`.
- Support atomic push `O(size_of_update)` operations.
- Combine reflog storage with ref storage.

This file format spec was originally written in July, 2017 by Shawn
Pearce.  Some refinements since then were made by Shawn and by Han-Wen
Nienhuys based on experiences implementing and experimenting with the
format.  (All of this was in the context of our work at Google and
Google is happy to contribute the result to the Git project.)

Imported from JGit[1]'s current version (c217d33ff,
"Documentation/technical/reftable: improve repo layout", 2020-02-04)
of Documentation/technical/reftable.md and converted to asciidoc by
running

  pandoc -t asciidoc -f markdown reftable.md >reftable.txt

using pandoc 2.2.1.  The result required the following additional
minor changes:

- removed the [TOC] directive to add a table of contents, since
  asciidoc does not support it
- replaced git-scm.com/docs links with linkgit: directives that link
  to other pages within Git's documentation

[1] https://eclipse.googlesource.com/jgit/jgit

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoThe second batch
Junio C Hamano [Tue, 9 Jun 2020 00:50:01 +0000 (17:50 -0700)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jt/curl-verbose-on-trace-curl'
Junio C Hamano [Tue, 9 Jun 2020 01:06:32 +0000 (18:06 -0700)] 
Merge branch 'jt/curl-verbose-on-trace-curl'

Rewrite support for GIT_CURL_VERBOSE in terms of GIT_TRACE_CURL.

Looking good.

* jt/curl-verbose-on-trace-curl:
  http, imap-send: stop using CURLOPT_VERBOSE
  t5551: test that GIT_TRACE_CURL redacts password

3 years agoMerge branch 'cc/upload-pack-data'
Junio C Hamano [Tue, 9 Jun 2020 01:06:32 +0000 (18:06 -0700)] 
Merge branch 'cc/upload-pack-data'

Code clean-up.

* cc/upload-pack-data:
  upload-pack: use upload_pack_data fields in receive_needs()
  upload-pack: pass upload_pack_data to create_pack_file()
  upload-pack: remove static variable 'stateless_rpc'
  upload-pack: pass upload_pack_data to check_non_tip()
  upload-pack: pass upload_pack_data to send_ref()
  upload-pack: move symref to upload_pack_data
  upload-pack: use upload_pack_data writer in receive_needs()
  upload-pack: pass upload_pack_data to receive_needs()
  upload-pack: pass upload_pack_data to get_common_commits()
  upload-pack: use 'struct upload_pack_data' in upload_pack()
  upload-pack: move 'struct upload_pack_data' around
  upload-pack: move {want,have}_obj to upload_pack_data
  upload-pack: remove unused 'wants' from upload_pack_data

3 years agoMerge branch 'cb/bisect-helper-parser-fix'
Junio C Hamano [Tue, 9 Jun 2020 01:06:31 +0000 (18:06 -0700)] 
Merge branch 'cb/bisect-helper-parser-fix'

The code to parse "git bisect start" command line was lax in
validating the arguments.

* cb/bisect-helper-parser-fix:
  bisect--helper: avoid segfault with bad syntax in `start --term-*`

3 years agoMerge branch 'js/checkout-p-new-file'
Junio C Hamano [Tue, 9 Jun 2020 01:06:31 +0000 (18:06 -0700)] 
Merge branch 'js/checkout-p-new-file'

"git checkout -p" did not handle a newly added path at all.

* js/checkout-p-new-file:
  checkout -p: handle new files correctly

3 years agoMerge branch 'dl/remote-curl-deadlock-fix'
Junio C Hamano [Tue, 9 Jun 2020 01:06:30 +0000 (18:06 -0700)] 
Merge branch 'dl/remote-curl-deadlock-fix'

On-the-wire protocol v2 easily falls into a deadlock between the
remote-curl helper and the fetch-pack process when the server side
prematurely throws an error and disconnects.  The communication has
been updated to make it more robust.

* dl/remote-curl-deadlock-fix:
  stateless-connect: send response end packet
  pkt-line: define PACKET_READ_RESPONSE_END
  remote-curl: error on incomplete packet
  pkt-line: extern packet_length()
  transport: extract common fetch_pack() call
  remote-curl: remove label indentation
  remote-curl: fix typo

3 years agoMerge branch 'bc/filter-process'
Junio C Hamano [Tue, 9 Jun 2020 01:06:30 +0000 (18:06 -0700)] 
Merge branch 'bc/filter-process'

Code simplification and test coverage enhancement.

* bc/filter-process:
  t2060: add a test for switch with --orphan and --discard-changes
  builtin/checkout: simplify metadata initialization

3 years agoMerge branch 'vs/complete-stash-show-p-fix'
Junio C Hamano [Tue, 9 Jun 2020 01:06:29 +0000 (18:06 -0700)] 
Merge branch 'vs/complete-stash-show-p-fix'

The command line completion script (in contrib/) tried to complete
"git stash -p" as if it were "git stash push -p", but it was too
aggressive and also affected "git stash show -p", which has been
corrected.

* vs/complete-stash-show-p-fix:
  completion: don't override given stash subcommand with -p

3 years agoMerge branch 'rs/fsck-duplicate-names-in-trees'
Junio C Hamano [Tue, 9 Jun 2020 01:06:28 +0000 (18:06 -0700)] 
Merge branch 'rs/fsck-duplicate-names-in-trees'

The check in "git fsck" to ensure that the tree objects are sorted
still had corner cases it missed unsorted entries.

* rs/fsck-duplicate-names-in-trees:
  fsck: detect more in-tree d/f conflicts
  t1450: demonstrate undetected in-tree d/f conflict
  t1450: increase test coverage of in-tree d/f detection
  fsck: fix a typo in a comment

3 years agoMerge branch 'es/bugreport-shell'
Junio C Hamano [Tue, 9 Jun 2020 01:06:28 +0000 (18:06 -0700)] 
Merge branch 'es/bugreport-shell'

"git bugreport" learns to report what shell is in use.

* es/bugreport-shell:
  bugreport: include user interactive shell
  help: add shell-path to --build-options

3 years agoMerge branch 'tb/commit-graph-no-check-oids'
Junio C Hamano [Tue, 9 Jun 2020 01:06:27 +0000 (18:06 -0700)] 
Merge branch 'tb/commit-graph-no-check-oids'

Clean-up the commit-graph codepath.

* tb/commit-graph-no-check-oids:
  commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag
  t5318: reorder test below 'graph_read_expect'
  commit-graph.c: simplify 'fill_oids_from_commits'
  builtin/commit-graph.c: dereference tags in builtin
  builtin/commit-graph.c: extract 'read_one_commit()'
  commit-graph.c: peel refs in 'add_ref_to_set'
  commit-graph.c: show progress of finding reachable commits
  commit-graph.c: extract 'refs_cb_data'

3 years agoMerge branch 'cb/t4210-illseq-auto-detect'
Junio C Hamano [Tue, 9 Jun 2020 01:06:27 +0000 (18:06 -0700)] 
Merge branch 'cb/t4210-illseq-auto-detect'

As FreeBSD is not the only platform whose regexp library reports
a REG_ILLSEQ error when fed invalid UTF-8, add logic to detect that
automatically and skip the affected tests.

* cb/t4210-illseq-auto-detect:
  t4210: detect REG_ILLSEQ dynamically and skip affected tests
  t/helper: teach test-regex to report pattern errors (like REG_ILLSEQ)

3 years agoMerge branch 'ds/line-log-on-bloom'
Junio C Hamano [Tue, 9 Jun 2020 01:06:26 +0000 (18:06 -0700)] 
Merge branch 'ds/line-log-on-bloom'

"git log -L..." now takes advantage of the "which paths are touched
by this commit?" info stored in the commit-graph system.

* ds/line-log-on-bloom:
  line-log: integrate with changed-path Bloom filters
  line-log: try to use generation number-based topo-ordering
  line-log: more responsive, incremental 'git log -L'
  t4211-line-log: add tests for parent oids
  line-log: remove unused fields from 'struct line_log_data'

3 years agot5318: test that '--stdin-commits' respects '--[no-]progress'
Taylor Blau [Mon, 1 Jun 2020 18:01:31 +0000 (12:01 -0600)] 
t5318: test that '--stdin-commits' respects '--[no-]progress'

The following lines were not covered in a recent line-coverage test
against Git:

  builtin/commit-graph.c
  5b6653e5 244) progress = start_delayed_progress(
  5b6653e5 268) stop_progress(&progress);

These statements are executed when both '--stdin-commits' and
'--progress' are passed. Introduce a trio of tests that exercise various
combinations of these options to ensure that these lines are covered.

More importantly, this is exercising a (somewhat) previously-ignored
feature of '--stdin-commits', which is that it respects '--progress'.
Prior to 5b6653e523 (builtin/commit-graph.c: dereference tags in
builtin, 2020-05-13), dereferencing input from '--stdin-commits' was
done inside of commit-graph.c.

Now that an additional progress meter may be generated from outside of
commit-graph.c, add a corresponding test to make sure that it also
respects '--[no]-progress'.

The other location that generates progress meter output (from d335ce8f24
(commit-graph.c: show progress of finding reachable commits,
2020-05-13)) is already covered by any test that passes '--reachable'.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot5318: use 'test_must_be_empty'
Taylor Blau [Wed, 3 Jun 2020 22:21:07 +0000 (16:21 -0600)] 
t5318: use 'test_must_be_empty'

A handful of tests in t5318 use 'test_line_count = 0 ...' to make sure
that some command does not write any output. While correct, it is more
idiomatic to use 'test_must_be_empty' instead. Switch the former
invocations to use the latter instead.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoStart the post 2.27 cycle
Junio C Hamano [Tue, 2 Jun 2020 20:34:13 +0000 (13:34 -0700)] 
Start the post 2.27 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'en/fast-import-looser-date'
Junio C Hamano [Tue, 2 Jun 2020 20:35:05 +0000 (13:35 -0700)] 
Merge branch 'en/fast-import-looser-date'

Some repositories in the wild have commits that record nonsense
committer timezone (e.g. rails.git); "git fast-import" learned an
option to pass these nonsense timestamps intact to allow recreating
existing repositories as-is.

* en/fast-import-looser-date:
  fast-import: add new --date-format=raw-permissive format

3 years agoMerge branch 'mt/zsh-completion-optim'
Junio C Hamano [Tue, 2 Jun 2020 20:35:04 +0000 (13:35 -0700)] 
Merge branch 'mt/zsh-completion-optim'

Command line completion (incontrib/) update.

* mt/zsh-completion-optim:
  completion: use native ZSH array pattern matching

3 years agoMerge branch 'la/diff-relative-config'
Junio C Hamano [Tue, 2 Jun 2020 20:35:04 +0000 (13:35 -0700)] 
Merge branch 'la/diff-relative-config'

The commands in the "diff" family learned to honor "diff.relative"
configuration variable.

* la/diff-relative-config:
  diff: add config option relative

3 years agoMerge branch 'rs/checkout-b-track-error'
Junio C Hamano [Tue, 2 Jun 2020 20:35:04 +0000 (13:35 -0700)] 
Merge branch 'rs/checkout-b-track-error'

The error message from "git checkout -b foo -t bar baz" was
confusing.

* rs/checkout-b-track-error:
  checkout: improve error messages for -b with extra argument
  checkout: add tests for -b and --track

3 years agoMerge branch 'lo/sparse-universal-zero-init'
Junio C Hamano [Tue, 2 Jun 2020 20:35:03 +0000 (13:35 -0700)] 
Merge branch 'lo/sparse-universal-zero-init'

We've adopted a convention that any on-stack structure can be
initialized to have zero values in all fields with "= { 0 }", even
when the first field happens to be a pointer, but sparse complained
that a null pointer should be spelled NULL for a long time.  Start
using -Wno-universal-initializer option to squelch it.

* lo/sparse-universal-zero-init:
  sparse: allow '{ 0 }' to be used without warnings

3 years agoMerge branch 'cb/t5608-cleanup'
Junio C Hamano [Tue, 2 Jun 2020 20:35:03 +0000 (13:35 -0700)] 
Merge branch 'cb/t5608-cleanup'

Test fixup.

* cb/t5608-cleanup:
  t5608: avoid say() and use "skip_all" instead for consistency

3 years agoMerge branch 'jx/pkt-line-doc-count-fix'
Junio C Hamano [Tue, 2 Jun 2020 20:35:02 +0000 (13:35 -0700)] 
Merge branch 'jx/pkt-line-doc-count-fix'

Docfix.

* jx/pkt-line-doc-count-fix:
  doc: fix wrong 4-byte length of pkt-line message

3 years agoMerge branch 'jn/experimental-opts-into-proto-v2'
Junio C Hamano [Tue, 2 Jun 2020 20:35:01 +0000 (13:35 -0700)] 
Merge branch 'jn/experimental-opts-into-proto-v2'

"feature.experimental" configuration variable is to let volunteers
easily opt into a set of newer features, which use of the v2
transport protocol is now a part of.

* jn/experimental-opts-into-proto-v2:
  config: let feature.experimental imply protocol.version=2

3 years agoMerge branch 'bk/p4-prepare-p4-only-fix'
Junio C Hamano [Tue, 2 Jun 2020 20:35:01 +0000 (13:35 -0700)] 
Merge branch 'bk/p4-prepare-p4-only-fix'

The "--prepare-p4-only" option is supposed to stop after replaying
one changeset, but kept going (by mistake?)

* bk/p4-prepare-p4-only-fix:
  git-p4.py: fix --prepare-p4-only error with multiple commits

3 years agoMerge branch 'an/merge-single-strategy-optim'
Junio C Hamano [Tue, 2 Jun 2020 20:35:01 +0000 (13:35 -0700)] 
Merge branch 'an/merge-single-strategy-optim'

Code optimization for a common case.

* an/merge-single-strategy-optim:
  merge: optimization to skip evaluate_result for single strategy

3 years agodiff: discard blob data from stat-unmatched pairs
Jeff King [Mon, 1 Jun 2020 20:22:18 +0000 (16:22 -0400)] 
diff: discard blob data from stat-unmatched pairs

When performing a tree-level diff against the working tree, we may find
that our index stat information is dirty, so we queue a filepair to be
examined later. If the actual content hasn't changed, we call this a
stat-unmatch; the stat information was out of date, but there's no
actual diff.  Normally diffcore_std() would detect and remove these
identical filepairs via diffcore_skip_stat_unmatch().  However, when
"--quiet" is used, we want to stop the diff as soon as we see any
changes, so we check for stat-unmatches immediately in diff_change().

That check may require us to actually load the file contents into the
pair of diff_filespecs. If we find that the pair isn't a stat-unmatch,
then no big deal; we'd likely load the contents later anyway to generate
a patch, do rename detection, etc, so we want to hold on to it. But if
it is a stat-unmatch, then we have no more use for that data; the whole
point is that we're going discard the pair. However, we never free the
allocated diff_filespec data.

In most cases, keeping that data isn't a problem. We don't expect a lot
of stat-unmatch entries, and since we're using --quiet, we'd quit as
soon as we saw such a real change anyway. However, there are extreme
cases where it makes a big difference:

  1. We'd generally mmap() the working tree half of the pair. And since
     the OS may limit the total number of maps, we can run afoul of this
     in large repositories. E.g.:

       $ cd linux
       $ git ls-files | wc -l
       67959
       $ sysctl vm.max_map_count
       vm.max_map_count = 65530
       $ git ls-files | xargs touch ;# everything is stat-dirty!
       $ git diff --quiet
       fatal: mmap failed: Cannot allocate memory

     It should be unusual to have so many files stat-dirty, but it's
     possible if you've just run a script like "sed -i" or similar.

     After this patch, the above correctly exits with code 0.

  2. Even if you don't hit mmap limits, the index half of the pair will
     have been pulled from the object database into heap memory. Again
     in a clone of linux.git, running:

       $ git ls-files | head -n 10000 | xargs touch
       $ git diff --quiet

     peaks at 145MB heap before this patch, and 94MB after.

This patch solves the problem by freeing any diff_filespec data we
picked up during the "--quiet" stat-unmatch check in diff_changes.
Nobody is going to need that data later, so there's no point holding on
to it. There are a few things to note:

  - we could skip queueing the pair entirely, which could in theory save
    a little work. But there's not much to save, as we need a
    diff_filepair to feed to diff_filespec_check_stat_unmatch() anyway.
    And since we cache the result of the stat-unmatch checks, a later
    call to diffcore_skip_stat_unmatch() call will quickly skip over
    them. The diffcore code also counts up the number of stat-unmatched
    pairs as it removes them. It's doubtful any callers would care about
    that in combination with --quiet, but we'd have to reimplement the
    logic here to be on the safe side. So it's not really worth the
    trouble.

  - I didn't write a test, because we always produce the correct output
    unless we run up against system mmap limits, which are both
    unportable and expensive to test against. Measuring peak heap
    would be interesting, but our perf suite isn't yet capable of that.

  - note that diff without "--quiet" does not suffer from the same
    problem. In diffcore_skip_stat_unmatch(), we detect the stat-unmatch
    entries and drop them immediately, so we're not carrying their data
    around.

  - you _can_ still trigger the mmap limit problem if you truly have
    that many files with actual changes. But it's rather unlikely. The
    stat-unmatch check avoids loading the file contents if the sizes
    don't match, so you'd need a pretty trivial change in every single
    file. Likewise, inexact rename detection might load the data for
    many files all at once. But you'd need not just 64k changes, but
    that many deletions and additions. The most likely candidate is
    perhaps break-detection, which would load the data for all pairs and
    keep it around for the content-level diff. But again, you'd need 64k
    actually changed files in the first place.

    So it's still possible to trigger this case, but it seems like "I
    accidentally made all my files stat-dirty" is the most likely case
    in the real world.

Reported-by: Jan Christoph Uhde <Jan@UhdeJc.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.27 v2.27.0
Junio C Hamano [Mon, 1 Jun 2020 06:03:57 +0000 (23:03 -0700)] 
Git 2.27

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'cb/test-use-ere-for-alternation'
Junio C Hamano [Sun, 31 May 2020 18:38:44 +0000 (11:38 -0700)] 
Merge branch 'cb/test-use-ere-for-alternation'

Portability fix for tests added recently.

* cb/test-use-ere-for-alternation:
  t: avoid alternation (not POSIX) in grep's BRE

3 years agoMerge tag 'l10n-2.27.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Sun, 31 May 2020 18:14:07 +0000 (11:14 -0700)] 
Merge tag 'l10n-2.27.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.27.0-rnd2

* tag 'l10n-2.27.0-rnd2' of git://github.com/git-l10n/git-po: (23 commits)
  l10n: zh_TW.po: v2.27.0 round 2 (0 untranslated)
  l10n: zh_TW.po: v2.27.0 round 1 (0 untranslated)
  l10n: de.po: Fix typo in the German translation of octopus
  l10n: de.po: Update German translation for Git 2.27.0
  l10n: it.po: update for Git 2.27.0 round #2
  l10n: tr: v2.27.0 round 2
  l10n: fr.po v2.27.0 rnd 2
  l10n: bg.po: Updated Bulgarian translation (4875t)
  l10n: Update Catalan translation
  l10n: sv.po: Update Swedish translation (4875t0f0u)
  l10n: vi(4875t): Updated Vietnamses translation for 2.27.0rd2
  l10n: zh_CN: for git v2.27.0 l10n round 1~2
  l10n: git.pot: v2.27.0 round 2 (+1)
  l10n: Update Catalan translation
  l10n: vi(4874t): Updated Vietnamses translation for 2.27.0
  l10n: es: 2.27.0 round 1
  l10n: bg.po: Updated Bulgarian translation (4868t)
  l10n: fr v2.27.0 rnd 1
  l10n: sv.po: Update Swedish translation (4839t0f0u)
  l10n: tr: v2.27.0 round 1
  ...

3 years agofast-import: add new --date-format=raw-permissive format
Elijah Newren [Sat, 30 May 2020 20:25:57 +0000 (20:25 +0000)] 
fast-import: add new --date-format=raw-permissive format

There are multiple repositories in the wild with random, invalid
timezones.  Most notably is a commit from rails.git with a timezone of
"+051800"[1].  A few searches will find other repos with that same
invalid timezone as well.  Further, Peff reports that GitHub relaxed
their fsck checks in August 2011 to accept any timezone value[2], and
there have been multiple reports to filter-repo about fast-import
crashing while trying to import their existing repositories since they
had timezone values such as "-7349423" and "-43455309"[3].

The existing check on timezone values inside fast-import may prove
useful for people who are crafting fast-import input by hand or with a
new script.  For them, the check may help them avoid accidentally
recording invalid dates.  (Note that this check is rather simplistic and
there are still several forms of invalid dates that fast-import does not
check for: dates in the future, timezone values with minutes that are
not divisible by 15, and timezone values with minutes that are 60 or
greater.)  While this simple check may have some value for those users,
other users or tools will want to import existing repositories as-is.
Provide a --date-format=raw-permissive format that will not error out on
these otherwise invalid timezones so that such existing repositories can
be imported.

[1] https://github.com/rails/rails/commit/4cf94979c9f4d6683c9338d694d5eb3106a4e734
[2] https://lore.kernel.org/git/20200521195513.GA1542632@coredump.intra.peff.net/
[3] https://github.com/newren/git-filter-repo/issues/88

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'master' of github.com:ruester/git-po-de
Jiang Xin [Sat, 30 May 2020 03:26:53 +0000 (11:26 +0800)] 
Merge branch 'master' of github.com:ruester/git-po-de

* 'master' of github.com:ruester/git-po-de:
  l10n: de.po: Fix typo in the German translation of octopus
  l10n: de.po: Update German translation for Git 2.27.0

3 years agoMerge branch of github.com:AlessandroMenti/git-po
Jiang Xin [Sat, 30 May 2020 03:25:17 +0000 (11:25 +0800)] 
Merge branch of github.com:AlessandroMenti/git-po

* 'update-italian-translation' of github.com:AlessandroMenti/git-po:
  l10n: it.po: update for Git 2.27.0 round #2

3 years agoMerge branch 'bc/sha-256-part-1-of-4'
Junio C Hamano [Fri, 29 May 2020 22:12:20 +0000 (15:12 -0700)] 
Merge branch 'bc/sha-256-part-1-of-4'

Docfix.

* bc/sha-256-part-1-of-4:
  Documentation: correct hash environment variable

3 years agoMerge branch 'ma/rev-list-options-docfix'
Junio C Hamano [Fri, 29 May 2020 22:12:19 +0000 (15:12 -0700)] 
Merge branch 'ma/rev-list-options-docfix'

Docfix.

* ma/rev-list-options-docfix:
  rev-list-options.txt: start a list for `show-pulls`

3 years agoMerge branch 'jk/ci-only-on-selected-branches'
Junio C Hamano [Fri, 29 May 2020 22:12:19 +0000 (15:12 -0700)] 
Merge branch 'jk/ci-only-on-selected-branches'

Dev support.

* jk/ci-only-on-selected-branches:
  ci/config: correct instruction for CI preferences

3 years agot: avoid alternation (not POSIX) in grep's BRE
Carlo Marcelo Arenas Belón [Fri, 29 May 2020 08:20:08 +0000 (01:20 -0700)] 
t: avoid alternation (not POSIX) in grep's BRE

f1e3df3169 (t: increase test coverage of signature verification output,
2020-03-04) adds GPG dependent tests to t4202 and t6200 that were found
problematic with at least OpenBSD 6.7.

Using an escaped '|' for alternations works only in some implementations
of grep (e.g. GNU and busybox).

It is not part of POSIX[1] and not supported by some BSD, macOS, and
possibly other POSIX compatible implementations.

Use `grep -E`, and write it using extended regular expression.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03

Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: zh_TW.po: v2.27.0 round 2 (0 untranslated)
Yi-Jyun Pan [Fri, 29 May 2020 16:37:53 +0000 (00:37 +0800)] 
l10n: zh_TW.po: v2.27.0 round 2 (0 untranslated)

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
3 years agol10n: zh_TW.po: v2.27.0 round 1 (0 untranslated)
Yi-Jyun Pan [Sat, 23 May 2020 13:26:15 +0000 (21:26 +0800)] 
l10n: zh_TW.po: v2.27.0 round 1 (0 untranslated)

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
3 years agol10n: de.po: Fix typo in the German translation of octopus
Jan Engelhardt [Tue, 31 Mar 2020 20:37:26 +0000 (22:37 +0200)] 
l10n: de.po: Fix typo in the German translation of octopus

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
3 years agol10n: de.po: Update German translation for Git 2.27.0
Matthias Rüster [Sun, 24 May 2020 11:27:46 +0000 (13:27 +0200)] 
l10n: de.po: Update German translation for Git 2.27.0

Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
3 years agocompletion: use native ZSH array pattern matching
Marco Trevisan (Treviño) [Tue, 26 May 2020 19:13:17 +0000 (19:13 +0000)] 
completion: use native ZSH array pattern matching

When clearing the builtin operations on re-sourcing in the ZSH case we
can use the native ${parameters} associative array keys values to get
the currently `__gitcomp_builtin_*` operations using pattern matching
instead of using sed.

As also stated in commit 94408dc7, introducing this change the usage of
sed has some overhead implications, while ZSH can do this check just
using its native syntax.

Signed-off-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: it.po: update for Git 2.27.0 round #2
Alessandro Menti [Wed, 27 May 2020 16:22:22 +0000 (18:22 +0200)] 
l10n: it.po: update for Git 2.27.0 round #2

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
3 years agoMerge branch 'fr_2.27.0rnd2' of github.com:jnavila/git
Jiang Xin [Thu, 28 May 2020 02:46:04 +0000 (10:46 +0800)] 
Merge branch 'fr_2.27.0rnd2' of github.com:jnavila/git

* 'fr_2.27.0rnd2' of github.com:jnavila/git:
  l10n: fr.po v2.27.0 rnd 2

3 years agoMerge branch 'master' of github.com:bitigchi/git-po
Jiang Xin [Thu, 28 May 2020 02:45:33 +0000 (10:45 +0800)] 
Merge branch 'master' of github.com:bitigchi/git-po

* 'master' of github.com:bitigchi/git-po:
  l10n: tr: v2.27.0 round 2

3 years agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Thu, 28 May 2020 02:45:11 +0000 (10:45 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (4875t)

3 years agoMerge branch 'master' of github.com:Softcatala/git-po
Jiang Xin [Thu, 28 May 2020 02:44:21 +0000 (10:44 +0800)] 
Merge branch 'master' of github.com:Softcatala/git-po

* 'master' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

3 years agocheckout -p: handle new files correctly
Johannes Schindelin [Wed, 27 May 2020 21:09:06 +0000 (21:09 +0000)] 
checkout -p: handle new files correctly

The original patch selection code was written for `git add -p`, and the
fundamental unit on which it works is a hunk.

We hacked around that to handle deletions back in 24ab81ae4d
(add-interactive: handle deletion of empty files, 2009-10-27). But `git
add -p` would never see a new file, since we only consider the set of
tracked files in the index.

However, since the same machinery was used for `git checkout -p` &
friends, we can see new files.

Handle this case specifically, adding a new prompt for it that is
modeled after the `deleted file` case.

This also fixes the problem where added _empty_ files could not be
staged via `git checkout -p`.

Reported-by: Merlin Büge <toni@bluenox07.de>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoDocumentation: correct hash environment variable
Toon Claes [Tue, 26 May 2020 18:37:20 +0000 (20:37 +0200)] 
Documentation: correct hash environment variable

To set the default hash algorithm you can set the `GIT_DEFAULT_HASH`
environment variable. In the documentation this variable is named
`GIT_DEFAULT_HASH_ALGORITHM`, which is incorrect.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: tr: v2.27.0 round 2
Emir Sarı [Wed, 27 May 2020 09:48:41 +0000 (12:48 +0300)] 
l10n: tr: v2.27.0 round 2

Signed-off-by: Emir Sarı <bitigchi@me.com>
3 years agol10n: fr.po v2.27.0 rnd 2
Jean-Noël Avila [Wed, 27 May 2020 09:18:48 +0000 (11:18 +0200)] 
l10n: fr.po v2.27.0 rnd 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agol10n: bg.po: Updated Bulgarian translation (4875t)
Alexander Shopov [Wed, 27 May 2020 07:44:12 +0000 (09:44 +0200)] 
l10n: bg.po: Updated Bulgarian translation (4875t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agol10n: Update Catalan translation
Jordi Mas [Wed, 27 May 2020 06:59:48 +0000 (08:59 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
3 years agol10n: sv.po: Update Swedish translation (4875t0f0u)
Peter Krefting [Wed, 27 May 2020 06:41:28 +0000 (07:41 +0100)] 
l10n: sv.po: Update Swedish translation (4875t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
3 years agol10n: vi(4875t): Updated Vietnamses translation for 2.27.0rd2
Tran Ngoc Quan [Wed, 27 May 2020 01:07:58 +0000 (08:07 +0700)] 
l10n: vi(4875t): Updated Vietnamses translation for 2.27.0rd2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
3 years agol10n: zh_CN: for git v2.27.0 l10n round 1~2
Jiang Xin [Sun, 11 Mar 2018 00:53:35 +0000 (08:53 +0800)] 
l10n: zh_CN: for git v2.27.0 l10n round 1~2

Translate 73 new messages (4875t0f0u) for git 2.27.0.

Reviewed-by: 依云 <lilydjwg@gmail.com>
Reviewed-by: Fangyi Zhou <me@fangyi.io>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agol10n: git.pot: v2.27.0 round 2 (+1)
Jiang Xin [Tue, 26 May 2020 23:24:01 +0000 (07:24 +0800)] 
l10n: git.pot: v2.27.0 round 2 (+1)

Generate po/git.pot from v2.27.0-rc2 for git v2.27.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoMerge branch 'master' of github.com:git-l10n/git-po
Jiang Xin [Tue, 26 May 2020 23:22:26 +0000 (07:22 +0800)] 
Merge branch 'master' of github.com:git-l10n/git-po

* 'master' of github.com:git-l10n/git-po:
  l10n: Update Catalan translation
  l10n: vi(4874t): Updated Vietnamses translation for 2.27.0
  l10n: es: 2.27.0 round 1
  l10n: bg.po: Updated Bulgarian translation (4868t)
  l10n: fr v2.27.0 rnd 1
  l10n: sv.po: Update Swedish translation (4839t0f0u)
  l10n: tr: v2.27.0 round 1
  l10n: it.po: update the Italian translation for Git 2.27.0 round 1
  l10n: git.pot: v2.27.0 round 1 (72 new, 37 removed)
  l10n: Update Catalan translation

3 years agoGit 2.27-rc2 v2.27.0-rc2
Junio C Hamano [Tue, 26 May 2020 16:38:13 +0000 (09:38 -0700)] 
Git 2.27-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'ss/faq-ignore'
Junio C Hamano [Tue, 26 May 2020 16:32:08 +0000 (09:32 -0700)] 
Merge branch 'ss/faq-ignore'

Doc markup fix.

* ss/faq-ignore:
  gitfaq: avoid validation error with older asciidoc

3 years agorev-list-options.txt: start a list for `show-pulls`
Martin Ågren [Mon, 25 May 2020 17:06:07 +0000 (19:06 +0200)] 
rev-list-options.txt: start a list for `show-pulls`

The explanation of the `--show-pulls` option added in commit 8d049e182e
("revision: --show-pulls adds helpful merges", 2020-04-10) consists of
several paragraphs and we use "+" throughout to tie them together in one
long chain of list continuations. Only thing is, we're not in any kind
of list, so these pluses end up being rendered literally.

The preceding few paragraphs describe `--ancestry-path` and there we
*do* have a list, since we've started one with `--ancestry-path::`. In
fact, we have several such lists for all the various history-simplifying
options we're discussing earlier in this file.

Thus, we're missing a list both from a consistency point of view and
from a practical rendering standpoint.

Let's start a list for `--show-pulls` where we start actually discussing
the option, and keep the paragraphs preceding it out of that list. That
is, drop all those pluses before the new list we're adding here.

Helped-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogitfaq: avoid validation error with older asciidoc
Todd Zullinger [Tue, 19 May 2020 04:53:01 +0000 (00:53 -0400)] 
gitfaq: avoid validation error with older asciidoc

When building with asciidoc-8.4.5 (as found on CentOS/Red Hat 6), the
period in the "[[files-in-.gitignore-are-tracked]]" anchor is not
properly parsed as a section:

  WARNING: gitfaq.txt: line 245: missing [[files-in-.gitignore-are-tracked]] section

The resulting XML file fails to validate with xmlto:

    xmlto: /git/Documentation/gitfaq.xml does not validate (status 3)
    xmlto: Fix document syntax or use --skip-validation option
     /git/Documentation/gitfaq.xml:3: element refentry: validity error :
     Element refentry content does not follow the DTD, expecting
     (beginpage? , indexterm* , refentryinfo? , refmeta? , (remark | link
     | olink | ulink)* , refnamediv+ , refsynopsisdiv? , (refsect1+ |
     refsection+)), got (refmeta refnamediv refsynopsisdiv refsect1
     refsect1 refsect1 refsect1 variablelist refsect1 refsect1 )
    Document /git/Documentation/gitfaq.xml does not validate

Let's avoid breaking users of platforms which ship an old version of
asciidoc, since the cost to do so is quite low.

Reported-by: Son Luong Ngoc <sluongng@gmail.com>
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoHopefully final batch before 2.27-rc2
Junio C Hamano [Mon, 25 May 2020 01:13:53 +0000 (18:13 -0700)] 
Hopefully final batch before 2.27-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'dd/t5703-grep-a-fix'
Junio C Hamano [Mon, 25 May 2020 02:39:40 +0000 (19:39 -0700)] 
Merge branch 'dd/t5703-grep-a-fix'

Update an unconditional use of "grep -a" with a perl script in a test.

* dd/t5703-grep-a-fix:
  t5703: replace "grep -a" usage by perl

3 years agoMerge branch 'ds/multi-pack-verify'
Junio C Hamano [Mon, 25 May 2020 02:39:39 +0000 (19:39 -0700)] 
Merge branch 'ds/multi-pack-verify'

Fix for a copy-and-paste error introduced during 2.20 era.

* ds/multi-pack-verify:
  fsck: use ERROR_MULTI_PACK_INDEX

3 years agoMerge branch 'ma/doc-fixes'
Junio C Hamano [Mon, 25 May 2020 02:39:38 +0000 (19:39 -0700)] 
Merge branch 'ma/doc-fixes'

Various doc fixes.

* ma/doc-fixes:
  git-sparse-checkout.txt: add missing '
  git-credential.txt: use list continuation
  git-commit-graph.txt: fix list rendering
  git-commit-graph.txt: fix grammo
  date-formats.txt: fix list continuation

3 years agoMerge branch 'cb/bisect-replay-with-dos-fix'
Junio C Hamano [Mon, 25 May 2020 02:39:38 +0000 (19:39 -0700)] 
Merge branch 'cb/bisect-replay-with-dos-fix'

Re-fix longstanding "edited bisect log may confuse bisect replay
with trailing carriage-return" issue.

* cb/bisect-replay-with-dos-fix:
  bisect: avoid tailing CR characters from revision in replay

3 years agoMerge branch 'gs/commit-graph-path-filter'
Junio C Hamano [Mon, 25 May 2020 02:39:38 +0000 (19:39 -0700)] 
Merge branch 'gs/commit-graph-path-filter'

Test fix.

* gs/commit-graph-path-filter:
  t4216: avoid unnecessary subshell in test_bloom_filters_not_used

3 years agoMerge branch 'dl/merge-autostash'
Junio C Hamano [Mon, 25 May 2020 02:39:37 +0000 (19:39 -0700)] 
Merge branch 'dl/merge-autostash'

Test fix.

* dl/merge-autostash:
  t5520: avoid alternation in grep's BRE (not POSIX)

3 years agoMerge branch 'bc/faq'
Junio C Hamano [Mon, 25 May 2020 02:39:36 +0000 (19:39 -0700)] 
Merge branch 'bc/faq'

"git help guides" now includes the newly added FAQ document.

* bc/faq:
  command-list.txt: add gitfaq to the list of guides

3 years agoMerge branch 'jt/avoid-prefetch-when-able-in-diff'
Junio C Hamano [Mon, 25 May 2020 02:39:35 +0000 (19:39 -0700)] 
Merge branch 'jt/avoid-prefetch-when-able-in-diff'

Test-coverage enhancement.

* jt/avoid-prefetch-when-able-in-diff:
  t4067: make rename detection test output raw diff

3 years agoMerge branch 'gp/hppa-stack-test-fix'
Junio C Hamano [Mon, 25 May 2020 02:39:35 +0000 (19:39 -0700)] 
Merge branch 'gp/hppa-stack-test-fix'

Platform dependent tweak to a test for HP-PA.

* gp/hppa-stack-test-fix:
  tests: skip small-stack tests on hppa architecture

3 years agosparse: allow '{ 0 }' to be used without warnings
Luc Van Oostenryck [Fri, 22 May 2020 00:25:02 +0000 (02:25 +0200)] 
sparse: allow '{ 0 }' to be used without warnings

In standard C, '{ 0 }' can be used as an universal zero-initializer.
However, Sparse complains if this is used on a type where the first
member (possibly nested) is a pointer since Sparse purposely wants
to warn when '0' is used to initialize a pointer type.

Legitimaly, it's desirable to be able to use '{ 0 }' as an idiom
without these warnings [1,2]. To allow this, an option have now
been added to Sparse:
    537e3e2dae univ-init: conditionally accept { 0 } without warnings

So, add this option to the SPARSE_FLAGS variable.

Note: The option have just been added to Sparse. So, to benefit
      now from this patch it's needed to use the latest Sparse
      source from kernel.org. The option will simply be ignored
      by older versions of Sparse.

[1] https://lore.kernel.org/r/e6796c60-a870-e761-3b07-b680f934c537@ramsayjones.plus.com
[2] https://lore.kernel.org/r/xmqqd07xem9l.fsf@gitster.c.googlers.com

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agostateless-connect: send response end packet
Denton Liu [Tue, 19 May 2020 10:54:00 +0000 (06:54 -0400)] 
stateless-connect: send response end packet

Currently, remote-curl acts as a proxy and blindly forwards packets
between an HTTP server and fetch-pack. In the case of a stateless RPC
connection where the connection is terminated before the transaction is
complete, remote-curl will blindly forward the packets before waiting on
more input from fetch-pack. Meanwhile, fetch-pack will read the
transaction and continue reading, expecting more input to continue the
transaction. This results in a deadlock between the two processes.

This can be seen in the following command which does not terminate:

$ git -c protocol.version=2 clone https://github.com/git/git.git --shallow-since=20151012
Cloning into 'git'...

whereas the v1 version does terminate as expected:

$ git -c protocol.version=1 clone https://github.com/git/git.git --shallow-since=20151012
Cloning into 'git'...
fatal: the remote end hung up unexpectedly

Instead of blindly forwarding packets, make remote-curl insert a
response end packet after proxying the responses from the remote server
when using stateless_connect(). On the RPC client side, ensure that each
response ends as described.

A separate control packet is chosen because we need to be able to
differentiate between what the remote server sends and remote-curl's
control packets. By ensuring in the remote-curl code that a server
cannot send response end packets, we prevent a malicious server from
being able to perform a denial of service attack in which they spoof a
response end packet and cause the described deadlock to happen.

Reported-by: Force Charlie <charlieio@outlook.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agopkt-line: define PACKET_READ_RESPONSE_END
Denton Liu [Tue, 19 May 2020 10:53:59 +0000 (06:53 -0400)] 
pkt-line: define PACKET_READ_RESPONSE_END

In a future commit, we will use PACKET_READ_RESPONSE_END to separate
messages proxied by remote-curl. To prepare for this, add the
PACKET_READ_RESPONSE_END enum value.

In switch statements that need a case added, die() or BUG() when a
PACKET_READ_RESPONSE_END is unexpected. Otherwise, mirror how
PACKET_READ_DELIM is implemented (especially in cases where packets are
being forwarded).

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoremote-curl: error on incomplete packet
Denton Liu [Tue, 19 May 2020 10:53:58 +0000 (06:53 -0400)] 
remote-curl: error on incomplete packet

Currently, remote-curl acts as a proxy and blindly forwards packets
between an HTTP server and fetch-pack. In the case of a stateless RPC
connection where the connection is terminated with a partially written
packet, remote-curl will blindly send the partially written packet
before waiting on more input from fetch-pack. Meanwhile, fetch-pack will
read the partial packet and continue reading, expecting more input. This
results in a deadlock between the two processes.

For a stateless connection, inspect packets before sending them and
error out if a packet line packet is incomplete.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff: add config option relative
Laurent Arnoud [Fri, 22 May 2020 10:46:18 +0000 (12:46 +0200)] 
diff: add config option relative

The `diff.relative` boolean option set to `true` shows only changes in
the current directory/value specified by the `path` argument of the
`relative` option and shows pathnames relative to the aforementioned
directory.

Teach `--no-relative` to override earlier `--relative`

Add for git-format-patch(1) options documentation `--relative` and
`--no-relative`

Signed-off-by: Laurent Arnoud <laurent@spkdev.net>
Acked-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot5608: avoid say() and use "skip_all" instead for consistency
Carlo Marcelo Arenas Belón [Fri, 22 May 2020 18:42:14 +0000 (11:42 -0700)] 
t5608: avoid say() and use "skip_all" instead for consistency

Printing a message directly to stdout could affect TAP processing
and is not really needed, as there is a standard way to skip all
tests that could be used instead, while printing an equivalent
message.

While at it; update the message to better reflect that since
a85efb5985 (t5608-clone-2gb.sh: turn GIT_TEST_CLONE_2GB into a bool,
2019-11-22), the enabling variable should be a recognized boolean
(ex: true, false, 1, 0) and get rid of the prerequisite that used
to guard all the tests, since "skip_all" is just much faster and
idempotent.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocheckout: improve error messages for -b with extra argument
René Scharfe [Sun, 24 May 2020 07:23:00 +0000 (09:23 +0200)] 
checkout: improve error messages for -b with extra argument

When we try to create a branch "foo" based on "origin/master" and give
git commit -b an extra unsupported argument "bar", it confusingly
reports:

   $ git checkout -b foo origin/master bar
   fatal: 'bar' is not a commit and a branch 'foo' cannot be created from it

   $ git checkout --track -b foo origin/master bar
   fatal: 'bar' is not a commit and a branch 'foo' cannot be created from it

That's wrong, because it very well understands that "origin/master" is
supposed to be the start point for the new branch and not "bar".  Check
if we got a commit and show more fitting messages in that case instead:

   $ git checkout -b foo origin/master bar
   fatal: Cannot update paths and switch to branch 'foo' at the same time.

   $ git checkout --track -b foo origin/master bar
   fatal: '--track' cannot be used with updating paths

Original-patch-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocheckout: add tests for -b and --track
René Scharfe [Sun, 24 May 2020 07:22:51 +0000 (09:22 +0200)] 
checkout: add tests for -b and --track

Test git checkout -b with and without --track and demonstrate unexpected
error messages when it's given an extra (i.e. unsupported) path
argument.  In both cases it reports:

   $ git checkout -b foo origin/master bar
   fatal: 'bar' is not a commit and a branch 'foo' cannot be created from it

The problem is that the start point we gave for the new branch is
"origin/master" and "bar" is just some extra argument -- it could even
be a valid commit, which would make the message even more confusing.  We
have more fitting error messages in git commit, but get confused; use
the text of the rights ones in the tests.

Reported-by: Dana Dahlstrom <dahlstrom@google.com>
Original-test-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobisect--helper: avoid segfault with bad syntax in `start --term-*`
Carlo Marcelo Arenas Belón [Wed, 20 May 2020 23:26:27 +0000 (16:26 -0700)] 
bisect--helper: avoid segfault with bad syntax in `start --term-*`

06f5608c14 (bisect--helper: `bisect_start` shell function partially in C,
2019-01-02) adds a lax parser for `git bisect start` which could result
in a segfault under a bad syntax call for start with custom terms.

Detect if there are enough arguments left in the command line to use for
--term-{old,good,new,bad} and abort with the same syntax error the original
implementation will show if not.

While at it, remove an unnecessary (and incomplete) check for unknown
arguments and make sure to add a test to avoid regressions.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: Update Catalan translation
Jordi Mas [Fri, 22 May 2020 05:59:22 +0000 (07:59 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
3 years agocompletion: don't override given stash subcommand with -p
Ville Skyttä [Thu, 21 May 2020 18:35:59 +0000 (21:35 +0300)] 
completion: don't override given stash subcommand with -p

df70b190 (completion: make stash -p and alias for stash push -p,
2018-04-20) wanted to make sure "git stash -p <TAB>" offers the same
completion as "git stash push -p <TAB>", but it did so by forcing the
$subcommand to be "push" whenever then "-p" option is found on the
command line.

This harms any subcommand that can take the "-p" option---even when the
subcommand is explicitly given, e.g. "git stash show -p", the code added
by the change would overwrite the $subcommand the user gave us.

Fix it by making sure that the defaulting to "push" happens only when
there is no $subcommand given yet.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge https://github.com/prati0100/git-gui
Junio C Hamano [Thu, 21 May 2020 18:15:04 +0000 (11:15 -0700)] 
Merge https://github.com/prati0100/git-gui

* https://github.com/prati0100/git-gui:
  git-gui: Handle Ctrl + BS/Del in the commit msg
  Subject: git-gui: fix syntax error because of missing semicolon

3 years agofsck: detect more in-tree d/f conflicts
René Scharfe [Thu, 21 May 2020 09:52:54 +0000 (11:52 +0200)] 
fsck: detect more in-tree d/f conflicts

If the conflict candidate file name from the top of the stack is not a
prefix of the current candiate directory then we can discard it as no
matching directory can come up later.  But we are not done checking the
candidate directory -- the stack might still hold a matching file name,
so stay in the loop and check the next candidate file name.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot1450: demonstrate undetected in-tree d/f conflict
René Scharfe [Thu, 21 May 2020 09:52:43 +0000 (11:52 +0200)] 
t1450: demonstrate undetected in-tree d/f conflict

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot1450: increase test coverage of in-tree d/f detection
René Scharfe [Thu, 21 May 2020 09:52:28 +0000 (11:52 +0200)] 
t1450: increase test coverage of in-tree d/f detection

Exercise the case of putting a conflict candidate file name back on the
stack because a matching directory might yet come up later.

Do that by factoring out the test code into a function to allow for more
concise notation in the form of parameters indicating names of trees
(with trailing slash) and blobs (without trailing slash) in no
particular order (they are sorted by git mktree).  Then add the new test
case as a second function call.

Fix a typo in the test title while at it ("dublicate").

Reported-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agofsck: fix a typo in a comment
René Scharfe [Thu, 21 May 2020 09:52:04 +0000 (11:52 +0200)] 
fsck: fix a typo in a comment

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodoc: fix wrong 4-byte length of pkt-line message
Jiuyang Xie [Thu, 21 May 2020 11:32:38 +0000 (19:32 +0800)] 
doc: fix wrong 4-byte length of pkt-line message

The first four bytes of the line, the pkt-len, indicates the total
length of the pkt-line in hexadecimal. Fix wrong pkt-len headers of
some pkt-line messages in `http-protocol.txt` and `pack-protocol.txt`.

Reviewed-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Jiuyang Xie <jiuyang.xjy@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot2060: add a test for switch with --orphan and --discard-changes
brian m. carlson [Thu, 21 May 2020 02:07:12 +0000 (02:07 +0000)] 
t2060: add a test for switch with --orphan and --discard-changes

We have several code paths in the checkout code which are traversed only
in this case, due to switch having different defaults from checkout.
Let's add a test that the combination of options works and produces the
expected behavior.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobuiltin/checkout: simplify metadata initialization
brian m. carlson [Thu, 21 May 2020 02:07:11 +0000 (02:07 +0000)] 
builtin/checkout: simplify metadata initialization

When we call init_checkout_metadata in reset_tree, we want to pass the
object ID of the commit in question so that it can be passed to filters,
or if there is no commit, the tree.  We anticipated this latter case,
which can occur elsewhere in the checkout code, but it cannot occur
here.  The only case in which we do not have a commit object is when
invoking git switch with --orphan.  Moreover, we can only hit this code
path without a commit object additionally with either --force or
--discard-changes.

In such a case, there is no point initializing the checkout metadata
with a commit or tree because (a) there is no commit, only the empty
tree, and (b) we will never use the data, since no files will be smudged
when checking out a branch with no files.  Pass the all-zeros object ID
in this case, since we just need some value which is a valid pointer.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoconfig: let feature.experimental imply protocol.version=2
Jonathan Nieder [Thu, 21 May 2020 02:15:33 +0000 (19:15 -0700)] 
config: let feature.experimental imply protocol.version=2

Git 2.26 used protocol v2 as its default protocol, but soon after
release, users noticed that the protocol v2 negotiation code was prone
to fail when fetching from some remotes that are far ahead of others
(such as linux-next.git versus Linus's linux.git).  That has been
fixed by 0b07eecf6ed (Merge branch 'jt/v2-fetch-nego-fix',
2020-05-01), but to be cautious, we are using protocol v0 as the
default in 2.27 to buy some time for any other unanticipated issues to
surface.

To that end, let's ensure that users requesting the bleeding edge
using the feature.experimental flag *do* get protocol v2.  This way,
we can gain experience with a wider audience for the new protocol
version and be more confident when it is time to enable it by default
for all users in some future Git version.

Implementation note: this isn't with the rest of the
feature.experimental options in repo-settings.c because those are tied
to a repository object, whereas this code path is used for operations
like "git ls-remote" that do not require a repository.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'il/ctrl-bs-del'
Pratyush Yadav [Thu, 21 May 2020 12:55:32 +0000 (18:25 +0530)] 
Merge branch 'il/ctrl-bs-del'

Allow deleting words backwards and forwards using Ctrl + Backspace and
Delete in the commit message buffer.

* il/ctrl-bs-del:
  git-gui: Handle Ctrl + BS/Del in the commit msg

3 years agol10n: vi(4874t): Updated Vietnamses translation for 2.27.0
Tran Ngoc Quan [Thu, 21 May 2020 01:22:14 +0000 (08:22 +0700)] 
l10n: vi(4874t): Updated Vietnamses translation for 2.27.0

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