git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git log and merge commits
@ 2007-05-14 16:13 Geert Uytterhoeven
  2007-05-14 16:56 ` Jakub Narebski
  2007-05-14 17:51 ` Linus Torvalds
  0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2007-05-14 16:13 UTC (permalink / raw)
  To: git; +Cc: Geert Uytterhoeven

	Hi,

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>'.

Using `git show <commit-id>' does show the changes.

As I noticed the problem originally in a non-public repository, it was a bit
difficult to report. But I've just found an example in linux.git, too:

`git show 5cd47155155a32e5b944ac9fc3f3dc578e429aa0' shows the merge commit.
But `git log -p include/asm-arm/arch-ixp4xx/io.h' doesn't show it.

It happens in git 1.4.4.4 (what I'm using regularly), but also in 1.5.1.4.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git log and merge commits
  2007-05-14 16:13 git log and merge commits Geert Uytterhoeven
@ 2007-05-14 16:56 ` Jakub Narebski
  2007-05-14 17:51 ` Linus Torvalds
  1 sibling, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2007-05-14 16:56 UTC (permalink / raw)
  To: git

[Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,
     git@vger.kernel.org]

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>'.

Have you tried `git log -p --cc'?

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git log and merge commits
  2007-05-14 16:13 git log and merge commits Geert Uytterhoeven
  2007-05-14 16:56 ` Jakub Narebski
@ 2007-05-14 17:51 ` Linus Torvalds
  2007-05-14 18:01   ` Geert Uytterhoeven
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2007-05-14 17:51 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: git



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.

"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!)

		Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git log and merge commits
  2007-05-14 17:51 ` Linus Torvalds
@ 2007-05-14 18:01   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2007-05-14 18:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

On Mon, 14 May 2007, Linus Torvalds wrote:
> 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.

> "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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-14 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-14 16:13 git log and merge commits Geert Uytterhoeven
2007-05-14 16:56 ` Jakub Narebski
2007-05-14 17:51 ` Linus Torvalds
2007-05-14 18:01   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).