git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFE] Please add name and email to git credentials

From
Jeff King <peff@peff.net>
Date
Nov 2, 2018, 17:56 UTC
Message-ID
<20181102175605.GA17353@sigill.intra.peff.net>
In-Reply-To
<841569ad61dd5f4f5424e8c2860a4c01f146c8a1.camel@laposte.net>
On Fri, Nov 02, 2018 at 06:32:36PM +0100, Nicolas Mailhot wrote:
Show 11 quoted lines
> > 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.

Show 6 quoted lines
> 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
Previous: Nicolas MailhotNext: Randall S. Becker
Message 11 of 13 in “[RFE] Please add name and email to git credentials”
  1. Nicolas MailhotNov 1, 2018
  2. Ævar Arnfjörð BjarmasonNov 1, 2018
  3. Nicolas MailhotNov 1, 2018
  4. Ævar Arnfjörð BjarmasonNov 1, 2018
  5. Christian CouderNov 1, 2018
  6. Nicolas MailhotNov 1, 2018
  7. Christian CouderNov 2, 2018
  8. Nicolas MailhotNov 2, 2018
  9. Jeff KingNov 2, 2018
  10. Nicolas MailhotNov 2, 2018
  11. Jeff KingNov 2, 2018
  12. Randall S. BeckerNov 1, 2018
  13. Nicolas MailhotNov 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.