On 06.02.23 18:27, Ernie Rael wrote:
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.
right, this all has to happen in branches which are not integrated yet.
Never force push to other public branches. Projects will usually have
branch protection enabled to prevent that from happening.
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)?
right, it will show "no changes". Unless you pulled from master to
update the branch for example. Then it will show (sometimes a lot of)
changes even though it won't show the commits in the list since they are
already in master (target branch).
But if all you did is to squash and force push, it won't show any
changes since it is just a diff tool which compares two branches: the
one before push and the one after.
-mbien
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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists