Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
14 Posts 1043 Views
I think I have pretty much got my head around contributing code back on GitHub, but there is one thing that is really confusing me, the docs state I have to prefix a new branch with an issue number.
So I created a new issue in GitHub, setup a branch with that issue number then pushed it, created a pull request and now there is a new issue created associated with that pull request.
I am guessing this is not how it is supposed to happen? If so, how am I supposed to get the issue number before creating the branch?
Apologies if it is a bit of a noob question, the docs don't really seem to make it clear.
As I understood it, what you do is create a ticket, then use the ticketnumber to create the branch and also add it to the commit title/pull request title. Next, to come full circle, revisit the ticket and mention you created a pull request. At least that feels somewhat logic to me.
But I could be absolutely wrong, although I did try and they did merge... :-)
What do you mean by 'add it to the commit title/pull request title'? You mean make the title something like 'Issue #xx description of issue'?
Other than that, everything else I have done using the same workflow as you have outlined.
Please note I'm not saying we should do it like this - it 's just how I sort of interpreted things :-)
I'm thinking along the lines of 'FIX: something something (#1234)', to link everything together.
Well, I didn't think you were, but your interpretation seems to be pretty much the same as mine...
So, I guess I just need to add #ISSUE-NUMBER to the title somewhere, and GitHub picks this up automatically?
I will try and close down my pull request, and re-open using this technique, see if it works...
I just checked, and my pull request did have Issue #44 in its title.
What is more, I had that in my commit message, and GitHub picked up in the open issue that I had committed code against this issue, but the pull request still opened a new issue.
I'm sorry, maybe I wasn't clear on that - I didn't refer to an issue on github, I meant ticket on open.silverstripe.org...
Oh right, so I have to go and open an issue on open.silverstripe.org, not on GitHub?
I don't think it actually stipulates that on the docs, although I could be wrong :-s.