Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH/FYI v4 13/12] fixup! t/t3511: add some tests of 'cherry-pick -s' functionality

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:08

Jonathan Nieder [off-list ref] writes:
Brandon Casey wrote:
quoted
I'm not sure we should apply this though.  I'm leaning towards saying that
the 'cherry-pick -s' behavior with respect to a commit with an empty message
body should be undefined.  If we want it to be undefined then we probably
shouldn't introduce a test which would have the effect of defining it.
Maybe it would make sense to just check that cherry-pick doesn't
segfault in this case?
;-)
That is, compute the output but don't compare it to expected output, as
in:

	test_expect_success 'adding signoff to empty message does something sane' '
		git reset --hard HEAD^ &&
		git cherry-pick --allow-empty-message -s empty-branch &&
		git show --pretty=format:%B -s empty-branch >actual &&

		# sign-off is included *somewhere*
		grep "^Signed-off-by:.*>\$" actual
	'
Isn't what the current code happens to do is the best we could do?
We would end up showing one entry whose title appears to be
"Signed-off-by: ..." in the shortlog output if we did so.  If we
added an empty line, then the shortlog output will have a single
empty line that is equally unsightly.

We could force a message like this:

	tree d7f87518a26e9f00714675706f165b94f3625177
        parent f459a4b602c0f4d371e1717572de6d0c4d39c6b1
        author Junio C Hamano [off-list ref] 1360699963 -0800
        committer Junio C Hamano [off-list ref] 1360699980 -0800

	!!cherry-picked from a commit without any message!!

        Signed-off-by: Junio C Hamano [off-list ref]

but I do not think that buys us much; it only replaces a totally
uninformative empty line with another totally uninformative junk.

That ugliness is a price the insane person, who is cherry picking a
commit without any justification made by another insane person,
indicates that he is willing to pay by doing so.  At that point I do
not think we should care.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help