emngaiden
emngaiden

Reputation: 75

git log pretty format with %cI placeholder returns "cI" instead of the commit date

I'm running a script to get commit data of some repositories in a server. The git command I am using is this:

git log HEAD -1 --pretty=%H~%h~%cI~%cE~%cn~%s

It works perfectly on my windows pc, but in my server with CentOS, it prints the string "cI" instead of the formated ISO date.

Result on Windows PC:

40c688e4976d28a560f5711e73c2a933da3cfbbe~40c688e~2021-07-02T17:18:48-04:[email protected]~gituser1~Commit into master

Result on CentOS server same repository:

40c688e4976d28a560f5711e73c2a933da3cfbbe~40c688e~cI~usertest@mail.com~gituser1~Commit into master

What could be the problem?

EDIT: Im using git version 2.30.0.windows.2 on windows and git version 1.8.3.1 on CentOS

Upvotes: 0

Views: 248

Answers (1)

eftshift0
eftshift0

Reputation: 30277

It's more than likely due to the fact that you are using a version of git on centos that didn't support --pretty=%cI. Consider updating it. I might be wrong but I think it showed up in git in version v2.2.0. https://github.com/git/git/commit/466fb6742d7fb7d3e6994b2d0d8db83a8786ebcf

Upvotes: 1

Related Questions