-
Notifications
You must be signed in to change notification settings - Fork 129
Pull request "Squash and merge" button changes author details #1368
Comments
Reply from
The workaround suggested is unworkable because the PR's author is not the maintainer of the code in question, so does not have the authority to review or merge the PR. The real workaround is for the maintainer to do the merge using the |
samtools/hts-specs#335 is a PR that was merged via the GitHub UI (likely also with the "Squash and merge" button), resulting in the commit samtools/hts-specs@eb9d612 on master:
Here the original AuthorDate and AuthorEmail have been retained, as expected. So the arguably incorrect date behaviour and the clearly incorrect email behaviour are a recent change, deployed on GitHub.com somewhere between September 16th and 19th. |
This seems to be a rough duplicate of #1303, although it does helpfully provide a lot more details. |
@aspiers: #1303 is a complaint (filed in July) that a particular project maintainer didn't appropriately preserve Author information when rebasing the OP's commits, and a request for a GitHub enhancement to preserve the original Authors informations outwith git when squashing commits from several authors in the UI. This is a bug report about a behaviour change in September. The two pertain to related areas of functionality, but are not duplicates. |
Upon further testing, I see that AuthorName is also affected. Whatever you carefully set up your Name and Email address to be, e.g., via bespoke |
Just noticed this as well, see this commit https://github.com/WeakAuras/WeakAuras2/commit/fa75abcc7b618b93d416aaa3f0a6315a2ab486d8.patch that was a |
Problem still exists: see PR jmarshall/test@02f15df which became jmarshall/test@2105ce7 on Squash'n'Merging. (Add .patch to those links to see a rawer view of the commits.) |
Previously tweeted about here and here. Followup email sent to
|
Reply received from GitHub Support on January 2nd:
Problem still exists unchanged on retesting today; my reply to Support, sent today:
|
To clarify, my down-thumbs reaction 👎 on John's update today was about the lack of any movement from GitHub. I often do squash-and-merge commits of pull requests, but thus far haven't had anyone complain - people setting their commit authorship differently to their Github profile must be a minority? However, they would be a tech savvy minority ... |
Reply received from Support today:
Thanks (assuming 1 = high!). Insert here standard concern about “no response” and “bug report disappeared into the void” being indistinguishable… GitHub has supported attaching multiple email addresses to each GH account for many years. This author rewriting goes directly against this, so once again it seems astonishing that the September behaviour was ever deployed… |
@negebauer: This issue is a history corruption bug that was introduced last September. The UI limitation you mention is issue #95 (see #95 (comment) and following). |
Another three months have passed with this at “Priority 1”, and the problem still exists unchanged on retesting today. |
I was just poking around and stumbled across this issue. At Artsy we're discussing moving to squash and merge by default. I definitely don't want to overwrite my coworker's contributions. I haven't really noticed this issue in the past so I started testing it out. TL;DR I believe this issue is solved. Before I reached that conclusion, I started looking around for ways to fix this if it was an issue. I found the git trailer When I looked at the commits in master I was greeted with this... So GitHub is recognizing (at least from the UI) that my coworker authored it but I merged it. Great! I checked git to verify... It's attributed to my coworker @mdole which is the desired behavior. Looks good! I wanted to verify that the trailer was what caused it to work. It could be that the issue is just fixed generally... I found another PR that I could squash. Did it without the trailer this time. Pretty much the same as above. I checked the commit log in master... Looks like it worked! Given that, I think this issue is fixed and the The git log of that last commit just to verify. Caveat There is a slight possibility that this functionality is in beta and not spread to all users. I have no indication to say that's the case, but the possibility exists. I'd love for someone else to try and let me know if it works. |
@zephraph: In fact, your PRs demonstrate that this issue is still present. The email address to which GitHub rewrites the Author is associated with the same GItHub user, so this bug does not affect the GitHub user to whom the commits are attributed in the UI. This is not at issue.
Your second PR more clearly demonstrates this bug. The commit on the PR branch is:
but as merged to master it becomes
As you see, both the name and the email address of |
We have some updates coming, it might be useful to separate the date issue from the author in the future. This is a good reference for the problems but I’d like to track both separately. More to come soon. |
Ahhh, I see. Thanks for the clarification! Sent with GitHawk |
To clarify this a bit, we have updates coming related to the authoring part but nothing yet for what is happening with the dates. |
So was the Sent with GitHawk |
@jmarshall What's your take on the latest change? Is it fair to say that it resolves some aspects of this issue but not all? For example at a glance it doesn't seem to address date changes, but I haven't tried it myself. As @clarkbw suggested, maybe it makes sense to split them into separate issues. |
@WilliamMartinsson: Nope. As previously noted, the choose-your-email dropdown added to the PR merge dialog is (the latter part of) #95. This issue is about what happens to So just now I have tested this once again, this time (for the first time) testing it as if I have composed a pull request containing another GitHub user's work: PR jmarshall/test#22 contains one commit:
(The real
As you see, As you see, the As you also see, my committer identity has been shoved into Unfortunately I haven't tested this with another GitHub user's email address previously, so I don't know whether this behaviour is new. @zephraph's second PR in #1368 (comment) suggests that this behaviour is indeed new since April 17th, as in that case renovate-bot's authorship was retained in the commit as merged. (But it is hard to be sure, as in that case renovate-bot opened the PR that contained renovate-bot's commit, but in my test just now it was I who opened the PR containing my colleague's commit. It is conceivable that GitHub might be overriding In summary, there does appear to have been a recent change in behaviour and it appears to have made the authorship aspects of this issue much worse. It would be interesting to hear what GitHub's goals in altering What I would expect to happen in this case is the same thing as happens with
|
@jmarshall I really appreciate the in-depth breakdown here. Thanks for taking the time to share that. I've been researching the history of the behavior internally to try to determine the expected behavior (and why it is that way). I'm still waiting to hear back from a few colleagues, but I did want to share my understanding so far:
|
Any news on this issue? It's quite an issue that PR authors aren't kept in the final merge/squash commit message. As maintainer, and hence reviewer and merger, I do NOT want to get credits for work done by others. |
the same issue is being discussed here #1303 |
Just got bit by this, the behavior was very unexpected! |
Indeed! Just did my first maintainer merge and accidentally exposed a user's email who did not want that email in the git log. |
This should've been removed as part of c52a603.
For squash-and-merged PRs |
samtools/hts-specs#339 was a pull request consisting of a single commit:
It was merged using the GitHub UI "Squash and merge" button (so that it would be rebased onto the current tip of origin/master) leading to the following commit on the main repository's master:
As expected, the Committer and CommitDate have been altered to reflect the person who pressed the merge button.
The AuthorDate has been altered by GitHub to be the same as CommitDate, but this is incorrect — the commit was still originally authored on Friday 14th.
The AuthorEmail has been altered by GitHub to be the default email address associated with the @jmarshall GitHub account at the time. This is very incorrect, as I do not use this email address when doing work on samtools/hts-specs.
When the "Squash and merge" button is being used to squash several commits from different authors, there is an argument to be had that Author/AuthorDate could be updated in some way (or GitHub could just follow what
git
does in this case).When the "Squash and merge" button is being used to squash several commits from the same author (so AuthorName and AuthorEmail are the same, which is trivially true when there is only one commit), it is a bug to change the author's listed AuthorName or AuthorEmail.
The text was updated successfully, but these errors were encountered: