Re: [PATCH_v1] add 'git credential' plumbing command

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH_v1] add 'git credential' plumbing command

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:02

Jeff King [off-list ref] writes:
Perhaps it would be simpler to accept a URL on the command line, and
also provide a --stdin option for callers that want to feed it directly.
So:

  git credential fill https://example.com/foo.git

would be identical to:

  git credential --stdin fill <<\EOF
  protocol=https
  host=example.com
  path=foo.git
  EOF
and "git credential fill https://peff@example.com/foo.git" would be
identical to the latter one with user=peff already filled in?
I am tempted to suggest that this actually output the _whole_
credential, not just the username and password. Coupled with the above
behavior, you would get:

  $ git credential fill https://example.com/foo.git
  protocol=https
  host=example.com
  path=foo.git
  username=bob
  password=secr3t

which happens to be exactly what you want to feed back to the "approve"
and "reject" actions (and it is not really any harder to parse).

We _could_ get by with allowing:

  git credential --stdin approve https://example.com/foo.git <<\EOF
  username=bob
  password=secr3t
  EOF

and having it combine the URL on the command-line with the entries on
stdin (and indeed, I think that is the only sane thing to do when
--stdin and a URL are both given).
All good suggestions ;-).

Re: [PATCH_v1] add 'git credential' plumbing command

From: Jeff King <hidden>
Date: 2016-06-15 22:54:02

On Mon, Jun 11, 2012 at 08:34:55AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Perhaps it would be simpler to accept a URL on the command line, and
also provide a --stdin option for callers that want to feed it directly.
So:

  git credential fill https://example.com/foo.git

would be identical to:

  git credential --stdin fill <<\EOF
  protocol=https
  host=example.com
  path=foo.git
  EOF
and "git credential fill https://peff@example.com/foo.git" would be
identical to the latter one with user=peff already filled in?
Exactly. Though see my other response to Matthieu, which notes that:

  git credential fill https://peff:supersecret@example.com/foo.git

is problematic. :(

Probably it should be spelled:

  git credential fill <<\EOF
  url=https://peff:supersecret@example.com/foo.git
  EOF

and then:

  git credential fill <<\EOF
  url=https://peff:supersecret@example.com/foo.git
  username=junio
  password=othersecret

would do what you expect (break the URL out into its components, and
then override particular fields).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help