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

Re: credential-store get: No such file or directory

From
Jeff King <peff@peff.net>
Date
Nov 4, 2021, 14:55 UTC
Message-ID
<YYP0dnBgfY16fSP7@coredump.intra.peff.net>
In-Reply-To
<CAP8dQmtLt_2+ExGUB71nJz_PWHKRrzqQVtX7d8T6FpPqgatiFQ@mail.gmail.com>
On Thu, Nov 04, 2021 at 09:12:39AM -0500, Steven Penny wrote:
Show 13 quoted lines
> On Thu, Nov 4, 2021 at 4:43 AM Jeff King wrote:
> > It's because internally, the "git credential-store get" command is
> > assembled as a single string passed to the shell, whereas remote-https
> > is run directly via exec/spawn.
> 
> Actually, I bet that is whats causing the problem. I am using MSYS2 Git [1],
> which is not a native Windows build of Git, but one that relies on the MSYS2 DLL
> for path translations and such. I have actually built a Windows native Git, but
> its a pain, so its easier just to use the package. Anyway, the "non native"
> Windows version, probably considers Bash the shell, so any commands being passed
> to a shell probably will be looking for Bash. I dont have Bash on my system,
> because for the most part I dont want or need it. If I need a shell, I just use
> PowerShell.
OK, that would explain it, I think.
Show 5 quoted lines
> Would it be possible for Git to just run "credential-store" directly, like other
> commands? I assume stuff like "~/.git-credentials" would be a problem, but
> couldnt you just do something like this instead (pseudocode):
> 
>     var cred string = os.Getenv("HOME") + "/.git-credentials"
Possible yes, easy no.

The "~" part is trivial; that's expanded inside the C program anyway. The harder thing is that helper strings can be arbitrary shell commands (if you start them with "!"), so we decide at parse time whether to stick the "git credential-" in front and then always treat it as a shell command, rather than carrying through the knowledge that it doesn't need a shell. So switching that would ripple through the whole call stack and the data structures.

Definitely not impossible, and not even _hard_, but it's not like a one-liner change.

-Peff
Previous: Steven Penny
Message 9 of 9 in “credential-store get: No such file or directory”
  1. Steven PennyNov 3, 2021
  2. Steven PennyNov 3, 2021
  3. Jeff KingNov 3, 2021
  4. Steven PennyNov 3, 2021
  5. Jeff KingNov 3, 2021
  6. Steven PennyNov 3, 2021
  7. Jeff KingNov 4, 2021
  8. Steven PennyNov 4, 2021
  9. Jeff KingNov 4, 2021

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.