I am trying to format my git logs in a very specific format.
I originally used 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 ref information (i.e. tag / branch) for each commit. I can view this information with the git log --source , and this shows what exactly I want (i.e. Ref, which is after the 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'm trying to do is include this information at the end of my original command --format="..." so that I have an output that looks like this:
b05f827b41856e6f4bcfba20c32f58434ce3a5a6,Kevin Jalbert, kevin.j.jalbert@gmail.com ,Fri Sep 7 14:43:16 2012 -0400,206f23d,refs/remotes/origin/HEAD
I cannot find any format placeholder that refers to the commit branch / tag / ref based on the --source flag. Am I just missing the right placeholder? Or is there an alternative way to format / display ref along with the user information I desire?
source share