{"thread":{"id":"8153","subject":"git log and merge commits","startedAt":"2007-05-14T16:13:23Z","lastAt":"2007-05-14T18:01:47Z","messageCount":4,"participants":["Geert Uytterhoeven","Jakub Narebski","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"42140","messageId":"Pine.LNX.4.62.0705141803590.11269@pademelon.sonytel.be","threadId":"8153","inReplyTo":null,"subject":"git log and merge commits","fromName":"Geert Uytterhoeven","fromEmail":"geert.uytterhoeven@sonycom.com","sentAt":"2007-05-14T16:13:23Z","receivedAt":"2007-05-14T16:13:23Z","isPatch":false,"sender":{"key":"geert.uytterhoeven@sonycom.com","avatar":null},"body":"\tHi,\n\nI noticed `git log -p' doesn't show the changes introduced by merge commits.\nThis is true for plain `git log -p' and for `git log -p <filename>'.\n\nUsing `git show <commit-id>' does show the changes.\n\nAs I noticed the problem originally in a non-public repository, it was a bit\ndifficult to report. But I've just found an example in linux.git, too:\n\n`git show 5cd47155155a32e5b944ac9fc3f3dc578e429aa0' shows the merge commit.\nBut `git log -p include/asm-arm/arch-ixp4xx/io.h' doesn't show it.\n\nIt happens in git 1.4.4.4 (what I'm using regularly), but also in 1.5.1.4.\n\nGr{oetje,eeting}s,\n\n\t\t\t\t\t\tGeert\n\n--\nGeert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)\nGeert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1\nVoice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium\n"},{"id":"42146","messageId":"f2a42g$ein$2@sea.gmane.org","threadId":"8153","inReplyTo":"Pine.LNX.4.62.0705141803590.11269@pademelon.sonytel.be","subject":"Re: git log and merge commits","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-05-14T16:56:11Z","receivedAt":"2007-05-14T16:56:11Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,\n     git@vger.kernel.org]\n\nGeert Uytterhoeven wrote:\n\n> I noticed `git log -p' doesn't show the changes introduced by merge commits.\n> This is true for plain `git log -p' and for `git log -p <filename>'.\n\nHave you tried `git log -p --cc'?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"42154","messageId":"alpine.LFD.0.98.0705141045180.6739@woody.linux-foundation.org","threadId":"8153","inReplyTo":"Pine.LNX.4.62.0705141803590.11269@pademelon.sonytel.be","subject":"Re: git log and merge commits","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-05-14T17:51:34Z","receivedAt":"2007-05-14T17:51:34Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 14 May 2007, Geert Uytterhoeven wrote:\n> \n> I noticed `git log -p' doesn't show the changes introduced by merge commits.\n> This is true for plain `git log -p' and for `git log -p <filename>'.\n\nThe default diff output format is silent about merges, because merges can \nbe shown multiple different ways, and you have to tell git which format \nyou want.\n\n\"git show\" defaults to using \"--cc\", which is usually what you want. But \nit can be a fairly expensive operation, so \"git log\" defaults to not \nshowing the merges at all.\n\nThe alternative format is just plain \"-c\", which shows a combined merge \n(ie it effectively shows the diff from *both* parents for any file with \ncontent merging). It gets really really large, really easily, which is why \n\"--cc\" is often more interesting (since it shows what looks like just the \npotential conflicts!)\n\n\t\tLinus\n"},{"id":"42155","messageId":"Pine.LNX.4.62.0705141959110.23495@pademelon.sonytel.be","threadId":"8153","inReplyTo":"alpine.LFD.0.98.0705141045180.6739@woody.linux-foundation.org","subject":"Re: git log and merge commits","fromName":"Geert Uytterhoeven","fromEmail":"geert.uytterhoeven@sonycom.com","sentAt":"2007-05-14T18:01:47Z","receivedAt":"2007-05-14T18:01:47Z","isPatch":false,"sender":{"key":"geert.uytterhoeven@sonycom.com","avatar":null},"body":"On Mon, 14 May 2007, Linus Torvalds wrote:\n> On Mon, 14 May 2007, Geert Uytterhoeven wrote:\n> > I noticed `git log -p' doesn't show the changes introduced by merge commits.\n> > This is true for plain `git log -p' and for `git log -p <filename>'.\n> \n> The default diff output format is silent about merges, because merges can \n> be shown multiple different ways, and you have to tell git which format \n> you want.\n\nIC.\n\n> \"git show\" defaults to using \"--cc\", which is usually what you want. But \n> it can be a fairly expensive operation, so \"git log\" defaults to not \n> showing the merges at all.\n> \n> The alternative format is just plain \"-c\", which shows a combined merge \n> (ie it effectively shows the diff from *both* parents for any file with \n> content merging). It gets really really large, really easily, which is why \n> \"--cc\" is often more interesting (since it shows what looks like just the \n> potential conflicts!)\n\nYes, --cc (as pointed out by Jakub, too), and -c both show the merge change.\n\nIn my case a file was modified by a merge, but semantically that change didn't\nbelong to the merge. I saw during `git pull' that the file got modified, but I\ncouldn't find the actual change with `git log -p'...\n\nThanks!\n\nGr{oetje,eeting}s,\n\n\t\t\t\t\t\tGeert\n\n--\nGeert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)\nGeert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1\nVoice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium\n"}]}