git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Nicolas Mailhot <nicolas.mailhot@laposte.net>
Cc: git <git@vger.kernel.org>
Subject: Re: [RFE] Please add name and email to git credentials
Date: Fri, 2 Nov 2018 13:56:05 -0400	[thread overview]
Message-ID: <20181102175605.GA17353@sigill.intra.peff.net> (raw)
In-Reply-To: <841569ad61dd5f4f5424e8c2860a4c01f146c8a1.camel@laposte.net>

On Fri, Nov 02, 2018 at 06:32:36PM +0100, Nicolas Mailhot wrote:

> > I did create the way git credential matches repo urls. And I do not
> > think your proposal is a good idea. The credential system is about
> > interacting with a remote URL, and creating a commit object is a local
> > operation. That mismatch leaks through when you work with multiple
> > remotes, since it is not clear which URL we would match against when
> > the operation does not involve a remote at all.
> 
> I don't think it's quite that simple. The id part of creating a commit
> object is not a local operation at all. You choose the id written in a
> commit for a specific remote target, it has no use locally, most of us
> do not need it to reach themselves.

I don't think that's true. You do not need to have a remote at all to
use Git.

But more importantly, the commit is not in any way tied to a specific
remote. You might have multiple remotes that are storing many of the
same objects. So even if you wanted to somehow assign a segment of
history to a remote, it is not an unambiguous mapping.

> So yes there is a leak but it’s built in the git commit logic itself.
> Ideally, git would defer resolving <me> in commits to when I push to a
> remote target. I'm sure you’re aware of all the workarounds git users do
> at push time, when they realize the commit <me> is not the good one.

Your second sentence is fundamentally at odds with how Git works and its
decentralized data model.

> And since the leak is built in the commit logic itself, there are no
> perfect solutions that do not involve revisiting how commit works.
> 
> So, unless someone wants to revisit git commit, we’re left with
> imperfect solutions, and git credentials is no worse than another. It
> certainly fixes my use case fine. You did good work in git credentials.

Sorry, I just don't agree with any of the logic here. That's not how
commits work in Git, and all of the solutions are not equally imperfect.

-Peff

  reply	other threads:[~2018-11-02 17: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
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 [this message]
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=20181102175605.GA17353@sigill.intra.peff.net \
    --to=peff@peff.net \
    --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).