Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created August 5, 2011 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/1128757 to your computer and use it in GitHub Desktop.
Save grahamc/1128757 to your computer and use it in GitHub Desktop.
0) Iterate over each branch
1) Iterate over the list of commits in your branch that aren't in master
2) If it has multiple parents, skip it
3) Get the date of the commit
4) Perform date magic
...
???) Profit
# Gets commits unique the branch, not in master
git rev-list topicbranch ^master
# Get the parents of a particular commit hash, space separated
git log --format=format:"%%P" --max-count=1 commithash
# Get the date of a particular hash
git log --format=format:"%%cD" --max-count=1 commithash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment