All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Dragan Simic <dsimic@manjaro.org>
Cc: git@vger.kernel.org, gitster@pobox.com, rsbecker@nexbridge.com,
	 github@seichter.de
Subject: Re: [PATCH v4 3/4] t1300: add more tests for whitespace and inline comments
Date: Thu, 21 Mar 2024 00:55:20 -0400	[thread overview]
Message-ID: <CAPig+cQekOLrpcK_NcL951SRZAg-1Y1aFzE0-i-uCTK_XuiajQ@mail.gmail.com> (raw)
In-Reply-To: <688128d8ef09589712634888074ffd71a192a7aa.1710994548.git.dsimic@manjaro.org>

On Thu, Mar 21, 2024 at 12:17 AM Dragan Simic <dsimic@manjaro.org> wrote:
> Add a handful of additional tests, to improve the coverage of the handling
> of configuration file entries whose values contain internal whitespace,
> leading and/or trailing whitespace, which may or may not be enclosed within
> quotation marks, or which contain an additional inline comment.
>
> At the same time, rework one already existing whitespace-related test a bit,
> to ensure its consistency with the newly added tests.  This change introduced
> no functional changes to the already existing test.
>
> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> diff --git a/t/t1300-config.sh b/t/t1300-config.sh
> @@ -11,6 +11,98 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> +test_expect_success 'setup whitespace config' '
> +       sed -e "s/^|//" \
> +           -e "s/[$]$//" \
> +           -e "s/X/\\t/g" >.git/config <<-\EOF

Representing TAB as `\t` in the sed replacement is not necessarily
portable and (as far as I can see) we don't rely upon that in any
existing tests. It probably would be safer to employ a literal TAB
character in `s/X/ /g` as Junio showed in his example[1].

[1]: https://lore.kernel.org/git/xmqqzfutjtfo.fsf@gitster.g/

  reply	other threads:[~2024-03-21  4:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  4:17 [PATCH v4 0/4] Fix a bug in configuration parsing, and improve tests and documentation Dragan Simic
2024-03-21  4:17 ` [PATCH v4 1/4] config: minor addition of whitespace Dragan Simic
2024-03-21  4:17 ` [PATCH v4 2/4] config: really keep value-internal whitespace verbatim Dragan Simic
2024-03-21  4:17 ` [PATCH v4 3/4] t1300: add more tests for whitespace and inline comments Dragan Simic
2024-03-21  4:55   ` Eric Sunshine [this message]
2024-03-21  5:01     ` Dragan Simic
2024-03-21  4:17 ` [PATCH v4 4/4] config.txt: describe handling of whitespace further Dragan Simic
2024-03-21  5:11   ` Eric Sunshine
2024-03-21  5:16     ` Dragan Simic
2024-03-21  5:21       ` Eric Sunshine
2024-03-21  5:31         ` Dragan Simic
2024-03-21  7:32     ` Junio C Hamano
2024-03-21  4:50 ` [PATCH v4 0/4] Fix a bug in configuration parsing, and improve tests and documentation Eric Sunshine
2024-03-21  4:58   ` Dragan Simic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPig+cQekOLrpcK_NcL951SRZAg-1Y1aFzE0-i-uCTK_XuiajQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    --cc=github@seichter.de \
    --cc=gitster@pobox.com \
    --cc=rsbecker@nexbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.