From: Michael Schubert <mschub@elegosoft.com>
To: Tillmann.Crueger@telekom.de
Cc: git <git@vger.kernel.org>
Subject: Re: Git submodules with usernames in the URL
Date: Tue, 14 Feb 2012 15:55:04 +0100 [thread overview]
Message-ID: <4F3A75C8.5070201@elegosoft.com> (raw)
In-Reply-To: <E76DF6102FDBC04BA291EAE9A3BAECB50137C2AC6530@HE111540.emea1.cds.t-internal.com>
On 02/14/2012 02:26 PM, Tillmann.Crueger@telekom.de wrote:
> I already had a look at the mailinglist archive, but I could not find
> any mention of this problem. There is a posting on Stackoverflow.com
> about this
> (http://stackoverflow.com/questions/7714326/git-submodule-url-not-including-username)
> with a workaround, but it would nice to have an official position.
>
> Here is the problem:
>
> When I am using git-submodule over an authorized https it is
> convenient to be able to specify the username directly in the url in
> the form https://user@domain.com/path/to/repo. So I am able to do a
>
>> git submodule add https://user@domain.com/path/to/repo
>
> Howver if I do this, the username becomes baked into the URL of the
> submodule, so other people working with the repository will not be
> able to use the submodule and have to change the URL first.
>
> Is there an actual rationale for including the username in the URL in
> this case, or is this just because it is simpler than removing it?
>
> One thing I noticed, is that automatically removing it would
> basically eliminate the convinience for the person who has been using
> that URL in the first place. If the username was removed every update
> would have to query the username again. Also having a username in the
> repo could be correct, in case this isn't a real user, but a role for
> using that repository.
* If the submodule repository is accessible without authentication, no
user specific URL should go into the repository.
* If the submodule repository is not accessible without authentication,
the user specific URL should not go into the repository either,
because of the problem you just described. (Sure, you could add a
"git submodule user", but..)
> Still I feel that having a username within a repository is hardly
> ever what someone wants and most often a mistake. For now I will try
> to educate everybody about this and fix all repositories where this
> goes wrong, but a better solution would be nice to have.
Git >= v1.7.9 comes with a credentials API and some helpers; see
commit abca927dbef2c310056b8a1a8be5561212b3243a
and following or the available documentation for credentials, e.g.:
https://raw.github.com/gitster/git/master/Documentation/git-credential-store.txt
In contrib, there's a helper for the OS X keychain:
https://github.com/gitster/git/tree/master/contrib/credential
If that's no option, you would have to go with netrc / url config
approach.
HTH.
prev parent reply other threads:[~2012-02-14 14:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 13:26 Git submodules with usernames in the URL Tillmann.Crueger
2012-02-14 14:55 ` Michael Schubert [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=4F3A75C8.5070201@elegosoft.com \
--to=mschub@elegosoft.com \
--cc=Tillmann.Crueger@telekom.de \
--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.
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 NNTP newsgroup(s).