]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agoMerge branch 'ra/t5150-depends-on-perl'
Junio C Hamano [Wed, 25 Dec 2019 19:21:58 +0000 (11:21 -0800)] 
Merge branch 'ra/t5150-depends-on-perl'

Some Porcelain commands are written in Perl, and tests on them are
expected not to work when the platform lacks a working perl.

* ra/t5150-depends-on-perl:
  t5150: skip request-pull test if Perl is disabled

4 years agoMerge branch 'dl/format-patch-notes-config-fixup'
Junio C Hamano [Wed, 25 Dec 2019 19:21:58 +0000 (11:21 -0800)] 
Merge branch 'dl/format-patch-notes-config-fixup'

"git format-patch" can take a set of configured format.notes values
to specify which notes refs to use in the log message part of the
output.  The behaviour of this was not consistent with multiple
--notes command line options, which has been corrected.

* dl/format-patch-notes-config-fixup:
  notes.h: fix typos in comment
  notes: break set_display_notes() into smaller functions
  config/format.txt: clarify behavior of multiple format.notes
  format-patch: move git_config() before repo_init_revisions()
  format-patch: use --notes behavior for format.notes
  notes: extract logic into set_display_notes()
  notes: create init_display_notes() helper
  notes: rename to load_display_notes()

4 years agoMerge branch 'am/pathspec-f-f-checkout'
Junio C Hamano [Wed, 25 Dec 2019 19:21:57 +0000 (11:21 -0800)] 
Merge branch 'am/pathspec-f-f-checkout'

A few more commands learned the "--pathspec-from-file" command line
option.

* am/pathspec-f-f-checkout:
  checkout, restore: support the --pathspec-from-file option
  doc: restore: synchronize <pathspec> description
  doc: checkout: synchronize <pathspec> description
  doc: checkout: fix broken text reference
  doc: checkout: remove duplicate synopsis
  add: support the --pathspec-from-file option
  cmd_add: prepare for next patch

4 years agoMerge branch 'am/pathspec-from-file'
Junio C Hamano [Wed, 25 Dec 2019 19:21:57 +0000 (11:21 -0800)] 
Merge branch 'am/pathspec-from-file'

An earlier series to teach "--pathspec-from-file" to "git commit"
forgot to make the option incompatible with "--all", which has been
corrected.

* am/pathspec-from-file:
  commit: forbid --pathspec-from-file --all

4 years agocommit: forbid --pathspec-from-file --all
Alexandr Miloslavskiy [Mon, 16 Dec 2019 15:47:52 +0000 (15:47 +0000)] 
commit: forbid --pathspec-from-file --all

I forgot this in my previous patch `--pathspec-from-file` for
`git commit` [1]. When both `--pathspec-from-file` and `--all` were
specified, `--all` took precedence and `--pathspec-from-file` was
ignored. Before `--pathspec-from-file` was implemented, this case was
prevented by this check in `parse_and_validate_options()` :

    die(_("paths '%s ...' with -a does not make sense"), argv[0]);

It is unfortunate that these two cases are disconnected. This came as
result of how the code was laid out before my patches, where `pathspec`
is parsed outside of `parse_and_validate_options()`. This branch is
already full of refactoring patches and I did not dare to go for another
one.

Fix by mirroring `die()` for `--pathspec-from-file` as well.

[1] Commit e440fc58 ("commit: support the --pathspec-from-file option" 2019-11-19)

Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3434: mark successful test as such
Elijah Newren [Fri, 13 Dec 2019 21:03:45 +0000 (21:03 +0000)] 
t3434: mark successful test as such

t3434.3 was fixed by commit 917d0d6234be ("Merge branch
'js/rebase-r-safer-label'", 2019-12-05).  t3434 did not exist in
js/rebase-r-safer-label, so could not have marked the test as fixed, and
it was probably not noticed that the merge fixed this test.  Mark it as
fixed now.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agonotes.h: fix typos in comment
Denton Liu [Wed, 18 Dec 2019 18:17:43 +0000 (10:17 -0800)] 
notes.h: fix typos in comment

In 1d7297513d (notes: break set_display_notes() into smaller functions,
2019-12-11), we introduced a comment which had a couple of typos. In the
first typo, we referenced 'enable_default_display_notes' instead of
'enable_ref_display_notes'. In the second typo, we wrote "is a points to"
instead of "is a pointer to". Correct both of these typos.

Reported-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe sixth batch
Junio C Hamano [Mon, 16 Dec 2019 21:07:19 +0000 (13:07 -0800)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'rs/patch-id-use-oid-to-hex'
Junio C Hamano [Mon, 16 Dec 2019 21:14:48 +0000 (13:14 -0800)] 
Merge branch 'rs/patch-id-use-oid-to-hex'

Code cleanup.

* rs/patch-id-use-oid-to-hex:
  patch-id: use oid_to_hex() to print multiple object IDs

4 years agoMerge branch 'rs/commit-export-env-simplify'
Junio C Hamano [Mon, 16 Dec 2019 21:14:47 +0000 (13:14 -0800)] 
Merge branch 'rs/commit-export-env-simplify'

Code cleanup.

* rs/commit-export-env-simplify:
  commit: use strbuf_add() to add a length-limited string

4 years agoMerge branch 'rs/archive-zip-code-cleanup'
Junio C Hamano [Mon, 16 Dec 2019 21:14:47 +0000 (13:14 -0800)] 
Merge branch 'rs/archive-zip-code-cleanup'

Code cleanup.

* rs/archive-zip-code-cleanup:
  archive-zip: use enum for compression method

4 years agoMerge branch 'js/t3404-indent-fix'
Junio C Hamano [Mon, 16 Dec 2019 21:14:47 +0000 (13:14 -0800)] 
Merge branch 'js/t3404-indent-fix'

Test cleanup.

* js/t3404-indent-fix:
  t3404: fix indentation

4 years agoMerge branch 'dr/branch-usage-casefix'
Junio C Hamano [Mon, 16 Dec 2019 21:14:46 +0000 (13:14 -0800)] 
Merge branch 'dr/branch-usage-casefix'

Message fix.

* dr/branch-usage-casefix:
  l10n: minor case fix in 'git branch' '--unset-upstream' description

4 years agoMerge branch 'sg/t9300-robustify'
Junio C Hamano [Mon, 16 Dec 2019 21:08:47 +0000 (13:08 -0800)] 
Merge branch 'sg/t9300-robustify'

The test on "fast-import" used to get stuck when "fast-import" died
in the middle.

* sg/t9300-robustify:
  t9300-fast-import: don't hang if background fast-import exits too early
  t9300-fast-import: store the PID in a variable instead of pidfile

4 years agoMerge branch 'js/add-i-a-bit-more-tests'
Junio C Hamano [Mon, 16 Dec 2019 21:08:47 +0000 (13:08 -0800)] 
Merge branch 'js/add-i-a-bit-more-tests'

Test coverage update in preparation for further work on "git add -i".

* js/add-i-a-bit-more-tests:
  apply --allow-overlap: fix a corner case
  git add -p: use non-zero exit code when the diff generation failed
  t3701: verify that the diff.algorithm config setting is handled
  t3701: verify the shown messages when nothing can be added
  t3701: add a test for the different `add -p` prompts
  t3701: avoid depending on the TTY prerequisite
  t3701: add a test for advanced split-hunk editing

4 years agoMerge branch 'dl/range-diff-with-notes'
Junio C Hamano [Mon, 16 Dec 2019 21:08:46 +0000 (13:08 -0800)] 
Merge branch 'dl/range-diff-with-notes'

Code clean-up.

* dl/range-diff-with-notes:
  range-diff: clear `other_arg` at end of function
  range-diff: mark pointers as const
  t3206: fix incorrect test name

4 years agoMerge branch 'hw/doc-in-header'
Junio C Hamano [Mon, 16 Dec 2019 21:08:39 +0000 (13:08 -0800)] 
Merge branch 'hw/doc-in-header'

* hw/doc-in-header:
  trace2: move doc to trace2.h
  submodule-config: move doc to submodule-config.h
  tree-walk: move doc to tree-walk.h
  trace: move doc to trace.h
  run-command: move doc to run-command.h
  parse-options: add link to doc file in parse-options.h
  credential: move doc to credential.h
  argv-array: move doc to argv-array.h
  cache: move doc to cache.h
  sigchain: move doc to sigchain.h
  pathspec: move doc to pathspec.h
  revision: move doc to revision.h
  attr: move doc to attr.h
  refs: move doc to refs.h
  remote: move doc to remote.h and refspec.h
  sha1-array: move doc to sha1-array.h
  merge: move doc to ll-merge.h
  graph: move doc to graph.h and graph.c
  dir: move doc to dir.h
  diff: move doc to diff.h and diffcore.h

4 years agoMerge branch 'rs/xdiff-ignore-ws-w-func-context'
Junio C Hamano [Mon, 16 Dec 2019 21:08:32 +0000 (13:08 -0800)] 
Merge branch 'rs/xdiff-ignore-ws-w-func-context'

The "diff" machinery learned not to lose added/removed blank lines
in the context when --ignore-blank-lines and --function-context are
used at the same time.

* rs/xdiff-ignore-ws-w-func-context:
  xdiff: unignore changes in function context

4 years agoMerge branch 'dl/rebase-with-autobase'
Junio C Hamano [Mon, 16 Dec 2019 21:08:32 +0000 (13:08 -0800)] 
Merge branch 'dl/rebase-with-autobase'

"git rebase" did not work well when format.useAutoBase
configuration variable is set, which has been corrected.

* dl/rebase-with-autobase:
  rebase: fix format.useAutoBase breakage
  format-patch: teach --no-base
  t4014: use test_config()
  format-patch: fix indentation
  t3400: demonstrate failure with format.useAutoBase

4 years agoMerge branch 'dl/test-cleanup'
Junio C Hamano [Mon, 16 Dec 2019 21:08:32 +0000 (13:08 -0800)] 
Merge branch 'dl/test-cleanup'

Test cleanup.

* dl/test-cleanup: (26 commits)
  t7700: stop losing return codes of git commands
  t7700: make references to SHA-1 generic
  t7700: replace egrep with grep
  t7700: consolidate code into test_has_duplicate_object()
  t7700: consolidate code into test_no_missing_in_packs()
  t7700: s/test -f/test_path_is_file/
  t7700: move keywords onto their own line
  t7700: remove spaces after redirect operators
  t7700: drop redirections to /dev/null
  t7501: stop losing return codes of git commands
  t7501: remove spaces after redirect operators
  t5703: stop losing return codes of git commands
  t5703: simplify one-time-sed generation logic
  t5317: use ! grep to check for no matching lines
  t5317: stop losing return codes of git commands
  t4138: stop losing return codes of git commands
  t4015: use test_write_lines()
  t4015: stop losing return codes of git commands
  t3600: comment on inducing SIGPIPE in `git rm`
  t3600: stop losing return codes of git commands
  ...

4 years agoMerge branch 'cs/store-packfiles-in-hashmap'
Junio C Hamano [Mon, 16 Dec 2019 21:08:31 +0000 (13:08 -0800)] 
Merge branch 'cs/store-packfiles-in-hashmap'

In a repository with many packfiles, the cost of the procedure that
avoids registering the same packfile twice was unnecessarily high
by using an inefficient search algorithm, which has been corrected.

* cs/store-packfiles-in-hashmap:
  packfile.c: speed up loading lots of packfiles

4 years agoMerge branch 'js/builtin-add-i-cmds'
Junio C Hamano [Mon, 16 Dec 2019 21:08:31 +0000 (13:08 -0800)] 
Merge branch 'js/builtin-add-i-cmds'

"git add -i" that is getting rewritten in C has been extended to
cover subcommands other than the "patch".

* js/builtin-add-i-cmds:
  built-in add -i: offer the `quit` command
  built-in add -i: re-implement the `diff` command
  built-in add -i: implement the `patch` command
  built-in add -i: re-implement `add-untracked` in C
  built-in add -i: re-implement `revert` in C
  built-in add -i: implement the `update` command
  built-in add -i: prepare for multi-selection commands
  built-in add -i: allow filtering the modified files list
  add-interactive: make sure to release `rev.prune_data`

4 years agoMerge branch 'dd/time-reentrancy'
Junio C Hamano [Mon, 16 Dec 2019 21:08:31 +0000 (13:08 -0800)] 
Merge branch 'dd/time-reentrancy'

Avoid gmtime() and localtime() and prefer their reentrant
counterparts.

* dd/time-reentrancy:
  mingw: use {gm,local}time_s as backend for {gm,local}time_r
  archive-zip.c: switch to reentrant localtime_r
  date.c: switch to reentrant {gm,local}time_r

4 years agoMerge branch 'ag/sequencer-todo-updates'
Junio C Hamano [Mon, 16 Dec 2019 21:08:31 +0000 (13:08 -0800)] 
Merge branch 'ag/sequencer-todo-updates'

Reduce unnecessary reading of state variables back from the disk
during sequencer operation.

* ag/sequencer-todo-updates:
  sequencer: directly call pick_commits() from complete_action()
  rebase: fill `squash_onto' in get_replay_opts()
  sequencer: move the code writing total_nr on the disk to a new function
  sequencer: update `done_nr' when skipping commands in a todo list
  sequencer: update `total_nr' when adding an item to a todo list

4 years agofix-typo: consecutive-word duplications
ryenus [Sun, 15 Dec 2019 15:12:24 +0000 (15:12 +0000)] 
fix-typo: consecutive-word duplications

Correct unintentional duplication(s) of words, such as "the the",
and "can can" etc.

The changes are only applied to cases where it's fixing what is clearly
wrong or prone to misunderstanding, as suggested by the reviewers.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Denton Liu <liu.denton@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: ryenus <ryenus@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agonotes: break set_display_notes() into smaller functions
Denton Liu [Thu, 12 Dec 2019 00:49:50 +0000 (16:49 -0800)] 
notes: break set_display_notes() into smaller functions

In 8164c961e1 (format-patch: use --notes behavior for format.notes,
2019-12-09), we introduced set_display_notes() which was a monolithic
function with three mutually exclusive branches. Break the function up
into three small and simple functions that each are only responsible for
one task.

This family of functions accepts an `int *show_notes` instead of
returning a value suitable for assignment to `show_notes`. This is for
two reasons. First of all, this guarantees that the external
`show_notes` variable changes in lockstep with the
`struct display_notes_opt`. Second, this prompts future developers to be
careful about doing something meaningful with this value. In fact, a
NULL check is intentionally omitted because causing a segfault here
would tell the future developer that they are meant to use the value for
something meaningful.

One alternative was making the family of functions accept a
`struct rev_info *` instead of the `struct display_notes_opt *`, since
the former contains the `show_notes` field as well. This does not work
because we have to call git_config() before repo_init_revisions().
However, if we had a `struct rev_info`, we'd need to initialize it before
it gets assigned values from git_config(). As a result, we break the
circular dependency by having standalone `int show_notes` and
`struct display_notes_opt notes_opt` variables which temporarily hold
values from git_config() until the values are copied over to `rev`.

To implement this change, we need to get a pointer to
`rev_info::show_notes`. Unfortunately, this is not possible with
bitfields and only direct-assignment is possible. Change
`rev_info::show_notes` to a non-bitfield int so that we can get its
address.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoconfig/format.txt: clarify behavior of multiple format.notes
Denton Liu [Thu, 12 Dec 2019 00:49:47 +0000 (16:49 -0800)] 
config/format.txt: clarify behavior of multiple format.notes

In 8164c961e1 (format-patch: use --notes behavior for format.notes,
2019-12-09), we slightly tweaked the behavior of having multiple
`format.notes` configuration variables. We did not update the
documentation to reflect this, however.

Explictly state the behavior of having multiple `format.notes`
configuration variables so users are clear on what to expect.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe fifth batch
Junio C Hamano [Tue, 10 Dec 2019 21:53:00 +0000 (13:53 -0800)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'ag/sequencer-continue-leakfix'
Junio C Hamano [Tue, 10 Dec 2019 21:11:46 +0000 (13:11 -0800)] 
Merge branch 'ag/sequencer-continue-leakfix'

Leakfix.

* ag/sequencer-continue-leakfix:
  sequencer: fix a memory leak in sequencer_continue()

4 years agoMerge branch 'em/test-skip-regex-illseq'
Junio C Hamano [Tue, 10 Dec 2019 21:11:45 +0000 (13:11 -0800)] 
Merge branch 'em/test-skip-regex-illseq'

Test portability fix.

* em/test-skip-regex-illseq:
  t4210: skip i18n tests that don't work on FreeBSD

4 years agoMerge branch 'hi/gpg-use-check-signature'
Junio C Hamano [Tue, 10 Dec 2019 21:11:45 +0000 (13:11 -0800)] 
Merge branch 'hi/gpg-use-check-signature'

Hide lower-level verify_signed-buffer() API as a pure helper to
implement the public check_signature() function, in order to
encourage new callers to use the correct and more strict
validation.

* hi/gpg-use-check-signature:
  gpg-interface: prefer check_signature() for GPG verification

4 years agoMerge branch 'bc/t9001-zsh-in-posix-emulation-mode'
Junio C Hamano [Tue, 10 Dec 2019 21:11:45 +0000 (13:11 -0800)] 
Merge branch 'bc/t9001-zsh-in-posix-emulation-mode'

Test portability fix.

* bc/t9001-zsh-in-posix-emulation-mode:
  t9001: avoid including non-trailing NUL bytes in variables

4 years agoMerge branch 'sg/test-squelch-noise-in-commit-bulk'
Junio C Hamano [Tue, 10 Dec 2019 21:11:44 +0000 (13:11 -0800)] 
Merge branch 'sg/test-squelch-noise-in-commit-bulk'

Code cleanup.

* sg/test-squelch-noise-in-commit-bulk:
  test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk'

4 years agoMerge branch 'jk/perf-wo-git-dot-pm'
Junio C Hamano [Tue, 10 Dec 2019 21:11:44 +0000 (13:11 -0800)] 
Merge branch 'jk/perf-wo-git-dot-pm'

Test cleanup.

* jk/perf-wo-git-dot-pm:
  t/perf: don't depend on Git.pm

4 years agoMerge branch 'ds/commit-graph-delay-gen-progress'
Junio C Hamano [Tue, 10 Dec 2019 21:11:43 +0000 (13:11 -0800)] 
Merge branch 'ds/commit-graph-delay-gen-progress'

One kind of progress messages were always given during commit-graph
generation, instead of following the "if it takes more than two
seconds, show progress" pattern, which has been corrected.

* ds/commit-graph-delay-gen-progress:
  commit-graph: use start_delayed_progress()
  progress: create GIT_PROGRESS_DELAY

4 years agoMerge branch 'jt/clone-recursesub-ref-advise'
Junio C Hamano [Tue, 10 Dec 2019 21:11:43 +0000 (13:11 -0800)] 
Merge branch 'jt/clone-recursesub-ref-advise'

The interaction between "git clone --recurse-submodules" and
alternate object store was ill-designed.  The documentation and
code have been taught to make more clear recommendations when the
users see failures.

* jt/clone-recursesub-ref-advise:
  submodule--helper: advise on fatal alternate error
  Doc: explain submodule.alternateErrorStrategy

4 years agoMerge branch 'as/t7812-missing-redirects-fix'
Junio C Hamano [Tue, 10 Dec 2019 21:11:43 +0000 (13:11 -0800)] 
Merge branch 'as/t7812-missing-redirects-fix'

Test fix.

* as/t7812-missing-redirects-fix:
  t7812: expect failure for grep -i with invalid UTF-8 data
  t7812: add missing redirects

4 years agoMerge branch 'dl/pretty-reference'
Junio C Hamano [Tue, 10 Dec 2019 21:11:42 +0000 (13:11 -0800)] 
Merge branch 'dl/pretty-reference'

"git log" family learned "--pretty=reference" that gives the name
of a commit in the format that is often used to refer to it in log
messages.

* dl/pretty-reference:
  SubmittingPatches: use `--pretty=reference`
  pretty: implement 'reference' format
  pretty: add struct cmt_fmt_map::default_date_mode_type
  pretty: provide short date format
  t4205: cover `git log --reflog -z` blindspot
  pretty.c: inline initalize format_context
  revision: make get_revision_mark() return const pointer
  completion: complete `tformat:` pretty format
  SubmittingPatches: remove dq from commit reference
  pretty-formats.txt: use generic terms for hash
  SubmittingPatches: use generic terms for hash

4 years agoMerge branch 'dl/submodule-set-url'
Junio C Hamano [Tue, 10 Dec 2019 21:11:42 +0000 (13:11 -0800)] 
Merge branch 'dl/submodule-set-url'

"git submodule" learned a subcommand "set-url".

* dl/submodule-set-url:
  submodule: teach set-url subcommand

4 years agoMerge branch 'js/mingw-inherit-only-std-handles'
Junio C Hamano [Tue, 10 Dec 2019 21:11:42 +0000 (13:11 -0800)] 
Merge branch 'js/mingw-inherit-only-std-handles'

Work around a issue where a FD that is left open when spawning a
child process and is kept open in the child can interfere with the
operation in the parent process on Windows.

* js/mingw-inherit-only-std-handles:
  mingw: forbid translating ERROR_SUCCESS to an errno value
  mingw: do set `errno` correctly when trying to restrict handle inheritance
  mingw: restrict file handle inheritance only on Windows 7 and later
  mingw: spawned processes need to inherit only standard handles
  mingw: work around incorrect standard handles
  mingw: demonstrate that all file handles are inherited by child processes

4 years agoMerge branch 'po/bundle-doc-clonable'
Junio C Hamano [Tue, 10 Dec 2019 21:11:41 +0000 (13:11 -0800)] 
Merge branch 'po/bundle-doc-clonable'

Doc update.

* po/bundle-doc-clonable:
  Doc: Bundle file usage

4 years agoMerge branch 'ra/rebase-i-more-options'
Junio C Hamano [Tue, 10 Dec 2019 21:11:41 +0000 (13:11 -0800)] 
Merge branch 'ra/rebase-i-more-options'

"git rebase -i" learned a few options that are known by "git
rebase" proper.

* ra/rebase-i-more-options:
  rebase -i: finishing touches to --reset-author-date
  rebase: add --reset-author-date
  rebase -i: support --ignore-date
  sequencer: rename amend_author to author_to_rename
  rebase -i: support --committer-date-is-author-date
  sequencer: allow callers of read_author_script() to ignore fields
  rebase -i: add --ignore-whitespace flag

4 years agoMerge branch 'am/pathspec-from-file'
Junio C Hamano [Tue, 10 Dec 2019 21:11:40 +0000 (13:11 -0800)] 
Merge branch 'am/pathspec-from-file'

A few commands learned to take the pathspec from the
standard input or a named file, instead of taking it as the command
line arguments.

* am/pathspec-from-file:
  commit: support the --pathspec-from-file option
  doc: commit: synchronize <pathspec> description
  reset: support the `--pathspec-from-file` option
  doc: reset: synchronize <pathspec> description
  pathspec: add new function to parse file
  parse-options.h: add new options `--pathspec-from-file`, `--pathspec-file-nul`

4 years agoSync with Git 2.24.1
Junio C Hamano [Tue, 10 Dec 2019 06:17:55 +0000 (22:17 -0800)] 
Sync with Git 2.24.1

4 years agoformat-patch: move git_config() before repo_init_revisions()
Denton Liu [Mon, 9 Dec 2019 13:10:48 +0000 (05:10 -0800)] 
format-patch: move git_config() before repo_init_revisions()

In 13cdf78094 (format-patch: teach format.notes config option,
2019-05-16), the order in which git_config() and repo_init_revisions()
were swapped so that `rev.notes_opt` would be initialized before
git_config() was called. This is problematic, however, as git_config()
should generally be called before repo_init_revisions().

Break this circular dependency by creating `show_notes` and `notes_opt`
which git_config() reads into. Then, copy these values over to
`rev.show_notes` and `rev.notes_opt` after repo_init_revisions() is
called.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoformat-patch: use --notes behavior for format.notes
Denton Liu [Mon, 9 Dec 2019 13:10:46 +0000 (05:10 -0800)] 
format-patch: use --notes behavior for format.notes

When we had multiple `format.notes` config values where we had `<ref1>`,
`false`, `<ref2>` (in that order), then we would print out the notes for
both `<ref1>` and `<ref2>`. This doesn't make sense, however, since we
parse the config in a top-down manner and a `false` should be able to
override previous configurations, just like how `--no-notes` will
override previous `--notes`.

Duplicate the logic that handles the `--[no-]notes[=]` option to
`format.notes` for consistency. As a result, when parsing the config
from top to bottom, `format.notes = true` will behave like `--notes`,
`format.notes = <ref>` will behave like `--notes=<ref>` and
`format.notes = false` will behave like `--no-notes`.

This change isn't strictly backwards compatible but since it is an edge
case where a sane user would not mix notes refs with `false` and this
feature is relatively new (released only in v2.23.0), this change should
be harmless.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agonotes: extract logic into set_display_notes()
Denton Liu [Mon, 9 Dec 2019 13:10:44 +0000 (05:10 -0800)] 
notes: extract logic into set_display_notes()

Instead of open coding the logic that tweaks the variables in
`struct display_notes_opt` within handle_revision_opt(), abstract away the
logic into set_display_notes() so that it can be reused.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agonotes: create init_display_notes() helper
Denton Liu [Mon, 9 Dec 2019 13:10:41 +0000 (05:10 -0800)] 
notes: create init_display_notes() helper

We currently open code the initialization for revs->notes_opt. Abstract
this away into a helper function so that the logic can be reused in a
future commit.

This is slightly wasteful as we memset the struct twice but this is only
run once so it shouldn't have any major effect.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agonotes: rename to load_display_notes()
Denton Liu [Mon, 9 Dec 2019 13:10:39 +0000 (05:10 -0800)] 
notes: rename to load_display_notes()

According to the function comment, init_display_notes() was supposed to
"Load the notes machinery for displaying several notes trees." Rename
this function to load_display_notes() so that its use is more accurately
represented.

This is done because, in a future commit, we will reuse the name
init_display_notes().

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoarchive-zip: use enum for compression method
René Scharfe [Sat, 7 Dec 2019 12:20:33 +0000 (13:20 +0100)] 
archive-zip: use enum for compression method

Add an enumeration to assign names to the magic values that determine
the ZIP compression method to use.  Use those names to improve code
readability.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: minor case fix in 'git branch' '--unset-upstream' description
Dimitriy Ryazantcev [Sun, 8 Dec 2019 09:26:47 +0000 (11:26 +0200)] 
l10n: minor case fix in 'git branch' '--unset-upstream' description

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3404: fix indentation
Johannes Schindelin [Sat, 7 Dec 2019 22:22:44 +0000 (22:22 +0000)] 
t3404: fix indentation

This test case was added in 66ae9a57b88 (t3404: rebase -i: demonstrate
short SHA-1 collision, 2013-08-23), and it is not indented in the way we
usually indent sub-shell code in our test cases these days.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopatch-id: use oid_to_hex() to print multiple object IDs
René Scharfe [Sat, 7 Dec 2019 19:16:51 +0000 (20:16 +0100)] 
patch-id: use oid_to_hex() to print multiple object IDs

flush_current_id() prints the hexadecimal representation of two object
IDs.  When the code was added in f97672225b (Add "git-patch-id" program
to generate patch ID's., 2005-06-23), sha1_to_hex() had only a single
internal static buffer, so the result of one invocation had to be stored
in a local buffer.

Since dcb3450fd8 (sha1_to_hex() usage cleanup, 2006-05-03) it rotates
through four buffers, which allows to print up to four object IDs at the
same time.  1a876a69af6 (patch-id: convert to use struct object_id,
2015-03-13) replaced sha1_to_hex() with oid_to_hex(), which has the same
feature.  Use it to simplify the code.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit: use strbuf_add() to add a length-limited string
René Scharfe [Sat, 7 Dec 2019 11:16:04 +0000 (12:16 +0100)] 
commit: use strbuf_add() to add a length-limited string

This is shorter and simpler.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe fourth batch
Junio C Hamano [Fri, 6 Dec 2019 23:10:00 +0000 (15:10 -0800)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'dl/lore-is-the-archive'
Junio C Hamano [Fri, 6 Dec 2019 23:09:24 +0000 (15:09 -0800)] 
Merge branch 'dl/lore-is-the-archive'

Publicize lore.kernel.org mailing list archive and use URLs
pointing into it to refer to notable messages in the documentation.

* dl/lore-is-the-archive:
  doc: replace LKML link with lore.kernel.org
  RelNotes: replace Gmane with real Message-IDs
  doc: replace MARC links with lore.kernel.org

4 years agoMerge branch 'jk/lore-is-the-archive'
Junio C Hamano [Fri, 6 Dec 2019 23:09:23 +0000 (15:09 -0800)] 
Merge branch 'jk/lore-is-the-archive'

Doc update for the mailing list archiving and nntp service.

* jk/lore-is-the-archive:
  doc: replace public-inbox links with lore.kernel.org
  doc: recommend lore.kernel.org over public-inbox.org

4 years agoMerge branch 'tg/perf-remove-stale-result'
Junio C Hamano [Fri, 6 Dec 2019 23:09:23 +0000 (15:09 -0800)] 
Merge branch 'tg/perf-remove-stale-result'

PerfTest fix to avoid stale result mixed up with the latest round
of test results.

* tg/perf-remove-stale-result:
  perf-lib: use a single filename for all measurement types

4 years agoMerge branch 'jk/send-pack-check-negative-with-quick'
Junio C Hamano [Fri, 6 Dec 2019 23:09:22 +0000 (15:09 -0800)] 
Merge branch 'jk/send-pack-check-negative-with-quick'

Performance tweak on "git push" into a repository with many refs
that point at objects we have never heard of.

* jk/send-pack-check-negative-with-quick:
  send-pack: use OBJECT_INFO_QUICK to check negative objects

4 years agoMerge branch 'hi/grep-do-not-return-void'
Junio C Hamano [Fri, 6 Dec 2019 23:09:22 +0000 (15:09 -0800)] 
Merge branch 'hi/grep-do-not-return-void'

Code cleanup.

* hi/grep-do-not-return-void:
  grep: don't return an expression from pcre2_free()

4 years agoMerge branch 'rs/use-skip-prefix-more'
Junio C Hamano [Fri, 6 Dec 2019 23:09:22 +0000 (15:09 -0800)] 
Merge branch 'rs/use-skip-prefix-more'

Code cleanup.

* rs/use-skip-prefix-more:
  name-rev: use skip_prefix() instead of starts_with()
  push: use skip_prefix() instead of starts_with()
  shell: use skip_prefix() instead of starts_with()
  fmt-merge-msg: use skip_prefix() instead of starts_with()
  fetch: use skip_prefix() instead of starts_with()

4 years agoMerge branch 'rs/simplify-prepare-cmd'
Junio C Hamano [Fri, 6 Dec 2019 23:09:22 +0000 (15:09 -0800)] 
Merge branch 'rs/simplify-prepare-cmd'

Code cleanup.

* rs/simplify-prepare-cmd:
  run-command: use prepare_git_cmd() in prepare_cmd()

4 years agoMerge branch 'rs/test-cleanup'
Junio C Hamano [Fri, 6 Dec 2019 23:09:22 +0000 (15:09 -0800)] 
Merge branch 'rs/test-cleanup'

Test cleanup.

* rs/test-cleanup:
  t7811: don't create unused file
  t9300: don't create unused file
  test: use test_must_be_empty F instead of test_cmp empty F
  test: use test_must_be_empty F instead of test -z $(cat F)
  t1400: use test_must_be_empty
  t1410: use test_line_count
  t1512: use test_line_count

4 years agoMerge branch 'sg/assume-no-todo-update-in-cherry-pick'
Junio C Hamano [Fri, 6 Dec 2019 23:09:21 +0000 (15:09 -0800)] 
Merge branch 'sg/assume-no-todo-update-in-cherry-pick'

While running "revert" or "cherry-pick --edit" for multiple
commits, a recent regression incorrectly detected "nothing to
commit, working tree clean", instead of replaying the commits,
which has been corrected.

* sg/assume-no-todo-update-in-cherry-pick:
  sequencer: don't re-read todo for revert and cherry-pick

4 years agoMerge branch 'sg/osx-force-gcc-9'
Junio C Hamano [Fri, 6 Dec 2019 23:09:21 +0000 (15:09 -0800)] 
Merge branch 'sg/osx-force-gcc-9'

TravisCI update.

* sg/osx-force-gcc-9:
  ci: build Git with GCC 9 in the 'osx-gcc' build job

4 years agorange-diff: clear `other_arg` at end of function
Denton Liu [Fri, 6 Dec 2019 20:16:31 +0000 (12:16 -0800)] 
range-diff: clear `other_arg` at end of function

We were leaking memory by not clearing `other_arg` after we were done
using it. Clear it after we've finished using it.

Note that this isn't strictly necessary since the memory will be
reclaimed once the command exits. However, since we are releasing the
strbufs, we should also clear `other_arg` for consistency.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorange-diff: mark pointers as const
Denton Liu [Fri, 6 Dec 2019 20:16:26 +0000 (12:16 -0800)] 
range-diff: mark pointers as const

The contents pointed to by `diffopt` and `other_arg` should not be
modified. Mark these as `const` to indicate this.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3206: fix incorrect test name
Denton Liu [Fri, 6 Dec 2019 20:16:22 +0000 (12:16 -0800)] 
t3206: fix incorrect test name

The name of the test used to indicate that it was testing the `--notes`
option but it was really testing the `format.notes` configuration.
Correct the test name to reflect this.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot9300-fast-import: don't hang if background fast-import exits too early
SZEDER Gábor [Fri, 6 Dec 2019 19:03:31 +0000 (20:03 +0100)] 
t9300-fast-import: don't hang if background fast-import exits too early

The five tests checking 'git fast-import's checkpoint handling in
't9300-fast-import.sh', all with the prefix "V:" in their test
description, can hang indefinitely if 'git fast-import' unexpectedly
dies early in any of these tests.

These five tests run 'git fast-import' in the background, while
feeding instructions to its standard input through a fifo (fd 8) from
a background subshell, and reading and verifying its standard output
through another fifo (fd 9) in the test script's main shell process.
This "reading and verifying" is basically a 'while read ...' shell
loop iterating until 'git fast-import' outputs the expected line,
ignoring any other output.  This doesn't work very well when 'git
fast-import' dies before printing that particular line, because the
'read' builtin doesn't get EOF after the death of 'git fast-import',
as their input and output are not connected directly but through a
fifo.  Consequently, that 'read' hangs waiting for the next line from
the already dead 'git fast-import', leaving the test script and in
turn the whole test suite hanging.

Avoid this hang by checking whether the background 'git fast-import'
process exited unexpectedly early, and interrupt the 'while read' loop
if it did.  We have to jump through some hoops to achive that, though:

  - Start the background 'git fast-import' in another background
    subshell, which then:

      - prints the PID of that 'git fast-import' process to the fifo,
to be read by the main shell process, so it will know which
process to kill when the test is finished.

      - waits until that 'git fast-import' process exits.  If it does
exit, then report its exit code, and write a message to the
fifo used for 'git fast-import's standard output, thus
un-block the 'read' builtin in the main shell process.

  - Modify that 'while read' loop to break the loop upon seeing that
    message, and fail the test in the usual way.

  - Once the test is finished kill that background subshell as well,
    and do so before killing the background 'git fast-import'.
    Otherwise the background 'git fast-import' and subshell processes
    would die racily, and if 'git fast-import' were to die sooner,
    then we might get some undesired and potentially confusing
    messages in the test's output.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot9300-fast-import: store the PID in a variable instead of pidfile
SZEDER Gábor [Fri, 6 Dec 2019 19:03:30 +0000 (20:03 +0100)] 
t9300-fast-import: store the PID in a variable instead of pidfile

The five tests running 'git fast-import' in the background in
't9300-fast-import.sh' store the PID of that background process in a
pidfile, to be used to check whether that background process survived
each test and then to kill it in test_when_finished commands.  To
achieve this all these five tests run three $(cat <pidfile>) command
substitutions each.

Store the PID of the background 'git fast-import' in a variable to
avoid those extra processes.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoapply --allow-overlap: fix a corner case
Johannes Schindelin [Fri, 6 Dec 2019 13:08:25 +0000 (13:08 +0000)] 
apply --allow-overlap: fix a corner case

Yes, yes, this is supposed to be only a band-aid option for `git add -p`
not Doing The Right Thing. But as long as we carry the `--allow-overlap`
option, we might just as well get it right.

This fixes the case where one hunk inserts a line before the first line,
and is followed by a hunk whose context overlaps with the first one's
and which appends a line at the end.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogit add -p: use non-zero exit code when the diff generation failed
Johannes Schindelin [Fri, 6 Dec 2019 13:08:24 +0000 (13:08 +0000)] 
git add -p: use non-zero exit code when the diff generation failed

The first thing `git add -p` does is to generate a diff. If this diff
cannot be generated, `git add -p` should not continue as if nothing
happened, but instead fail.

What we *actually* do here is much broader: we now verify for *every*
`run_cmd_pipe()` call that the spawned process actually succeeded.

Note that we have to change two callers in this patch, as we need to
store the spawned process' output in a local variable, which means that
the callers can no longer decide whether to interpret the `return <$fh>`
in array or in scalar context.

This bug was noticed while writing a test case for the diff.algorithm
feature, and we let that test case double as a regression test for this
fixed bug, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3701: verify that the diff.algorithm config setting is handled
Johannes Schindelin [Fri, 6 Dec 2019 13:08:23 +0000 (13:08 +0000)] 
t3701: verify that the diff.algorithm config setting is handled

Without this patch, there is actually no test in Git's test suite that
covers the diff.algorithm feature. Let's add one.

We do this by passing a bogus value and then expecting `git diff-files`
to produce the appropriate error message.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3701: verify the shown messages when nothing can be added
Johannes Schindelin [Fri, 6 Dec 2019 13:08:22 +0000 (13:08 +0000)] 
t3701: verify the shown messages when nothing can be added

In preparation for re-implementing `git add -p` in pure C (where we will
purposefully keep the implementation of `git add -p` separate from the
implementation of `git add -i`), let's verify that the user is told the
same things as in the Perl version when the diff file is either empty or
contains only entries about binary files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3701: add a test for the different `add -p` prompts
Johannes Schindelin [Fri, 6 Dec 2019 13:08:21 +0000 (13:08 +0000)] 
t3701: add a test for the different `add -p` prompts

The `git add -p` command offers different prompts for regular diff hunks
vs mode change pseudo hunks vs diffs deleting files.

Let's cover this in the regresion test suite, in preparation for
re-implementing `git add -p` in C.

For the mode change prompt, we use a trick that lets this test case pass
even on systems without executable bit, i.e. where `core.filemode =
false` (such as Windows): we first add the file to the index with `git
add --chmod=+x`, and then call `git add -p` with `core.filemode` forced
to `true`. The file on disk has no executable bit set, therefore we will
see a mode change.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3701: avoid depending on the TTY prerequisite
Johannes Schindelin [Fri, 6 Dec 2019 13:08:20 +0000 (13:08 +0000)] 
t3701: avoid depending on the TTY prerequisite

The TTY prerequisite is a rather heavy one: it not only requires Perl to
work, but also the IO/Pty.pm module (with native support, and it
requires pseudo terminals, too).

In particular, test cases marked with the TTY prerequisite would be
skipped in Git for Windows' SDK.

In the case of `git add -p`, we do not actually need that big a hammer,
as we do not want to test any functionality that requires a pseudo
terminal; all we want is for the interactive add command to use color,
even when being called from within the test suite.

And we found exactly such a trick earlier already: when we added a test
case to verify that the main loop of `git add -i` is colored
appropriately. Let's use that trick instead of the TTY prerequisite.

While at it, we avoid the pipes, as we do not want a SIGPIPE to break
the regression test cases (which will be much more likely when we do not
run everything through Perl because that is inherently slower).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3701: add a test for advanced split-hunk editing
Johannes Schindelin [Fri, 6 Dec 2019 13:08:19 +0000 (13:08 +0000)] 
t3701: add a test for advanced split-hunk editing

In this developer's workflows, it often happens that a hunk needs to be
edited in a way that adds lines, and sometimes even reduces the number
of context lines.

Let's add a regression test for this.

Note that just like the preceding test case, the new test case is *not*
handled gracefully by the current `git add -p`. It will be handled
correctly by the upcoming built-in `git add -p`, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.24.1 v2.24.1
Johannes Schindelin [Wed, 4 Dec 2019 22:10:12 +0000 (23:10 +0100)] 
Git 2.24.1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.23.1
Johannes Schindelin [Wed, 4 Dec 2019 22:09:11 +0000 (23:09 +0100)] 
Sync with 2.23.1

* maint-2.23: (44 commits)
  Git 2.23.1
  Git 2.22.2
  Git 2.21.1
  mingw: sh arguments need quoting in more circumstances
  mingw: fix quoting of empty arguments for `sh`
  mingw: use MSYS2 quoting even when spawning shell scripts
  mingw: detect when MSYS2's sh is to be spawned more robustly
  t7415: drop v2.20.x-specific work-around
  Git 2.20.2
  t7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x
  Git 2.19.3
  Git 2.18.2
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  ...

4 years agoGit 2.23.1 v2.23.1
Johannes Schindelin [Wed, 4 Dec 2019 22:07:46 +0000 (23:07 +0100)] 
Git 2.23.1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.22.2
Johannes Schindelin [Wed, 4 Dec 2019 22:06:31 +0000 (23:06 +0100)] 
Sync with 2.22.2

* maint-2.22: (43 commits)
  Git 2.22.2
  Git 2.21.1
  mingw: sh arguments need quoting in more circumstances
  mingw: fix quoting of empty arguments for `sh`
  mingw: use MSYS2 quoting even when spawning shell scripts
  mingw: detect when MSYS2's sh is to be spawned more robustly
  t7415: drop v2.20.x-specific work-around
  Git 2.20.2
  t7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x
  Git 2.19.3
  Git 2.18.2
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  ...

4 years agoGit 2.22.2 v2.22.2
Johannes Schindelin [Wed, 4 Dec 2019 22:05:10 +0000 (23:05 +0100)] 
Git 2.22.2

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.21.1
Johannes Schindelin [Wed, 4 Dec 2019 22:03:16 +0000 (23:03 +0100)] 
Sync with 2.21.1

* maint-2.21: (42 commits)
  Git 2.21.1
  mingw: sh arguments need quoting in more circumstances
  mingw: fix quoting of empty arguments for `sh`
  mingw: use MSYS2 quoting even when spawning shell scripts
  mingw: detect when MSYS2's sh is to be spawned more robustly
  t7415: drop v2.20.x-specific work-around
  Git 2.20.2
  t7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x
  Git 2.19.3
  Git 2.18.2
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  ...

4 years agoGit 2.21.1 v2.21.1
Johannes Schindelin [Wed, 4 Dec 2019 22:01:50 +0000 (23:01 +0100)] 
Git 2.21.1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoMerge branch 'fix-msys2-quoting-bugs'
Johannes Schindelin [Mon, 16 Sep 2019 11:26:40 +0000 (13:26 +0200)] 
Merge branch 'fix-msys2-quoting-bugs'

These patches fix several bugs in quoting arguments when spawning shell
scripts on Windows.

Note: these bugs are Windows-only, as we have to construct a command
line for the process-to-spawn, unlike Linux/macOS, where `execv()`
accepts an already-split command line.

Furthermore, these fixes were not included in the CVE-2019-1350 part of
v2.14.6 because the Windows-specific quoting when spawning shell scripts
was contributed from Git for Windows into Git only in the v2.21.x era.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agomingw: sh arguments need quoting in more circumstances
Johannes Schindelin [Thu, 19 Sep 2019 21:43:03 +0000 (23:43 +0200)] 
mingw: sh arguments need quoting in more circumstances

Previously, we failed to quote characters such as '*', '(' and the
likes. Let's fix this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agot7415: drop v2.20.x-specific work-around
Johannes Schindelin [Wed, 4 Dec 2019 21:47:25 +0000 (22:47 +0100)] 
t7415: drop v2.20.x-specific work-around

This reverts the work-around that was introduced just for the v2.20.x
release train in "t7415: adjust test for dubiously-nested submodule
gitdirs for v2.20.x"; It is not necessary for v2.21.x.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agomingw: fix quoting of empty arguments for `sh`
Johannes Schindelin [Thu, 19 Sep 2019 21:38:33 +0000 (23:38 +0200)] 
mingw: fix quoting of empty arguments for `sh`

When constructing command-lines to spawn processes, it is an unfortunate
but necessary decision to quote arguments differently: MSYS2 has
different dequoting rules (inherited from Cygwin) than the rest of
Windows.

To accommodate that, Git's Windows compatibility layer has two separate
quoting helpers, one for MSYS2 (which it uses exclusively when spawning
`sh`) and the other for regular Windows executables.

The MSYS2 one had an unfortunate bug where a `,` somehow slipped in,
instead of the `;`. As a consequence, empty arguments would not be
enclosed in a pair of double quotes, but the closing double quote was
skipped.

Let's fix this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agomingw: use MSYS2 quoting even when spawning shell scripts
Johannes Schindelin [Thu, 19 Sep 2019 15:05:45 +0000 (17:05 +0200)] 
mingw: use MSYS2 quoting even when spawning shell scripts

At the point where `mingw_spawn_fd()` is called, we already have a full
path to the script interpreter in that scenario, and we pass it in as
the executable to run, while the `argv` reflect what the script should
receive as command-line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agomingw: detect when MSYS2's sh is to be spawned more robustly
Johannes Schindelin [Thu, 19 Sep 2019 15:05:21 +0000 (17:05 +0200)] 
mingw: detect when MSYS2's sh is to be spawned more robustly

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.20.2
Johannes Schindelin [Wed, 4 Dec 2019 21:46:37 +0000 (22:46 +0100)] 
Sync with 2.20.2

* maint-2.20: (36 commits)
  Git 2.20.2
  t7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x
  Git 2.19.3
  Git 2.18.2
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  ...

4 years agoGit 2.20.2 v2.20.2
Johannes Schindelin [Wed, 4 Dec 2019 21:33:15 +0000 (22:33 +0100)] 
Git 2.20.2

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agosubmodule: defend against submodule.update = !command in .gitmodules
Jonathan Nieder [Thu, 5 Dec 2019 09:28:28 +0000 (01:28 -0800)] 
submodule: defend against submodule.update = !command in .gitmodules

In v2.15.4, we started to reject `submodule.update` settings in
`.gitmodules`. Let's raise a BUG if it somehow still made it through
from anywhere but the Git config.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
4 years agot7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x
Johannes Schindelin [Wed, 4 Dec 2019 09:06:08 +0000 (10:06 +0100)] 
t7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x

In v2.20.x, Git clones submodules recursively by first creating the
submodules' gitdirs and _then_ "updating" the submodules. This can lead
to the situation where the clone path is taken because the directory
(while it exists already) is not a git directory, but then the clone
fails because that gitdir is unexpectedly already a directory.

This _also_ works around the vulnerability that was fixed in "Disallow
dubiously-nested submodule git directories", but it produces a different
error message than the one expected by the test case, therefore we
adjust the test case accordingly.

Note: as the two submodules "race each other", there are actually two
possible error messages, therefore we have to teach the test case to
expect _two_ possible (and good) outcomes in addition to the one it
expected before.

Note: this workaround is only necessary for the v2.20.x release train;
The behavior changed again in v2.21.x so that the original test case's
expectations are met again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.19.3
Johannes Schindelin [Wed, 4 Dec 2019 21:31:10 +0000 (22:31 +0100)] 
Sync with 2.19.3

* maint-2.19: (34 commits)
  Git 2.19.3
  Git 2.18.2
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  ...

4 years agoGit 2.19.3 v2.19.3
Johannes Schindelin [Wed, 4 Dec 2019 21:29:33 +0000 (22:29 +0100)] 
Git 2.19.3

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.18.2
Johannes Schindelin [Wed, 4 Dec 2019 21:27:04 +0000 (22:27 +0100)] 
Sync with 2.18.2

* maint-2.18: (33 commits)
  Git 2.18.2
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  is_ntfs_dotgit(): speed it up
  ...

4 years agoGit 2.18.2 v2.18.2
Johannes Schindelin [Wed, 4 Dec 2019 21:22:52 +0000 (22:22 +0100)] 
Git 2.18.2

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
4 years agoSync with 2.17.3
Johannes Schindelin [Wed, 4 Dec 2019 21:21:20 +0000 (22:21 +0100)] 
Sync with 2.17.3

* maint-2.17: (32 commits)
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  is_ntfs_dotgit(): speed it up
  mingw: disallow backslash characters in tree objects' file names
  ...

4 years agoGit 2.17.3 v2.17.3
Johannes Schindelin [Wed, 4 Dec 2019 21:13:04 +0000 (22:13 +0100)] 
Git 2.17.3

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>