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