From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Christian Couder'" <christian.couder@gmail.com>,
<nicolas.mailhot@laposte.net>
Cc: "'git'" <git@vger.kernel.org>
Subject: RE: [RFE] Please add name and email to git credentials
Date: Thu, 1 Nov 2018 10:32:00 -0400 [thread overview]
Message-ID: <001601d471ef$a9ccf110$fd66d330$@nexbridge.com> (raw)
In-Reply-To: <CAP8UFD1rTJNOZzFMryY9BNKHUZKE8FUEgw+4jFfnZ7G8KGNrkw@mail.gmail.com>
On November 1, 2018 10:13 AM, Christian Couder wrote:
> Sent: > To: nicolas.mailhot@laposte.net
> Cc: git <git@vger.kernel.org>
> Subject: Re: [RFE] Please add name and email to git credentials
>
> On Thu, Nov 1, 2018 at 2:31 PM Nicolas Mailhot
> <nicolas.mailhot@laposte.net> wrote:
> >
> > Le jeudi 01 novembre 2018 à 12:22 +0100, Ævar Arnfjörð Bjarmason a
> > écrit :
> > >
> > > Where would we get an E-Mail to lookup to pass to the helper? Are
> > > you just asking that the helper git the result of $(git config
> > > user.name && git config user.email)? If so why can't it just look
> > > this up itself?
> >
> > So, just in case it was not clear enough, allow things in .gitconfig
> > like
> >
> > [credential "https://pkgs.fedoraproject.org/"]
> > username = doe4ever
> > name = John Doe
> > email = doe4ever@fedoraproject.org
> > [credential "https://gitlab.corp.com/"] username = jdoe56874 name =
> > John Doe, Snr Engineer email = john.doe@corp.com
> >
> > Instead of just
> >
> > [user]
> > name = John Doe
> > email = john.doe@corp.com
> > [credential "https://pkgs.fedoraproject.org/"]
> > username = doe4ever
> > [credential "https://gitlab.corp.com/"] username = jdoe56874
> >
> > and drat, I've commited to XXX with the wrong name/email again
>
> How can Git know when you commit where you will want to push the
> commit afterwards?
>
> What if you want to push the same commit to 2 different places that need
> different credentials?
Agree. You are asking git to change history depending on where pushes are done. Applying a legacy VCS paradigm here? Git has a global view of history. It must be the same everywhere, so if you push to two different places, the history must be the same, because those two places may in turn push to another shared repo. Then who is the authority?
What I have managed to do is to associated name and email with config --local so that it binds to the clone and overrides your --global setting. I can have different identities based on what clone I am working on, but once history is created, that's it. If I push from one clone to another, the identity of the clone where I did my first commit is what the second clone sees.
Hope this helps.
Randall
-- Brief whoami:
NonStop developer since approximately 211288444200000000
UNIX developer since approximately 421664400
-- In my real life, I talk too much.
next prev parent reply other threads:[~2018-11-01 14:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-01 9:59 [RFE] Please add name and email to git credentials Nicolas Mailhot
2018-11-01 11:22 ` Ævar Arnfjörð Bjarmason
2018-11-01 12:34 ` Nicolas Mailhot
2018-11-01 13:15 ` Ævar Arnfjörð Bjarmason
2018-11-01 14:13 ` Christian Couder
2018-11-01 14:32 ` Randall S. Becker [this message]
2018-11-01 14:42 ` Nicolas Mailhot
2018-11-02 8:27 ` Christian Couder
2018-11-02 8:57 ` Nicolas Mailhot
2018-11-02 16:51 ` Jeff King
2018-11-02 17:32 ` Nicolas Mailhot
2018-11-02 17:56 ` Jeff King
2018-11-01 11:32 ` Nicolas Mailhot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001601d471ef$a9ccf110$fd66d330$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=nicolas.mailhot@laposte.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).