From: Steven Penny <srpen6@gmail.com>
To: git@vger.kernel.org
Subject: Re: credential-store get: No such file or directory
Date: Tue, 2 Nov 2021 20:19:56 -0500 [thread overview]
Message-ID: <CAP8dQmvguqPXy6Rg_RkuFmf4+LPh79HM_EBM+Wi9dYn3N+vrcQ@mail.gmail.com> (raw)
In-Reply-To: <CAP8dQmu6Dfo4KBsVk+6xeR6=+S8bOKk-kbc3ub7c0jAsH61-cg@mail.gmail.com>
On Tue, Nov 2, 2021 at 7:27 PM Steven Penny wrote:
> fatal: cannot run git credential-store get: No such file or directory
I came up with a workaround. I wrote my own AskPass program using Go language.
Here it is:
package main
import (
"bytes"
"fmt"
"net/url"
"os"
)
func main() {
cache, err := os.UserCacheDir()
if err != nil {
panic(err)
}
buf, err := os.ReadFile(cache + "/git/credentials")
if err != nil {
panic(err)
}
buf = bytes.TrimSpace(buf)
addr, err := url.Parse(string(buf))
if err != nil {
panic(err)
}
if len(os.Args) != 2 {
return
}
prompt := os.Args[1]
if len(prompt) < 8 {
return
}
switch prompt[:8] {
case "Username":
fmt.Fprintln(os.Stderr, "Username")
fmt.Println(addr.User.Username())
case "Password":
fmt.Fprintln(os.Stderr, "Password")
pass, ok := addr.User.Password()
if ok {
fmt.Println(pass)
}
}
}
next prev parent reply other threads:[~2021-11-03 1:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 0:27 credential-store get: No such file or directory Steven Penny
2021-11-03 1:19 ` Steven Penny [this message]
2021-11-03 2:25 ` Jeff King
2021-11-03 3:57 ` Steven Penny
2021-11-03 11:10 ` Jeff King
2021-11-03 16:01 ` Steven Penny
2021-11-04 9:43 ` Jeff King
2021-11-04 14:12 ` Steven Penny
2021-11-04 14:55 ` Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP8dQmvguqPXy6Rg_RkuFmf4+LPh79HM_EBM+Wi9dYn3N+vrcQ@mail.gmail.com \
--to=srpen6@gmail.com \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).