You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Matthias Bläsing <mb...@doppel-helix.eu> on 2019/12/12 20:41:34 UTC

Merging on github (aka Squash and Merge is broken)

Hello all Committers,

please be extra careful when using the "Squash and Merge" Option on
github. It is broken regarding author information.

When you use the option, github tries to be clever and uses the public
information of the author as present in the profile of the person on
github. This results mostly in utterly useless information - see for an
example commit (chosen as it is the most recent sample and the work is
good):

e978ba9b235ca1eaeb6f6fddf7dca46c20c337fc

https://github.com/apache/netbeans/commit/e978ba9b235ca1eaeb6f6fddf7dca46c20c337fc

The author information is

Karl T <De...@users.noreply.github.com>

If you look into the original PR branch, you see the full author
information:

Karl Tauber <ka...@jformdesigner.com>

That is helpful and allows to identify the author.

As a contributor this is easily prevented: use valid real world
information in the profile and ensure an email address is marked as
public. As a committer drop the github GUI and squash manually:

1. Modify your git configuration of the repository to include the
github pull requests. In my case this looks like this:

[remote "github"]
	url = https://github.com/apache/netbeans.git
   	fetch = +refs/heads/*:refs/remotes/github/*
   	fetch = +refs/pull/*/head:refs/remotes/github/pr/*

2. You can now fetch from github and will also get the PRs - sample:

   matthias@athena:~/src/netbeans$ git fetch github
   remote: Enumerating objects: 132, done.
   remote: Counting objects: 100% (132/132), done.
   remote: Compressing objects: 100% (42/42), done.
   remote: Total 150 (delta 59), reused 122 (delta 51), pack-reused 18
   Empfange Objekte: 100% (150/150), 31.75 KiB | 10.58 MiB/s, Fertig.
   Löse Unterschiede auf: 100% (59/59), abgeschlossen mit 31 lokalen Objekten.
   Von https://github.com/apache/netbeans
   8e2aa441a2f7..21691f5cbf68  master              -> github/master
 + 05b76b069b6e...1cd74c3c90d0 refs/pull/1559/head -> github/pr/1559  (Aktualisierung erzwungen)
 + 4589bd05e462...771f1a9d5368 refs/pull/1643/head -> github/pr/1643  (Aktualisierung erzwungen)
 + f55b055eaccd...c8a53a038e51 refs/pull/1765/head -> github/pr/1765  (Aktualisierung erzwungen)
   d11c6bf5d20d..7a42cbc99cab  refs/pull/1771/head -> github/pr/1771
 * [neue Referenz]             refs/pull/1772/head -> github/pr/1772
matthias@athena:~/src/netbeans$ 

3. Ensure your master branch is current

   git checkout master
   git pull

4. Checkout the PR:

   git checkout github/pr/1771

5. Rebase the PR onto master

   git rebase master

6. Do the squashing - get an overview how far back you need to go (the last 20 commits with author):

   git log --pretty="%h%x09%ae%x09%s" -n 20

7. Do an interactive rebase (in this case the last 6 commits will be included):

   git rebase -i HEAD~6

8. Your editor is opened with the commits listed - you can now apply different commands to
   do a sane squasing, change the default `pick` to `s` (short for squash)

   pick 213fefed1af0 [NETBEANS-3428] FlatLaf: UI delegates for editor and view [...]
   s b66a05ff095c [NETBEANS-3428] FlatLaf: fix editor and view tabs painting is[...]
   s 3ffacc5bc969 [NETBEANS-3428] FlatLaf: removed no longer needed class NbFla[...]
   s 32852d80343b [NETBEANS-3428] FlatLaf: give HeapView better colors in FlatL[...]
   s 952e39847f2e [NETBEANS-3428] FlatLaf: - increase major release version of [...]
   s dc439be5df98 [NETBEANS-3428] FlatLaf: - avoid using `com.formdev.flatlaf.u[...]


9. Save the result and exit editor

10. You are asked to create a new commit message and prepares it by including all commit
    messages of the commits you are squashing

11. Check the author (shown in the comment section at the bottom

12. Save and exit editor

13. The commit of the new commit will be shown (here: c20b63503c98):

matthias@athena:~/src/netbeans$ git rebase -i HEAD~6
[losgelöster HEAD c20b63503c98] [NETBEANS-3428] FlatLaf: UI delegates for editor and view tabs in main window
 Author: Karl Tauber <ka...@jformdesigner.com>
 Date: Tue Dec 10 19:52:42 2019 +0100
 17 files changed, 1546 insertions(+), 41 deletions(-)

14. Switch back to master

   git checkout master

15. Merge (commit hash from above):

   git merge c20b63503c98

16. Push

   git push


Do this multiple times with test sets, then its _very_ easy. The alternative is of
course to ask the author to do the squash himself, he can update the PR (requires
a forced push)

Greetings

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Junichi Yamamoto <ju...@gmail.com>.
Maybe, the author checks "Keep my email address private" option?[1]

Matthias, It would be nice if you also write this example (using an
example author information) on the wiki :)

[1] https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address#setting-your-commit-email-address-on-github

Thank you,
Junichi



On Fri, Dec 13, 2019 at 5:41 AM Matthias Bläsing
<mb...@doppel-helix.eu> wrote:
>
> Hello all Committers,
>
> please be extra careful when using the "Squash and Merge" Option on
> github. It is broken regarding author information.
>
> When you use the option, github tries to be clever and uses the public
> information of the author as present in the profile of the person on
> github. This results mostly in utterly useless information - see for an
> example commit (chosen as it is the most recent sample and the work is
> good):
>
> e978ba9b235ca1eaeb6f6fddf7dca46c20c337fc
>
> https://github.com/apache/netbeans/commit/e978ba9b235ca1eaeb6f6fddf7dca46c20c337fc
>
> The author information is
>
> Karl T <De...@users.noreply.github.com>
>
> If you look into the original PR branch, you see the full author
> information:
>
> Karl Tauber <ka...@jformdesigner.com>
>
> That is helpful and allows to identify the author.
>
> As a contributor this is easily prevented: use valid real world
> information in the profile and ensure an email address is marked as
> public. As a committer drop the github GUI and squash manually:
>
> 1. Modify your git configuration of the repository to include the
> github pull requests. In my case this looks like this:
>
> [remote "github"]
>         url = https://github.com/apache/netbeans.git
>         fetch = +refs/heads/*:refs/remotes/github/*
>         fetch = +refs/pull/*/head:refs/remotes/github/pr/*
>
> 2. You can now fetch from github and will also get the PRs - sample:
>
>    matthias@athena:~/src/netbeans$ git fetch github
>    remote: Enumerating objects: 132, done.
>    remote: Counting objects: 100% (132/132), done.
>    remote: Compressing objects: 100% (42/42), done.
>    remote: Total 150 (delta 59), reused 122 (delta 51), pack-reused 18
>    Empfange Objekte: 100% (150/150), 31.75 KiB | 10.58 MiB/s, Fertig.
>    Löse Unterschiede auf: 100% (59/59), abgeschlossen mit 31 lokalen Objekten.
>    Von https://github.com/apache/netbeans
>    8e2aa441a2f7..21691f5cbf68  master              -> github/master
>  + 05b76b069b6e...1cd74c3c90d0 refs/pull/1559/head -> github/pr/1559  (Aktualisierung erzwungen)
>  + 4589bd05e462...771f1a9d5368 refs/pull/1643/head -> github/pr/1643  (Aktualisierung erzwungen)
>  + f55b055eaccd...c8a53a038e51 refs/pull/1765/head -> github/pr/1765  (Aktualisierung erzwungen)
>    d11c6bf5d20d..7a42cbc99cab  refs/pull/1771/head -> github/pr/1771
>  * [neue Referenz]             refs/pull/1772/head -> github/pr/1772
> matthias@athena:~/src/netbeans$
>
> 3. Ensure your master branch is current
>
>    git checkout master
>    git pull
>
> 4. Checkout the PR:
>
>    git checkout github/pr/1771
>
> 5. Rebase the PR onto master
>
>    git rebase master
>
> 6. Do the squashing - get an overview how far back you need to go (the last 20 commits with author):
>
>    git log --pretty="%h%x09%ae%x09%s" -n 20
>
> 7. Do an interactive rebase (in this case the last 6 commits will be included):
>
>    git rebase -i HEAD~6
>
> 8. Your editor is opened with the commits listed - you can now apply different commands to
>    do a sane squasing, change the default `pick` to `s` (short for squash)
>
>    pick 213fefed1af0 [NETBEANS-3428] FlatLaf: UI delegates for editor and view [...]
>    s b66a05ff095c [NETBEANS-3428] FlatLaf: fix editor and view tabs painting is[...]
>    s 3ffacc5bc969 [NETBEANS-3428] FlatLaf: removed no longer needed class NbFla[...]
>    s 32852d80343b [NETBEANS-3428] FlatLaf: give HeapView better colors in FlatL[...]
>    s 952e39847f2e [NETBEANS-3428] FlatLaf: - increase major release version of [...]
>    s dc439be5df98 [NETBEANS-3428] FlatLaf: - avoid using `com.formdev.flatlaf.u[...]
>
>
> 9. Save the result and exit editor
>
> 10. You are asked to create a new commit message and prepares it by including all commit
>     messages of the commits you are squashing
>
> 11. Check the author (shown in the comment section at the bottom
>
> 12. Save and exit editor
>
> 13. The commit of the new commit will be shown (here: c20b63503c98):
>
> matthias@athena:~/src/netbeans$ git rebase -i HEAD~6
> [losgelöster HEAD c20b63503c98] [NETBEANS-3428] FlatLaf: UI delegates for editor and view tabs in main window
>  Author: Karl Tauber <ka...@jformdesigner.com>
>  Date: Tue Dec 10 19:52:42 2019 +0100
>  17 files changed, 1546 insertions(+), 41 deletions(-)
>
> 14. Switch back to master
>
>    git checkout master
>
> 15. Merge (commit hash from above):
>
>    git merge c20b63503c98
>
> 16. Push
>
>    git push
>
>
> Do this multiple times with test sets, then its _very_ easy. The alternative is of
> course to ask the author to do the squash himself, he can update the PR (requires
> a forced push)
>
> Greetings
>
> Matthias
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




RE: Merging on github (aka Squash and Merge is broken)

Posted by Eirik Bakke <eb...@ultorg.com>.
Thank you... will ask the PR author to do this and then do "Squash and Merge", and verify that it ends up correct.

-- Eirik

-----Original Message-----
From: Matthias Bläsing <mb...@doppel-helix.eu> 
Sent: Friday, October 9, 2020 1:09 PM
To: dev@netbeans.apache.org
Subject: Re: Merging on github (aka Squash and Merge is broken)

Am Freitag, den 09.10.2020, 17:06 +0000 schrieb Eirik Bakke:
> > 1. Ask the author to update his author information and squash the 
> > commits and force push the updated commit
> 
> If the author puts his proper email on his Github profile, will the 
> "Squash and Merge" button work? Or will he still have to do the manual 
> squash and force push?

The crucial point in the past was, that the email had to be selected as "Public email" in the "Profile" section of the settings.

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Am Freitag, den 09.10.2020, 17:06 +0000 schrieb Eirik Bakke:
> > 1. Ask the author to update his author information and squash the
> > commits and force push the updated commit
> 
> If the author puts his proper email on his Github profile, will the
> "Squash and Merge" button work? Or will he still have to do the
> manual squash and force push?

The crucial point in the past was, that the email had to be selected as
"Public email" in the "Profile" section of the settings.

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




RE: Merging on github (aka Squash and Merge is broken)

Posted by Eirik Bakke <eb...@ultorg.com>.
> 1. Ask the author to update his author information and squash the commits and force push the updated commit

If the author puts his proper email on his Github profile, will the "Squash and Merge" button work? Or will he still have to do the manual squash and force push?

-- Eirik

-----Original Message-----
From: Matthias Bläsing <mb...@doppel-helix.eu> 
Sent: Friday, October 9, 2020 1:01 PM
To: dev@netbeans.apache.org
Subject: Re: Merging on github (aka Squash and Merge is broken)

Hi Eirik,

actually not sure if github improved, but I looked at the profile of the author:

https://github.com/MKuettner

and there is a real name (great), but no email address. Looking at the commits (locally), I see a valid email address, but the real name part is not complete.

I see two options:

1. Ask the author to update his author information and squash the commits and force push the updated commit 2. Do it yourself locally and update the author information

From a "good for future" perspective, I would prefer (1).

HTH

Matthias

Am Freitag, den 09.10.2020, 16:26 +0000 schrieb Eirik Bakke:
> What's the status on "Squash and merge"?
> 
> I'd like to merge the PR at
> https://github.com/apache/netbeans/pull/2410 , but I can't remember 
> how to verify that "Squash and merge" won't put in bogus author 
> information.
> 
> -- Eirik
> 
> -----Original Message-----
> From: Neil C Smith <ne...@apache.org>
> Sent: Sunday, August 9, 2020 8:43 AM
> To: dev <de...@netbeans.apache.org>
> Subject: Re: Merging on github (aka Squash and Merge is broken)
> 
> On Thu, 12 Dec 2019 at 20:41, Matthias Bläsing < 
> mblaesing@doppel-helix.eu> wrote:
> > 14. Switch back to master
> > 
> >    git checkout master
> > 
> > 15. Merge (commit hash from above):
> > 
> >    git merge c20b63503c98
> > 
> > 16. Push
> > 
> >    git push
> > 
> > 
> > Do this multiple times with test sets, then its _very_ easy. The 
> > alternative is of course to ask the author to do the squash himself, 
> > he can update the PR (requires a forced push)
> 
> Just following up on this.  I've had a few of these come up during
> 12.1 so far.  I'm also not entirely a fan of bypassing the PR system 
> or direct pushes to upstream master (I have push-url set to disabled 
> by default).
> 
> As well as the author squashing the PR, it is also possible for any 
> committer to force push the PR branch (by default anyway) if the 
> author cannot for some reason.  I did this with eg.
> https://github.com/apache/netbeans/pull/2023  And I think all is fine 
> with the git history on this.
> 
> Matthias, could you have a quick check on that?  I used your 
> instructions roughly up to where to push to.  But this has the benefit 
> of linking back to original PR / closing, allowing the author to check 
> over, and running CI tests again before merging.  Thoughts on pros / 
> cons of updating instructions to recommend this?
> 
> Thanks and best wishes,
> 
> Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Neil C Smith <ne...@apache.org>.
On Sat, 10 Oct 2020, 18:32 Laszlo Kishalmi, <la...@gmail.com>
wrote:

> Now what would be the best option? Remove the top of master by force
> (not a really nice thing to do) or create a revert PR? Well the first
> would resolve the issue commit with the wrong email in the repo, the
> later one would be just a corrective one.
>

Last time this was discussed I suggested we look at adding a .mailmap file?
Think some other ASF projects are doing this for same purpose.

It's potentially the easiest option if force pushing to the PR is a problem
for some people (although I found Matthias' instructions on the wiki very
useful, apart from changing the target branch)

Neil

RE: Merging on github (aka Squash and Merge is broken)

Posted by Eirik Bakke <eb...@ultorg.com>.
> The crucial point in the past was, that the email had to be selected as "Public email" in the "Profile" section of the settings.

I just used the "Squash and Merge" feature to merge https://github.com/apache/netbeans/pull/2410 , and can confirm that the author information that ended up in the NetBeans git repository is the full name (not GitHub username) and email address which is listed on the PR author's public github profile.

So as long as these two pieces of information show up correctly on the PR author's public github profile, it seems safe to use the "Squash and Merge" feature.

(And if erroneous info has already been committed, I agree with Mathias' point about using "git revert" rather than force push to master.)

-- Eirik

-----Original Message-----
From: Matthias Bläsing <mb...@doppel-helix.eu> 
Sent: Sunday, October 11, 2020 3:09 PM
To: dev@netbeans.apache.org
Subject: Re: Merging on github (aka Squash and Merge is broken)

Hi,

Am Samstag, den 10.10.2020, 10:32 -0700 schrieb Laszlo Kishalmi:
> It seems it is still an issue on github squash and merge. Just did a 
> merge. I've checked the email on the individual commits which seemed 
> to be right and valid, then ended up in the master as
> 72509841+adrienDG@users.noreply.github.com
> https://github.com/apache/netbeans/commit/7990cee5aa9d8460b563d7ad44d7
> 43843c6c064a
> 
> Now what would be the best option? Remove the top of master by force 
> (not a really nice thing to do) or create a revert PR? Well the first 
> would resolve the issue commit with the wrong email in the repo, the 
> later one would be just a corrective one.
> 

we can't force push into master. That would be a problem for all users already on latest master, as their repository state becomes invalid.
I'm also not sure how the github <-> asf sync infrastructure would take it. We should have very good reasons to change history for a public branch, which I would only see for security issues.

I suggest to revert the commit with the normal git mechanic (revert commit references reverted commit, possible adding a reasoning). After that a cleaned version can be applied.

HTH

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Hi,

Am Samstag, den 10.10.2020, 10:32 -0700 schrieb Laszlo Kishalmi:
> It seems it is still an issue on github squash and merge. Just did a 
> merge. I've checked the email on the individual commits which seemed to 
> be right and valid, then ended up in the master as 
> 72509841+adrienDG@users.noreply.github.com 
> https://github.com/apache/netbeans/commit/7990cee5aa9d8460b563d7ad44d743843c6c064a
> 
> Now what would be the best option? Remove the top of master by force 
> (not a really nice thing to do) or create a revert PR? Well the first 
> would resolve the issue commit with the wrong email in the repo, the 
> later one would be just a corrective one.
> 

we can't force push into master. That would be a problem for all users
already on latest master, as their repository state becomes invalid.
I'm also not sure how the github <-> asf sync infrastructure would take
it. We should have very good reasons to change history for a public
branch, which I would only see for security issues.

I suggest to revert the commit with the normal git mechanic (revert
commit references reverted commit, possible adding a reasoning). After
that a cleaned version can be applied.

HTH

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Laszlo Kishalmi <la...@gmail.com>.
It seems it is still an issue on github squash and merge. Just did a 
merge. I've checked the email on the individual commits which seemed to 
be right and valid, then ended up in the master as 
72509841+adrienDG@users.noreply.github.com 
https://github.com/apache/netbeans/commit/7990cee5aa9d8460b563d7ad44d743843c6c064a

Now what would be the best option? Remove the top of master by force 
(not a really nice thing to do) or create a revert PR? Well the first 
would resolve the issue commit with the wrong email in the repo, the 
later one would be just a corrective one.

On 10/10/20 10:15 AM, Eirik Bakke wrote:
> In my case I'm using git on Windows with WSL, which unfortunately is very slow when working with the NetBeans repository. Stashing my own changes, switching branches, rebasing to squash etc. turns merging someone else's PR into a 30-minute operation. It's a lot easier, for me at least as a reviewer, if the original PR author configures their github with the right info so that "Squash and Merge" will just work correctly.
>
> -- Eirik
>
>
> -----Original Message-----
> From: Neil C Smith <ne...@apache.org>
> Sent: Friday, October 9, 2020 1:37 PM
> To: dev <de...@netbeans.apache.org>
> Subject: Re: Merging on github (aka Squash and Merge is broken)
>
> On Fri, 9 Oct 2020 at 18:00, Matthias Bläsing <mb...@doppel-helix.eu> wrote:
>> 1. Ask the author to update his author information and squash the
>> commits and force push the updated commit 2. Do it yourself locally
>> and update the author information
>>
>>  From a "good for future" perspective, I would prefer (1).
> A reminder from email above that if doing (2) you can force push to the author's PR branch, which any committer can do by default, then get the author to check if necessary, and merge as normal.
>
> That way we don't bypass PR statuses, etc.
>
> Best wishes,
>
> Neil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




RE: Merging on github (aka Squash and Merge is broken)

Posted by Eirik Bakke <eb...@ultorg.com>.
In my case I'm using git on Windows with WSL, which unfortunately is very slow when working with the NetBeans repository. Stashing my own changes, switching branches, rebasing to squash etc. turns merging someone else's PR into a 30-minute operation. It's a lot easier, for me at least as a reviewer, if the original PR author configures their github with the right info so that "Squash and Merge" will just work correctly.

-- Eirik


-----Original Message-----
From: Neil C Smith <ne...@apache.org> 
Sent: Friday, October 9, 2020 1:37 PM
To: dev <de...@netbeans.apache.org>
Subject: Re: Merging on github (aka Squash and Merge is broken)

On Fri, 9 Oct 2020 at 18:00, Matthias Bläsing <mb...@doppel-helix.eu> wrote:
> 1. Ask the author to update his author information and squash the 
> commits and force push the updated commit 2. Do it yourself locally 
> and update the author information
>
> From a "good for future" perspective, I would prefer (1).

A reminder from email above that if doing (2) you can force push to the author's PR branch, which any committer can do by default, then get the author to check if necessary, and merge as normal.

That way we don't bypass PR statuses, etc.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Neil C Smith <ne...@apache.org>.
On Fri, 9 Oct 2020 at 18:00, Matthias Bläsing <mb...@doppel-helix.eu> wrote:
> 1. Ask the author to update his author information and squash the
> commits and force push the updated commit
> 2. Do it yourself locally and update the author information
>
> From a "good for future" perspective, I would prefer (1).

A reminder from email above that if doing (2) you can force push to
the author's PR branch, which any committer can do by default, then
get the author to check if necessary, and merge as normal.

That way we don't bypass PR statuses, etc.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Hi Eirik,

actually not sure if github improved, but I looked at the profile of
the author:

https://github.com/MKuettner

and there is a real name (great), but no email address. Looking at the
commits (locally), I see a valid email address, but the real name part
is not complete.

I see two options:

1. Ask the author to update his author information and squash the
commits and force push the updated commit
2. Do it yourself locally and update the author information

From a "good for future" perspective, I would prefer (1).

HTH

Matthias

Am Freitag, den 09.10.2020, 16:26 +0000 schrieb Eirik Bakke:
> What's the status on "Squash and merge"?
> 
> I'd like to merge the PR at 
> https://github.com/apache/netbeans/pull/2410 , but I can't remember
> how to verify that "Squash and merge" won't put in bogus author
> information.
> 
> -- Eirik
> 
> -----Original Message-----
> From: Neil C Smith <ne...@apache.org> 
> Sent: Sunday, August 9, 2020 8:43 AM
> To: dev <de...@netbeans.apache.org>
> Subject: Re: Merging on github (aka Squash and Merge is broken)
> 
> On Thu, 12 Dec 2019 at 20:41, Matthias Bläsing <
> mblaesing@doppel-helix.eu> wrote:
> > 14. Switch back to master
> > 
> >    git checkout master
> > 
> > 15. Merge (commit hash from above):
> > 
> >    git merge c20b63503c98
> > 
> > 16. Push
> > 
> >    git push
> > 
> > 
> > Do this multiple times with test sets, then its _very_ easy. The 
> > alternative is of course to ask the author to do the squash
> > himself, 
> > he can update the PR (requires a forced push)
> 
> Just following up on this.  I've had a few of these come up during
> 12.1 so far.  I'm also not entirely a fan of bypassing the PR system
> or direct pushes to upstream master (I have push-url set to disabled
> by default).
> 
> As well as the author squashing the PR, it is also possible for any
> committer to force push the PR branch (by default anyway) if the
> author cannot for some reason.  I did this with eg.
> https://github.com/apache/netbeans/pull/2023  And I think all is fine
> with the git history on this.
> 
> Matthias, could you have a quick check on that?  I used your
> instructions roughly up to where to push to.  But this has the
> benefit of linking back to original PR / closing, allowing the author
> to check over, and running CI tests again before merging.  Thoughts
> on pros / cons of updating instructions to recommend this?
> 
> Thanks and best wishes,
> 
> Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




RE: Merging on github (aka Squash and Merge is broken)

Posted by Eirik Bakke <eb...@ultorg.com>.
What's the status on "Squash and merge"?

I'd like to merge the PR at https://github.com/apache/netbeans/pull/2410 , but I can't remember how to verify that "Squash and merge" won't put in bogus author information.

-- Eirik

-----Original Message-----
From: Neil C Smith <ne...@apache.org> 
Sent: Sunday, August 9, 2020 8:43 AM
To: dev <de...@netbeans.apache.org>
Subject: Re: Merging on github (aka Squash and Merge is broken)

On Thu, 12 Dec 2019 at 20:41, Matthias Bläsing <mb...@doppel-helix.eu> wrote:
> 14. Switch back to master
>
>    git checkout master
>
> 15. Merge (commit hash from above):
>
>    git merge c20b63503c98
>
> 16. Push
>
>    git push
>
>
> Do this multiple times with test sets, then its _very_ easy. The 
> alternative is of course to ask the author to do the squash himself, 
> he can update the PR (requires a forced push)

Just following up on this.  I've had a few of these come up during
12.1 so far.  I'm also not entirely a fan of bypassing the PR system or direct pushes to upstream master (I have push-url set to disabled by default).

As well as the author squashing the PR, it is also possible for any committer to force push the PR branch (by default anyway) if the author cannot for some reason.  I did this with eg.
https://github.com/apache/netbeans/pull/2023  And I think all is fine with the git history on this.

Matthias, could you have a quick check on that?  I used your instructions roughly up to where to push to.  But this has the benefit of linking back to original PR / closing, allowing the author to check over, and running CI tests again before merging.  Thoughts on pros / cons of updating instructions to recommend this?

Thanks and best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Neil C Smith <ne...@apache.org>.
On Thu, 12 Dec 2019 at 20:41, Matthias Bläsing
<mb...@doppel-helix.eu> wrote:
> 14. Switch back to master
>
>    git checkout master
>
> 15. Merge (commit hash from above):
>
>    git merge c20b63503c98
>
> 16. Push
>
>    git push
>
>
> Do this multiple times with test sets, then its _very_ easy. The alternative is of
> course to ask the author to do the squash himself, he can update the PR (requires
> a forced push)

Just following up on this.  I've had a few of these come up during
12.1 so far.  I'm also not entirely a fan of bypassing the PR system
or direct pushes to upstream master (I have push-url set to disabled
by default).

As well as the author squashing the PR, it is also possible for any
committer to force push the PR branch (by default anyway) if the
author cannot for some reason.  I did this with eg.
https://github.com/apache/netbeans/pull/2023  And I think all is fine
with the git history on this.

Matthias, could you have a quick check on that?  I used your
instructions roughly up to where to push to.  But this has the benefit
of linking back to original PR / closing, allowing the author to check
over, and running CI tests again before merging.  Thoughts on pros /
cons of updating instructions to recommend this?

Thanks and best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Merging on github (aka Squash and Merge is broken)

Posted by Laszlo Kishalmi <la...@gmail.com>.
Thank you Matthias!

I was not aware of that behavior of GitHub.

On 12/12/19 12:41 PM, Matthias Bläsing wrote:
> Hello all Committers,
>
> please be extra careful when using the "Squash and Merge" Option on
> github. It is broken regarding author information.
>
> When you use the option, github tries to be clever and uses the public
> information of the author as present in the profile of the person on
> github. This results mostly in utterly useless information - see for an
> example commit (chosen as it is the most recent sample and the work is
> good):
>
> e978ba9b235ca1eaeb6f6fddf7dca46c20c337fc
>
> https://github.com/apache/netbeans/commit/e978ba9b235ca1eaeb6f6fddf7dca46c20c337fc
>
> The author information is
>
> Karl T <De...@users.noreply.github.com>
>
> If you look into the original PR branch, you see the full author
> information:
>
> Karl Tauber <ka...@jformdesigner.com>
>
> That is helpful and allows to identify the author.
>
> As a contributor this is easily prevented: use valid real world
> information in the profile and ensure an email address is marked as
> public. As a committer drop the github GUI and squash manually:
>
> 1. Modify your git configuration of the repository to include the
> github pull requests. In my case this looks like this:
>
> [remote "github"]
> 	url = https://github.com/apache/netbeans.git
>     	fetch = +refs/heads/*:refs/remotes/github/*
>     	fetch = +refs/pull/*/head:refs/remotes/github/pr/*
>
> 2. You can now fetch from github and will also get the PRs - sample:
>
>     matthias@athena:~/src/netbeans$ git fetch github
>     remote: Enumerating objects: 132, done.
>     remote: Counting objects: 100% (132/132), done.
>     remote: Compressing objects: 100% (42/42), done.
>     remote: Total 150 (delta 59), reused 122 (delta 51), pack-reused 18
>     Empfange Objekte: 100% (150/150), 31.75 KiB | 10.58 MiB/s, Fertig.
>     Löse Unterschiede auf: 100% (59/59), abgeschlossen mit 31 lokalen Objekten.
>     Von https://github.com/apache/netbeans
>     8e2aa441a2f7..21691f5cbf68  master              -> github/master
>   + 05b76b069b6e...1cd74c3c90d0 refs/pull/1559/head -> github/pr/1559  (Aktualisierung erzwungen)
>   + 4589bd05e462...771f1a9d5368 refs/pull/1643/head -> github/pr/1643  (Aktualisierung erzwungen)
>   + f55b055eaccd...c8a53a038e51 refs/pull/1765/head -> github/pr/1765  (Aktualisierung erzwungen)
>     d11c6bf5d20d..7a42cbc99cab  refs/pull/1771/head -> github/pr/1771
>   * [neue Referenz]             refs/pull/1772/head -> github/pr/1772
> matthias@athena:~/src/netbeans$
>
> 3. Ensure your master branch is current
>
>     git checkout master
>     git pull
>
> 4. Checkout the PR:
>
>     git checkout github/pr/1771
>
> 5. Rebase the PR onto master
>
>     git rebase master
>
> 6. Do the squashing - get an overview how far back you need to go (the last 20 commits with author):
>
>     git log --pretty="%h%x09%ae%x09%s" -n 20
>
> 7. Do an interactive rebase (in this case the last 6 commits will be included):
>
>     git rebase -i HEAD~6
>
> 8. Your editor is opened with the commits listed - you can now apply different commands to
>     do a sane squasing, change the default `pick` to `s` (short for squash)
>
>     pick 213fefed1af0 [NETBEANS-3428] FlatLaf: UI delegates for editor and view [...]
>     s b66a05ff095c [NETBEANS-3428] FlatLaf: fix editor and view tabs painting is[...]
>     s 3ffacc5bc969 [NETBEANS-3428] FlatLaf: removed no longer needed class NbFla[...]
>     s 32852d80343b [NETBEANS-3428] FlatLaf: give HeapView better colors in FlatL[...]
>     s 952e39847f2e [NETBEANS-3428] FlatLaf: - increase major release version of [...]
>     s dc439be5df98 [NETBEANS-3428] FlatLaf: - avoid using `com.formdev.flatlaf.u[...]
>
>
> 9. Save the result and exit editor
>
> 10. You are asked to create a new commit message and prepares it by including all commit
>      messages of the commits you are squashing
>
> 11. Check the author (shown in the comment section at the bottom
>
> 12. Save and exit editor
>
> 13. The commit of the new commit will be shown (here: c20b63503c98):
>
> matthias@athena:~/src/netbeans$ git rebase -i HEAD~6
> [losgelöster HEAD c20b63503c98] [NETBEANS-3428] FlatLaf: UI delegates for editor and view tabs in main window
>   Author: Karl Tauber <ka...@jformdesigner.com>
>   Date: Tue Dec 10 19:52:42 2019 +0100
>   17 files changed, 1546 insertions(+), 41 deletions(-)
>
> 14. Switch back to master
>
>     git checkout master
>
> 15. Merge (commit hash from above):
>
>     git merge c20b63503c98
>
> 16. Push
>
>     git push
>
>
> Do this multiple times with test sets, then its _very_ easy. The alternative is of
> course to ask the author to do the squash himself, he can update the PR (requires
> a forced push)
>
> Greetings
>
> Matthias
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists