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

Re: git log and merge commits

From
GUGeert Uytterhoeven <geert.uytterhoeven@sonycom.com>
Date
May 14, 2007, 18:01 UTC
Message-ID
<Pine.LNX.4.62.0705141959110.23495@pademelon.sonytel.be>
In-Reply-To
<alpine.LFD.0.98.0705141045180.6739@woody.linux-foundation.org>
On Mon, 14 May 2007, Linus Torvalds wrote:
Show 7 quoted lines
> On Mon, 14 May 2007, Geert Uytterhoeven wrote:
> > I noticed `git log -p' doesn't show the changes introduced by merge commits.
> > This is true for plain `git log -p' and for `git log -p <filename>'.
> 
> The default diff output format is silent about merges, because merges can 
> be shown multiple different ways, and you have to tell git which format 
> you want.
IC.
Show 9 quoted lines
> "git show" defaults to using "--cc", which is usually what you want. But 
> it can be a fairly expensive operation, so "git log" defaults to not 
> showing the merges at all.
> 
> The alternative format is just plain "-c", which shows a combined merge 
> (ie it effectively shows the diff from *both* parents for any file with 
> content merging). It gets really really large, really easily, which is why 
> "--cc" is often more interesting (since it shows what looks like just the 
> potential conflicts!)
Yes, --cc (as pointed out by Jakub, too), and -c both show the merge change.

In my case a file was modified by a merge, but semantically that change didn't belong to the merge. I saw during `git pull' that the file got modified, but I couldn't find the actual change with `git log -p'...

Thanks!
Gr{oetje,eeting}s,
						Geert

-- Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

Previous: Linus Torvalds
Message 4 of 4 in “git log and merge commits”
  1. Geert UytterhoevenMay 14, 2007
  2. Jakub NarebskiMay 14, 2007
  3. Linus TorvaldsMay 14, 2007
  4. Geert UytterhoevenMay 14, 2007

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.