git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Credential helpers processing order
@ 2016-08-16 15:13 Dmitry Neverov
  2016-08-16 15:58 ` Jacob Keller
  2016-08-16 16:12 ` Jeff King
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Neverov @ 2016-08-16 15:13 UTC (permalink / raw)
  To: Git List

Hi,

I wonder why credential helpers are called in the order: system,
global, local, command-line and not in the reverse order? This make it
impossible to provide a custom helper and disable default ones via
command-line parameter. My use-case is to clone a repository in a
non-interactive environment where a system-level GUI helper is
configured: clone hangs since system-level helper called first and
there is no input from the user. Also if a system-level helper sets
quit=true, then lower-level helpers won't be called at all. Is it by
design?

--
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Credential helpers processing order
  2016-08-16 15:13 Credential helpers processing order Dmitry Neverov
@ 2016-08-16 15:58 ` Jacob Keller
  2016-08-16 16:12 ` Jeff King
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2016-08-16 15:58 UTC (permalink / raw)
  To: Dmitry Neverov; +Cc: Git List

On Tue, Aug 16, 2016 at 8:13 AM, Dmitry Neverov
<dmitry.neverov@gmail.com> wrote:
> Hi,
>
> I wonder why credential helpers are called in the order: system,
> global, local, command-line and not in the reverse order? This make it
> impossible to provide a custom helper and disable default ones via
> command-line parameter. My use-case is to clone a repository in a
> non-interactive environment where a system-level GUI helper is
> configured: clone hangs since system-level helper called first and
> there is no input from the user. Also if a system-level helper sets
> quit=true, then lower-level helpers won't be called at all. Is it by
> design?
>

If I understand correctly, the credential helpers aren't supposed to
require input so it is assumed they can be tried in sequence if one
fails? It might make sense to reverse the order though...

Thanks,
Jake

> --
> Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Credential helpers processing order
  2016-08-16 15:13 Credential helpers processing order Dmitry Neverov
  2016-08-16 15:58 ` Jacob Keller
@ 2016-08-16 16:12 ` Jeff King
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2016-08-16 16:12 UTC (permalink / raw)
  To: Dmitry Neverov; +Cc: Git List

On Tue, Aug 16, 2016 at 05:13:55PM +0200, Dmitry Neverov wrote:

> I wonder why credential helpers are called in the order: system,
> global, local, command-line and not in the reverse order? This make it
> impossible to provide a custom helper and disable default ones via
> command-line parameter. My use-case is to clone a repository in a
> non-interactive environment where a system-level GUI helper is
> configured: clone hangs since system-level helper called first and
> there is no input from the user. Also if a system-level helper sets
> quit=true, then lower-level helpers won't be called at all. Is it by
> design?

I agree that it's not really a sensible order. But reversing them isn't
quite right either. The problem is that the config code just gives the
credential code a sequence of items, with no indication which file they
came from, with what priority, etc.

For config keys with a single value, "last one wins" makes sense; we
just keep overwriting the previous value.

But for lists (like credential.helper, but also other things like
remote.*.fetch), we just build up the list. And we can't tell the
difference between two items next to each in the same file, or two in
different files with differing priorities.

Fixing that would be tricky. But I think for your case (and most similar
cases), you'd be happy to just be able to "reset" the list to empty. As
of git v2.9.0, you can do that, like so:

  [credential]
  helper = "!echo >&2 should not run;:"
  helper =
  helper = "!echo >&2 should run;:"

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-16 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-16 15:13 Credential helpers processing order Dmitry Neverov
2016-08-16 15:58 ` Jacob Keller
2016-08-16 16:12 ` Jeff King

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).