git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Keller, Jacob E <jacob.e.keller@intel.com>
Date
Feb 16, 2022, 01:16 UTC
Message-ID
<CO1PR11MB5089008D502F964AF9425F86D6359@CO1PR11MB5089.namprd11.prod.outlook.com>
In-Reply-To
<220215.868rucy4t6.gmgdl@evledraar.gmail.com>
Show 17 quoted lines
> -----Original Message-----
> From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> Sent: Monday, February 14, 2022 11:16 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: git@vger.kernel.org; Jacob Keller <jacob.keller@gmail.com>
> 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.
 
Show 20 quoted lines
> > +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

Previous: Ævar Arnfjörð Bjarmason
Message 10 of 10 in “name-rev: test showing failure with non-monotonic commit dates”
  1. name-rev: test showing failure with non-monotonic commit datesJacob Keller, Feb 14, 2022
  2. Junio C HamanoFeb 14, 2022
  3. Jacob KellerFeb 14, 2022
  4. Derrick StoleeFeb 15, 2022
  5. Keller, Jacob EFeb 15, 2022
  6. Junio C HamanoFeb 16, 2022
  7. Jacob KellerFeb 27, 2022
  8. Johannes SchindelinMar 9, 2022
  9. Ævar Arnfjörð BjarmasonFeb 15, 2022
  10. Keller, Jacob EFeb 16, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.