Change the contributing guidelines document to make the recommended process more familiar and obvious to users of plain git.
This issue is not a request or proposal to replace Gerrit or the review process. This issue is not a request or proposal to remove the git-codereview tool or to make drastic changes to how anyone on the Go team or existing contributors go about contributing.
There are other open issues proposing a switch to GitHub (#21956), or adding the ability to support pushing via GitHub (#18517). Based on my own experience I think much of the friction that GitHub users are experiencing is caused by the contributing guidelines centering around git-codereview, which abstracts git away from the developer. Abstracting git away from developers is jarring when developers know how to use that tool already. It gives them the experience that they are using something that is entirely different to what they use today, even though it is not.
I recently submitted my first contribution to Go and was surprised at how straight forward and refreshing Gerrit was in comparison to GitHub. I had delayed contributing because the process described at https://golang.org/doc/contribute.html appeared so different to what I was use to. In practice it wasn't. It only appeared that way because there was a layer of abstraction.
Before contributing the main point of friction for me wasn't the use of Gerrit vs GitHub, but the fact that all of the examples centered around the use of git-codereview, a custom tool for interacting with the Go Gerrit instance. I realize this tool is optional, but it took time to read all of the text and note down which git commands each git-codereview command actually used.
At the end it came down to:
git clonegit pull -rgit checkout -b <branch>git commitgit push -u origin HEAD:refs/for/master (patch set 1)git commit --amendgit push -u origin HEAD:refs/for/master (patch set 2)The above is almost identical to the workflows I use at work and on open source on GitHub, and it is instantly familiar to me as a git user.
The contribution guidelines tell a different story:
git codereview hooksgit clonegit syncgit changegit mail (patch set 1)git change (to amend)git mail (patch set 2)While the above is technically less commands, it's four new commands that I had never seen before and had to learn about. These commands abstract git away from plain git users, unnecessarily.
Some ideas for how the contributing guidelines document could be made more familiar to plain git users:
git-codereview with plain git commands where the corresponding git commands are simple and straight forward. e.g. git sync vs git pull -r, git push vs git mail, etc.git-codereview the recommended path for those not familiar with git, or power users.git-codereview.I've got a branch with changes to the contributing doc that I made to experiment with these ideas and to confirm if focusing on plain git commands would make it appear more familiar and approachable. I'd love to be involved with improving the guidelines in this way if this is something that the community agrees with.
While the above is technically less commands, it's four new commands that I had never seen before and had to learn about.
Programmers are expected to constantly learn new things.
These commands abstract git away from plain git users, unnecessarily.
Unnecessarily??? Of course not.
CC @spf13
Before doing any changes to the contributing guidelines I think it might be informative to poll existing contributors to see what proportions of them use which codereview commands.
FWIW, I personally only use the mail subcommand because it is shorter to type, and use plain git for everything else.
The contributing guidelines does mention the plain git equivalent of most codereview subcommands but the layout/formatting could use some improvement. Consider for instance:
Once you have the changes queued up, you will want to commit them. In the Go contribution workflow this is done with a git change command, which creates a local branch and commits the changes directly to that local branch.
$ git change <branch>The name <branch> is an arbitrary one you choose to identify the local branch containing your changes and will not be used elsewhere. This is an offline operation and nothing will be sent to the server yet.
(In Git terms, git change <branch> runs git checkout -b branch, then git branch --set-upstream-to origin/master, then git commit.)
Instead of assuming the use of codereview, it would arguably be better to first describe the operation using plain git concepts, and then mention the change subcommand, along with the plain git equivalent e.g:
Once you have the changes queued up, you will want to commit them. In the Go contribution workflow this is done by committing your changes to a local branch. This is an offline operation and nothing will be sent to the server yet.
For convenience, the
codereviewtool provides achangesubcommand that performs the necessary git operations.$ git change <branch> $ git checkout -b <branch> $ git --set-upstream-to origin/master $ git commitThe name <branch> is an arbitrary one you choose to identify the local branch containing your changes and will not be used elsewhere.
I think I'm outside the new contributor guide's target audience, but I thought I'd just voice that I've never learned to use git-codereview aside from the commit hooks. I was already comfortable using Git and Gerrit from previous projects before Go switched to using them, so I've just always used plain Git/Gerrit.
Perhaps I'm projecting, but I would expect 1) more potential contributors are already familiar with Git/Gerrit than git-codereview, 2) contributors would be more interested in learning tools that are applicable outside of just the Go project (to be fair, I have no idea how reusable git-codereview is for contributing to other Git projects), and 3) there's more documentation on how to use Git/Gerrit than git-codereview (e.g., StackOverflow).
I use git codereview exclusively. I consider the gerrit dance to be gerrits
problem and I'm grateful that Russ wrote a tool to hide it.
On Tue, Oct 31, 2017 at 3:30 PM, Matthew Dempsky notifications@github.com
wrote:
I think I'm outside the new contributor guide's target audience, but I
thought I'd just voice that I've never learned to use git-codereview aside
from the commit hooks. I was already comfortable using Git and Gerrit from
previous projects, so I've just always done that.So perhaps I'm projecting, but I would expect 1) more potential
contributors are already familiar with Git/Gerrit than git-codereview, 2)
contributors would be more interested in learning tools that are applicable
outside of just the Go project (to be fair, I have no idea how reusable
git-codereview is for contributing to other Git projects), and 3) there's
more documentation on how to use Git/Gerrit than git-codereview (e.g.,
StackOverflow).—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/22484#issuecomment-340656949, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA1zZ3xodMiTQsgtI12dlBtgyuwSaks5sxqJxgaJpZM4QKM9n
.
@mdempsky you might be the only person who could say you were more familiar with Git and Gerrit from previous projects. The vast majority of people coming to the Go project haven't heard of Gerrit before, much less used it.
@leighmcculloch
I've spent a lot of time with our first time contributors and I'd say most don't have the same level of familiarity using Git as you do. Many memorize the handful of commands they need to use and never go past that. Many of those git commands would be unfamiliar, especially installing the hooks. This is the first step and would cause significant friction.
I would support having the instructions still preferring git codereview but expanding the documentation to include the git alternative.
I think @huguesb suggestion is perfect and we should pursue that approach.
If someone wants to prepare that CL and assign it to me as a reviewer that would be awesome.
I'm up for doing it. The draft change I had made was essentially the same example @huguesb included, with codereview and plain git side-by-side. I'll clean it up and push it.
@spf13 I think it's rather unlikely that @mdempsky would be the only person familiar with Git and Gerrit from previous projects. I had been using Gerrit at work for a few years before I contributed to Go. Likewise, a significant portion of Go contributors are (ex-)Googlers who have been exposed to Mondrian. That's not to say we shouldn't be trying to make it easier to onboard unfamiliar people, just that we also have to be careful to avoid confusing people already familiar with Git/Gerrit, and fwiw, I found the codereview commands to be more confusing than helpful.
@davecheney I find this really surprising as I've personally used git in a number of contexts where gerrit was not involved and the only significant differences in workflow was using git push origin <branch> as opposed to git push -u origin HEAD:refs/for/master which is arguably a rather minor variation. Out of curiosity, were you familiar with git before contributing to Go? If so, what was your typical workflow like and what are your pain points in the Gerrit workflow?
On 1 Nov 2017, at 02:32, Hugues notifications@github.com wrote:
@spf13 I think it's rather unlikely that @mdempsky would be the only person familiar with Git and Gerrit from previous projects. I had been using Gerrit at work for a few years before I contributed to Go. Likewise, a significant portion of Go contributors are (ex-)Googlers who have been exposed to Mondrian. That's not to say we shouldn't be trying to make it easier to onboard unfamiliar people, just that we also have to be careful to avoid confusing people already familiar with Git/Gerrit, and fwiw, I found the codereview commands to be more confusing than helpful.
@davecheney I find this really surprising as I've personally used git in a number of contexts where gerrit was not involved and the only significant differences in workflow was using git push origin
as opposed to git push -u origin HEAD:refs/for/master which is arguably a rather minor variation. Out of curiosity, were you familiar with git before contributing to Go? If so, what was your typical workflow like and what are your pain points in the Gerrit workflow?
I don’t have any pain points, I’ve always used git codereview and I’m grateful that I can just ignore whatever Gerrit does behind the scenes. All I have to remember is to use git mail rather than git push to send a cl. Easy.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@spf13
@mdempsky you might be the only person who could say you were more familiar with Git and Gerrit from previous projects.
To be clear, I wasn't claiming that a lot of people are already familiar with Git and Gerrit (though I do think a lot of people are familiar with Git, at least based on how frequently we're asked to switch to GitHub pull requests). I was just saying that more people are likely to be familiar with Git and Gerrit (which are used by some other large projects) than with git-codereview (which seems to be an exclusively Go tool).
I've got two versions implemented and I can submit a CL for either. In both versions the plain git commands are presented the same as the git-codereview commands rather than being buried in the paragraph text.
Side by side:

One after the other:

I think side by side looks good on a desktop browser, but does require a small amount of new CSS in the godoc tool which will be one more thing that needs to be maintained and may be a little harder to read on screens that are smaller. To resolve the small screen size issue I can make it responsive and one-after-the-other on smaller screens.
I think the one-after-the-other screenshot above is sufficient and lower maintenance.
@spf13 Thoughts?
Change https://golang.org/cl/76318 mentions this issue: doc: move plain git examples in contribution guide
@spf13 CL 76318 ☝️ keep the plain git examples listed after the git-codereview examples, but changes their format so they are in code blocks and less hidden. I think it sufficiently improves the guide to make it more familiar for those familiar with git, without adding maintenance burden to this page which I think would happen if we introduced the side-by-side examples.
I pushed two smaller CLs ahead of this one that contain small changes that also help structure the introduction of using plain git.
@leighmcculloch apologies, I'm seeing these comments after the CLs.
I think the approach side by side with responsive after is best and the extra maintenance of a bit more CSS is ok.
No worries. I have a branch prepared for side by side, I'll add the responsive behavior to fallback to one after the other and submit them shortly.
Do I need to do anything to ensure the godoc style.css change is merged first and available in the same release?
For the side-by-side version, it's not clear at a glance that both are equivalent. Perhaps adding labels like "with codrereview aliases" (ideally linked to that section) and "plain git"?
For accessibility reasons those should be there regardless, even if hidden from visual user agents. Otherwise, a screen reader would just read them in order, making it sound like you have to run all four commands in a row. The other version didn't need this because of the explicitly included "or" between the panes.
@spf13 Screenshots of the side-by-side falling back to one after the other:
Greater than 500px:

Less than 500px:

If this is 👍 I'll look at adding labels per @jimmyfrasche's suggestion, assuming you agree @spf13.
Yes. I think the labels are critical to make it clear. I think we are
heading in the right direction.
On Wed, Nov 8, 2017 at 2:31 AM Leigh McCulloch notifications@github.com
wrote:
@spf13 https://github.com/spf13 Screenshots of the side-by-side falling
back to one after the other:Greater than 500px:
[image: screen shot 2017-11-07 at 11 25 59 pm]
https://user-images.githubusercontent.com/351529/32536399-382619e0-c413-11e7-93b1-d2975c4d09e4.pngLess than 500px:
[image: screen shot 2017-11-07 at 11 26 12 pm]
https://user-images.githubusercontent.com/351529/32536406-3d17793a-c413-11e7-8af6-a73e915bc380.pngIf this is 👍 I'll look at adding labels per @jimmyfrasche
https://github.com/jimmyfrasche's suggestion, assuming you agree @spf13
https://github.com/spf13.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/22484#issuecomment-342733579, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKlZNQbUD5JRaz5H1DK2K_v23Q3A9x3ks5s0VizgaJpZM4QKM9n
.
@spf13 Screenshots with labels at the three different responsive layouts that godoc renders in:
Greater than 700px:

Greater than 500px:

Less than 500px:

If this looks good from a presentation point-of-view I'll push CLs to golang/tools and golang/go with the css and html changes for code review.
@leighmcculloch can't speak for @spf13 but that ticks my boxes and any specifics can be worked out in the CL.
Change https://golang.org/cl/76874 mentions this issue: godoc/static: add css for codereview and plain git side-by-side examples
I've pushed CLs for this now:
contribute.htmlstyle.css@spf13 I addressed your concerns back in November in the two CL's above.
I refactored big chunks of the contribute guide for clarity, adding also very short overviews of the processes for people just skimming it. For reference, this is what it looks like today:
https://tip.golang.org/doc/contribute.html
I don't think that we should go with this proposal of showing expanded git commands. I'll explain my reasoning:
change and mail. They're explained with simple examples, in the contexts of other standard git commands, so I think they're clear to use and learn. Compared to when this issue was opened, they are 2 instead of 4, and they're more clearly explained in a general, quick overview.git push -u origin HEAD:refs/for/master will make things easier to understand and follow. The syntax HEAD:refs/for/master is not very common among average git users. If people have to copy & paste it, they can just copy & paste the codereview command which is shorter and more clear.All in all, I think this belongs more to the git codereview reference documentation, rather than the contribution guide. Another alternative might be to put it into the wiki, which is more comprehensive and reads more as a reference and less as a tutorial.
Closing this issue since @rasky pointed out that the direction of contribute.html has changed. Also the number of Gerrit specific commands in the examples has been reduced with the rewrite :claps:. I agree now that GitHub PRs are supported this change is less impactful. Not just for new contributors but for those who prefer plain git, abandoning Gerrit to use a plain git interface via GitHub is much simpler.
Most helpful comment
I've got two versions implemented and I can submit a CL for either. In both versions the plain git commands are presented the same as the git-codereview commands rather than being buried in the paragraph text.
Side by side:

One after the other:

I think side by side looks good on a desktop browser, but does require a small amount of new CSS in the godoc tool which will be one more thing that needs to be maintained and may be a little harder to read on screens that are smaller. To resolve the small screen size issue I can make it responsive and one-after-the-other on smaller screens.
I think the one-after-the-other screenshot above is sufficient and lower maintenance.
@spf13 Thoughts?