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

Re: What the meaning of two commit ID in a merge commit's log

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 4, 2020, 04:08 UTC
Message-ID
<20200104040804.GD6570@camp.crustytoothpaste.net>
In-Reply-To
<56365810.1196c.16f6e224802.Coremail.wuzhouhui14@mails.ucas.ac.cn>
On 2020-01-04 at 01:18:58, wuzhouhui wrote:
Show 14 quoted lines
> Hi,
> 
> When I use "git log" to display commit log, I see there are
> two commit IDs in a merge commit, e.g.
> 
>     commit 2187f215ebaac73ddbd814696d7c7fa34f0c3de0
>     Merge: 2d3145f8d280 fbd542971aa1
>     Author: Linus Torvalds <torvalds@linux-foundation.org>
>     Date:   Tue Dec 17 13:27:02 2019 -0800
> 
>         Merge tag 'for-5.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
> 
> In the previous example, we can see two commit IDs: 2d3145f8d280 and
> fbd542971aa1. So, what's the meaning of them, precisely.

Non-merge commits have a single parent commit that they're based on (unless they're a root commit). Merge commits, since they merge two (or more) separate lines of development, contain multiple parent commits (usually, but not always, two). So the two commit IDs here are the two parent commits of this merge.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: wuzhouhui
Message 2 of 2 in “What the meaning of two commit ID in a merge commit's log”
  1. wuzhouhuiJan 4, 2020
  2. brian m. carlsonJan 4, 2020

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.