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

Re: Credential Store: Don't acquire lock when only reading the file

From
Simão Afonso <simao.afonso@powertools-tech.com>
Date
Oct 30, 2020, 11:22 UTC
Message-ID
<20201030112229.3rcyylkuyrlrhn7g@safonso-t430>
In-Reply-To
<20201030055541.GA3264588@coredump.intra.peff.net>
Hi Jeff, thanks for the fast reply.
On 2020-10-30 01:55:41, Jeff King wrote:
Show 6 quoted lines
> I agree that "get" should not be taking a lock. And looking at the code,
> I don't think that it is.
> 
> However, after successfully using a password, Git will then trigger each
> helper with a "store" command. So likely what you are seeing is each
> fetch telling credential-store to store the successful password.
Ah, the plot thickens. That sounds more like it.
On 2020-10-30 01:55:41, Jeff King wrote:
Show 16 quoted lines
> There are a few options here:
> 
>   - we could have Git not do that. And indeed, I wrote a patch for that
>     long ago:
> 
>       https://lore.kernel.org/git/20120407033417.GA13914@sigill.intra.peff.net/
> 
>     but it turns out that some people rely on it. There were some
>     options discussed there for moving it forward, but nothing ever
>     happened.
> 
>     Another option that we didn't discuss there: we could remember which
>     helper gave us the credential and not feed it back to itself. That
>     would let simple cases work without the extra request, but would let
>     more complex ones (feeding the result of one helper to another)
>     continue to work the same.

Right, I did not imagine you could chain credential helpers, but that makes sense.

On 2020-10-30 01:55:41, Jeff King wrote:
> Interested in trying a patch for any of those?

Sounds good to me, I should be able to handle it if you CC/BCC me (subscribing to the firehose is a bit too much).

For reference, I'm using:
> $ git --version
> git version 2.29.1
Previous: Jeff KingNext: Jeff King
Message 3 of 7 in “Credential Store: Don't acquire lock when only reading the file”
  1. Simão AfonsoOct 29, 2020
  2. Jeff KingOct 30, 2020
  3. Simão AfonsoOct 30, 2020
  4. Jeff KingOct 30, 2020
  5. Simão AfonsoOct 30, 2020
  6. Simão AfonsoOct 30, 2020
  7. Jeff KingOct 30, 2020

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.