Re: [PATCH] rev-list: restore the NUL commit separator in --header mode

3 messages, 3 authors, 2016-10-20 · open the first message on its own page

Re: [PATCH] rev-list: restore the NUL commit separator in --header mode

From: Junio C Hamano <hidden>
Date: 2016-10-19 22:42:07

Dennis Kaarsemaker [off-list ref] writes:
+	touch expect &&
+	printf "\0" > expect &&
What's the point of that "touch", especially if you are going to
overwrite it immediately after?
+	git rev-list --header --max-count=1 HEAD | tail -n1 >actual &&
As "tail" is a tool for text files, it is likely unportable to use
"tail -n1" to grab the "last incomplete line that happens to contain
a single NUL".
+	test_cmp_bin expect actual
+'

Re: [PATCH] rev-list: restore the NUL commit separator in --header mode

From: Dennis Kaarsemaker <hidden>
Date: 2016-10-20 18:04:38

On Wed, 2016-10-19 at 15:41 -0700, Junio C Hamano wrote:
Dennis Kaarsemaker [off-list ref] writes:
quoted
+	touch expect &&
+	printf "\0" > expect &&

What's the point of that "touch", especially if you are going to
overwrite it immediately after?
Leftover debugging crud. I tried various ways of generating an
actual/expect to compare.
quoted
+	git rev-list --header --max-count=1 HEAD | tail -n1 >actual &&

As "tail" is a tool for text files, it is likely unportable to use
"tail -n1" to grab the "last incomplete line that happens to contain
a single NUL".
quoted
+	test_cmp_bin expect actual
+'
Yeah, I was fearing that. I didn't find anything in the testsuite that
helps answering the question "does this file end with a NUL" and would
appreciate a hint :)

D.

Re: [PATCH] rev-list: restore the NUL commit separator in --header mode

From: Jacob Keller <hidden>
Date: 2016-10-20 18:12:49

On Thu, Oct 20, 2016 at 11:04 AM, Dennis Kaarsemaker
[off-list ref] wrote:
On Wed, 2016-10-19 at 15:41 -0700, Junio C Hamano wrote:
quoted
Dennis Kaarsemaker [off-list ref] writes:
quoted
+   touch expect &&
+   printf "\0" > expect &&

What's the point of that "touch", especially if you are going to
overwrite it immediately after?
Leftover debugging crud. I tried various ways of generating an
actual/expect to compare.
quoted
quoted
+   git rev-list --header --max-count=1 HEAD | tail -n1 >actual &&

As "tail" is a tool for text files, it is likely unportable to use
"tail -n1" to grab the "last incomplete line that happens to contain
a single NUL".
quoted
+   test_cmp_bin expect actual
+'
Yeah, I was fearing that. I didn't find anything in the testsuite that
helps answering the question "does this file end with a NUL" and would
appreciate a hint :)

D.
I did some searching, and we do use sed so I replaced it with sed \$!d
which appears to work. I think we should probably implement a
test_ends_with_nul or something.

Thanks,
Jake
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help