Skip to content
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

doc: note the costs of fetching all pull requests #18382

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

vasild
Copy link
Contributor

@vasild vasild commented Mar 19, 2020

Also mention that it is possible to fetch just one pull request.

@fanquake fanquake added the Docs label Mar 19, 2020
doc/productivity.md Outdated Show resolved Hide resolved
@maflcko
Copy link
Member

maflcko commented Mar 19, 2020

I tend to fetch only a single pull by just copying the URL in blue on the top right (e.g. for this pull https://github.com/vasild/bitcoin/tree/note_fetch_all_cost)

Then, paste it into a terminal and replace the tree/ with a space:

$ git fetch https://github.com/vasild/bitcoin/ note_fetch_all_cost

remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 17 (delta 11), reused 13 (delta 11), pack-reused 3
Unpacking objects: 100% (17/17), 10.37 KiB | 212.00 KiB/s, done.
From https://github.com/vasild/bitcoin
 * branch                  note_fetch_all_cost -> FETCH_HEAD

@vasild
Copy link
Contributor Author

vasild commented Mar 19, 2020

Actually, isn't it an overkill to download all pull requests - opened, closed and merged (~1 GB)? Usually one wants to review or test one PR.

@sipa you added this in 31444491f2#diff-e4de6d71249c78e229a61d6a03ac255aR422 almost 4 years ago when the volume of this was smaller. What about dropping this advice from the doc and replace it with instructions on fetching a single PR, as per the comment above and/or github help?

@maflcko
Copy link
Member

maflcko commented Mar 19, 2020

Some people might have a really large disk and review a lot of pull requests or want to archive everything that happens for other reasons, so it might be good to mention both: the "archival solution" and the quick fetch solution.

Copy link
Contributor

@fjahr fjahr left a comment

Choose a reason for hiding this comment

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

Concept ACK

I think this is good so people don't get surprised by the large amount of data. Agree with @kristapsk that there should not be any specific numbers though.

doc/productivity.md Outdated Show resolved Hide resolved
@vasild vasild force-pushed the note_fetch_all_cost branch from 5d7a817 to 5ebd8f6 Compare March 20, 2020 07:47
Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

ACK 5ebd8f6
Thanks for adding those valuable informations/instructions 👍

@promag
Copy link
Contributor

promag commented Mar 23, 2020

FWIW I also tend to add a remote for each recurring contributor fork which also allows me to sneak peek what they are doing.

@laanwj
Copy link
Member

laanwj commented Mar 26, 2020

This renders as:

screenshot

I don't think the "For example:"s should be in the code box.

@vasild vasild force-pushed the note_fetch_all_cost branch from 5ebd8f6 to abf7ff1 Compare March 26, 2020 19:33
@vasild
Copy link
Contributor Author

vasild commented Mar 26, 2020

Right, updated. It looks better now.

@sipa
Copy link
Member

sipa commented Mar 26, 2020

Doing some numbers myself:

Cloning bitcoin/bitcoin downloads 138.8 MiB, resulting in a size on disk of .git of 146.8 MB.
Starting with a fresh clone:

  • Fetching refs/pull/* downloads an additional 801.37 MiB, resulting in a size on disk of .git of 1405.4 MB.
  • Fetching refs/pull/*/head instead downloads an additional 797.09 MiB, resulting in a size on disk of .git of 1233.0 MB.

I've generally never had a use for the refs/pull/*/merge branches (I prefer doing a merge with master myself if needed anyway, and that's rare), maybe it's reasonable to only suggest fetching the heads?

@vasild vasild force-pushed the note_fetch_all_cost branch from abf7ff1 to 61dd7e2 Compare March 27, 2020 08:23
@vasild
Copy link
Contributor Author

vasild commented Mar 27, 2020

Those numbers more or less coincide with my observations.
I agree with refs/pull/* vs refs/pull/*/head.
Updated, render preview.

@laanwj
Copy link
Member

laanwj commented Mar 27, 2020

Right, updated. It looks better now.

Thanks, yes, looks much better now.

ACK 61dd7e2

@laanwj laanwj added this to the 0.20.0 milestone Mar 27, 2020
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

As there are many ways to do this, and a wide range of user computing configurations and needs, it never really made sense to me why these precise instructions (and now examples) would be provided. (I use a somewhat different gitconfig for this and know other contributors who do as well). Just a counterpoint.

for example:

```
git fetch https://github.com/glowang/bitcoin/ update_blocksonly_docs:docs_pr
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked with this person about using their identity here?

Copy link
Member

Choose a reason for hiding this comment

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

Ping @glowang.

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for asking - this is fine with me!

@RandyMcMillan
Copy link
Contributor

It may be useful to add a note about pulling from the most recent passing commit hash on Travis-ci.

@laanwj
Copy link
Member

laanwj commented Mar 28, 2020

It may be useful to add a note about pulling from the most recent passing commit hash on Travis-ci.

I don't think github allows fetching by commit hash. You can only fetch labels or branches. It would be awesomely convenient sometimes to retrieve an old version of a PR that has been force-pushed over, to compare, but I've never managed to do this.

@promag
Copy link
Contributor

promag commented Mar 28, 2020

I don't think github allows fetching by commit hash. You can only fetch labels or branches.

FWIW I also tend to add a remote for each recurring contributor fork which also allows me to sneak peek what they are doing.

@laanwj I do git remote update laanwj && git reset --hard laanwj/<sha>

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

re-ACK 61dd7e2
Just checked that since my last ACK:

  • formatting has improved (the for example: string is now outside of the monospaced code block)
  • example .gitconfig section has been changed to only retreiving the heads

@theStack
Copy link
Contributor

As there are many ways to do this, and a wide range of user computing configurations and needs, it never really made sense to me why these precise instructions (and now examples) would be provided. (I use a somewhat different gitconfig for this and know other contributors who do as well). Just a counterpoint.

Personally speaking, the instructions on how to fetch all pull requests were very helpful when I started contributing/reviewing. It would be highly absurd to encourage new contributors to review and test code but then not including any instructions how to do so in terms of git(hub) workflow IMHO. I cannot follow the argumentation "there are many ways to do it, so better not even describe a single one of them".

@laanwj
Copy link
Member

laanwj commented Mar 28, 2020

@laanwj I do git remote update laawnj && git reset --hard laawnj/

You don't need the laanwj/ before the hash. But yes, that will work, but only for commits that are currently (or have been at some point when you've fetched) connected to a tag or branch. If you've missed the point they were part of a branch, you cannot fetch them anymore. You can however view those commits through the web interface.

Personally speaking, the instructions on how to fetch all pull requests were very helpful when I started contributing/reviewing.

Personally I think it's useful to have some tips for things people frequently want to do, but otherwise refer to existing documentation. I also understand @jonatack's point that we don't want to end up maintaining an alternative git documentation here.

@jonatack
Copy link
Member

jonatack commented Mar 28, 2020

It would be highly absurd to encourage new contributors to review and test code but then not including any instructions how to do so in terms of git(hub) workflow IMHO. I cannot follow the argumentation "there are many ways to do it, so better not even describe a single one of them".

I and others do describe these things more or less in detail in various articles to help onboard new people, a process I've been going through as well. Also, there are resources like https://bitcoincore.reviews to help onboard contributors -- and which I continue to learn from -- which everyone can contribute to and participate in.

@theStack
Copy link
Contributor

It would be highly absurd to encourage new contributors to review and test code but then not including any instructions how to do so in terms of git(hub) workflow IMHO. I cannot follow the argumentation "there are many ways to do it, so better not even describe a single one of them".

I and others do describe these things more or less in detail in various articles to help onboard new people, a process I've been going through as well. Also, there are resources like https://bitcoincore.reviews to help onboard contributors -- and which I continue to learn from -- which everyone can contribute to and participate in.

Fair enough, there is indeed very good and deep introductory material out there (for me it was this article by Jimmy Song that got me started) and the PR Review Club is an absolutely awesome idea. I'd still without hesitation recommend to every newcomer to carefully read the included docs as early as possible (at the very least developer-notes.md and productivity.md), as common denominator of contributor-agreed best practices and tips, that are less likely to get outdated than articles maintained by single individuals. To sum up my view: as long as we have documents like productivity.md included in the repository, they should also include basics about how to fetch and checkout pull requests.

doc/productivity.md Outdated Show resolved Hide resolved
Also, update the example to skip downloading the merge commits when
downloading all PRs.
@vasild vasild force-pushed the note_fetch_all_cost branch from 61dd7e2 to d695eb4 Compare March 31, 2020 12:44
@vasild
Copy link
Contributor Author

vasild commented Mar 31, 2020

This PR caused more discussions than I anticipated plus some controversy.

The initial reason I opened it is that I expected the upstream-pull remote to download only the currently opened PRs and the download to be less than 100-ish MB, so I wanted to "warn" others that it is more expensive than that, given that git does not display the total download size upfront.

Updated the PR with just this basic info in one sentence (plus download only heads).

Render preview

@maflcko
Copy link
Member

maflcko commented Apr 2, 2020

ACK d695eb4

@laanwj laanwj removed this from the 0.20.0 milestone Apr 2, 2020
Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK d695eb4

@fanquake fanquake merged commit d478595 into bitcoin:master Apr 3, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 3, 2020
d695eb4 doc: note the costs of fetching all pull requests (Vasil Dimov)

Pull request description:

  Also mention that it is possible to fetch just one pull request.

ACKs for top commit:
  MarcoFalke:
    ACK d695eb4
  fanquake:
    ACK d695eb4

Tree-SHA512: afe080fd018b2e773fb974956937e819085831bf0c1c5623f7f12c728639906b80666b785234058ee39fd98115a53a2fad431c54ee0840667e60bb317e4a828d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 27, 2021
d695eb4 doc: note the costs of fetching all pull requests (Vasil Dimov)

Pull request description:

  Also mention that it is possible to fetch just one pull request.

ACKs for top commit:
  MarcoFalke:
    ACK d695eb4
  fanquake:
    ACK d695eb4

Tree-SHA512: afe080fd018b2e773fb974956937e819085831bf0c1c5623f7f12c728639906b80666b785234058ee39fd98115a53a2fad431c54ee0840667e60bb317e4a828d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 28, 2021
d695eb4 doc: note the costs of fetching all pull requests (Vasil Dimov)

Pull request description:

  Also mention that it is possible to fetch just one pull request.

ACKs for top commit:
  MarcoFalke:
    ACK d695eb4
  fanquake:
    ACK d695eb4

Tree-SHA512: afe080fd018b2e773fb974956937e819085831bf0c1c5623f7f12c728639906b80666b785234058ee39fd98115a53a2fad431c54ee0840667e60bb317e4a828d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
d695eb4 doc: note the costs of fetching all pull requests (Vasil Dimov)

Pull request description:

  Also mention that it is possible to fetch just one pull request.

ACKs for top commit:
  MarcoFalke:
    ACK d695eb4
  fanquake:
    ACK d695eb4

Tree-SHA512: afe080fd018b2e773fb974956937e819085831bf0c1c5623f7f12c728639906b80666b785234058ee39fd98115a53a2fad431c54ee0840667e60bb317e4a828d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
d695eb4 doc: note the costs of fetching all pull requests (Vasil Dimov)

Pull request description:

  Also mention that it is possible to fetch just one pull request.

ACKs for top commit:
  MarcoFalke:
    ACK d695eb4
  fanquake:
    ACK d695eb4

Tree-SHA512: afe080fd018b2e773fb974956937e819085831bf0c1c5623f7f12c728639906b80666b785234058ee39fd98115a53a2fad431c54ee0840667e60bb317e4a828d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
d695eb4 doc: note the costs of fetching all pull requests (Vasil Dimov)

Pull request description:

  Also mention that it is possible to fetch just one pull request.

ACKs for top commit:
  MarcoFalke:
    ACK d695eb4
  fanquake:
    ACK d695eb4

Tree-SHA512: afe080fd018b2e773fb974956937e819085831bf0c1c5623f7f12c728639906b80666b785234058ee39fd98115a53a2fad431c54ee0840667e60bb317e4a828d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.