doc: Explain how to fetch commits directly #32774

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2506-doc-fetch-commit changing 1 files +10 −1
  1. maflcko commented at 6:28 am on June 19, 2025: member
    This is often needed, and works better than the existing refspec documentation, because even commits that have been force-pushed away can be fetched (as long as they are not garbage collected on the remote).
  2. DrahtBot added the label Docs on Jun 19, 2025
  3. DrahtBot commented at 6:28 am on June 19, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32774.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK l0rinc, willcl-ark, Sjors, rkrux, janb84

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. maflcko requested review from rkrux on Jun 19, 2025
  5. doc: Explain how to fetch commits directly fa94fd53c9
  6. maflcko force-pushed on Jun 19, 2025
  7. hebasto commented at 8:40 am on June 19, 2025: member
    I use this technique regularly, but I hadn’t realised there was a demand for documenting it.
  8. in doc/productivity.md:178 in fa94fd53c9
    174+
    175+
    176 ### Reference PRs easily with `refspec`s
    177 
    178-When looking at other's pull requests, it may make sense to add the following section to your `.git/config` file:
    179+As an alternative to fetching commits directly, when looking at pull requests by others, it may make sense to add the following section to your `.git/config` file:
    


    l0rinc commented at 8:48 am on June 19, 2025:
    Would it make sense to document gh workflow as an alternative as well, i.e. gh pr checkout 32774 or gh pr checkout maflcko:2506-doc-fetch-commit?

    willcl-ark commented at 9:06 am on June 19, 2025:

    I use a different method still to fetch (or update) a single pr from the remote (specifically so that I don’t require yet another 3rd party tool): https://github.com/willcl-ark/nixos-config/blob/fce2bae088d03eaa624affe01f0dbf7dfbfbba91/home/common.nix#L158-L159

    I imagine there are countless more ways of doing the same thing, and I think we probably don’t need or want to get into documenting them all here; one is probably fine :)


    l0rinc commented at 9:20 am on June 19, 2025:
    I mentioned it since it’s a different (cli) view of GitHub, not a third party tool.

    maflcko commented at 11:00 am on June 19, 2025:

    I use a different method still to fetch (or update) a single pr from the remote (specifically so that I don’t require yet another 3rd party tool): https://github.com/willcl-ark/nixos-config/blob/fce2bae088d03eaa624affe01f0dbf7dfbfbba91/home/common.nix#L158-L159

    Nice. I think this can be put into the next section to offer an alternative that uses less bandwidth/storage. But this can be done in a follow-up.

    I mentioned it since it’s a different (cli) view of GitHub, not a third party tool.

    Not sure about vendor-specific tooling. Maybe it can be discussed in a follow-up?

  9. l0rinc approved
  10. l0rinc commented at 8:50 am on June 19, 2025: contributor

    ACK fa94fd53c99611e90698dddf81881c302a3aa799

    It’s friendlier this way - though GitHub’s cli tool is even more convenient

  11. willcl-ark approved
  12. willcl-ark commented at 9:24 am on June 19, 2025: member

    ACK fa94fd53c99611e90698dddf81881c302a3aa799

    Seems sensible to document as contributors here frequently review force-pushed branches.

  13. Sjors commented at 9:38 am on June 19, 2025: member

    ACK fa94fd53c99611e90698dddf81881c302a3aa799

    Had to do this a few times when reviewing a range-diff, when my machine didn’t have the previous commit (switching between machines).

  14. rkrux approved
  15. rkrux commented at 9:52 am on June 19, 2025: contributor

    ACK fa94fd53c99611e90698dddf81881c302a3aa799 Thanks for raising the PR quickly.

    even commits that have been force-pushed away can be fetched

    This is exactly the issue I had faced yesterday.

    they are not garbage collected on the remote

    I didn’t know the commits were garbage collected on the remote but makes sense.

  16. janb84 commented at 10:35 am on June 19, 2025: contributor

    ACK fa94fd53c99611e90698dddf81881c302a3aa799

    This PR adds an explanation how to fetch commits directly, these kind of “small” but helpful tips are very valuable for starting contributors (like me)

  17. maflcko commented at 11:01 am on June 19, 2025: member

    I didn’t know the commits were garbage collected on the remote but makes sense.

    See #11742#pullrequestreview-81413721 for an example that was garbage collected

  18. fanquake merged this on Jun 19, 2025
  19. fanquake closed this on Jun 19, 2025

  20. maflcko deleted the branch on Jun 19, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-07-08 12:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me