Commit graph

60875 commits

Author SHA1 Message Date
Philippe Blain 88894aaeea blame: simplify 'setup_scoreboard' interface
The previous commit moved the initialization of 'sb.path' in
'builtin/blame.c::cmd_blame' before the call to
'blame.c::setup_scoreboard'. Since 'cmd_blame' is the only caller of
'setup_scoreboard', it is now unnecessary for 'setup_scoreboard' to
receive 'path' as a separate argument, as 'sb.path' is already
initialized.

Remove this argument from setup_scoreboard's interface and use the
'path' field of the 'sb' 'struct blame_scoreboard' instead.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:15 -08:00
Philippe Blain 9466e3809d blame: enable funcname blaming with userdiff driver
In blame.c::cmd_blame, we send the 'path' field of the 'sb' 'struct
blame_scoreboard' as the 'path' argument to
'line-range.c::parse_range_arg', but 'sb.path' is not set yet; it's set
to the local variable 'path' a few lines later at line 1137.

This 'path' argument is only used in 'parse_range_arg' if we are blaming
a funcname, i.e. `git blame -L :<funcname> <path>`, and in that case it
is sent to 'parse_range_funcname', where it is used to determine if a
userdiff driver should be used for said <path> to match the given
funcname.

Since 'path' is yet unset, the userdiff driver is never used, so we fall
back to the default funcname regex, which is usually not appropriate for
paths that are set to use a specific userdiff driver, and thus either we
match some unrelated lines, or we die with

    fatal: -L parameter '<funcname>' starting at line 1: no match

This has been the case ever since `git blame` learned to blame a
funcname in 13b8f68c1f (log -L: :pattern:file syntax to find by
funcname, 2013-03-28).

Enable funcname blaming for paths using specific userdiff drivers by
initializing 'sb.path' earlier in 'cmd_blame', when some of its other
fields are initialized, so that it is set when passed to
'parse_range_arg'.

Add a regression test in 'annotate-tests.sh', which is sourced in
t8001-annotate.sh and t8002-blame.sh, leveraging an existing file used
to test the userdiff patterns in t4018-diff-funcname.

Also, use 'sb.path' instead of 'path' when constructing the error
message at line 1114, for consistency.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:15 -08:00
Philippe Blain 180d641d7d line-log: mention both modes in 'blame' and 'log' short help
'git blame -h' and 'git log -h' both show '-L <n,m>' and describe this
option as "Process only line range n,m, counting from 1". No hint is
given that a function name regex can also be used.

Use <range> instead, and expand the description of the option to mention
both modes. Remove "counting from 1" as it's uneeded; it's uncommon to
refer to the first line of a file as "line 0".

Also, for 'git log', improve the wording to better reflect the long help.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:14 -08:00
Philippe Blain 0cce88f1e4 doc: add more pointers to gitattributes(5) for userdiff
Several Git commands can make use of the builtin userdiff patterns, but
it's not obvious in the documentation. Add pointers to the 'Defining a
custom hunk header' part of gitattributes(5) in the description of the
following options:

- the '--function-context' option of `git diff` and friends
- the '--function-context' option of `git grep`
- the '-L :<funcname>' option of `git log`, `gitk` and `git blame`

In 'git-grep.txt', take the opportunity to use backticks in the
description of '--show-function', and improve the wording of the
desription of '--function-context'.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:14 -08:00
Philippe Blain a4514a46d9 blame-options.txt: also mention 'funcname' in '-L' description
Make it clearer that a function can be blamed by feeding `git blame`
'-L :<funcname>' by mentioning it at the beginnning of the description
of the '-L' option.

Also, in 'line-range-options.txt', which is used for git-log(1) and
gitk(1), do not parenthesize the mention of the ':<funcname>' mode, to
place it on equal footing with the '<start>,<end>' mode.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:14 -08:00
Philippe Blain fd5c74e781 doc: line-range: improve formatting
Improve the formatting of the description of the line-range option '-L'
for `git log`, `gitk` and `git blame`:

- Use bold for <start>, <end> and <funcname>
- Use backticks for literals

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:14 -08:00
Philippe Blain f9c8d8cbbe doc: log, gitk: move '-L' description to 'line-range-options.txt'
The description of the '-L' option for `git log` and `gitk` is almost
the same, but is repeated in both 'git-log.txt' and 'gitk.txt' (the
difference being that 'git-log.txt' lists the option with a space
after '-L', while 'gitk.txt' lists it as stuck and notes that `gitk`
only understands the stuck form).

Reduce duplication by creating a new file, 'line-range-options.txt',
and include it in both files.

To simplify the presentation, only list the stuck form for both
commands, and remove the note about `gitk` only understanding the stuck
form.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-01 15:54:14 -08:00
Junio C Hamano e2850a27a9 Second batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-30 13:04:24 -07:00
Junio C Hamano 876511ef61 Merge branch 'js/ci-ghwf-dedup-tests'
GitHub Actions automated test improvement to skip tests on a tree
identical to what has already been tested.

* js/ci-ghwf-dedup-tests:
  ci: make the "skip-if-redundant" check more defensive
  ci: work around old records of GitHub runs
2020-10-30 13:04:24 -07:00
Junio C Hamano f9c0e741a9 Merge branch 'dl/resurrect-update-for-sha256'
"git resurrect" script (in contrib/) learned that the object names
may be longer than 40-hex depending on the hash function in use.

* dl/resurrect-update-for-sha256:
  contrib/git-resurrect.sh: use hash-agnostic OID pattern
  contrib/git-resurrect.sh: indent with tabs
2020-10-30 13:04:24 -07:00
Junio C Hamano c8b7c0272a Merge branch 'cm/t7xxx-cleanup'
Micro clean-up.

* cm/t7xxx-cleanup:
  t7102: prepare expected output inside test_expect_* block
  t7201: put each command on a separate line
  t7201: use 'git -C' to avoid subshell
  t7102,t7201: remove whitespace after redirect operator
  t7102,t7201: remove unnecessary blank spaces in test body
  t7101,t7102,t7201: modernize test formatting
2020-10-30 13:04:24 -07:00
Junio C Hamano a42035fbe4 Merge branch 'ct/t0000-use-test-path-is-file'
Micro clean-up of a test script.

* ct/t0000-use-test-path-is-file:
  t0000: use test_path_is_file instead of "test -f"
2020-10-30 13:04:24 -07:00
Junio C Hamano 678c787c00 Merge branch 'en/t7518-unflake'
Work around flakiness in a test.

* en/t7518-unflake:
  t7518: fix flaky grep invocation
2020-10-30 13:04:23 -07:00
Junio C Hamano ad27df6a5c Git 2.29.2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAl+bMwAACgkQsLXohpav
 5svZGw/7BZHWgPdL0HDPmOW31sHSB09g8qFfKNLcCuTXy8Mov05uUOScH958NDhu
 sZE4HLFk89zZMJrQO+6SfSxuX/d+MzMdX0ul0dNMPe5XGqyuQCshwX0FtWGbXL/2
 XSIP+QjK9mGCo16N497uWGX7PT1jyCg2mYdBBi29QR97y7zN6frgdvUB6EYjUvbT
 NQwV1hKawRHw8jqhpJG2a3iVR78WM35M3+alc5dDilpnaDtCMuIpTGSOsICwYVvG
 LMHbAekwFK+OIjUbgdUtr7fV6yJ98vMKcHkGwcBVE8zjBP4F1lgVJNpE8b99bGv9
 lg1vESujj/O/OrTM5pcnmxOTF8q+k8qy4cOgc4+nWjwvbuHAexxln3LBauGO52kZ
 givxpO+QCK95coK1UXhCI0RtaeX8dLe/mBH3kshQaMLABnCANNDR7aBPd7bSyVW7
 lzdYvSIi+MjK48wEGOmyE25diB8W024/orKeaOHBHF5KIjslWLuWuTXPzQJWY9q/
 8a2GDN1rGIN3k/M59TLLMAQFKgGRCPLkL/D/5iuoyVZhychQG5z5/+Pnxf1tK9bb
 rit830W6KagQH+g9BWytsMFUvdNMBygggdibAwIwTIe+mxOsGXZBPgLTkz9X14Ol
 lYMu8vlt40X6erC/EjTA1cfX8GF6DpWC3+4mG+VHMfzBdNwlTG4=
 =fy0P
 -----END PGP SIGNATURE-----

Sync with Git 2.29.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-29 14:25:15 -07:00
Junio C Hamano 898f80736c Git 2.29.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-29 14:24:09 -07:00
Junio C Hamano a94bce62b9 Merge branch 'cc/doc-filter-branch-typofix' into maint
Docfix.

* cc/doc-filter-branch-typofix:
  filter-branch doc: fix filter-repo typo
2020-10-29 14:18:49 -07:00
Junio C Hamano 4f9f7c1442 Merge branch 'jk/committer-date-is-author-date-fix' into maint
In 2.29, "--committer-date-is-author-date" option of "rebase" and
"am" subcommands lost the e-mail address by mistake, which has been
corrected.

* jk/committer-date-is-author-date-fix:
  rebase: fix broken email with --committer-date-is-author-date
  am: fix broken email with --committer-date-is-author-date
  t3436: check --committer-date-is-author-date result more carefully
2020-10-29 14:18:47 -07:00
Junio C Hamano f9b6481aed First batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-27 15:09:51 -07:00
Junio C Hamano 0e41cfad62 Merge branch 'dl/checkout-guess'
"git checkout" learned to use checkout.guess configuration variable
and enable/disable its "--[no-]guess" option accordingly.

* dl/checkout-guess:
  checkout: learn to respect checkout.guess
  Documentation/config/checkout: replace sq with backticks
2020-10-27 15:09:51 -07:00
Junio C Hamano f3cfeb3078 Merge branch 'dl/checkout-p-merge-base'
"git checkout -p A...B [-- <path>]" did not work, even though the
same command without "-p" correctly used the merge-base between
commits A and B.

* dl/checkout-p-merge-base:
  t2016: add a NEEDSWORK about the PERL prerequisite
  add-patch: add NEEDSWORK about comparing commits
  Doc: document "A...B" form for <tree-ish> in checkout and switch
  builtin/checkout: fix `git checkout -p HEAD...` bug
2020-10-27 15:09:51 -07:00
Junio C Hamano 40696c6727 Merge branch 'sb/clone-origin'
"git clone" learned clone.defaultremotename configuration variable
to customize what nickname to use to call the remote the repository
was cloned from.

* sb/clone-origin:
  clone: allow configurable default for `-o`/`--origin`
  clone: read new remote name from remote_name instead of option_origin
  clone: validate --origin option before use
  refs: consolidate remote name validation
  remote: add tests for add and rename with invalid names
  clone: use more conventional config/option layering
  clone: add tests for --template and some disallowed option pairs
2020-10-27 15:09:50 -07:00
Junio C Hamano de0a7effc8 Merge branch 'sk/force-if-includes'
"git push --force-with-lease[=<ref>]" can easily be misused to lose
commits unless the user takes good care of their own "git fetch".
A new option "--force-if-includes" attempts to ensure that what is
being force-pushed was created after examining the commit at the
tip of the remote ref that is about to be force-replaced.

* sk/force-if-includes:
  t, doc: update tests, reference for "--force-if-includes"
  push: parse and set flag for "--force-if-includes"
  push: add reflog check for "--force-if-includes"
2020-10-27 15:09:49 -07:00
Junio C Hamano 52b8c8c716 Merge branch 'ds/maintenance-part-2'
"git maintenance", an extended big brother of "git gc", continues
to evolve.

* ds/maintenance-part-2:
  maintenance: add incremental-repack auto condition
  maintenance: auto-size incremental-repack batch
  maintenance: add incremental-repack task
  midx: use start_delayed_progress()
  midx: enable core.multiPackIndex by default
  maintenance: create auto condition for loose-objects
  maintenance: add loose-objects task
  maintenance: add prefetch task
2020-10-27 15:09:47 -07:00
Junio C Hamano 26bb5437f6 Merge branch 'rs/worktree-list-show-locked'
"git worktree list" now shows if each worktree is locked.  This
possibly may open us to show other kinds of states in the future.

* rs/worktree-list-show-locked:
  worktree: teach `list` to annotate locked worktree
2020-10-27 15:09:47 -07:00
Junio C Hamano ae84e924da Merge branch 'rs/tighten-callers-of-deref-tag'
Code clean-up.

* rs/tighten-callers-of-deref-tag:
  line-log: handle deref_tag() returning NULL
  blame: handle deref_tag() returning NULL
  grep: handle deref_tag() returning NULL
2020-10-27 15:09:46 -07:00
Junio C Hamano 63e52739d2 Merge branch 'rs/dist-doc-with-git-archive'
Use "git archive" more to produce the release tarball.

* rs/dist-doc-with-git-archive:
  Makefile: remove the unused variable TAR_DIST_EXTRA_OPTS
  Makefile: use git init/add/commit/archive for dist-doc
2020-10-27 15:09:46 -07:00
Junio C Hamano 1a42a77f4b Merge branch 'cw/ci-ghwf-check-ws-errors'
Dev support.

* cw/ci-ghwf-check-ws-errors:
  ci: github action - add check for whitespace errors
2020-10-27 15:09:46 -07:00
Junio C Hamano 2810828d7c Merge branch 'sd/userdiff-css-update'
Userdiff for CSS update.

* sd/userdiff-css-update:
  userdiff: expand detected chunk headers for css
2020-10-27 15:09:46 -07:00
Junio C Hamano a4adb60583 Merge branch 'rk/completion-stash'
The command line completion script (in contrib/) learned that "git
stash show" takes the options "git diff" takes.

* rk/completion-stash:
  git-completion.bash: stash-show: complete $__git_diff_common_options
  git-completion.bash: __git_diff_common_options: add --[no-]patch
2020-10-27 15:09:46 -07:00
Junio C Hamano dc53e7bc20 Merge branch 'kb/userdiff-rust-macro-rules'
Userdiff for Rust update.

* kb/userdiff-rust-macro-rules:
  userdiff: recognize 'macro_rules!' as starting a Rust function block
2020-10-27 15:09:46 -07:00
Junio C Hamano a8a49ebf61 Merge branch 'js/userdiff-php'
Userdiff for PHP update.

* js/userdiff-php:
  userdiff: PHP: catch "abstract" and "final" functions
2020-10-27 15:09:46 -07:00
Junio C Hamano 1d1c4a8759 other small fixes for 2.29.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-26 14:59:59 -07:00
Junio C Hamano 839129c6d8 Merge branch 'cc/doc-filter-branch-typofix'
Docfix.

* cc/doc-filter-branch-typofix:
  filter-branch doc: fix filter-repo typo
2020-10-26 14:59:59 -07:00
Junio C Hamano f34687dc81 Merge branch 'jk/committer-date-is-author-date-fix'
In 2.29, "--committer-date-is-author-date" option of "rebase" and
"am" subcommands lost the e-mail address by mistake, which has been
corrected.

* jk/committer-date-is-author-date-fix:
  rebase: fix broken email with --committer-date-is-author-date
  am: fix broken email with --committer-date-is-author-date
  t3436: check --committer-date-is-author-date result more carefully
2020-10-26 14:59:58 -07:00
Jeff King 5f35edd9d7 rebase: fix broken email with --committer-date-is-author-date
Commit 7573cec52c (rebase -i: support --committer-date-is-author-date,
2020-08-17) copied the committer ident-parsing code from builtin/am.c.
And in doing so, it copied a bug in which we always set the email to an
empty string. We fixed the version in git-am in the previous commit;
this commit fixes the copied code.

Reported-by: VenomVendor <info@venomvendor.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-23 08:25:22 -07:00
Jeff King 16b0bb99ea am: fix broken email with --committer-date-is-author-date
Commit e8cbe2118a (am: stop exporting GIT_COMMITTER_DATE, 2020-08-17)
rewrote the code for setting the committer date to use fmt_ident(),
rather than setting an environment variable and letting commit_tree()
handle it. But it introduced two bugs:

  - we use the author email string instead of the committer email

  - when parsing the committer ident, we used the wrong variable to
    compute the length of the email, resulting in it always being a
    zero-length string

This commit fixes both, which causes our test of this option via the
rebase "apply" backend to now succeed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-23 08:25:19 -07:00
Jeff King 56706dba33 t3436: check --committer-date-is-author-date result more carefully
After running "rebase --committer-date-is-author-date", we confirm that
the committer date is the same as the author date. However, we don't
look at any other parts of the committer ident line to make sure we
didn't screw them up. And indeed, there are a few bugs here. Depending
on the rebase backend in use, we may accidentally use the author email
instead of the committer's, or even an empty string.

Let's teach our test_ctime_is_atime helper to check the committer name
and email, which reveals several failing tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-23 08:25:17 -07:00
Junio C Hamano 2e673356ae Git 2.29.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAl+SArMACgkQsLXohpav
 5ss3cg//ZT2qC2ypqEaOuVXPVKBlTxIEL43OxQsOQCazpHSHtEnMVLIEDUX467Dd
 UJyQReuSU/Kis7ucL1MCFXMxdvH8dGl/FdyS6lREND7w1lpudyGjTxO+mTXUrqGH
 J5zhYC2DzeX7inA6gviN543krVeiT5p0I9Yk5/dWDBOciYKMOsQJGyYkp5Qzw8OO
 7hog+B0752iwzpnZMOiIFGY0xiw89X1MkVgNGlzuPebf6Ws3+/LXfPHJbjn5Xd+q
 V4v/YVBYRPIlTYoMox/2/dE4/FB47MCn+YNpxtELsq0kQCAARcI+ucoqHYegs/2r
 Q1yQlRr5LAu6oy5hesv7ZvlrHUNIrGzQeTFjdbWSQ83NwsbuUzhmdeiiIGawcjK5
 XypTT/FeS9zFLyPQ/PogsnYzFFzG5b3PXx0Eq/K3LeI0qDDpAdnA3HU8pJrLUKGU
 dZhSMr8G4Xw8fzxQsEcYSkVtFdcwwq2zYB4kFsUh1eoCDJF5ZJTyX8tdXeenlviy
 VqTlN9uAgTjkVUTAjcODzZwp4MJOl4y8Sql9d+gCzfCsgxNsdBt8debqbF55MuPb
 /0qZsWveSK0V6pnoWhsqMNtJfwcYjCLw0kaEkn80KYEWj24tAgEi2hDTEav1K21R
 zigK5ewtCFrbhtXm1B9gxaWYICZUyW4aKf6Mnb2Njkbl2IYZIEY=
 =y9La
 -----END PGP SIGNATURE-----

Sync with Git 2.29.1
2020-10-22 15:13:15 -07:00
Junio C Hamano b927c80531 Git 2.29.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-22 15:07:25 -07:00
Junio C Hamano 380ba99077 Merge branch 'js/no-builtins-on-disk-option' into maint
Brown-paper-bag fix.

* js/no-builtins-on-disk-option:
  SKIP_DASHED_BUILT_INS: do not skip the bin/ programs
2020-10-22 15:01:22 -07:00
Junio C Hamano 31f4c833ac t7102: prepare expected output inside test_expect_* block
That way we can notice if there is a breakage/bug in the parts of
the test that prepare the expected outcome, which is how modern
tests are arranged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-22 10:39:05 -07:00
Charvi Mendiratta 1c0ab5c7fa t7201: put each command on a separate line
Modern practice is to avoid multiple commands per line,
and instead place each command on its own line.

Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-22 10:37:57 -07:00
Charvi Mendiratta 627f2d79de t7201: use 'git -C' to avoid subshell
Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-22 10:37:57 -07:00
Charvi Mendiratta c327762f81 t7102,t7201: remove whitespace after redirect operator
According to Documentation/CodingGuidelines, redirect
operator is written with space before, but no space
after them.

Let's remove these whitespaces after redirect operators.

Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-22 10:37:54 -07:00
Johannes Schindelin 907e6379d0 SKIP_DASHED_BUILT_INS: do not skip the bin/ programs
The idea of the `SKIP_DASHED_BUILT_INS` option is to stop hard-linking
the built-in commands as separate executables. The patches to do that
specifically excluded the three commands `receive-pack`,
`upload-archive` and `upload-pack`, though: these commands are expected
to be present in the `PATH` in their dashed form on the server side of
any fetch/push.

However, due to an oversight by myself, even if those commands were
still hard-linked, they were not installed into `bin/`.

Noticed-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-21 12:56:40 -07:00
Charvi Mendiratta 78b8d9340d t7102,t7201: remove unnecessary blank spaces in test body
t7102 and t7201 still follow the old style of having blank
lines around test body, which is not consistence with our
current practice.

Let's remove those unnecessary blank lines.

Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-20 13:21:43 -07:00
Charvi Mendiratta e166fe363d t7101,t7102,t7201: modernize test formatting
Some tests in these scripts are formatted using a very old style:
        test_expect_success \
            'title' \
            'body line 1 &&
             body line 2'

Updating the formatting to the modern style:
        test_expect_success 'title' '
            body line 1 &&
            body line 2
        '

Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-20 13:21:43 -07:00
Christian Couder 3e0a5dc9af filter-branch doc: fix filter-repo typo
The name of the tool is 'git-filter-repo' not
'git-repo-filter'.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-20 12:22:25 -07:00
Junio C Hamano 69986e19ff Git 2.29
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-19 09:58:42 -07:00
Elijah Newren 04b65a3bc0 t7518: fix flaky grep invocation
t7518.1 added in commit 862e80a413 ("ident: handle NULL email when
complaining of empty name", 2017-02-23), was trying to make sure that
the test with an empty ident did not segfault and did not result in
glibc quiety translating a NULL pointer into a name of "(null)".  It did
the latter by ensuring that a grep for "null" didn't appear in the
output, but on one automatic CI run I observed the following output:

fatal: empty ident name (for <runner@fv-az128-670.gcliasfzo2nullsdbrimjtbyhg.cx.internal.cloudapp.net>) not allowed

Note that 'null' appears as a substring of the domain name, found
within 'gcliasfzo2nullsdbrimjtbyhg'.  Tighten the test by searching for
"(null)" rather than "null".

Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-10-18 13:17:53 -07:00