Re: git log anomalities
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Jul 22, 2013, 10:40 UTC
- Message-ID
- <87bo5u28l6.fsf@linux-k42r.v.cablecom.net>
- In-Reply-To
- <20130722090854.GA22222@pengutronix.de>
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
Show 21 quoted lines
> Hello, > > today I looked at the changes to drivers/net/ethernet/freescale/fec.c in > the kernel since v3.8 using > > git log --stat v3.8.. --full-diff -- drivers/net/ethernet/freescale/fec.c > > which looks as expected. But when I added --graph the diffstats change. > E.g. for 793fc0964be1921f15a44be58b066f22b925d90b it changes from: > > drivers/net/ethernet/freescale/Makefile | 3 +- > drivers/net/ethernet/freescale/fec.c | 1966 ----------------------------- > drivers/net/ethernet/freescale/fec_main.c | 1966 +++++++++++++++++++++++++++++ > drivers/net/ethernet/freescale/fec_ptp.c | 3 - > 4 files changed, 1968 insertions(+), 1970 deletions(-) > > to > > | Documentation/devicetree/bindings/net/dsa/dsa.txt | 91 + > | .../bindings/net/marvell-orion-mdio.txt | 3 + > | Documentation/networking/ip-sysctl.txt | 35 +-
[...]
> | 404 files changed, 15373 insertions(+), 8563 deletions(-) > > Is that a bug, or a feature I don't understand?
Nice catch. It's a bad interaction between --full-diff, --stat and --parents (which --graph implies in an internal-workings kind of way).
The parent rewriting gets to mess with the history *before* we generate the diffs. Normally this wouldn't matter, because the pathspec filter would then again exclude all but the "real" change from the diff. But with --full-diff, you see all the changes between 793fc096 and the next commit that touches the given pathspec (47a5247f), which is -- at this stage, after rewriting -- the "parent".
I suspect to fix this we'll need to separate the "real" from the "rewritten" parents, which might take a bit of work.
--
Thomas Rast
trast@{inf,student}.ethz.ch