Re:Git Koans (2013)
by mooneater on Thursday January 12, 2017 @12:04AM
(#13379938)
"How can I find out which branch each parent was originally made on" -- ouch. Ive dreamed of automatically tacking on branch names to commit messages to solve this very issue.
[ Parent
| on HN ]
Re:Git Koans (2013)
by an_account on Thursday January 12, 2017 @12:20AM
(#13379991)
As long as the branch hasn't been deleted, it's possible to figure out based on the commits, correct? (Not exactly easy, but possible.)
And if the branch has been deleted, which typically happens after merging, then there's not much reason to know the branch name.
Is there something I'm missing here?
> then there's not much reason to know the branch name
Most likely the branch names give you a good deal of information in working out why things have happened.
That information should be in the merge commit message. If you merge something git will offer you a default commit message like "Merge branch 'foo'".
(assuming a non-fast-forward commit, where the branch is not really a branch because nothing happens in parallel)
So can I ask git to show me the merge commit that relates to the commit I'm looking at?
This
Re:Git Koans (2013)
by Vinkekatten on Thursday January 12, 2017 @08:22AM
(#13381956)
We use Jira and bitbucket - most if not all branch names contain an issue number and the name of the issue, while commit messages can be more cryptic. This is often helpful when the branch has been deleted, as it usually is.
Re:Git Koans (2013)
by Vinkekatten on Thursday January 12, 2017 @08:20AM
(#13381952)
We use bitbucket server for pull requests and merges, and it does this. It's brilliant, since the branch name often describes the solved problem better than the commit messages.