# [PATCH] Avoid perl in t1300-repo-config

9 messages from 2007-06-27 to 2007-06-28. Participants: Alex Riesen, Frank Lichtenheld, Junio C Hamano, Jakub Narebski, Johannes Schindelin.
Thread: https://gitlist.dev/t/8748

## Alex Riesen, 2007-06-27 12:45

Subject: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <81b0412b0706270545w65ca2556yaafaac6ff31b5961@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0706270545w65ca2556yaafaac6ff31b5961%40mail.gmail.com

```
It fixes the test on system where ActiveState Perl is used.
It is also shorter.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 t/t1300-repo-config.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


From e844edbdc63150386dc4eb2c2080ece4f371cd04 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Wed, 27 Jun 2007 14:40:41 +0200
Subject: [PATCH] Avoid perl in t1300-repo-config

It fixes the test on system where ActiveState Perl is used.
It is shorter as a bonus.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 t/t1300-repo-config.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 7a77bef..60b0dc5 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -530,24 +530,24 @@ EOF
 
 cat > expect <<\EOF
 Key: section.sub=section.val1
-Value: foo=bar
+foo=bar
 Key: section.sub=section.val2
-Value: foo
+foo
 bar
 Key: section.sub=section.val3
-Value: 
+
 
 
 Key: section.sub=section.val4
-Value: 
+
 Key: section.sub=section.val5
 EOF
 
-git config --null --list | perl -0ne 'chop;($key,$value)=split(/\n/,$_,2);print "Key: $key\n";print "Value: $value\n" if defined($value)' > result
+git config --null --list | xargs -n1 -0 echo 'Key:' > result
 
 test_expect_success '--null --list' 'cmp result expect'
 
-git config --null --get-regexp 'val[0-9]' | perl -0ne 'chop;($key,$value)=split(/\n/,$_,2);print "Key: $key\n";print "Value: $value\n" if defined($value)' > result
+git config --null --get-regexp 'val[0-9]' | xargs -n1 -0 echo 'Key:' > result
 
 test_expect_success '--null --get-regexp' 'cmp result expect'
 
-- 
1.5.2.2.1308.g540b6


```

## Frank Lichtenheld, 2007-06-27 15:15

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <20070627151545.GF12721@planck.djpig.de>
URL: https://gitlist.dev/e/20070627151545.GF12721%40planck.djpig.de
In-Reply-To: <81b0412b0706270545w65ca2556yaafaac6ff31b5961@mail.gmail.com>

```
On Wed, Jun 27, 2007 at 02:45:40PM +0200, Alex Riesen wrote:
> It fixes the test on system where ActiveState Perl is used.
> It is also shorter.

Thanks :)

For future reference: What in my code broke with ActiveState Perl?
The command line options?

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

```

## Alex Riesen, 2007-06-27 15:47

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <81b0412b0706270847j1bfc8a68ge6213643f02391ec@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0706270847j1bfc8a68ge6213643f02391ec%40mail.gmail.com
In-Reply-To: <20070627151545.GF12721@planck.djpig.de>

```
On 6/27/07, Frank Lichtenheld <frank@lichtenheld.de> wrote:
> On Wed, Jun 27, 2007 at 02:45:40PM +0200, Alex Riesen wrote:
> > It fixes the test on system where ActiveState Perl is used.
> > It is also shorter.
>
> Thanks :)
>
> For future reference: What in my code broke with ActiveState Perl?
> The command line options?
>

Nothing really, the code is perfect and options are correct.
ActiveState is just clueless, and activates \r\n line endings
on stdout/stderr by default, unless the stream is binmoded
(irrespective of whether the stream is tty or not).

```

## Junio C Hamano, 2007-06-28 04:30

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <7vmyykog4e.fsf@assigned-by-dhcp.pobox.com>
URL: https://gitlist.dev/e/7vmyykog4e.fsf%40assigned-by-dhcp.pobox.com
In-Reply-To: <81b0412b0706270545w65ca2556yaafaac6ff31b5961@mail.gmail.com>

```
"Alex Riesen" <raa.lkml@gmail.com> writes:

> It fixes the test on system where ActiveState Perl is used.
> It is also shorter.
> ...
> -git config --null --list | perl -0ne 'chop;($key,$value)=split(/\n/,$_,2);print "Key: $key\n";print "Value: $value\n" if defined($value)' > result
> +git config --null --list | xargs -n1 -0 echo 'Key:' > result

This now makes us rely on "xargs -0", which is probably much
less portable than Perl isn't it?  Because the point of the test
is that it can show things in NUL terminated format, I'd rather
keep it use a bit more portable stuff.  Also I am not sure if
the two tests are really testing the same thing.

Maybe postprocess "git config -z" output with "tr '[\000]' 'Q'"
or something so that the comparison of the result does not have
to worry about NULs?  I dunno.

By the way, is it possible for gmail users to avoid attachments
when sending patches in?

```

## Alex Riesen, 2007-06-28 07:41

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <81b0412b0706280041i535efdf0r87e552551b796044@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0706280041i535efdf0r87e552551b796044%40mail.gmail.com
In-Reply-To: <7vmyykog4e.fsf@assigned-by-dhcp.pobox.com>

```
On 6/28/07, Junio C Hamano <gitster@pobox.com> wrote:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
> > It fixes the test on system where ActiveState Perl is used.
> > It is also shorter.
> > ...
> > -git config --null --list | perl -0ne 'chop;($key,$value)=...
> > +git config --null --list | xargs -n1 -0 echo 'Key:' > result
>
> This now makes us rely on "xargs -0", which is probably much
> less portable than Perl isn't it?

Dunno. Have yet too meet a system where it doesn't work.
That said, SUSv6 does not mention it.

> Maybe postprocess "git config -z" output with "tr '[\000]' 'Q'"
> or something so that the comparison of the result does not have
> to worry about NULs?  I dunno.

Will try that.

> By the way, is it possible for gmail users to avoid attachments
> when sending patches in?

No. The message text is unpredictably garbled

```

## Alex Riesen, 2007-06-28 08:56

Subject: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <81b0412b0706280156q56944862s94644917b95e892f@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0706280156q56944862s94644917b95e892f%40mail.gmail.com
In-Reply-To: <81b0412b0706280041i535efdf0r87e552551b796044@mail.gmail.com>

```
It fixes the test on systems where ActiveState Perl is used.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 t/t1300-repo-config.sh |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

On 6/28/07, Alex Riesen <raa.lkml@gmail.com> wrote:
> On 6/28/07, Junio C Hamano <gitster@pobox.com> wrote:
> > "Alex Riesen" <raa.lkml@gmail.com> writes:
> >
> > > It fixes the test on system where ActiveState Perl is used.
> > > It is also shorter.
> > > ...
> > > -git config --null --list | perl -0ne 'chop;($key,$value)=...
> > > +git config --null --list | xargs -n1 -0 echo 'Key:' > result
> >
> > This now makes us rely on "xargs -0", which is probably much
> > less portable than Perl isn't it?
>
> Dunno. Have yet too meet a system where it doesn't work.
> That said, SUSv6 does not mention it.
>
> > Maybe postprocess "git config -z" output with "tr '[\000]' 'Q'"
> > or something so that the comparison of the result does not have
> > to worry about NULs?  I dunno.
>
> Will try that.
>

So I did. Any idea as to how make the here-document
_without_ the trailing LF?


From 846fcfe47938ee894eb433b6f3a24ae4b6479e5b Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Wed, 27 Jun 2007 14:40:41 +0200
Subject: [PATCH] Avoid perl in t1300-repo-config

It fixes the test on system where ActiveState Perl is used.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 t/t1300-repo-config.sh |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 7a77bef..27486de 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -529,25 +529,23 @@ cat > .git/config <<\EOF
 EOF
 
 cat > expect <<\EOF
-Key: section.sub=section.val1
-Value: foo=bar
-Key: section.sub=section.val2
-Value: foo
-bar
-Key: section.sub=section.val3
-Value: 
+section.sub=section.val1
+foo=barQsection.sub=section.val2
+foo
+barQsection.sub=section.val3
 
 
-Key: section.sub=section.val4
-Value: 
-Key: section.sub=section.val5
+Qsection.sub=section.val4
+Qsection.sub=section.val5Q
 EOF
 
-git config --null --list | perl -0ne 'chop;($key,$value)=split(/\n/,$_,2);print "Key: $key\n";print "Value: $value\n" if defined($value)' > result
+git config --null --list | tr '[\000]' 'Q' > result
+echo >>result
 
 test_expect_success '--null --list' 'cmp result expect'
 
-git config --null --get-regexp 'val[0-9]' | perl -0ne 'chop;($key,$value)=split(/\n/,$_,2);print "Key: $key\n";print "Value: $value\n" if defined($value)' > result
+git config --null --get-regexp 'val[0-9]' | tr '[\000]' 'Q' > result
+echo >>result
 
 test_expect_success '--null --get-regexp' 'cmp result expect'
 
-- 
1.5.2.2.1308.g540b6


```

## Jakub Narebski, 2007-06-28 09:28

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <f5vuv9$f8s$1@sea.gmane.org>
URL: https://gitlist.dev/e/f5vuv9%24f8s%241%40sea.gmane.org
In-Reply-To: <81b0412b0706280041i535efdf0r87e552551b796044@mail.gmail.com>

```
Alex Riesen wrote:

>> By the way, is it possible for gmail users to avoid attachments
>> when sending patches in?
> 
> No. The message text is unpredictably garbled

If by "gmail users" you mean gmail web interface, then probably no.
No problems with using gmail from email client or from git-send-email
(the latter after configuring sendmail in my case).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Alex Riesen, 2007-06-28 11:00

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <81b0412b0706280400u5c234fb6hd72a431f57ec8975@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0706280400u5c234fb6hd72a431f57ec8975%40mail.gmail.com
In-Reply-To: <f5vuv9$f8s$1@sea.gmane.org>

```
On 6/28/07, Jakub Narebski <jnareb@gmail.com> wrote:
> >> By the way, is it possible for gmail users to avoid attachments
> >> when sending patches in?
> >
> > No. The message text is unpredictably garbled
>
> If by "gmail users" you mean gmail web interface, then probably no.
> No problems with using gmail from email client or from git-send-email
> (the latter after configuring sendmail in my case).

Can't. M$ Exchange plagued

```

## Johannes Schindelin, 2007-06-28 14:19

Subject: Re: [PATCH] Avoid perl in t1300-repo-config
Message-ID: <Pine.LNX.4.64.0706281412190.4438@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0706281412190.4438%40racer.site
In-Reply-To: <81b0412b0706280041i535efdf0r87e552551b796044@mail.gmail.com>

```
Hi,

On Thu, 28 Jun 2007, Alex Riesen wrote:

> On 6/28/07, Junio C Hamano <gitster@pobox.com> wrote:
> 
> > By the way, is it possible for gmail users to avoid attachments when 
> > sending patches in?
> 
> No. The message text is unpredictably garbled

It is not really unpredictable.

- whitespace at the end of line is stripped
- too long lines are _always_ broken (and our diffstat lines qualify for 
  that)
- empty lines at the end of the message are stripped (does not concern us)
- empty lines at the beginning of the message are stripped (does not 
  concern us either)
- encodings different from UTF-8 are a problem

Of course, the first reason already precludes diffs from being sent. Just 
think of an empty line, which is in both versions (or even worse, a single 
space on the line).

Ciao,
Dscho

```
