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

Re: [PATCH 1/1] credential: do not mask the username

From
Jeff King <peff@peff.net>
Date
Apr 30, 2019, 22:21 UTC
Message-ID
<20190430222146.GA19492@sigill.intra.peff.net>
In-Reply-To
<nycvar.QRO.7.76.6.1904301753030.45@tvgsbejvaqbjf.bet>
On Tue, Apr 30, 2019 at 06:07:15PM -0400, Johannes Schindelin wrote:
Show 13 quoted lines
> >   2. Use another tool besides askpass. I don't know of any askpass
> >      implementations that take something like our ECHO flag, but there
> >      are lots of other tools. I doubt there's any easy portable
> >      solution, though. And anyway, credential helpers are a much more
> >      advanced version of this anyway, so I'd probably steer people in
> >      that direction.
> [...]
> 
> How about inventing a new convention: we could set `GIT_ASKPASS_FLAGS`
> as an environment variable that contains whitespace-delimited flags, in
> the current instance just "echo"?
> 
> We could then teach `git-gui--askpass` to heed that.

Yeah, I almost suggested something like that for my (2) above, but I couldn't actually find an askpass implementation that supported this (though there are lots of general dialog tools that do).

But today I learned about git-gui--askpass. :)

So yeah, I think that is a solution in the right direction, but it may not be helping that many people if it is specific to git-gui--askpass.

> Mind you, these days, this patch is a lot less necessary because Git for
> Windows (which is *the* platform where you'd expect no terminal to be
> available when fetching/pushing, right?) defaults to using the Git
> Credential Manager [*1*].

The no-terminal thing isn't specific to Windows. You can imagine somebody triggering "git fetch" from any GUI on Linux that no longer has a controlling terminal (because the GUI was spawned by a desktop manager or some such).

But I definitely agree that credential helpers are the right way to do fancier prompting. AFAIK your GCM is the only one which actually does prompting (most of the rest are just key-store interfaces), but it's definitely inbounds and was part of the original intent. For usernames, I personally just stick mine in credential.$URL.username config, since they're obviously not a secret. But then my habits may not match most users. :)

Show 5 quoted lines
> What do you think about the `GIT_ASKPASS_FLAGS` thing? It is not perfect,
> but it could be used at least in conjunction with `git-gui--askpass` (or
> with other helpers that would make use of this side channel to receive
> more information about the way they should present the question to the
> user)?
It seems perfectly reasonable to me, but if it were me, I think this:
> Alternatively, I could simply drop that patch from Git for Windows, as it
> really only concerns users who override the default, opting out of using
> Git Credential Manager.
would be the path I would take.
-Peff
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 8 in “credential: do not mask the username”
  1. 0/1 credential: do not mask the usernameJohannes Schindelin via GitGitGadget, Apr 29, 2019
  2. 1/1 credential: do not mask the usernameJarosław Honkis via GitGitGadget, Apr 29, 2019
  3. Eric SunshineApr 29, 2019
  4. Johannes SchindelinApr 29, 2019
  5. Jeff KingApr 29, 2019
  6. Johannes SchindelinApr 30, 2019
  7. Jeff KingApr 30, 2019
  8. Johannes SchindelinMay 3, 2019

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.