git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Uwe Kleine-KönigNext: Thomas Rast
Message 2 of 9 in “git log anomalities”
  1. Uwe Kleine-KönigJul 22, 2013
  2. Thomas RastJul 22, 2013
  3. log: use true parents for diff even when rewritingThomas Rast, Jul 22, 2013
  4. Junio C HamanoJul 22, 2013
  5. Thomas RastJul 23, 2013
  6. Uwe Kleine-KönigJul 23, 2013
  7. Junio C HamanoJul 23, 2013
  8. log: use true parents for diff even when rewritingThomas Rast, Jul 31, 2013
  9. Jeff KingJul 31, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.