public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Eric Wong <normalperson@yhbt•net>
Cc: git@vger•kernel.org, vleschuk@accesssoftek•com,
	Victor Leschuk <vleschuk@gmail•com>
Subject: Re: [PATCH] git-svn: shorten glob error message
Date: Thu, 14 Jan 2016 10:15:49 -0800	[thread overview]
Message-ID: <xmqqvb6wjacq.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160114040759.GA7671@dcvr.yhbt.net> (Eric Wong's message of "Thu, 14 Jan 2016 04:07:59 +0000")

Eric Wong <normalperson@yhbt•net> writes:

> Error messages should attempt to fit within the confines of
> an 80-column terminal to avoid compatibility and accessibility
> problems.  Furthermore the word "directories" can be misleading
> when used in the context of git refnames.
>
> Signed-off-by: Eric Wong <normalperson@yhbt•net>
> ---
>   Eric Wong <normalperson@yhbt•net> wrote:
>   > I also noticed the "Only one set of wildcard directories" error
>   > message is unnecessary long and "wildcard directories" should
>   > probably be shortened to "wildcards" to avoid wrapping in a terminal.
>   > That will probably be a separate patch for me.
>
>   There's likely more instances of this in git-svn, but I figured
>   we'll get this one fixed, first.
>
>   Also pushed to bogomips.org/git-svn.git
>   (commit dc6aa7e61e9d33856f54d63b7acb518383420373)
>   along with Victor's patch.

Thanks.

I am not sure if it is a good idea to show */*/* as an example in
the message (that is an anti-example of 'one set of wildcard' by
having three stars, isn't it?), but that is not a new issue this
change introduces.

>  	my $state = "left";
> -	my $die_msg = "Only one set of wildcard directories " .
> -				"(e.g. '*' or '*/*/*') is supported: '$glob'\n";
> +	my $die_msg = "Only one set of wildcards " .
> +				"(e.g. '*' or '*/*/*') is supported: $glob\n";
>  	for my $part (split(m|/|, $glob)) {
>  		if ($pattern_ok && $part =~ /[{}]/ &&
>  			 $part !~ /^\{[^{}]+\}/) {
> diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh
> index d732d31..29b363b 100755
> --- a/t/t9108-git-svn-glob.sh
> +++ b/t/t9108-git-svn-glob.sh
> @@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '
>  	test_cmp expect.two output.two
>  	'
>  
> -echo "Only one set of wildcard directories" \
> -     "(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
> -echo "" >> expect.three
> +test_expect_success 'prepare test disallow multi-globs' "
> +cat >expect.three <<EOF
> +Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
> +
> +EOF
> +	"
>  
>  test_expect_success 'test disallow multi-globs' '
>  	git config --add svn-remote.three.url "$svnrepo" &&
> diff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh
> index c318f9f..d0b79fe 100755
> --- a/t/t9109-git-svn-multi-glob.sh
> +++ b/t/t9109-git-svn-multi-glob.sh
> @@ -135,9 +135,12 @@ test_expect_success 'test another branch' '
>  	test_cmp expect.four output.four
>  	'
>  
> -echo "Only one set of wildcard directories" \
> -     "(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
> -echo "" >> expect.three
> +test_expect_success 'prepare test disallow multiple globs' "
> +cat >expect.three <<EOF
> +Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
> +
> +EOF
> +	"
>  
>  test_expect_success 'test disallow multiple globs' '
>  	git config --add svn-remote.three.url "$svnrepo" &&
> diff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh
> index a7641dc..8b22f22 100755
> --- a/t/t9168-git-svn-partially-globbed-names.sh
> +++ b/t/t9168-git-svn-partially-globbed-names.sh
> @@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '
>  	'
>  
>  test_expect_success 'prepare test disallow prefixed multi-globs' "
> -	echo \"Only one set of wildcard directories\" \
> -	     \"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\" >expect.four &&
> -	echo \"\" >>expect.four
> +cat >expect.four <<EOF
> +Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/b_*/t/*
> +
> +EOF
>  	"
>  
>  test_expect_success 'test disallow prefixed multi-globs' '

  reply	other threads:[~2016-01-14 18:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 14:25 [PATCH] git-svn: loosen config globs limitations Victor Leschuk
2016-01-13  3:16 ` Eric Wong
2016-01-13  6:40   ` Victor Leschuk
2016-01-13 18:45   ` Junio C Hamano
2016-01-13 19:26     ` Eric Wong
2016-01-14  4:07   ` [PATCH] git-svn: shorten glob error message Eric Wong
2016-01-14 18:15     ` Junio C Hamano [this message]
2016-01-22 16:07       ` Victor Leschuk
2016-01-27  2:54       ` Eric Wong
2016-01-27 20:26         ` Junio C Hamano

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=xmqqvb6wjacq.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=normalperson@yhbt$(echo .)net \
    --cc=vleschuk@accesssoftek$(echo .)com \
    --cc=vleschuk@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox