From: Pete Wyckoff <pw@padd•com>
To: Stefano Lattarini <stefano.lattarini@gmail•com>
Cc: git@vger•kernel.org, Junio C Hamano <gitster@pobox•com>,
Luke Diamand <luke@diamand•org>, Chris Li <git@chrisli•org>
Subject: Re: [PATCH 2/6] git-p4: handle utf16 filetype properly
Date: Sun, 16 Oct 2011 10:38:44 -0400 [thread overview]
Message-ID: <20111016143844.GB22144@arf.padd.com> (raw)
In-Reply-To: <201110161152.32335.stefano.lattarini@gmail.com>
stefano.lattarini@gmail•com wrote on Sun, 16 Oct 2011 11:52 +0200:
> Hello Pete.
>
> One more "outsider nit" here ...
>
> On Saturday 15 October 2011, Pete Wyckoff wrote:
> >
> > [SNIP]
> >
> > Add a test case to check utf16 handling, and +k and +ko handling.
> >
> > [SNIP]
> >
> > diff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh
> > new file mode 100755
> > index 0000000..cf07e6d
> > --- /dev/null
> > +++ b/t/t9802-git-p4-filetype.sh
> > @@ -0,0 +1,108 @@
> > +#!/bin/sh
> > +
> > +test_description='git-p4 p4 filetype tests'
> > +
> > +. ./lib-git-p4.sh
> > +
> > +test_expect_success 'start p4d' '
> > + start_p4d
> > +'
> > +
> > +test_expect_success 'utf-16 file create' '
> > + (
> > + cd "$cli" &&
> > +
> > + # p4 saves this verbatim
> > + echo -e "three\nline\ntext" >f-ascii &&
> >
> Not portable to (at least) solaris /usr/xpg4/bin/sh and /bin/ksh:
>
> $ /bin/ksh -c 'echo -e "three\nline\ntext"'
> -e three
> line
> text
>
> In fact, use of options and/or escape sequences in "echo" arguments is
> highly unportable (see the entry for `echo' in the "Limitations of Shell
> Builtins" section of the autoconf manual); your best bet is to use printf,
> which is more portable and well-behaved (at least on systems that are not
> musuem pieces).
Indeed. The t/ source consistently uses printf where \n is
needed.
> >
> > [SNIP]
> >
> > +
> > +build_smush() {
> > + cat >k_smush.py <<-EOF &&
> > + import re, sys
> > + sys.stdout.write(re.sub(r'(?i)\\\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\\\$', r'$\1$', sys.stdin.read()))
> > + EOF
> >
> This is a basically a stylistic nit, so fell free to disregard it completely,
> but ... wouldn't it be simpler to quote the "EOF" at the here-doc beginning,
> so that you don't have to escape all the backslashes in the here-doc itself?
> Similarly for other later usages.
Switched to using \EOF and got rid of the extranneous \.
Thanks,
-- Pete
next prev parent reply other threads:[~2011-10-16 14:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-15 15:53 [PATCH v2 0/6] git-p4 tests, filetypes, shell metacharacters Pete Wyckoff
2011-10-15 15:55 ` [PATCH 1/6] git-p4 tests: refactor and cleanup Pete Wyckoff
2011-10-16 9:38 ` Stefano Lattarini
2011-10-16 9:54 ` Stefano Lattarini
2011-10-16 14:35 ` Pete Wyckoff
2011-10-15 15:56 ` [PATCH 2/6] git-p4: handle utf16 filetype properly Pete Wyckoff
2011-10-16 9:52 ` Stefano Lattarini
2011-10-16 14:38 ` Pete Wyckoff [this message]
2011-10-15 15:57 ` [PATCH 3/6] git-p4: recognize all p4 filetypes Pete Wyckoff
2011-10-15 15:59 ` [PATCH 4/6] git-p4: stop ignoring apple filetype Pete Wyckoff
2011-10-15 16:00 ` [PATCH 5/6] git-p4: keyword flattening fixes Pete Wyckoff
2011-10-15 16:02 ` [PATCH 6/6] git-p4: handle files with shell metacharacters Pete Wyckoff
2011-10-15 20:00 ` [PATCH v2 0/6] git-p4 tests, filetypes, " Luke Diamand
-- strict thread matches above, loose matches on Subject: below --
2011-10-16 14:42 [PATCH v3 " Pete Wyckoff
2011-10-16 14:44 ` [PATCH 2/6] git-p4: handle utf16 filetype properly Pete Wyckoff
2011-10-16 14:59 ` Stefano Lattarini
2011-10-16 15:22 ` Pete Wyckoff
2011-10-16 18:08 ` Junio C Hamano
2011-10-16 22:47 ` Pete Wyckoff
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=20111016143844.GB22144@arf.padd.com \
--to=pw@padd$(echo .)com \
--cc=git@chrisli$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=luke@diamand$(echo .)org \
--cc=stefano.lattarini@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