Thread (3 messages) 3 messages, 2 authors, 2022-02-16

RE: [PATCH] name-rev: test showing failure with non-monotonic commit dates

From: "Keller, Jacob E" <jacob.e.keller@intel.com>
Date: 2022-02-16 01:16:39

-----Original Message-----
From: Ævar Arnfjörð Bjarmason <redacted>
Sent: Monday, February 14, 2022 11:16 PM
To: Keller, Jacob E <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org; Jacob Keller <redacted>
Subject: Re: [PATCH] name-rev: test showing failure with non-monotonic commit
dates


Shorter & avoids the needless subshell as:

    git init repo &&
    test_commit -C repo --date="2020-01-01 18:00" A &&
    test_commit -C repo --date="2020-01-02 18:00" B &&
    [...]
Sure. I can pick these improvements up if if we end up actually wanting the test case. I think we're still discussing the core problem in this thread too.

 
quoted
+test_expect_failure 'name-rev commit timestamp prevents naming commits' '
+	(
+		cd non-monotonic &&
+
+		B=$(git rev-parse main~3) &&
+
+		echo "$B main~3" >expect &&
+		git name-rev $B >actual &&
+
+		test_cmp expect actual
+	)
+'
I haven't checked, but is the explicit peeling to $B really needed here,
are the results different with a main~3 or main~3^{commit}?

I.e. the first column of the output will of course be, but will the
result on the second column? I suspect not, but haven't run this. In any
case I tihnk teh test/commit message could do with an explanation.
The first column is the commit id, so we need to get that either way to compare the expected and actual output. As far as I know passing "main~3" instead of the commit id to name-rev doesn't change this.

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