Question about merged PR #937

php.internals

Guilherme Blanco

6 years ago
Hi internals! One of my old PRs to PHP that was claimed to be merged disappeared from master. However, the upgrade note is still there in master and 7.4beta1. Here is the PR: https://github.com/php/php-src/pull/937 Here is the commit referencing it: https://github.com/php/php-src/commit/0adfa03397edcde8cba3bae2032b1f2ef26ea760 Please let me know if there's anything I can do to help. Regards,
-- Guilherme Blanco SVP Technology at Statflo Inc. Mobile: +1 647 232 5599

Christoph Becker

6 years ago
On 19.09.2019 at 17:01, guilhermeblanco@gmail.com wrote:
> One of my old PRs to PHP that was claimed to be merged disappeared > from master. However, the upgrade note is still there in master and > 7.4beta1. > > Here is the PR: https://github.com/php/php-src/pull/937 > Here is the commit referencing it: > https://github.com/php/php-src/commit/0adfa03397edcde8cba3bae2032b1f2ef26ea760 > > Please let me know if there's anything I can do to help.
From what I can tell, everything is there. PR #911 has been merged as <http://git.php.net/?p=php-src.git;a=commit;h=094d409b3d34c51f49e0121e5ccfe8b2a717aaf6>, and parts of that PR already with PR #928 as <http://git.php.net/?p=php-src.git;a=commit;h=f48c2327403ce76a870e74f31a069a64dfb711a2>.
-- Christoph M. Becker

Guilherme Blanco

6 years ago
Thanks for the clarification Christoph! Somehow I couldn't see it when looking for the commit hash. Sorry for the disturbance in the list here. PS: I find it funny that even though I'm the original author of the code, I don't show as a contributor in any statistics. It'd be a shame to not be considered as a valid voter for "lack of recent contribution" to the language. Cheers, On Thu, Sep 19, 2019 at 12:58 PM Christoph M. Becker <cmbecker69@gmx.de> wrote:
> > On 19.09.2019 at 17:01, guilhermeblanco@gmail.com wrote: > > One of my old PRs to PHP that was claimed to be merged disappeared > > from master. However, the upgrade note is still there in master and > > 7.4beta1. > > > > Here is the PR: https://github.com/php/php-src/pull/937 > > Here is the commit referencing it: > > https://github.com/php/php-src/commit/0adfa03397edcde8cba3bae2032b1f2ef26ea760 > > > > Please let me know if there's anything I can do to help. > > From what I can tell, everything is there. PR #911 has been merged as > <http://git.php.net/?p=php-src.git;a=commit;h=094d409b3d34c51f49e0121e5ccfe8b2a717aaf6>, > and parts of that PR already with PR #928 as > <http://git.php.net/?p=php-src.git;a=commit;h=f48c2327403ce76a870e74f31a069a64dfb711a2>. > > -- > Christoph M. Becker
-- Guilherme Blanco SVP Technology at Statflo Inc. Mobile: +1 647 232 5599

Alexandru Pătrănescu

6 years ago
Hi Guilherme, That is what is happening when squashing commits during merge. I noticed this also few months ago but didn't mentioned it as I though this is one of the usual flows. I quickly searched it now and found it here: https://wiki.php.net/vcs/gitworkflow: "Additionally, the history of pull requests often requires cleanup. For most pull requests, all commits can be squashed into one." It could be considered a good practice to not pollute git history with a lot of small commits as it would hinder analyzing it later. On the other hand I quite like (and promote) doing small incremental steps during a PR for multiple reasons that I can highlight if needed. Analyzing git history could be simplified by using --first-parent when one would not want to go in details on second parent of a merge commit with individual detailed commits. Also, there is no noticeable git performance improvements when using squash. One of the advantages here would be that author would see his name in contributors of a file or on repository level and be proud of it. This is an important factor especially in open source software as otherwise it could leave a bitter taste that you are not fully recognized as contributor in git's history and might decrease the chance to future contributions. Would it be up for discussion to define the way to merge pull requests in order to avoid squashing merges by a different author? Has this issue been discussed before? The mention that "the history of pull requests often requires cleanup" is not clearly defined. I would not agree that PR-937 https://github.com/php/php-src/pull/937/commits or PR-911 https://github.com/php/php-src/pull/911/commits required squashing. As a simple solution, if squashing is required it should be done by the original author, before merging. Regards, Alex On Thu, Sep 19, 2019 at 8:20 PM guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote:

Nikita Popov

6 years ago
On Fri, Sep 20, 2019 at 12:50 AM Alexandru Pătrănescu <drealecs@gmail.com> wrote:
> Hi Guilherme, > > That is what is happening when squashing commits during merge. > > I noticed this also few months ago but didn't mentioned it as I though this > is one of the usual flows. > I quickly searched it now and found it here: > https://wiki.php.net/vcs/gitworkflow: "Additionally, the history of pull > requests often requires cleanup. For most pull requests, all commits can be > squashed into one." > > It could be considered a good practice to not pollute git history with a > lot of small commits as it would hinder analyzing it later. > On the other hand I quite like (and promote) doing small incremental steps > during a PR for multiple reasons that I can highlight if needed. > > Analyzing git history could be simplified by using --first-parent when one > would not want to go in details on second parent of a merge commit with > individual detailed commits. > Also, there is no noticeable git performance improvements when using > squash. > > One of the advantages here would be that author would see his name in > contributors of a file or on repository level and be proud of it. > This is an important factor especially in open source software as otherwise > it could leave a bitter taste that you are not fully recognized as > contributor in git's history and might decrease the chance to future > contributions. > > Would it be up for discussion to define the way to merge pull requests in > order to avoid squashing merges by a different author? Has this issue been > discussed before? > The mention that "the history of pull requests often requires cleanup" is > not clearly defined. I would not agree that PR-937 > https://github.com/php/php-src/pull/937/commits or PR-911 > https://github.com/php/php-src/pull/911/commits required squashing. > As a simple solution, if squashing is required it should be done by the > original author, before merging. > > Regards, > Alex >
Git has separate notions of "author" and "committer". The author is preserved during squashing, and the author is what is relevant for contribution statistics on GitHub. If the author is preserved but the user doesn't show up as a contributor, that's likely due to a missing mail mapping between the email address and the GitHub account. Nikita

Alexandru Pătrănescu

6 years ago
Hi Nikita, Yes, you are right that the author (and not the committer) is the one taken in considerations for git blame and contributor display. Committer is just technical and related to who created/recreated a commit. But, unfortunately, you are wrong in believing that the author is preserved during merging with squash. A squash merge is similar with a normal commit, it has a single parent and it does not relate with the original commits in the git's commit graph. I can help with us making a quick test to demonstrate this. Alex On Fri, Sep 20, 2019 at 10:36 AM Nikita Popov <nikita.ppv@gmail.com> wrote:

Alexandru Pătrănescu

6 years ago
I was quick to write an answer and forgot to search for a more detailed explanation online, being busy with some other work tasks. Github explains it here: https://help.github.com/en/articles/about-merge-methods-on-github Before enabling squashing commits, consider these disadvantages:
> > - You lose information about when specific changes were originally > made and who authored the squashed commits. > >
Alex On Fri, Sep 20, 2019 at 11:56 AM Alexandru Pătrănescu <drealecs@gmail.com> wrote:

Christoph Becker

6 years ago
On 20.09.2019 at 11:22, Alexandru Pătrănescu wrote:
> I was quick to write an answer and forgot to search for a more detailed > explanation online, being busy with some other work tasks. > Github explains it here: > https://help.github.com/en/articles/about-merge-methods-on-github > > Before enabling squashing commits, consider these disadvantages: >> >> - You lose information about when specific changes were originally >> made and who authored the squashed commits.
<http://git.php.net/?p=php-src.git;a=commit;h=8326ef5519acb4dfcdcd3f059ee599d9e0faf174> has just been squashed by me, and still has the proper author information.
-- Christoph M. Becker

Alexandru Pătrănescu

6 years ago
Hi Christoph, Was this squash done during merging of a github pull request? On Fri, Sep 20, 2019 at 1:06 PM Christoph M. Becker <cmbecker69@gmx.de> wrote:

Christoph Becker

6 years ago
On 20.09.2019 at 12:35, Alexandru Pătrănescu wrote:
> Was this squash done during merging of a github pull request?
Yes, it was when applying <https://github.com/php/php-src/pull/4621>. I didn't use the Github UI, though.
-- Christoph M. Becker

Christoph Becker

6 years ago
On 19.09.2019 at 19:20, guilhermeblanco@gmail.com wrote:
> Thanks for the clarification Christoph! > Somehow I couldn't see it when looking for the commit hash. Sorry for > the disturbance in the list here. > > PS: I find it funny that even though I'm the original author of the > code, I don't show as a contributor in any statistics. > It'd be a shame to not be considered as a valid voter for "lack of > recent contribution" to the language.
>git log --author=Blanco --pretty=oneline
4498d34aeaadcbc2ab64b9c0f40f336bf363b2d6 Check interface/trait extension for internal classes 8c81d80e10e0f189307fc8ff4a8fb34bd0cb1fcb Made ZEND_ACC_TRAIT a saner value d51fb69c0125a144cacb8c59df89fea3f8ae7f4b Removed parsing support traits to have extends and implements. f48c2327403ce76a870e74f31a069a64dfb711a2 Decoupled class declaration statement into more granular pieces. 094d409b3d34c51f49e0121e5ccfe8b2a717aaf6 Removed ZEND_ACC_FINAL_CLASS which is unnecessary. This also fixed some currently defined classes as final which were just not being considered as such before. Looks good. :)
-- Christoph M. Becker