archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
153 stars 53 forks source link

Login name is used for merge commits. #47

Closed mpcjanssen closed 6 years ago

mpcjanssen commented 7 years ago

When the plugin automatically merges remote and local changes, the name used for the merge commit is the local login name. Instead the configured username and email from the configuration should be used. For example:

Configured user = Mark Janssen Configured email = mark.janssen@domain.com Windows 10 user = Mark

commit 610e4a3ad35faff6316be86cac2ff7d65c543a1b
Merge: 56c9305 86fac84
Author: Mark <personal-email>
Date:   Mon Sep 11 17:09:25 2017 +0200

    Merge branch 'master' of https://therepo/reponame.git

commit 56c930560863ab327c46ca81b62e4459e5c8df77
Author: Mark Janssen <mark.janssen@domain.com>

   The commit message
Phillipus commented 7 years ago

I suspect that in cases of automatic merge JGit looks for the username and email from the global .gitconfig file. If not present, then uses a system property.

I can change this so that it reads from .gitconfig and updates this when the plug-in preferences are saved.

mpcjanssen commented 7 years ago

@Phillipus that would be a sensible solution.

Phillipus commented 7 years ago

I've created a new release at:

https://www.archimatetool.com/plugins

Phillipus commented 7 years ago

To be clear:

Phillipus commented 7 years ago

And:

mpcjanssen commented 7 years ago

What is there against always storing the name/email in the repository settings?

I purposely don't set my global email for git to prevent leaking of work email in public repos or public email in work repos. The solution as it stands seems to set the global email after the first commit.

Phillipus commented 7 years ago

The solution as it stands seems to set the global email after the first commit.

This was done to provide a default for users who have not set global prefs.

mpcjanssen commented 7 years ago

If here would be an option to force storing of the name and email in repository settings only, that would be great. As it stands, it breaks my use of global and local settings.

Phillipus commented 7 years ago

If we get rid of this it might help:

Phillipus commented 7 years ago

Removed that last option. .gitconfig name/email can only be set from Preferences now. If not present these are stored for each repo.

Effectively - .gitconfig name/email is just a default if user does not enter name/email. If it does not exist these are always stored for each repo.

mpcjanssen commented 7 years ago

Thanks, commits look good. Will test before closing.