I am trying to format my git logs in a very specific format.
I was originally using git log --format="%H,%an,%ae,%ad,%p"
which would produce the following output (for each commit):
b05f827b41856e6f4bcfba20c32f58434ce3a5a6,Kevin Jalbert,kevin.j.jalbert@gmail.com,Fri Sep 7 14:43:16 2012 -0400,206f23d
Now I am trying to get the ref (i.e., tag/branch) information for each commit. I am able to view this information using the git log --source
command and this shows exactly what I want (i.e., the ref which is located after the commit SHA):
commit 84deec66f94085ee3a0e6f6204f06296d7a1a903 refs/remotes/origin/HEAD
Author: Kevin Jalbert <kevin.j.jalbert@gmail.com>
Date: Fri Sep 21 17:02:33 2012 -0400
commit message
commit f1e1b8d11defc48839557db5e54a5a6f7ffe6cad refs/heads/issue_5
Author: Kevin Jalbert <kevin.j.jalbert@gmail.com>
Date: Thu Sep 13 15:34:36 2012 -0400
commit message
commit d7acdbd957d9b477f8849fd5a37882cdd78d8e1f refs/tags/v0.3.0
Author: Kevin Jalbert <kevin.j.jalbert@gmail.com>
Date: Wed Sep 12 16:48:46 2012 -0400
commit message
What I am trying to do is to include this information at the end of my original --format="..."
command so I would have output that looks like:
b05f827b41856e6f4bcfba20c32f58434ce3a5a6,Kevin Jalbert,kevin.j.jalbert@gmail.com,Fri Sep 7 14:43:16 2012 -0400,206f23d,refs/remotes/origin/HEAD
I cannot seem to find any format placeholder that references the branch/tag/ref of a commit based on the --source
flag. Am I just missing the correct placeholder? Or is there an alternative way to format/display the ref along with the custom information I desire?