public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: Vladislav Kostenko <vkostenko@netlabsystems•com>
Cc: "Kyle J. McKay" <mackyle@gmail•com>, git@vger•kernel.org
Subject: Re: Fwd: Can't override username of default credential context to have different username in custom context.
Date: Tue, 28 Apr 2015 01:25:39 -0400	[thread overview]
Message-ID: <20150428052539.GG24580@peff.net> (raw)
In-Reply-To: <20150428052502.GF24580@peff.net>

[+cc Kyle, who I forgot on the initial send. Oops!]

On Tue, Apr 28, 2015 at 01:25:02AM -0400, Jeff King wrote:

> On Mon, Apr 27, 2015 at 09:19:31PM +0500, Vladislav Kostenko wrote:
> 
> > Here is my scenario:
> > 
> > 1. First I set default username
> > git config --global credential.username myUsername
> > 
> > 2. Then I want to have different username for my other repository
> > git config --global
> > credential.https://myOtherRepository.visualstudio.com.username
> > myOtherUsername
> > 
> > 3. When I try to pull new changes, git asks for password of myUsername
> > Password for 'https://myUsername@myOtherRepository.visualstudio.com':
> > 
> > But I want to have:
> > Password for 'https://myOtherUsername@myOtherRepository.visualstudio.com':
> > 
> > Is there any way to accomplish overriding?
> 
> Only by changing the ordering in the config file, as you noticed.
> 
> The other http.* options will choose the most-specific match, but the
> credential code predates that, and blindly goes in config order. Kyle
> (cc'd) added the urlmatch support for http.*, and might be able to say
> whether it could be adapted for the credential code. If so, then I think
> it would need somebody to volunteer to work on it.
> 
> That would technically be a backwards-incompatible change to switch the
> lookup order at this point in time, but I'm somewhat of the opinion that
> in any case it matters, the new behavior would be a strict improvement.
> 
> -Peff
> --
> 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

      reply	other threads:[~2015-04-28  5:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 16:19 Fwd: Can't override username of default credential context to have different username in custom context Vladislav Kostenko
2015-04-28  5:25 ` Jeff King
2015-04-28  5:25   ` Jeff King [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150428052539.GG24580@peff.net \
    --to=peff@peff$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=mackyle@gmail$(echo .)com \
    --cc=vkostenko@netlabsystems$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox