From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "Jakub Narębski" <jnareb@gmail.com>
Cc: Jeff Hostetler <git@jeffhostetler.com>, git <git@vger.kernel.org>,
Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v1 6/6] Unit tests for V2 porcelain status
Date: Thu, 21 Jul 2016 17:54:10 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1607211749590.14111@virtualbox> (raw)
In-Reply-To: <CANQwDwfWW4Fn7KBHrNv2nfvGHMrPQ4jGpz6wGAEGg3edn-ztfg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]
Hi,
On Wed, 20 Jul 2016, Jakub Narębski wrote:
> On 20 July 2016 at 17:47, Jeff Hostetler <git@jeffhostetler.com> wrote:
> > On 07/20/2016 11:30 AM, Jakub Narębski wrote:
> >> W dniu 2016-07-20 o 00:10, Jeff Hostetler pisze:
> >>>
> >>> +test_expect_success pre_initial_commit_0 '
> >>> + printf "## branch: (initial) master\n" >expected &&
> >>> + printf "?? actual\n" >>expected &&
> >>> + printf "?? dir1/\n" >>expected &&
> >>> + printf "?? expected\n" >>expected &&
> >>> + printf "?? file_x\n" >>expected &&
> >>> + printf "?? file_y\n" >>expected &&
> >>> + printf "?? file_z\n" >>expected &&
> >>
> >> Why not use heredoc syntax (cat <<\EOF), or prepare a file
> >> with expected output in the testsuite?
> >
> > The tests involving renames needed to embed a tab character
> > in the output and hiding a tab character in a heredoc seemed
> > error prone. So to be consistent I made them all printf-style.
>
> Ah, so that's the case for series of printf. I think in some other
> cases the Git testsuite simply uses HT variable for the TAB
> character.
Yeah, it would be more pleasant to read
echo >expected <<-EOF
## branch: (initial) master
?? actual
?? dir1/
?? expected
?? file_x
?? file_y
?? file_z
EOF
And it is also easy to use $HT in there (unless you want to use <<-\EOF).
Actually, even if you want to use \EOF, you can easily use `sed` to
expand, say, "Q" to tabs, such as was done here:
https://github.com/git/git/blob/v2.9.2/t/t4213-log-tabexpand.sh#L88-L92
Ciao,
Dscho
next prev parent reply other threads:[~2016-07-21 15:55 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 22:10 [PATCH v1 0/6] Porcelain Status V2 Jeff Hostetler
2016-07-19 22:10 ` [PATCH v1 1/6] Allow --porcelain[=<n>] in status and commit commands Jeff Hostetler
2016-07-20 15:08 ` Johannes Schindelin
2016-07-20 15:38 ` Jeff Hostetler
2016-07-21 14:28 ` Johannes Schindelin
2016-07-20 15:58 ` Jeff King
2016-07-20 17:26 ` Jeff Hostetler
2016-07-20 20:46 ` Junio C Hamano
2016-07-19 22:10 ` [PATCH v1 2/6] Status and checkout unit tests for --porcelain[=<n>] Jeff Hostetler
2016-07-20 15:19 ` Johannes Schindelin
2016-07-20 15:51 ` Jeff Hostetler
2016-07-20 16:00 ` Jeff King
2016-07-20 16:03 ` Jeff King
2016-07-20 17:31 ` Jeff Hostetler
2016-07-20 17:29 ` Jeff Hostetler
2016-07-19 22:10 ` [PATCH v1 3/6] Per-file output for Porcelain Status V2 Jeff Hostetler
2016-07-20 20:50 ` Junio C Hamano
2016-07-21 14:19 ` Johannes Schindelin
2016-07-20 21:31 ` Junio C Hamano
2016-07-21 18:58 ` Jeff Hostetler
2016-07-22 17:01 ` Junio C Hamano
2016-07-19 22:10 ` [PATCH v1 4/6] Expanded branch header " Jeff Hostetler
2016-07-20 16:06 ` Jeff King
2016-07-20 18:20 ` Jeff Hostetler
2016-07-20 20:54 ` Jeff King
2016-07-21 15:46 ` Johannes Schindelin
2016-07-21 19:03 ` Jeff Hostetler
2016-07-19 22:10 ` [PATCH v1 5/6] Add porcelain V2 documentation to status manpage Jeff Hostetler
2016-07-20 15:29 ` Jakub Narębski
2016-07-20 15:42 ` Jeff Hostetler
2016-07-20 15:55 ` Jakub Narębski
2016-07-20 21:50 ` Junio C Hamano
2016-07-19 22:10 ` [PATCH v1 6/6] Unit tests for V2 porcelain status Jeff Hostetler
2016-07-20 15:30 ` Jakub Narębski
2016-07-20 15:47 ` Jeff Hostetler
2016-07-20 16:01 ` Jakub Narębski
2016-07-21 15:54 ` Johannes Schindelin [this message]
2016-07-20 16:15 ` [PATCH v1 0/6] Porcelain Status V2 Jeff King
2016-07-20 19:27 ` Jeff Hostetler
2016-07-20 20:57 ` Jeff King
2016-07-21 16:02 ` Johannes Schindelin
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=alpine.DEB.2.20.1607211749590.14111@virtualbox \
--to=johannes.schindelin@gmx.de \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=peff@peff.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).