threads / discuss / 27995

Why do some commits not appear in "git log"?

Subject: Why do some commits not appear in "git log"?

## tl;dr

5 messages between Aug 2, 2011 and Aug 6, 2011.

replies: 4people: 3as markdown or json

Dov Grobgeld· Aug 2, 2011, 15:38 UTC · lore
Hi,
This is my first post to this list, so I hope this is the appropriate place.

I'm having a problem understanding why "git log file" does not show some of the commits where file is changed. Consider the following commit history:

> git log --pretty=oneline --abbrev-commit | head -20

e86d3b1 Merge remote-tracking branch 'git-svn' into MultiDataPath 05e7103 Made the system convert DP geometric info to MultiDP info and load it at machine start. 2de7375 Fixed compilation under Linux. b520873 Error handling!! 73110bd New Group manager for multi data processor dce3ae9 Merge branch 'MultiDataPath' of ssh://swteam/home/machine/git/SolarJet into MultiDataPath 25dff3c Merge branch 'MultiDataPath' of ssh://swteam/home/machine/git/SolarJet into MultiDataPath 247f418 Rewrite of the Finger heightmap nozzle selection algorithm for better load balancing. 026fec8 Stop all the jobs on async stop or on exception Choice nozzles using max nozzles number 84a60b7 avoid CarouselSimulationParams c40df74 git-svn-id: svn://swteam/SolarJet/trunk@4684 d8e1dcc2-e5e0-4eb0-83da-8cedbf775ddd :

Now let's limit this to the history of a single file:
> git log --pretty=oneline --abbrev-commit Apps/SolarJet/Project/qt/SysScripts/init.py | head

84a60b7 avoid CarouselSimulationParams c40df74 git-svn-id: svn://swteam/SolarJet/trunk@4684 d8e1dcc2-e5e0-4eb0-83da-8cedbf775ddd :

As can be see above there were lots of commits omitted now. E.g. 05e7103 (the second commit above). But if I list the changes in 05e7103 I then get:

> git show 05e7103 --name-only | grep init.py
Apps/SolarJet/Project/qt/SysScripts/init.py
Running without --name-only show that there is a substantial change in init.py
So why does this commit not show up in in "git log file"?

One interesting observation is that the only commits that appear in the "git log file" command are the commits that were imported from svn. All other commits are filtered out.

So is this a bug, or am I doing something wrong?

Thanks in advance! Dov

Michael Witten· Aug 2, 2011, 15:56 UTC · re: Dov Grobgeld · lore

Re: Why do some commits not appear in "git log"?

On Tue, Aug 2, 2011 at 15:38, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:
> git log --pretty=oneline --abbrev-commit | head -20

Try `--full-history' maybe? Also, rather than `head -20', you can limit the output directly with `-20':

  git log --pretty=oneline --abbrev-commit --full-history -20

It's hard to know what's going on in your particular example; perhaps give us the output of `git log' when using the `--graph' option.

Dov Grobgeld· Aug 3, 2011, 05:47 UTC · re: Michael Witten · lore

Re: Why do some commits not appear in "git log"?

--full-history indeed made the missing commits show up! So why was the commit pruned? It contains some substantial source changes as may be seen by the following commands:

1. Commit history for entire project:
> git log --full-history --pretty=oneline  -5 --abbrev-commit   | ~/scripts/crop

e86d3b1 Merge remote-tracking ... 05e7103 Made the system conver... 2de7375 Fixed compilation unde... b520873 Error handling!! 73110bd New Group manager for ...

2. Diff of a single file between two commits show that 05e7103
contains a substantial change for the file.
> git diff 05e7103 2de7375 Apps/SolarJet/Project/qt/SysScripts/init.py | wc
    105     389    5336
3. Full history of the file includes 05e7103
> git log --full-history --pretty=oneline  -5 --abbrev-commit Apps/SolarJet/Project/qt/SysScripts/init.py  | ~/scripts/crop

05e7103 Made the system conver... 84a60b7 avoid CarouselSimulati... c40df74 git-svn-id: svn://swte... 0bdf4b6 Group manager for mult... 0536a0d git-svn-id: svn://swte...

4. But the default "pruned" history of the file does not contain 05e7103
> git log  --pretty=oneline  -5 --abbrev-commit Apps/SolarJet/Project/qt/SysScripts/init.py  | ~/scripts/crop

84a60b7 avoid CarouselSimulati... c40df74 git-svn-id: svn://swte... 0536a0d git-svn-id: svn://swte... a720b61 Add full line wafer pr... 08b366b git-svn-id: svn://swte...

5. Here is the project graph:
> git log --graph --abbrev-commit --pretty=oneline -20 | ~/scripts/crop
*   e86d3b1 Merge remote-track...
|\
| * 026fec8 Stop all the jobs ...
| * 84a60b7 avoid CarouselSimu...
| * c40df74 git-svn-id: svn://...
| * fee6808 git-svn-id: svn://...
| * 047e697 Automatic Theta Ca...
* | 05e7103 Made the system co...
* | 2de7375 Fixed compilation ...
* | b520873 Error handling!!
* | 73110bd New Group manager ...
* |   dce3ae9 Merge branch 'Mu...
|\ \
| * \   25dff3c Merge branch '...

Finally, a few more questions. Is it possible to make gitk use the --full-history option when running 'gitk file'? Is there any configuration flag that always turns on "full history"?

Thanks! Dov

On Tue, Aug 2, 2011 at 18:56, Michael Witten <mfwitten@gmail.com> wrote:
Show 11 quoted lines
> On Tue, Aug 2, 2011 at 15:38, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:
>> git log --pretty=oneline --abbrev-commit | head -20
>
> Try `--full-history' maybe? Also, rather than `head -20', you can
> limit the output directly with `-20':
>
>  git log --pretty=oneline --abbrev-commit --full-history -20
>
> It's hard to know what's going on in your particular example; perhaps
> give us the output of `git log' when using the `--graph' option.
>
Junio C Hamano· Aug 3, 2011, 18:57 UTC · re: Dov Grobgeld · lore

Re: Why do some commits not appear in "git log"?

Dov Grobgeld <dov.grobgeld@gmail.com> writes:
> --full-history indeed made the missing commits show up! So why was the
> commit pruned? It contains some substantial source changes...

I suspect that these "substantial changes" did not make any contribution to the end result. Read

http://thread.gmane.org/gmane.comp.version-control.git/89400/focus=90659

These days, the --post-simplify option implemented in that discussion thread is called --simplify-merges or something, I think.

Dov Grobgeld· Aug 6, 2011, 17:43 UTC · lore

Re: Why do some commits not appear in "git log"?

Ok, now I grok it. Indeed these "substantial changes" by mistake undid another large change. So the net result was zero, which git was smart enough to figure out, and therefore these two changes +D and -D cancelled one another and none of them were shown.

Thanks a lot! Dov

On Wed, Aug 3, 2011 at 21:57, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
>
> Dov Grobgeld <dov.grobgeld@gmail.com> writes:
>
> > --full-history indeed made the missing commits show up! So why was the
> > commit pruned? It contains some substantial source changes...
>
> I suspect that these "substantial changes" did not make any contribution
> to the end result. Read
>
> http://thread.gmane.org/gmane.comp.version-control.git/89400/focus=90659
>
> These days, the --post-simplify option implemented in that discussion
> thread is called --simplify-merges or something, I think.

← back to recent threads