threads / patch / 12627

patchgit-svn: find-rev error message when missing arg

Subject: [PATCH] git-svn: find-rev error message when missing arg

## tl;dr

5 messages between Mar 11, 2008 and Mar 11, 2008. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Marc-Andre Lureau (elmarco)· Mar 11, 2008, 01:52 UTC · lore
Just let the user know that a revision argument is missing instead of a perl error. This error message mimic the "init" error message, but could be improved.
---
 git-svn.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to git-svn.perl +2 −1
diff --git a/git-svn.perl b/git-svn.perl
index 1195569..2ee7ca5 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -522,7 +522,8 @@ sub cmd_dcommit {
 }
 
 sub cmd_find_rev {
-	my $revision_or_hash = shift;
+	my $revision_or_hash = shift or die "SVN or git revison required ",
+	                                    "as a command-line argument\n";
 	my $result;
 	if ($revision_or_hash =~ /^r\d+$/) {
 		my $head = shift;
-- 
1.5.4.4.482.ga8b1
Eric Wong· Mar 11, 2008, 05:19 UTC · re: Marc-Andre Lureau (elmarco) · lore

Re: [PATCH] git-svn: find-rev error message when missing arg

"Marc-Andre Lureau (elmarco)" <marcandre.lureau@gmail.com> wrote:
> Just let the user know that a revision argument is missing instead of
> a perl error. This error message mimic the "init" error message, but
> could be improved.
Thanks Marc-Andre.  Three small things:
* Minor spelling error noted below.
* Please wrap your commit message lines at 72 characters or less.
* Sign-off?
Tentatively-Acked-by: Eric Wong <normalperson@yhbt.net>
Show 14 quoted lines
> ---
>  git-svn.perl |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 1195569..2ee7ca5 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -522,7 +522,8 @@ sub cmd_dcommit {
>  }
>  
>  sub cmd_find_rev {
> -	my $revision_or_hash = shift;
> +	my $revision_or_hash = shift or die "SVN or git revison required ",
                                                        revision
Show 5 quoted lines
> +	                                    "as a command-line argument\n";
>  	my $result;
>  	if ($revision_or_hash =~ /^r\d+$/) {
>  		my $head = shift;
> -- 
-- 
Eric Wong
Marc-Andre Lureau· Mar 11, 2008, 08:00 UTC · re: Eric Wong · lore

Just let the user know that a revision argument is missing instead of a perl error. This error message mimic the "init" error message, but could be improved.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
---
 git-svn.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to git-svn.perl +2 −1
diff --git a/git-svn.perl b/git-svn.perl
index 1195569..d8b38c9 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -522,7 +522,8 @@ sub cmd_dcommit {
 }
 
 sub cmd_find_rev {
-	my $revision_or_hash = shift;
+	my $revision_or_hash = shift or die "SVN or git revision required ",
+	                                    "as a command-line argument\n";
 	my $result;
 	if ($revision_or_hash =~ /^r\d+$/) {
 		my $head = shift;
-- 
1.5.4.4.482.ga8b1
Marc-André Lureau· Mar 11, 2008, 08:04 UTC · re: Eric Wong · lore

Re: [PATCH] git-svn: find-rev error message when missing arg

hi,
On Tue, Mar 11, 2008 at 7:19 AM, Eric Wong <normalperson@yhbt.net> wrote:
Show 6 quoted lines
>
>  * Minor spelling error noted below.
>  * Please wrap your commit message lines at 72 characters or less.
>  * Sign-off?
>
>  Tentatively-Acked-by: Eric Wong <normalperson@yhbt.net>

oups, I was too tired, I hope this second patch is fine. Thanks for reviewing :)

Regards,
-- 
Marc-André Lureau
Eric Wong· Mar 11, 2008, 20:46 UTC · re: Marc-André Lureau · lore

Re: [PATCH] git-svn: find-rev error message when missing arg

Marc-André Lureau <marcandre.lureau@gmail.com> wrote:
Show 12 quoted lines
> hi,
> 
> On Tue, Mar 11, 2008 at 7:19 AM, Eric Wong <normalperson@yhbt.net> wrote:
> >
> >  * Minor spelling error noted below.
> >  * Please wrap your commit message lines at 72 characters or less.
> >  * Sign-off?
> >
> >  Tentatively-Acked-by: Eric Wong <normalperson@yhbt.net>
> 
> oups, I was too tired, I hope this second patch is fine.
> Thanks for reviewing :)
Thanks for the patch and fixes Mark André
Acked-by: Eric Wong <normalperson@yhbt.net>
-- 
Eric Wong

← back to recent threads