1

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.

voltas
  • 553
  • 7
  • 24

1 Answers1

1

^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?")

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • : Thanks for your input. I modified my command as per your suggestion, as below git log --pretty=format:"%cn committed %h on %cd description %B files" --name-only 99214db 8ce980e instead of giving commit information b/n those range , its giving additional commit information too – voltas Oct 18 '16 at 07:33
  • @voltas yes, that is why I posted the picture about log range. Do you see the right commits at least? – VonC Oct 18 '16 at 07:34
  • If I want to restrict the information b/n 8ce980e and 99214db. How can I get it ? Thanks – voltas Oct 18 '16 at 07:35
  • I can see the entire commit ranges , from beginning to end , but I would like to restrict it between 8ce980e and 99214db and its associated commit details. Would like to take ur expertise here – voltas Oct 18 '16 at 07:44
  • Perfect, Thanks much.. +1 for your vivid explanation. – voltas Oct 18 '16 at 09:07
  • @voltas : Now i'm able to do a +1 .. crossed 15 reputation :) – voltas Oct 18 '16 at 09:17