From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood@talktalk.net>
Cc: Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH 3/5] Git::unquote_path() throw an exception on bad path
Date: Thu, 22 Jun 2017 12:37:08 -0700 [thread overview]
Message-ID: <xmqqh8z7ke57.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170622102622.26147-4-phillip.wood@talktalk.net> (Phillip Wood's message of "Thu, 22 Jun 2017 11:26:20 +0100")
Phillip Wood <phillip.wood@talktalk.net> writes:
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> This is what the other routines in Git.pm do if there's an error.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> perl/Git.pm | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/perl/Git.pm b/perl/Git.pm
> index 889bf88cfcd34136e24e166fb3b72cced6debf9d..51cb3446088dd12e8fd93d47b95e29fab22a8466 100644
> --- a/perl/Git.pm
> +++ b/perl/Git.pm
> @@ -1493,8 +1493,8 @@ when not using -z
> $_ = $2;
> last;
> }
> - # This is malformed -- just return it as-is for now.
> - return $_[0];
> + # This is malformed
> + throw Error::Simple("Invalid quoted path $_[0]");
> }
Output from "git grep Error::Simple" tells me that mostly we do not
upcase the first word of the error message. Perhaps this should
follow the convention.
It is a different matter that use of Error::Simple has been
discouraged for quite some time (e.g. *1*) and we haven't been got
around doing that. When the clean-up happens, this code will have
to be migrated to a different mechanism together with 30+ existing
uses of it; in the scope of this series, throwing of Error::Simple
is consistent with the remainder of Git.pm and is a good thing.
[References]
*1* https://public-inbox.org/git/1330809281-25774-1-git-send-email-jnareb@gmail.com/
next prev parent reply other threads:[~2017-06-22 19:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 10:26 [PATCH 0/5] Move unquote_path() from git-add--interactive.perl to Git.pm Phillip Wood
2017-06-22 10:26 ` [PATCH 1/5] Git.pm Add unquote_path() Phillip Wood
2017-06-22 19:26 ` Junio C Hamano
2017-06-22 10:26 ` [PATCH 2/5] Git::unquote_path() Handle '\a' Phillip Wood
2017-06-22 10:26 ` [PATCH 3/5] Git::unquote_path() throw an exception on bad path Phillip Wood
2017-06-22 19:37 ` Junio C Hamano [this message]
2017-06-22 10:26 ` [PATCH 4/5] Add tests for Git::unquote_path() Phillip Wood
2017-06-22 10:26 ` [PATCH 5/5] git-add--interactive.perl: Use unquote_path() from Git.pm Phillip Wood
2017-06-22 19:38 ` [PATCH 0/5] Move unquote_path() from git-add--interactive.perl to Git.pm Junio C Hamano
2017-06-22 23:18 ` Jeff King
2017-06-30 9:53 ` Phillip Wood
2017-06-30 9:49 ` [PATCH 0/4] Move unquote_path " Phillip Wood
2017-06-30 9:49 ` [PATCH 1/4] add -i move unquote_path() " Phillip Wood
2017-06-30 9:49 ` [PATCH 2/4] Git::unquote_path() Handle '\a' Phillip Wood
2017-06-30 9:49 ` [PATCH 3/4] Git::unquote_path() throw an exception on bad path Phillip Wood
2017-06-30 9:49 ` [PATCH 4/4] Add tests for Git::unquote_path() Phillip Wood
2017-06-30 15:06 ` [PATCH 0/4] Move unquote_path from git-add--interactive.perl to Git.pm 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqh8z7ke57.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=phillip.wood@dunelm.org.uk \
--cc=phillip.wood@talktalk.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).