Looking for clarification on some issues that arose in a side discussion in a PR.It comes down to this statement:

   So if I get this right, a pattern is to push several commits to a
   PR, then after approval, can squash locally (using mercurial in my
   case) and force push to the PR.

There were some comments about squash/merge and how github/git commands have issues going directly to main. I got confused because I missed the "to main" versus "to PR branch" distinction.

Here's my understanding: squashing and force pushing to a PR branch, in particular one that I opened, does not run into issues.

And from my perspective, as someone who never pushes to master, I can ignore issues relating to peculiarities around local squash and merge pushed directly to master.

An open question. If there's a PR with multiple commits and it's approved, and I then locally squashand force push to the PR branch. Does the "Compare" button associated with the forced push still show up and have a diff with no changes (assuming, of course, that there were no changes)?

Of course, depending on the situation, there are times when multiple commits in a single PR are desirable (fix+refactoring is given as an example).

-ernie

Reply via email to