git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t9138-git-svn-authors-prog.sh fixups
@ 2014-05-25 19:24 Jeremiah Mahler
  2014-05-27 19:43 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremiah Mahler @ 2014-05-25 19:24 UTC (permalink / raw)
  To: Mark Lodato; +Cc: git, Jeremiah Mahler

Several fixups of the t9138-git-svn-authors-prog.sh test script to
follow current recommendations in t/README.

  - Fixed a Perl script with a full "#!/usr/bin/perl" shebang
    to use write_script() and $PERL_PATH as per t/README.

  - Placed svn-authors data setup inside a test_expect_success.

  - Fixed trailing quotes to use the same indentation throughout.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
---
 t/t9138-git-svn-authors-prog.sh | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh
index 83cc5fc..d54c37a 100755
--- a/t/t9138-git-svn-authors-prog.sh
+++ b/t/t9138-git-svn-authors-prog.sh
@@ -7,40 +7,39 @@ test_description='git svn authors prog tests'
 
 . ./lib-git-svn.sh
 
-cat > svn-authors-prog <<'EOF'
-#!/usr/bin/perl
-$_ = shift;
-if (s/-sub$//)  {
-	print "$_ <$_\@sub.example.com>\n";
-}
-else {
-	print "$_ <$_\@example.com>\n";
-}
+write_script svn-authors-prog $PERL_PATH <<-\EOF
+	$_ = shift;
+	if (s/-sub$//)  {
+		print "$_ <$_\@sub.example.com>\n";
+	} else {
+		print "$_ <$_\@example.com>\n";
+	}
 EOF
-chmod +x svn-authors-prog
 
-cat > svn-authors <<'EOF'
-ff = FFFFFFF FFFFFFF <fFf@other.example.com>
-EOF
+test_expect_success 'svn-authors setup' '
+	cat >svn-authors <<-\EOF
+	ff = FFFFFFF FFFFFFF <fFf@other.example.com>
+	EOF
+'
 
 test_expect_success 'setup svnrepo' '
 	for i in aa bb cc-sub dd-sub ee-foo ff
 	do
 		svn mkdir -m $i --username $i "$svnrepo"/$i
 	done
-	'
+'
 
 test_expect_success 'import authors with prog and file' '
 	git svn clone --authors-prog=./svn-authors-prog \
 	    --authors-file=svn-authors "$svnrepo" x
-	'
+'
 
 test_expect_success 'imported 6 revisions successfully' '
 	(
 		cd x
 		test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 6
 	)
-	'
+'
 
 test_expect_success 'authors-prog ran correctly' '
 	(
@@ -56,7 +55,7 @@ test_expect_success 'authors-prog ran correctly' '
 		git rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \
 		  grep "^author aa <aa@example\.com> "
 	)
-	'
+'
 
 test_expect_success 'authors-file overrode authors-prog' '
 	(
@@ -64,7 +63,7 @@ test_expect_success 'authors-file overrode authors-prog' '
 		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
 		  grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> "
 	)
-	'
+'
 
 git --git-dir=x/.git config --unset svn.authorsfile
 git --git-dir=x/.git config --unset svn.authorsprog
-- 
2.0.0.rc4.1.g4a28f16.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] t9138-git-svn-authors-prog.sh fixups
  2014-05-25 19:24 [PATCH] t9138-git-svn-authors-prog.sh fixups Jeremiah Mahler
@ 2014-05-27 19:43 ` Junio C Hamano
  2014-05-27 19:53   ` Jeremiah Mahler
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2014-05-27 19:43 UTC (permalink / raw)
  To: Jeremiah Mahler; +Cc: Mark Lodato, git

Jeremiah Mahler <jmmahler@gmail.com> writes:

> Several fixups of the t9138-git-svn-authors-prog.sh test script to
> follow current recommendations in t/README.
>
>   - Fixed a Perl script with a full "#!/usr/bin/perl" shebang
>     to use write_script() and $PERL_PATH as per t/README.
>
>   - Placed svn-authors data setup inside a test_expect_success.
>
>   - Fixed trailing quotes to use the same indentation throughout.
>
> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
> ---
>  t/t9138-git-svn-authors-prog.sh | 35 +++++++++++++++++------------------
>  1 file changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh
> index 83cc5fc..d54c37a 100755
> --- a/t/t9138-git-svn-authors-prog.sh
> +++ b/t/t9138-git-svn-authors-prog.sh
> @@ -7,40 +7,39 @@ test_description='git svn authors prog tests'
>  
>  . ./lib-git-svn.sh
>  
> -cat > svn-authors-prog <<'EOF'
> -#!/usr/bin/perl
> -$_ = shift;
> -if (s/-sub$//)  {
> -	print "$_ <$_\@sub.example.com>\n";
> -}
> -else {
> -	print "$_ <$_\@example.com>\n";
> -}
> +write_script svn-authors-prog $PERL_PATH <<-\EOF

I think you meant to dq "$PERL_PATH" here.  Other than that, looks
OK to me.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] t9138-git-svn-authors-prog.sh fixups
  2014-05-27 19:43 ` Junio C Hamano
@ 2014-05-27 19:53   ` Jeremiah Mahler
  0 siblings, 0 replies; 3+ messages in thread
From: Jeremiah Mahler @ 2014-05-27 19:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio,

On Tue, May 27, 2014 at 12:43:06PM -0700, Junio C Hamano wrote:
> Jeremiah Mahler <jmmahler@gmail.com> writes:
> 
...
> > diff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh
> > index 83cc5fc..d54c37a 100755
> > --- a/t/t9138-git-svn-authors-prog.sh
> > +++ b/t/t9138-git-svn-authors-prog.sh
> > @@ -7,40 +7,39 @@ test_description='git svn authors prog tests'
> >  
> >  . ./lib-git-svn.sh
> >  
> > -cat > svn-authors-prog <<'EOF'
> > -#!/usr/bin/perl
> > -$_ = shift;
> > -if (s/-sub$//)  {
> > -	print "$_ <$_\@sub.example.com>\n";
> > -}
> > -else {
> > -	print "$_ <$_\@example.com>\n";
> > -}
> > +write_script svn-authors-prog $PERL_PATH <<-\EOF
> 
> I think you meant to dq "$PERL_PATH" here.  Other than that, looks
> OK to me.
> 
> Thanks.

Ah, you're right, it needs the quotes.  Can this minor changed be fixed
by editing the patch or should I re-send it?

-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-27 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-25 19:24 [PATCH] t9138-git-svn-authors-prog.sh fixups Jeremiah Mahler
2014-05-27 19:43 ` Junio C Hamano
2014-05-27 19:53   ` Jeremiah Mahler

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 NNTP newsgroup(s).