|
|
Line 1: |
Line 1: |
− | | + | #REDIRECT [[Version Control]] |
− | ==Guidelines on Git pull requests==
| + | |
− | From a #dreamwidth_dev conversation:
| + | |
− | | + | |
− | <pre>[02:18] <_Simon_> THat does lead to a question, actually - is there anything in particular
| + | |
− | you'd like to see in a pull request's text? Presumably t he bug number that it refers to,
| + | |
− | but otherwise... summary of what's done? Changelog? Just "Fixed it!"?
| + | |
− | (I realise this will depend a lot on the nature of the changes)
| + | |
− | [02:22] <Afuna> bsically, we want: | + | |
− | [02:22] <Afuna> (Bug 1234) Description of what changed
| + | |
− | [02:22] <Bugsy> Bug http://bugs.dwscoalition.org/show_bug.cgi?id=1234 trivial,
| + | |
− | P5, -undecided-, dwbugzilla, RESOLVED FIXED, Overeager offer to delete old S2 layers owned by system
| + | |
− | [02:22] <Afuna> optional extended information
| + | |
− | [02:22] <Afuna> aww bugsy
| + | |
− | [02:22] <Afuna> we'll be coming out with actual guidelines shortly!
| + | |
− | [02:22] <Afuna> (at some point *G*)
| + | |
− | [02:23] <_Simon_> hee, bugsy :-)
| + | |
− | [02:23] <kunzite> i seem to be one of the poor guinea pigs here in Noobletville. :D
| + | |
− | [02:23] <_Simon_> fair enough
| + | |
− | [02:23] <_Simon_> kunzite: I've been submitting them too,
| + | |
− | I was just wondering whether there was specific stuff I should be saying :-)
| + | |
− | [02:23] <Afuna> hmm. http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html is a good start
| + | |
− | [02:23] <Afuna> and we're going to be basing what we want on that ,
| + | |
− | plus requiring the bug number at the start
| + | |
− | [02:24] <_Simon_> err... those guidelines make sense as pull request messages.
| + | |
− | Not so much as commit messages, I'd have thought?
| + | |
− | [02:24] <Afuna> ahhh well!
| + | |
− | [02:24] <Afuna> the commit messages get used for the pull request
| + | |
− | [02:24] <Afuna> so in a sense , they're the same *G*
| + | |
− | [02:24] <Afuna> the goal basically is
| + | |
− | [02:24] <_Simon_> they do?
| + | |
− | [02:24] <Afuna> for someone reading the log later on
| + | |
− | [02:25] <Afuna> for it to still make sense t othem
| + | |
− | [02:25] * Afuna nods
| + | |
− | [02:25] <_Simon_> ah, I guess later on the pull request text has effectively vanished
| + | |
− | [02:25] <Afuna> eyeah
| + | |
− | [02:25] <Afuna> the pull requset text will still be on the website
| + | |
− | but it won't be part of the regular changelog
| + | |
− | [02:25] <Afuna> so the commit message is actually v. important
| + | |
− | [02:25] <Afuna> as it's what you se when going over history
| + | |
− | [02:25] <_Simon_> so do you want multiple work-in-progress commits to be rolled up
| + | |
− | into a single coherent one with a nice message before being submitted?
| + | |
− | [02:26] <Afuna> hmm. see there are arguments either way
| + | |
− | [02:26] <_Simon_> because I've submitted stuff with multiple commits of
| + | |
− | "added debugging stuff"; "removed debugging stuff"; "flailed a bit" and so forth...
| + | |
− | [02:26] <kunzite> i heart flailing.
| + | |
− | [02:26] <_Simon_> :-)
| + | |
− | [02:26] <Afuna> I'm in favor of just splatting them all in
| + | |
− | [02:26] <Afuna> *but* I'm not against cleaning up thinsg using git commit --squash
| + | |
− | [02:27] <_Simon_> Fair enough. Depends how embarassing the false-starts are, I guess ;-)
| + | |
− | [02:27] <Afuna> (because sometimes it's useful to see:
| + | |
− | "oh did this thing. which casued bug. don't do that. did this again"
| + | |
− | [02:27] <Afuna> yup!
| + | |
− | [02:27] <Afuna> basically *G*
| + | |
− | [02:27] <Afuna> so. right now we have in changelog
| + | |
− | [02:27] <Afuna> some ohhh maybe three changes to the same file
| + | |
− | [02:27] <_Simon_> (the last thing I worked on, it ended up such a mess
| + | |
− | that I actually started a new branch to do it again cleanly to submit...)
| + | |
− | [02:27] <Afuna> (apache/livejournal.pm)
| + | |
− | [02:27] <Afuna> because we one thing that kept running into edge cases
| + | |
− | [02:27] <Afuna> heeee
| + | |
− | [02:28] <Afuna> in that case, I would suggest git commit --squash
| + | |
− | [02:28] <kunzite> ok lovelies. i'm going to sleep.
| + | |
− | [02:28] <kunzite> <3
| + | |
− | [02:28] <Afuna> that should prove useful for cleaning up the most egregious of...
| + | |
− | [02:28] <Afuna> stuff
| + | |
− | | + | |
− | [02:28] <Afuna> night
| + | |
− | [02:28] <Afuna> !
| + | |
− | [02:28] <_Simon_> *nod* In that case, the *code* was also in a mess.
| + | |
− | I couldn't remember where I had left warns etc all over the place,
| + | |
− | added stuff then commented it out, etc. But, yes :-)
| + | |
− | [02:29] * Afuna nod nods
| + | |
− | [02:29] <Afuna> it used to be that putting it all into zilla sort of fixed that
| + | |
− | because we'd just get the finished product
| + | |
− | [02:29] <_Simon_> *nod*
| + | |
− | [02:29] <Afuna> but also sometimes looking back at code ,there's the sense of:
| + | |
− | [02:29] <Afuna> "oh, why did they do $this and not $that?"
| + | |
− | [02:29] <Afuna> and you look back into history
| + | |
− | [02:29] <Afuna> and it was shoved in as part of some giant commit with no context
| + | |
− | [02:30] <_Simon_> and hopefully somebody explained it in the commit,
| + | |
− | or you see a sequence where they tried the other and it didn't work. I see
| + | |
− | [02:30] <Afuna> or with all context having gone on probably in some comment thread somewhere else or
| + | |
− | [02:30] <Afuna> yeah *nods*
| + | |
− | [02:30] <Afuna> in an
| + | |
− | [02:30] <Afuna> whatsis
| + | |
− | [02:30] <Afuna> intermediat ecommit
| + | |
− | [02:30] <Afuna> OTOH I do see the, how it'd be helpful to just be able t oclean out warns ;-)
| + | |
− | [02:31] <Afuna> (what I sometimse do: I use "git stash" to save away debug lines for later
| + | |
− | [02:31] <Afuna> but without putting it into the main ... commit thing
| + | |
− | [02:31] <_Simon_> *nod*
| + | |
− | [02:31] <Afuna> or else I'll save the warns in a commit where there are no other functional changes
| + | |
− | [02:31] <_Simon_> that makes sense
| + | |
− | [02:31] <Afuna> so that it's easy to find them again
| + | |
− | [02:31] <Afuna> of course that's easy to say after the fact *G*</pre>
| + | |
− | | + | |
− | | + | |
− | ==That obnoxious error, fixing it==
| + | |
− | [http://www.freewayprojects.com/2011/11/solving-the-your-branch-is-ahead-of-originmaster-by-x-commits-issue-after-pulling-using-git/ http://www.freewayprojects.com/2011/11/solving-the-your-branch-is-ahead-of-originmaster-by-x-commits-issue-after-pulling-using-git/]
| + | |