I am trying to link Jira issues to commits in a central git repository, and have found the plugin SCM Activity for Jira. It is designed to be called from a
pre-receive) hook receives input on stdin like this:
<old-value> SP <new-value> SP <ref-name> LF
where is the old object name stored in the ref, <new-value> is the new object name to be stored in the ref and <ref-name> is the full name of the ref. When creating a new ref, <old-value> is 40 0.
(from man githooks)
Now I would like to "re-play" the sequence of pushes to the repository, to populate the database in Jira based on historical data.
git log --pretty=format "%H %gd" gives me part of what I want, but is there a way to get the previous value for a ref in a given commit?