Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented May 18, 2022

This avoids having to explain it in each thread

@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

🚨 Warning, this is untested, but tests and review are welcome.

Copy link
Contributor

@david-bakin david-bakin left a comment

Choose a reason for hiding this comment

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

What's wrong with a git merge --squash which I see is not recommended earlier in this document or in your update? (I really don't know, BTW, which is why I'm asking.)

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.

-0 on adding further git documentation to the repo, there are other and better resources

@jonatack
Copy link
Member

This avoids having to explain it in each thread

AFAICS you use pre-prepared maintainer responses and could add an appropriate link to an external resource where needed.

@laanwj
Copy link
Member

laanwj commented May 18, 2022

Concept ACK. I think having some easy to follow steps here is useful. I do agree with @jonatack that going into too much details about git usage is out of scope.

@DrahtBot DrahtBot added the Docs label May 18, 2022
Copy link

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

ACK faa280a

LGTM

@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

What's wrong with a git merge --squash which I see is not recommended earlier in this document or in your update? (I really don't know, BTW, which is why I'm asking.)

For me, this does not work:

$ git merge --squash bitcoin-core/master 
Already up to date. (nothing to squash)

@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

-0 on adding further git documentation to the repo, there are other and better resources

I agree. Mind sharing a link to the "other and better resources" that can be used?

@maflcko maflcko force-pushed the 2205-doc-squash- branch from faa280a to facf9e5 Compare May 18, 2022 12:30
@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

Recall that we are probably the only open source project that doesn't use the "squash on merge" GitHub feature, so I don't think there is documentation about this out there, but I am more than happy to be proven wrong.

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.

I agree. Mind sharing a link to the "other and better resources" that can be used?

A prepared response may be a better place than the repo for an external link, but here are a couple that are similar to your method (rather than, say, the more flexible git rebase -i).

@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

here are a couple that are similar to your method

Yes, this is where I got the idea from. However, they rely on commit-counting, which is non-trivial with merge commits.

@maflcko maflcko force-pushed the 2205-doc-squash- branch 2 times, most recently from fa81375 to 8888903 Compare May 18, 2022 14:15
@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

Changed to a more general approach (that may involve fixing conflicts again)

@suhailsaqan
Copy link
Contributor

Changed to a more general approach (that may involve fixing conflicts again)

That didn't work for my case in #25161 unfortunately.

@maflcko
Copy link
Member Author

maflcko commented May 18, 2022

Can you elaborate a bit on this? I tried it on #25161 and it worked for me.

@suhailsaqan
Copy link
Contributor

I must have done something wrong then. I can't remember exactly what happened but I think I actually accidentally pulled and pushed after running git rebase FETCH_HEAD which messed it all up again so I had to do something longer to fix it. Sorry for the confusion.

@theStack
Copy link
Contributor

If your change contains a merge commit...

Very likely I'm missing something fundamental here, but why would a change in a PR ever contain a merge commit? Is this for the scenario of "PR foo is based on PR bar, PR bar has been merged, now PR foo needs to rebase?"

@maflcko
Copy link
Member Author

maflcko commented May 23, 2022

It usually happens when the author merges with current Bitcoin Core master instead of rebase.

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 888890302edacf3392957ef9e682cd6cb17a5f5c

Alternatively, could move the two git lines to the rebase section below (where currently concrete git instructions are missing, it only says that "git rebase" can be used, but without example) and link to there, e.g. "you will need to remove the merge commit first by rebasing on the target branch".

@maflcko maflcko force-pushed the 2205-doc-squash- branch from 8888903 to fa2d226 Compare May 24, 2022 06:40
@maflcko
Copy link
Member Author

maflcko commented May 24, 2022

Thx, done.

@jonatack
Copy link
Member

Aside, just came across https://github.com/lsilva01/operating-bitcoin-core-v1/blob/main/git-tutorial.md ... maybe reply to people with https://github.com/lsilva01/operating-bitcoin-core-v1/blob/main/git-tutorial.md#2-squashing-and-rebasing when useful. (I'm not sure how sustainable it is for a contributor to not become familiar with git rebase -i, and most of the better tutorials and blog posts when searching for "how to squash your commits" seem to cover that approach, so suggesting it may be helpful to people, I don't know.)

@maflcko
Copy link
Member Author

maflcko commented May 25, 2022

Yeah, I am happy to review a pull request that removes the sections in our readme and replaces them with a link. Or should I do it here?

@laanwj
Copy link
Member

laanwj commented Jun 1, 2022

ACK fa2d226
IMO, this is an improvement. The high-level longer term discussion on the scope of our documentation can of course go on.

@laanwj laanwj merged commit e157b98 into bitcoin:master Jun 1, 2022
@maflcko maflcko deleted the 2205-doc-squash-🐾 branch June 1, 2022 06:59
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 1, 2022
fa2d226 doc: Explain squashing with merge commits (MacroFake)

Pull request description:

  This avoids having to explain it in each thread

ACKs for top commit:
  laanwj:
    ACK fa2d226

Tree-SHA512: e1533ee7c0ab0101c78aaebed97dc889b5eb941cf4c2dfbabbb5f0ec1bb7b1313a1a2e2405235d68c761f039373cebac67ce691a72c820a9252429d50c1ac7d5
@bitcoin bitcoin locked and limited conversation to collaborators Jun 1, 2023
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.

8 participants