{"thread":{"id":"28080","subject":"Bug report: git log --[num|short]stat sometimes counts lines wrong","startedAt":"2011-08-12T15:21:48Z","lastAt":"2011-08-15T15:33:05Z","messageCount":4,"participants":["Alexander Pepper","Carlos Martín Nieto"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"173403","messageId":"45CC44BC-03FF-4C5F-97B7-7ED03CB68BC2@inf.fu-berlin.de","threadId":"28080","inReplyTo":null,"subject":"Bug report: git log --[num|short]stat sometimes counts lines wrong","fromName":"Alexander Pepper","fromEmail":"pepper@inf.fu-berlin.de","sentAt":"2011-08-12T15:21:48Z","receivedAt":"2011-08-12T15:21:48Z","isPatch":false,"sender":{"key":"pepper@inf.fu-berlin.de","avatar":null},"body":"Hi there.\nThis is my first contribution to git (if you count a bug report as a contribution) and I'm not really familiar where to report bugs. In the irc channel #git at freenode somebody pointed me to this mailing list.\n\nFirst of: I'm running git version 1.7.6 on OS X 10.6.8.\n\nLet me describe what I observed.\nrepository: https://github.com/voldemort/voldemort.git\nThe command \"git log --numstat c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586\" shows for the commit c21ad764 and file '.../readonly/mr/HadoopStoreBuilderReducer.java' 25 lines added and 22 lines removed. But the patch of HadoopStoreBuilderReducer.java that I get with \"git show c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586 -- contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java\" adds 30 lines and removes 27.\n\nWhy does \"git log --numstat\" drops 5 added lines and 5 removed lines? This also holds true for \"git log --stat\" and \"git log --shortstat\".\n\nIs this a bug or am I missing an option to git log or git show?\n\nMore commits where I observed this problem on the same repository:\n7e00fb6d2cf131dfed59c180f2171952808cc336 src/java/voldemort/client/rebalance/MigratePartitions.java\n78ad6f2a6ea327dbae2110f4530a5bd07e5deaac src/java/voldemort/client/rebalance/MigratePartitions.java (same commit on another branch)\n7871933f0f0f056e2eeac03a01db1e9cf81f8bda src/java/voldemort/client/protocol/admin/AdminClient.java\n2d6f68b09c3bdc23dcf3ae1f91c9285fbd668820 src/java/voldemort/store/readonly/ExternalSorter.java\n6fcacee866307ec34eb32b268e2c2b885a949319 build.xml\n\nGreetings from Berlin\nAlex"},{"id":"173528","messageId":"91324E9A-3134-455D-B7CA-ABBDA88FC7B7@inf.fu-berlin.de","threadId":"28080","inReplyTo":"45CC44BC-03FF-4C5F-97B7-7ED03CB68BC2@inf.fu-berlin.de","subject":"Re: Bug report: git log --[num|short]stat sometimes counts lines wrong","fromName":"Alexander Pepper","fromEmail":"pepper@inf.fu-berlin.de","sentAt":"2011-08-15T08:24:55Z","receivedAt":"2011-08-15T08:24:55Z","isPatch":false,"sender":{"key":"pepper@inf.fu-berlin.de","avatar":null},"body":"Am 12.08.2011 um 17:21 schrieb Alexander Pepper:\n> Hi there.\n> This is my first contribution to git (if you count a bug report as a contribution) and I'm not really familiar where to report bugs. In the irc channel #git at freenode somebody pointed me to this mailing list.\n> \n> First of: I'm running git version 1.7.6 on OS X 10.6.8.\n> \n> Let me describe what I observed.\n> repository: https://github.com/voldemort/voldemort.git\n> The command \"git log --numstat c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586\" shows for the commit c21ad764 and file '.../readonly/mr/HadoopStoreBuilderReducer.java' 25 lines added and 22 lines removed. But the patch of HadoopStoreBuilderReducer.java that I get with \"git show c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586 -- contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java\" adds 30 lines and removes 27.\n> \n> Why does \"git log --numstat\" drops 5 added lines and 5 removed lines? This also holds true for \"git log --stat\" and \"git log --shortstat\".\n> \n> Is this a bug or am I missing an option to git log or git show?\n> \n> More commits where I observed this problem on the same repository:\n> 7e00fb6d2cf131dfed59c180f2171952808cc336 src/java/voldemort/client/rebalance/MigratePartitions.java\n> 78ad6f2a6ea327dbae2110f4530a5bd07e5deaac src/java/voldemort/client/rebalance/MigratePartitions.java (same commit on another branch)\n> 7871933f0f0f056e2eeac03a01db1e9cf81f8bda src/java/voldemort/client/protocol/admin/AdminClient.java\n> 2d6f68b09c3bdc23dcf3ae1f91c9285fbd668820 src/java/voldemort/store/readonly/ExternalSorter.java\n> 6fcacee866307ec34eb32b268e2c2b885a949319 build.xml\n> \n> Greetings from Berlin\n> Alex\n\nHello again.\n\nI also observed this behavior with git version 1.7.4.1 on Gentoo.\n\nAny ideas how to fix this?\n\nGreetings from Berlin\nAlex\n"},{"id":"173539","messageId":"1313422005.26123.2.camel@bee.lab.cmartin.tk","threadId":"28080","inReplyTo":"91324E9A-3134-455D-B7CA-ABBDA88FC7B7@inf.fu-berlin.de","subject":"Re: Bug report: git log --[num|short]stat sometimes counts lines wrong","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2011-08-15T15:26:39Z","receivedAt":"2011-08-15T15:26:39Z","isPatch":false,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On Mon, 2011-08-15 at 10:24 +0200, Alexander Pepper wrote:\n> Am 12.08.2011 um 17:21 schrieb Alexander Pepper:\n> > Hi there.\n> > This is my first contribution to git (if you count a bug report as a contribution) and I'm not really familiar where to report bugs. In the irc channel #git at freenode somebody pointed me to this mailing list.\n> > \n> > First of: I'm running git version 1.7.6 on OS X 10.6.8.\n> > \n> > Let me describe what I observed.\n> > repository: https://github.com/voldemort/voldemort.git\n> > The command \"git log --numstat c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586\" shows for the commit c21ad764 and file '.../readonly/mr/HadoopStoreBuilderReducer.java' 25 lines added and 22 lines removed. But the patch of HadoopStoreBuilderReducer.java that I get with \"git show c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586 -- contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java\" adds 30 lines and removes 27.\n> > \n> > Why does \"git log --numstat\" drops 5 added lines and 5 removed lines? This also holds true for \"git log --stat\" and \"git log --shortstat\".\n> > \n> > Is this a bug or am I missing an option to git log or git show?\n> > \n> > More commits where I observed this problem on the same repository:\n> > 7e00fb6d2cf131dfed59c180f2171952808cc336 src/java/voldemort/client/rebalance/MigratePartitions.java\n> > 78ad6f2a6ea327dbae2110f4530a5bd07e5deaac src/java/voldemort/client/rebalance/MigratePartitions.java (same commit on another branch)\n> > 7871933f0f0f056e2eeac03a01db1e9cf81f8bda src/java/voldemort/client/protocol/admin/AdminClient.java\n> > 2d6f68b09c3bdc23dcf3ae1f91c9285fbd668820 src/java/voldemort/store/readonly/ExternalSorter.java\n> > 6fcacee866307ec34eb32b268e2c2b885a949319 build.xml\n> > \n> > Greetings from Berlin\n> > Alex\n> \n> Hello again.\n> \n> I also observed this behavior with git version 1.7.4.1 on Gentoo.\n> \n> Any ideas how to fix this?\n\nI've just checked and `git show --stat` does give different numbers from\n`git show | diffstat`. Git ignores (or can ignore) empty lines in\nseveral contexts, have you checked to see if there are 5 empty lines\nadded and removed?\n\nCheers,\n   cmn\n"},{"id":"173541","messageId":"2E664B37-7447-4697-B6DC-3EAAAFDF2724@inf.fu-berlin.de","threadId":"28080","inReplyTo":"1313422005.26123.2.camel@bee.lab.cmartin.tk","subject":"Re: Bug report: git log --[num|short]stat sometimes counts lines wrong","fromName":"Alexander Pepper","fromEmail":"pepper@inf.fu-berlin.de","sentAt":"2011-08-15T15:33:05Z","receivedAt":"2011-08-15T15:33:05Z","isPatch":false,"sender":{"key":"pepper@inf.fu-berlin.de","avatar":null},"body":"Am 15.08.2011 um 17:26 schrieb Carlos Martín Nieto:\n> On Mon, 2011-08-15 at 10:24 +0200, Alexander Pepper wrote:\n>> Am 12.08.2011 um 17:21 schrieb Alexander Pepper:\n>>> Hi there.\n>>> This is my first contribution to git (if you count a bug report as a contribution) and I'm not really familiar where to report bugs. In the irc channel #git at freenode somebody pointed me to this mailing list.\n>>> \n>>> First of: I'm running git version 1.7.6 on OS X 10.6.8.\n>>> \n>>> Let me describe what I observed.\n>>> repository: https://github.com/voldemort/voldemort.git\n>>> The command \"git log --numstat c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586\" shows for the commit c21ad764 and file '.../readonly/mr/HadoopStoreBuilderReducer.java' 25 lines added and 22 lines removed. But the patch of HadoopStoreBuilderReducer.java that I get with \"git show c21ad764ea1bae7f7bd83b5e2cb015dcbc44d586 -- contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java\" adds 30 lines and removes 27.\n>>> \n>>> Why does \"git log --numstat\" drops 5 added lines and 5 removed lines? This also holds true for \"git log --stat\" and \"git log --shortstat\".\n>>> \n>>> Is this a bug or am I missing an option to git log or git show?\n>>> \n>>> More commits where I observed this problem on the same repository:\n>>> 7e00fb6d2cf131dfed59c180f2171952808cc336 src/java/voldemort/client/rebalance/MigratePartitions.java\n>>> 78ad6f2a6ea327dbae2110f4530a5bd07e5deaac src/java/voldemort/client/rebalance/MigratePartitions.java (same commit on another branch)\n>>> 7871933f0f0f056e2eeac03a01db1e9cf81f8bda src/java/voldemort/client/protocol/admin/AdminClient.java\n>>> 2d6f68b09c3bdc23dcf3ae1f91c9285fbd668820 src/java/voldemort/store/readonly/ExternalSorter.java\n>>> 6fcacee866307ec34eb32b268e2c2b885a949319 build.xml\n>>> \n>>> Greetings from Berlin\n>>> Alex\n>> \n>> Hello again.\n>> \n>> I also observed this behavior with git version 1.7.4.1 on Gentoo.\n>> \n>> Any ideas how to fix this?\n> \n> I've just checked and `git show --stat` does give different numbers from\n> `git show | diffstat`. Git ignores (or can ignore) empty lines in\n> several contexts, have you checked to see if there are 5 empty lines\n> added and removed?\n> \n> Cheers,\n>   cmn\n\nHi Charlos.\n\nAt least with \"git show c21ad764 -- contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java\" there are 6 removed lines and 5 added empty lines.\n\nIf  `git show --stat` ignores empty lines compared to `git show | diffstat`, is there a way or an option to enable, to tell `git show --stat` to also count empty lines?\n\nGreetings from Berlin\nAlex\n"}]}