{"thread":{"id":"13021","subject":"\"gitk\" and \"git log --graph\": Strange behaviour with --follow","startedAt":"2008-04-08T16:42:08Z","lastAt":"2008-04-09T09:40:45Z","messageCount":2,"participants":["Teemu Likonen","Adam Simpkins"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73856","messageId":"20080408164208.GA13871@mithlond","threadId":"13021","inReplyTo":null,"subject":"\"gitk\" and \"git log --graph\": Strange behaviour with --follow","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-04-08T16:42:08Z","receivedAt":"2008-04-08T16:42:08Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"I found something very strange in graphical history tools \"gitk\" and\n\"git log --graph\" when used with --follow. In Git repository compare the\nfollowing:\n\n  $ gitk -- utf8.c\n  $ gitk --follow -- utf8.c\n\nThe output of \"git log --graph\" is somewhat similar:\n\n  $ git log --graph --pretty=oneline -- utf8.c\n  $ git log --graph --pretty=oneline --follow -- utf8.c\n\nAll I can say is that the output is not intuitive at _all_. Almost all\nthe commits are in separate history lines.\n"},{"id":"73937","messageId":"20080409094044.GA20235@adamsimpkins.net","threadId":"13021","inReplyTo":"20080408164208.GA13871@mithlond","subject":"Re: \"gitk\" and \"git log --graph\": Strange behaviour with --follow","fromName":"Adam Simpkins","fromEmail":"adam@adamsimpkins.net","sentAt":"2008-04-09T09:40:45Z","receivedAt":"2008-04-09T09:40:45Z","isPatch":false,"sender":{"key":"adam@adamsimpkins.net","avatar":"https://gravatar.com/avatar/d3fd2c0b3e2d2136b56e95726ee03227bee4eb562f627dcd3ebca0623fa05054?d=mp&s=160"},"body":"On Tue, Apr 08, 2008 at 07:42:08PM +0300, Teemu Likonen wrote:\n> I found something very strange in graphical history tools \"gitk\" and\n> \"git log --graph\" when used with --follow. In Git repository compare the\n> following:\n> \n>   $ gitk -- utf8.c\n>   $ gitk --follow -- utf8.c\n> \n> The output of \"git log --graph\" is somewhat similar:\n> \n>   $ git log --graph --pretty=oneline -- utf8.c\n>   $ git log --graph --pretty=oneline --follow -- utf8.c\n> \n> All I can say is that the output is not intuitive at _all_. Almost all\n> the commits are in separate history lines.\n\nYes, I see this behavior too.  The --follow option disables parent\nrewriting, which gitk and \"git log --graph\" both rely on in this\ninstance.\n\nWithout --follow, the revision list is first pruned, and then the\nparents are rewritten to include only those in the pruned list.  The\nrevision walk then occurs only over the pruned list.\n\nWith --follow, the revision list is not pruned, so parent rewriting\ndoesn't happen (and even if it did, I don't think it would have any\neffect, since all commits are still in the list).  Instead, the\nrevision walk traverses all commits, but the log-tree/diff code simply\ndoesn't print any output for commits that aren't relevant.\n\n\nI'm not familiar enough with the diff code to know the best way to fix\nthis.  One possible way might be to perform an extra revision walk in\nrevision.c before the \"real\" walk occurs.  This initial walk would\nperform all of the diff calculations performed by the real walk, but\nonly for the purpose of pruning the list.  Then parent rewriting could\nbe done, and the \"real\" revision walk would only walk over the pruned\nlist.\n\n-- \nAdam Simpkins\nadam@adamsimpkins.net\n"}]}