Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve git setup instructions #20102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Apr 28, 2021

PR Summary

Inspired by NumPy and pandas.

This is aims at eventually removing the somewhat outdated and fuzzy gitwash docs.

@timhoffm timhoffm added this to the v3.5.0 milestone Apr 28, 2021
Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea a lot of getting rid of the gitwash, just what is the level of fluency with git that we expect & into how much detail do we want to go?

@timhoffm
Copy link
Member Author

timhoffm commented Apr 29, 2021

just what is the level of fluency with git that we expect & into how much detail do we want to go?

Little fluency, little detail 😄 :

Users should be able to follow the first steps by copying the commands we show them without having to understand git. With that they should manage to

  1. set up the repo
  2. to create a branch, add a commit and push
  3. change back to master and pull updates

Points 2. and 3 are still to write. https://pandas.pydata.org/docs/development/contributing.html#creating-a-branch and https://numpy.org/doc/stable/dev/index.html#development-process-summary are good templates.

@timhoffm timhoffm force-pushed the doc-git branch 2 times, most recently from 13790cb to caba923 Compare May 1, 2021 20:36
@jklymak
Copy link
Member

jklymak commented May 2, 2021

I think it's kinda hard to commit this without 2 & 3. Where does this stand with respect to gitwash? What is the advantage over what we already have?

Fwiw I think the gitwash stuff should be dropped. So far as I can tell it is abandonware and we can't have a big chunk of our docs depend on something we can't push changes to. OTOH the idea is good. It's silly for every project on the planet to have slightly different, but fundamentally the same, guide to GitHub just with different project names. But we probably should have a plan, perhaps in coordination with other projects.

@timhoffm
Copy link
Member Author

timhoffm commented May 2, 2021

I think it's kinda hard to commit this without 2 & 3. Where does this stand with respect to gitwash? What is the advantage over what we already have?

1. Gitwash should be dropped for various reasons

It's outdated. It's not maintained. It's too long (13 pages!). It's not targeted enough.
I think we agree here.

2. We still need basic instructions how to set everything up

Setting everything up is not trivial. We don't want to loose potential contributors because the give up on getting the dev install to work or on making a PR. What we currently have outside of gitwash is not sufficient; e.g. it describes direct cloning from matplotlib/matplotlib and not using a fork.

3. We'll have to write these ourselves

While in principle

OTOH the idea is good. It's silly for every project on the planet to have slightly different, but fundamentally the same, guide to GitHub just with different project names. But we probably should have a plan, perhaps in coordination with other projects.

Gitwash died for lack of interest. Why should a new coordinated attempt work? I believe the level of detail and context of a getting started guide is too project specific and subjective, e.g. numpy is more terse than pandas. Both projects have really thought about their docs, and IMHO the difference is justified and on purpose: Numpy contributors are most likely more experienced than pandas contributors (and possibly also have to be as the numpy codebase is more difficult). IMHO any coordination would either iron over project needs or end up in endless discussion.

I'm willing to invest a couple of hours to wirte a concise guide for Matplotlib, but I'm not going to make this a larger scale project. If you have ambitions there, I'll stop the project and let you take over.

But we probably should have a plan

I do have:

  1. Write a basic intro for

    • set up the repo (this PR)
    • create a branch, add a commit and push (next PR - not enough time to make everything at once)
    • change back to master and pull updates (next PR ...)

    As written above, I'll take pandas/numpy as a template and cook up a version that seems right for Matplotlib.

  2. Drop gitwash

  3. Move on

@jklymak
Copy link
Member

jklymak commented May 2, 2021

No that makes sense to me.

I do feel that the write up needs to be complete though. Merging 1/3 of it would be confusing if the other 2/3 got forgotten for a while.

@timhoffm
Copy link
Member Author

timhoffm commented May 2, 2021

I plan to write these in the next few weeks, definitively before 3.5.

I fell that the three parts are largely indepenent and this PR would still be a net gain (the only downside being that it overlaps with gitwash, but I don't think many people would read that anyway).

@jklymak
Copy link
Member

jklymak commented May 3, 2021

and this PR would still be a net gain

maybe? It read to me like it stopped in the middle of the subject. It goes from adding an upstream remote to installing, which seemed a non-sequitur. Maybe it'd make sense if you just took adding the remote out?

@timhoffm
Copy link
Member Author

timhoffm commented May 3, 2021

I see cloning and adding a remote as belonging closely together. While you could start without the remote, you'll need it eventually when you want to pull in recent changes. Thus I believe this belongs in "Setting up git" and also that you should do it right away to have a "standard configuration".

I find the sequence of operations as laid out in the section titles quite natural:

  1. Setting up git and retrieving the latest version of the code
  2. Creating a dedicated environment
  3. Installing Matplotlib in editable mode
  4. Installing additional dependencies for development

(Well, you can debate if you want to switch 3 and 4. There's reason for both.)

@jklymak
Copy link
Member

jklymak commented May 3, 2021

If you don't tell people what to do with the remote they are going to wonder why you have this relatively obscure extra step and skip it.

I would guess that 95% of GitHub users never set a second remote, because they don't need one for their own repos. The idea of multiple remotes is super confusing for the first little while. I think it would be better to leave this off, and intorduce when needed, or explain why it's needed here.

@timhoffm
Copy link
Member Author

timhoffm commented May 3, 2021

I would guess that 95% of GitHub users never set a second remote, because they don't need one for their own repos.

If you only work with your repo, you don't need a second remote. If you work with any larger project you do.

or explain why it's needed here.

The GitHub help: add remote link is right there for further information. This is intentionally brief to not clutter the docs. Compare the numpy and pandas docs linked above which are also adding the remote immediately (I cite them as sort of a reference because both projects have put significant thought into their docs recently).

@story645
Copy link
Member

story645 commented May 3, 2021

What about a small line/section:

Get latest changes:

git checkout master 
git pull upstream master

Or are you supposed to rebase against master?

Somewhere before this should probably be a make a branch section so it's be ok to use checkout here.

.. code-block::

git remote add upstream https://github.com/matplotlib/matplotlib.git

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm just thinking a bit of explanation beyond the amorphous "connect". i.e.

Suggested change
Adding the `upstream` remote allows you to `rebase`_ your version of the code against any changes that are made to main project after you start your changes.
.. _rebase: link to wherever we describe rebasing...

@timhoffm
Copy link
Member Author

timhoffm commented May 4, 2021

@jklymak @story645 thank you for your feedback.

It appears, I cannot get my idea across in this step-wise approach and it's causing unnecessary discussion. I'll hold of until I find time to write up the full changes. Feel free to take over before that if you want to move this forward more quickly.

@timhoffm timhoffm marked this pull request as draft May 4, 2021 06:27
@timhoffm timhoffm modified the milestones: v3.5.0, v3.6.0 Jul 29, 2021
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Jul 5, 2022
@tacaswell
Copy link
Member

Given #23588 and #24662 what do we want to do with this PR?

@timhoffm
Copy link
Member Author

I'll check later.

@timhoffm timhoffm modified the milestones: v3.7.0, future releases Dec 15, 2022
@story645
Copy link
Member

has this pr been superseded by #26201 and #23588?

@timhoffm
Copy link
Member Author

This is superseeded. All relevant information is now in the docs.

@timhoffm timhoffm closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants