voltas voltas - 1 month ago 5
Git Question

Gathering git commit information b/n 2 commits

I'm looking to gather commit information between 2 git commits and I used the below command

$ git log --pretty=format:"%cn committed %h on %cd description %B files" --name-only 8ce980e ^99214db


and the output is below

DevTools App User committed 8ce980e on Mon Jun 6 09:09:28 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.102
files
.properties/release.properties

DevTools App User committed 179a8d9 on Mon Jun 6 08:12:40 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.101
files
.properties/release.properties

DevTools App User committed 2dc3410 on Mon Jun 6 07:48:21 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.100
files
.properties/release.properties

DevTools App User committed 49b34c7 on Mon Jun 6 06:23:30 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.99
files
.properties/release.properties

DevTools App User committed 5594e34 on Mon Jun 6 03:17:10 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.98
files
.properties/release.properties

DevTools App User committed 92915c9 on Fri Jun 3 11:16:04 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.93
files
.properties/release.properties

DevTools App User committed 17278e2 on Fri Jun 3 10:55:03 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.91
files
.properties/release.properties

DevTools App User committed c165306 on Thu Jun 2 14:43:33 2016 -0400 description Released Build version ${env.MAJOR_VERSION}.${env.MINOR_VERSION}.88
files
.properties/release.properties


Problem is - commit ID previous to 99214db i.e c165306 is getting displayed excluding the commit ID 99214db. I want the commit ID 99214db and its associated details also to be displayed.

Please help me where I'm wrong .Thanks.

Answer

^99214db means --not (git log): it excludes commits that are reachable from 99214db (including 99214db itself)

It would be easier to list all between 99214db and 8ce980e:

http://mythic-beasts.com/~mark/git-log-for-upload-smaller.png

git log 8ce980e...99214db~

(see "What are the differences between double-dot ".." and triple-dot "..." in Git diff commit ranges?")