Skip to main content
Active reading.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Git commit revision id to be 5five chars long when using pretty format in Ruby script

My code is the following

system('git log --pretty=format:[%h]: %an') 

where %h gives the revision id of the commit, and it is 7 charsseven characters long and %an is the author name.

My problem is that I want to have 5 digitsa five-digits revision id and not 7seven, but I can't find any flag of the form.

--date=iso-strict 

or whatever to do so.

Can you please tell me how toHow do I do it?

Git commit revision id to be 5 chars long when using pretty format in Ruby script

My code is the following

system('git log --pretty=format:[%h]: %an') 

where %h gives the revision id of the commit and it is 7 chars long and %an the author name.

My problem is that I want to have 5 digits revision id and not 7, but I can't find any flag of the form.

--date=iso-strict 

or whatever to do so.

Can you please tell me how to do it?

Git commit revision id to be five chars long when using pretty format in Ruby script

My code is the following

system('git log --pretty=format:[%h]: %an') 

where %h gives the revision id of the commit, and it is seven characters long and %an is the author name.

My problem is that I want to have a five-digits revision id and not seven, but I can't find any flag of the form.

--date=iso-strict 

or whatever to do so.

How do I do it?

Source Link
hack-is-art
  • 325
  • 6
  • 20

Git commit revision id to be 5 chars long when using pretty format in Ruby script

My code is the following

system('git log --pretty=format:[%h]: %an') 

where %h gives the revision id of the commit and it is 7 chars long and %an the author name.

My problem is that I want to have 5 digits revision id and not 7, but I can't find any flag of the form.

--date=iso-strict 

or whatever to do so.

Can you please tell me how to do it?