personalt
personalt

Reputation: 850

GIT Log - Displaying tags in logs with (tag: tagged_version_number)

I have a git command that I run to display my logs. It mostly works as designed, however I notice when I run a more simplified version with --oneline it displays the tagged entries a little nicer. In the --oneline version I get back (tag: 12.8.16.1) rather then (12.8.16.1). I would either like to modify the --oneline version to include the author or fix my current command so that it displays the tags as (tag:xxxx)

Command I would like to modify to include (tag: xxxx)

git log 12.6.22.1.. --pretty=format:"%an %C(yellow)%h %Cred%ad %Cgreen%d %Creset%s"  --date=short  testfile.xml


Smith e8995d2 2012-07-10  (12.8.16.1, origin/BUG_23213) Fix issue with bad code 
Jones 1bf9013 2012-07-03  FEATURE 1232 - added some new stuff

This is an example of the simple --oneline version. It works fine except I wanted to add the author.

git log 12.6.22.1.. --oneline --no-merges --decorate=short testfile.xml

 68b52ac PROJ 12311 - Adding field to report page
 37629d2 (tag: 12.8.16.1) Tagging for release
 0a8f43b (origin/BF_12312) Update timer to deal with milliseconds

Upvotes: 0

Views: 190

Answers (1)

Christopher
Christopher

Reputation: 44244

Try the pimped out git log alias. It's got beautiful oneline / author formatting. This is the full command:

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

Upvotes: 2

Related Questions