From: Junio C Hamano <gitster@pobox.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org, Dennis Kaarsemaker <dennis@kaarsemaker.net>,
Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH] rev-list: use hdr_termination instead of a always using a newline
Date: Thu, 20 Oct 2016 11:54:33 -0700 [thread overview]
Message-ID: <xmqq4m46hmvq.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161020181930.21084-1-jacob.e.keller@intel.com> (Jacob Keller's message of "Thu, 20 Oct 2016 11:19:30 -0700")
Jacob Keller <jacob.e.keller@intel.com> writes:
> diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
> index 3e752ce03280..e8c6979baf59 100755
> --- a/t/t6000-rev-list-misc.sh
> +++ b/t/t6000-rev-list-misc.sh
> @@ -4,6 +4,12 @@ test_description='miscellaneous rev-list tests'
>
> . ./test-lib.sh
>
> +test_ends_with_nul() {
> + printf "\0" >nul
> + sed '$!d' "$@" >contents
> + test_cmp_bin nul contents
> +}
> +
> test_expect_success setup '
> echo content1 >wanted_file &&
> echo content2 >unwanted_file &&
> @@ -100,4 +106,9 @@ test_expect_success '--bisect and --first-parent can not be combined' '
> test_must_fail git rev-list --bisect --first-parent HEAD
> '
>
> +test_expect_success '--header shows a NUL after each commit' '
> + git rev-list --header --max-count=1 HEAD | sed \$!d >actual &&
> + test_ends_with_nul actual
> +'
> +
> test_done
Thanks.
The main part of the patch looks good. For "passing NUL to sed",
I'd probably work it around like so:
t/t6000-rev-list-misc.sh | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index e8c6979baf..737026c34f 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -4,12 +4,6 @@ test_description='miscellaneous rev-list tests'
. ./test-lib.sh
-test_ends_with_nul() {
- printf "\0" >nul
- sed '$!d' "$@" >contents
- test_cmp_bin nul contents
-}
-
test_expect_success setup '
echo content1 >wanted_file &&
echo content2 >unwanted_file &&
@@ -107,8 +101,17 @@ test_expect_success '--bisect and --first-parent can not be combined' '
'
test_expect_success '--header shows a NUL after each commit' '
- git rev-list --header --max-count=1 HEAD | sed \$!d >actual &&
- test_ends_with_nul actual
+ # We know there is no Q in the true payload; names and
+ # addresses of the authors and the committers do not have
+ # any, and object names or header names do not, either.
+ git rev-list --header --max-count=2 HEAD |
+ nul_to_q |
+ grep "^Q" >actual &&
+ cat >expect <<-EOF &&
+ Q$(git rev-parse HEAD~1)
+ Q
+ EOF
+ test_cmp expect actual
'
test_done
next prev parent reply other threads:[~2016-10-20 18:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 18:19 [PATCH] rev-list: use hdr_termination instead of a always using a newline Jacob Keller
2016-10-20 18:49 ` Dennis Kaarsemaker
2016-10-20 18:54 ` Junio C Hamano [this message]
2016-10-20 20:05 ` Jacob Keller
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=xmqq4m46hmvq.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=dennis@kaarsemaker.net \
--cc=git@vger.kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jacob.keller@gmail.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.