Take this git graph as an example:
* ef99623 (c-branch) Other spaces
* 3c391fc (master) Merge branch 'b-branch'
|\
* | f0c357b Add spaces
| | * bc9833b (HEAD -> b-branch) Another space
| |/
| * 64d6e33 update
|/
* f716b36 rails newThe Ruby git gem requires me to go through each branch to get the commits—
ef99623 (HEAD -> c-branch) Other spaces
3c391fc (master) Merge branch 'b-branch'
f0c357b Add spaces
64d6e33 update
f716b36 rails newbc9833b (HEAD -> b-branch) Another space
64d6e33 update
f716b36 rails new3c391fc (HEAD -> master) Merge branch 'b-branch'
f0c357b Add spaces
64d6e33 update
f716b36 rails newThe issue I have is that the commit 64d6e33 update was made on b-branch, but after the merge, I don't know how I can determine the commit was created on b-branch and not master from looking at the logs.
To clarify, all I can determine from ruby-git is:
- I can loop through each branches log
- For each commit I can access the parent commit(s)
Inheritely branch names are not stored with commits, so determining what branch a commit was created on is really tricky— especially when merging is involved.