git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git log --numstat disagrees with git apply --numstat
@ 2008-12-11 23:53 Shawn O. Pearce
  2008-12-12  1:52 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Shawn O. Pearce @ 2008-12-11 23:53 UTC (permalink / raw)
  To: git

I've found a case where git apply --numstat and git log --numstat
produce different results for the same commit.

In egit (git://repo.or.cz/egit.git/):

  $ git log --numstat -1 --pretty=o 9bda5ece6806cd797416eaa47c
  9bda5ece6806cd797416eaa47c7b927cc6e9c3b2 Teach RevWalk about ...
  8       0       org.spearce.jgit/src/org/spearce/jgit/revwalk/DateRevQueue.java
  69      13      org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java

  $ git log -p -1 --pretty=o 9bda5ece6806cd797416eaa47c | git apply --numstat
  8       0       org.spearce.jgit/src/org/spearce/jgit/revwalk/DateRevQueue.java
  68      12      org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java

I found this because I was writing a unit test for JGit that ran
through the JGit project history and compared the output of git
log --numstat against the output of JGit's "git apply --numstat"
implementation, after scraping the "git log -p" output.

I can't quite figure out why log --numstat is coming up with a +1
difference here for both added and removed, but it is.  I haven't
dug into the Git code yet to figure out why.  FWIW, JGit produces
the same result as "git apply --numstat" (the 68/12).

At this point JGit was able to successfully read and match 715 of
1211 commits before it found this difference, so its also somewhat
rare to occur I think...

-- 
Shawn.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-15 20:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 23:53 git log --numstat disagrees with git apply --numstat Shawn O. Pearce
2008-12-12  1:52 ` Jeff King
2008-12-12  2:08   ` Jeff King
2008-12-12  2:21     ` Jeff King
2008-12-15  9:57       ` Junio C Hamano
2008-12-15 20:32         ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).