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

Re: [PATCH v4] fast-import: checkpoint: only write out refs and tags if we changed them

From
Eric Rannaud <e@nanocritical.com>
Date
May 28, 2019, 00:11 UTC
Message-ID
<CAH_=xoY+3_uEJ0VRVwP6vqLKdWzzU8hjLosf6sjjJtqP4mW=ng@mail.gmail.com>
In-Reply-To
<CABPp-BFkqyGT_YHReKPJKy-nX5eWYhb9AVE2UeD7M+nhKT0dqg@mail.gmail.com>
On Mon, May 27, 2019 at 4:27 PM Elijah Newren <newren@gmail.com> wrote:
Show 6 quoted lines
> That sounds good...though it's taking my short patch and just about
> amounts to completely rewriting it.  Would you like to take it over
> including authorship, and just add either a "Original-patch-by:" or
> "Based-on-patch-by:" for me in the commit message (these two tags
> appear to be the two most common attribution mechanism used in
> git.git's history when someone does this)?

Sure. Co-authored-by is an option too. I'll turn all of this in 3 patches: improve background_import, your patch, the rest of mine.

Show 14 quoted lines
> > > +       cat >input <<-INPUT_END &&
> > > +       feature done
> > > +       commit refs/heads/V3
> > > +       mark :3
> > > +       committer Me My <self@and.eye> 1234567890 +0123
> >
> > You likely want to use:
> > committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
>
> I see other tests in that testsuite using this, and using it here
> certainly wouldn't hurt; I'm not opposed to it.  But I'm
> curious...other than "other tests in the same testcase use it a lot" I
> don't see why the choice of committer name/email/date matters at all.
> Is there an actual reason for this that I just missed?
There is no direct benefit here except consistency.

These vars are set the same on every test run so that the SHA1 of generated patches is the same as in a previous run (see also test_tick() to increment the date by one minute). So in general this makes it easier to debug tests as hashes can be compared between runs. But your hand-picked values do give you that property.

However, as normal git commands use the vars automatically, by using them here, fast-import commands and direct git commands produce the same hashes if they're doing the same work. That's the main benefit of using them here: while the test does not currently rely on that property, maybe it will (or someone debugging down the road will expect that).

Previous: Elijah Newren
Message 6 of 6 in “fast-import: checkpoint: only write out refs and tags if we changed them”
  1. fast-import: checkpoint: only write out refs and tags if we changed themEric Rannaud, May 24, 2019
  2. Eric RannaudMay 25, 2019
  3. Elijah NewrenMay 27, 2019
  4. Eric RannaudMay 27, 2019
  5. Elijah NewrenMay 27, 2019
  6. Eric RannaudMay 28, 2019

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.