Thread (1 message) 1 message, 1 author, 2018-11-16

Re: [PATCH v2 1/2] [Outreachy] t3903-stash: test without configured user.name and user.email

From: Junio C Hamano <hidden>
Date: 2018-11-16 06:32:09

Junio C Hamano [off-list ref] writes:
Slavica Djukic [off-list ref] writes:
quoted
+test_expect_failure 'stash works when user.name and user.email are not set' '
+	git reset &&
+	git var GIT_COMMITTER_IDENT >expected &&
...
Anyway, we grab the committer ident we use by default during the
test with this command.  OK.
quoted
+	>1 &&
+	git add 1 &&
+	git stash &&
And we make sure we can create stash.
quoted
+	git var GIT_COMMITTER_IDENT >actual &&
+	test_cmp expected actual &&
I am not sure what you are testing with this step.  There is nothing
that changed environment variables or configuration since we ran
"git var" above.  Why does this test suspect that somebody in the
future may break the expectation that after running 'git add' and/or
'git stash', our committer identity may have been changed, and how
would such a breakage happen?
Just a note.

"git var GIT_COMMITTER_IDENT" has timestamp in it, so a naïve reader
might wonder what would happen if "git add 1" and "git stash" took
more than one second.  But it won't be a problem in this case as the
committer date comes from the environment GIT_COMMITTER_DATE, which
is set to a fixed known value and is incremented only by calling
test_commit helper function, which does not happen between the two
"git var" calls.

In any case, I am not sure I understand the point of comparing two
output from "git var" invocations we see ablve in this test.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help