[doc][trivial] Add basic git squash workflow [skip ci] #8034

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:contrib-squash changing 1 files +21 −7
  1. fanquake commented at 6:40 AM on May 10, 2016: member

    Fixes #8032

  2. fanquake force-pushed on May 10, 2016
  3. in CONTRIBUTING.md:None in 8af1606e6e outdated
      45 |  
      46 | -At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or rebase your commits before it will be merged. The length of time required for peer review is unpredictable and will vary from patch to patch.
      47 | +At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits before it will be merged. The basic squashing workflow is shown below.
      48 | +
      49 | +    git checkout your_branch_name
      50 | +    git rebase -i commit_shasum
    


    MarcoFalke commented at 6:46 AM on May 10, 2016:

    What is commit_shasum?

    Maybe HEAD~n?


    jonasschnelli commented at 7:22 AM on May 10, 2016:

    Maybe git rebase -i HEAD~<amount of commits to squash>

    Maybe add something like (please clean/rewrite the english)

    Use `p` at the beginning of the line to indicate the commit you wish to use as the base commit
    Use `s` at the beginning of the line for all commits you want to squash into the commit you have marked with `p`.
    

    laanwj commented at 7:36 AM on May 10, 2016:

    git rebase -i HEAD~<amount of commits to squash>

    It's not the number of commits to squash, but at least that amount +1, as you need a base commit too to squash into. Usually more like the total number of commits in someone's PR that they want to edit.

    I haven't found a really user friendly way to determine this base commit yet, which is why I usually look it up for people. HEAD~x may be best, but is also something to get wrong easily if you miscount.


    MarcoFalke commented at 7:47 AM on May 10, 2016:

    For me, git will tell me what the commands are when I am doing the rebase:

    # Commands: 
    # p, pick = use commit 
    # r, reword = use commit, but edit the commit message 
    # e, edit = use commit, but stop for amending 
    # s, squash = use commit, but meld into previous commit 
    # f, fixup = like "squash", but discard this commit's log message 
    # x, exec = run command (the rest of the line) using shell 
    
  4. in CONTRIBUTING.md:None in 8af1606e6e outdated
      48 | +
      49 | +    git checkout your_branch_name
      50 | +    git rebase -i commit_shasum
      51 | +    # set commits from 'pick' to 'squash'
      52 | +    # save and quit the editor
      53 | +    git push -f (force push to GitHub)
    


    MarcoFalke commented at 6:46 AM on May 10, 2016:

    nit: missing # after -f. (or leave the comment away)

  5. MarcoFalke commented at 6:49 AM on May 10, 2016: member

    It might be worth to mention that squashing is not required when the commits each have a different "topic"/task and are not fixup commits.

    Also, it might come in handy to add section headings, so it is easier to link to a section...

    Concept ACK.

  6. MarcoFalke added the label Docs and Output on May 10, 2016
  7. laanwj commented at 7:32 AM on May 10, 2016: member

    Concept ACK, this was long overdue, somehow I was not lazy enough describe this again in every new contributor's pull, but too lazy to add it into here :) Thanks for doing so.

  8. [doc] Add basic git squash example 90963e5370
  9. in CONTRIBUTING.md:None in 8af1606e6e outdated
      47 | +At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits before it will be merged. The basic squashing workflow is shown below.
      48 | +
      49 | +    git checkout your_branch_name
      50 | +    git rebase -i commit_shasum
      51 | +    # set commits from 'pick' to 'squash'
      52 | +    # save and quit the editor
    


    laanwj commented at 7:36 AM on May 10, 2016:

    After this, they'll get another editor in which they can combine/refine the commit messages.

  10. fanquake force-pushed on May 10, 2016
  11. fanquake renamed this:
    [doc][trivial] Add basic git squash workflow
    [doc][trivial] Add basic git squash workflow [skip ci]
    on May 10, 2016
  12. laanwj commented at 9:08 AM on May 10, 2016: member

    BTW: the [skip ci] did'n't work. I think you need to put it in the commit message, unfortunately. (doesn't have to be in the first line though, luckily)

  13. MarcoFalke commented at 12:40 PM on May 10, 2016: member

    utACK 90963e5

  14. achow101 commented at 12:20 PM on May 11, 2016: member

    utACK 90963e5

  15. paveljanik commented at 5:50 AM on May 24, 2016: contributor

    This is ready for merge.

  16. arowser commented at 8:43 AM on May 25, 2016: contributor

    Can one of the admins verify this patch?

  17. laanwj merged this on May 26, 2016
  18. laanwj closed this on May 26, 2016

  19. laanwj referenced this in commit e3a820751f on May 26, 2016
  20. fanquake deleted the branch on May 26, 2016
  21. codablock referenced this in commit fff085dfab on Sep 16, 2017
  22. codablock referenced this in commit 8dff1eeeaf on Sep 19, 2017
  23. codablock referenced this in commit 9bf6987933 on Dec 21, 2017
  24. DrahtBot locked this on Sep 8, 2021

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: 2026-04-14 21:15 UTC

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