I've realised another problem with this which is that if a PR was
opened before this change then it is not enough to merge with the
latest master and rerun the bin/authors_update.py script. The script
updates the AUTHORS file in the order of the commits but that order is
different when merging master into the PR rather than merging the PR
into master which is what happens in CI. That means that any PR from
before this change needs to be rebased against master (rather than
have master merged in) and then the script should be rerun.

It's not clear to me yet if this is just a temporary problem for PRs
that were opened before the change but haven't been merged yet. In
general though anything that involves appending to the end of a file
as the authors_update.py script does can lead to merge conflicts so
this might be an ongoing problem that requires recording the author
information in a different way. For example storing the author
information in alphabetical order would solve most of the problems
(they could be processed into a different order at release time).


Oscar

On Mon, 23 Aug 2021 at 19:28, Chris Smith <[email protected]> wrote:
>
> > have the same names
>
> Authors are identified by email addresses. If an author with a given name 
> uses more than one email address, then (according to the 
> `bin/mailmap_update.py` note,
>
>         Ambiguous name warning: if a person uses more than
>         one email address, entries should be added to .mailmap
>         to merge them into a single canonical address.
> /c
>
> On Saturday, August 21, 2021 at 10:58:45 AM UTC-5 Oscar wrote:
>>
>> Hi all,
>>
>> I just merged a PR to update the AUTHORS file:
>> https://github.com/sympy/sympy/pull/21881
>>
>> This is something that I've needed to do before each release and is
>> quite time consuming so in that PR I also added the scripts that check
>> the AUTHORS file to the CI tests. Now any PR that does not have up to
>> date author information will fail in CI. In particular this means that
>> any new contributor will need to add their name to the AUTHORS file
>> before their first PR can be merged.
>>
>> The name and email address in the AUTHORS file needs to match up with
>> the name/email in the git commits (as set by git config). Otherwise
>> there will need to be a line in the .mailmap file associating the
>> name/email in the authors file with the name/email in the commits. The
>> most common reason this is needed is if someone makes commits through
>> the github web UI which will always record a no reply email address.
>>
>> This will be problematic for new contributors but it means that the
>> author information will always be up to date and will be more accurate
>> since anyone contributing will be required to specify the name and
>> email address up front.
>>
>> The simple instruction for any new contributor is that you should
>> first set your name and email address in your git config:
>>
>> $ git config --global user.name "John Doe"
>> $ git config --global user.email [email protected]
>>
>> See e.g.:
>> https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
>>
>> If git is correctly configured in all of the commits then the sympy
>> git repo has two scripts that can be used to check and update the
>> author information. The first is
>>
>> $ bin/mailmap_update.py
>>
>> This extracts all name/email combinations from all commits in the repo
>> and checks that every email address is mapped to a unique name. If
>> there are two commits with the same email addresses but different
>> names then a mailmap line is needed to specify which name is the one
>> that should be used in the authors file. Likewise if the same name is
>> used with multiple email addresses then a mailmap line is needed to
>> specify which email address should go with the name. (I'm not sure how
>> to handle genuinely distinct people who actually have the same
>> name...).
>>
>> If there are no errors reported by mailmap_update.py then the second
>> script can be used to update the AUTHORS file:
>>
>> $ bin/authors_update.py
>>
>> This also extracts all name/email combinations from commits and then
>> runs them through the mapping in mailmap and then if any are not
>> listed in the authors file the script will add them. It will print
>> something to say what it has done. You can use git diff to see the
>> changes. These changes in .mailmap and AUTHORS need to be committed
>> and pushed.
>>
>> I expect some new contributors will find this difficult especially
>> since they might not discover that their git config has the wrong
>> name/email until after they have already made the commits and pushed
>> them. It will reduce the chances that someone accidentally uses the
>> wrong git config though (once your commits are merged to master this
>> is no way to remove them even if you do not want that name/email to be
>> used publicly). The simple fix is just to add some lines to .mailmap
>> but many contributors might prefer to actually fix their config and
>> redo the commits. In general I would rather have correct name/email
>> information recorded in the commits than have a .mailmap entry that
>> disambiguates them.
>>
>> Lastly whenever we have changes to CI like this there is a risk that a
>> PR that has already passed CI will be merged resulting in CI failure
>> on the master branch that then prevents any PRs from being merged
>> until it gets fixed. CI can be rerun for a PR by closing and
>> reopening.
>>
>> --
>> Oscar
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/91fba620-78c3-496b-b2e3-6ba37d3b211dn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxQ8xcZEJ77oWaX-j6o%2B8gK9x36GfL7LFPy_Lqp3EwcM9A%40mail.gmail.com.

Reply via email to