On Wed, Nov 11, 2015 at 12:50 AM, Petr Bena <benap...@gmail.com> wrote:

> Ok, I will try to merge all useful stuff in here:
> https://www.mediawiki.org/wiki/Git_for_dummies
>

The problem is these are matters of widely-varying taste and background.
When I tried to clean up in early 2013, git experts didn't even agree on
whether the gerrit remote should be origin, or whether people should use
`git review` at all. (Aside: right now [[Git]] has the awful
community-splitting  comment
"To simply *browse & fork our code* you can use the GitHub mirror
<https://github.com/wikimedia>."
followed by the precisely wrong git clone command for someone trying to
make a patch:
   git clone https://...
Sigh.)

I would urge people to judiciously update the pages we have, and only
create very targeted new pages rather than yet another starting point.
https://www.mediawiki.org/wiki/Gerrit/Getting_started seems OK, it's
focused on a new gerrit contributor. Gerrit/Tutorial is huge because this
isn't simple.

So here's more taste and matters of opinion.

* "the minimal knowledge needed in order to push to all major repositories
we use,"  Surely Dummies only use gerrit.  Why explain anything else?
* "VCS" term is not necessary, nobody uses it.
* "master" explanation brings in irrelevant detail. It's "The thing you get
from a remote repo and should never change"
* The `svn commands` are irrelevant. Dummies don't know SVN.
* Try not to use angle brackets, like git clone <repository goes here>,
dummies will type them. (I realize the <source> tag won't let you italicize
:-( )
* git pull --rebase is a bad idea, it leads to surprises.
* The way to avoid merge conflicts is NEVER EVER make an edit without first
creating a branch.
* Then, the guaranteed reliable way to update is `git checkout master; git
pull --ff-only`. That will stop you from making a mistake, it will stop you
from having your own local master with local changes buried down the commit
log.
* The fact that git mergetool shows up so soon indicates this is no longer
a guide for dummies, it's now a guide for troubleshooting. A guide for
dummies should give commands and advice to avoid trouble.
* git diff shows up too soon. Instead, dummies should be running `git
status` all the time. The way pros do this is to change their shell prompt
to show the repo status and branch. Setting this up will *change your life*
[1]. But it's too advanced for a Dummies guide. (I think MW-Vagrant's shell
should do it for you.)

* "If you want to push your branch to origin  git push origin
<branch_name>". Huh? I don't see how someone working on WMF projects can
ever do that.  The whole point of gerrit is you don't own master and should
never ever edit it because that way lies misery.

I guess this is actually a guide for tool labs where people control their
own remote repo and often do keep it on github. Fine, so say so: please
please rename it Git/Guide_for_tool_labs_repo_users or whatever to avoid
confusion.

Again, I acknowledge how hard this is.

[1] I used http://briancarper.net/blog/570/git-info-in-your-zsh-prompt ,
but I use the zsh shell so that's no help for 95%


On Tue, Nov 10, 2015 at 8:26 PM, Nick Wilson (Quiddity)
> <nwil...@wikimedia.org> wrote:
> > On Tue, Nov 10, 2015 at 10:54 AM, Legoktm <legoktm.wikipe...@gmail.com>
> wrote:
> >>
> >> Hi,
> >>
> >> On 11/10/2015 09:06 AM, Petr Bena wrote:
> >> > Perhaps it would worth merging and putting to some central location?
> >>
> >> Yes, that sounds like a good idea. I typically recommend
> >> <https://www.mediawiki.org/wiki/User:Wctaiwan/Gerrit_cheatsheet> to
> >> people who are confused with git.
> >>
> >
> > +1, as someone who uses it rarely enough to /always/ have to consult the
> FAQs.
> > I compiled a list at https://www.mediawiki.org/wiki/Git/Tips#See_also
> > and posted at https://www.mediawiki.org/wiki/Topic:Ssg7cjp65lw1oc7y
>

-- 
=S Page  WMF Tech writer
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to