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

Re: cherry-pick strangeness

From
Phil Hord <phil.hord@gmail.com>
Date
Jun 15, 2019, 00:24 UTC
Message-ID
<CABURp0p3iwizpZNR+aeAK3_sj7v2mu487AD57PiZG4fgne+tww@mail.gmail.com>
In-Reply-To
<CAEwRq=qufzNg_fBNPgSkV++VRHE2jE8q_iNBB1Fn=BQjTFRLEw@mail.gmail.com>

On Fri, Jun 14, 2019 at 12:29 AM Vincent Legoll <vincent.legoll@gmail.com> wrote:

Show 22 quoted lines
> On Fri, Jun 14, 2019 at 12:56 AM Elijah Newren <newren@gmail.com> wrote:
> > When you cherry-pick a commit, it reapplies its diff on top of a
> > (usually different) commit, preserving the author name/email/date, but
> > throwing away the committer name/email/date -- instead using your
> > name/email and the time of the cherry-pick for the committer.  Since
> > you are transplanting on the same commit, and you created both the
> > original commit and the cherry-pick, the only thing that can be
> > different is the committer timestamp.  Git records timestamps down to
> > 1-second resolution.  If you run in a script, odds are that the
> > original commit and the cherry-pick both run within the same second
> > (though not always), and thus you end up with precisely the same
> > commit.  When you run interactively, you take longer than a second
> > between commands, and thus have a different committer date which
> > naturally will have a different sha1sum.
>
> Thanks for the thorough explanation.
>
> Looks like this has nothing to do with "--[no-]ff" at all.
>
> Shouldn't something about that be added to the man page to avoid
> people scratch their heads ? (I can try to cook something if this is
> deemed acceptable)

Patches to documentation are welcome, but I'm not sure what you'd say. Is it just a note to point out that the HEAD resulting from cherry-pick is not guaranteed to be unique? That seems too noisy for something which is inconsequential to most users, to me. But others may disagree.

Previous: Vincent Legoll
Message 4 of 4 in “cherry-pick strangeness”
  1. Vincent LegollJun 13, 2019
  2. Elijah NewrenJun 13, 2019
  3. Vincent LegollJun 14, 2019
  4. Phil HordJun 15, 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.