Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support remote.name.pushurl correctly to fix #945 #949

Merged
merged 2 commits into from Jan 29, 2016

Conversation

sinbad
Copy link
Contributor

@sinbad sinbad commented Jan 25, 2016

Fixes #945

Right now git-lfs ignores the use of 'remote.[name].pushurl' in asymmetrical pull/push situations (within a single remote). This PR changes the way Endpoints are built so that the operation ("download" or "upload") is taken into account and the pushurl is used as a basis instead of the url when pushing. This avoids git-lfs behaving inconsistently with Git itself & the resulting confusion.

Also add support for 'remote.[name].lfspushurl' and global 'lfs.pushurl' so that push versions of urls are supported everywhere you might configure them.

This also affects the Access flags which are stored & looked up alongside the correct url based on whether you're pulling or pushing, in case the 2 urls have different auth mechanisms.

Also support separate remote.name.lfspushurl and global lfs.pushurl
to support asymmetrical pull/push in all cases
@@ -51,7 +51,8 @@ func getCredsForAPI(req *http.Request) (Creds, error) {
}

func getCredURLForAPI(req *http.Request) (*url.URL, error) {
apiUrl, err := Config.ObjectUrl("")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped ObjectUrl because it seems defunct except for this check, where it doesn't even use an oid. Seems it's just looking for a base api url to look up the creds for and Endpoint does that.

technoweenie added a commit that referenced this pull request Jan 29, 2016
Support remote.name.pushurl correctly to fix #945
@technoweenie technoweenie merged commit b5e636e into git-lfs:master Jan 29, 2016
@technoweenie
Copy link
Contributor

Thanks for tackling this! I tend to forget pushurl exists.

@sinbad sinbad deleted the support-remote-pushurl branch February 1, 2016 09:37
This was referenced Feb 2, 2016
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Oct 16, 2023
Our Server Discovery documentation describes how we form Git LFS
server API endpoint URLs based on Git remotes and other Git and Git LFS
configurations.  This documentation was introduced in commit
21e1695 of PR git-lfs#1641 and has only
been lightly modified since then.

As discusssed in issue git-lfs#5528, we append "/info/lfs" to Git remote URLs,
but only after rewriting those URLs according to any "url.{name}.insteadOf"
configurations, which is somewhat counter to what is implied by Git's
own documentation of these settings.  We may change this behaviour
in a future Git LFS major release.  For the present, though, we simply
add a fuller description of how we convert Git remote URLs into Git LFS
API server URLs to our documentation, specifically touching on the
sequence in which we rewrite, convert, and append the "/info/lfs"
path segments to the remote URLs.

In PR git-lfs#3748 we added support for Git LFS endpoints defined by "file://"
URLs, and in PR git-lfs#3918 we enhanced this by also accepting local file paths
in remote URLs, so we also include comments on how we handle these
cases in our new documentation.

Further, although support for distinct URLs used only for upload operations
has existed since PR git-lfs#949, it is not mentioned in our Server Discovery
documentation, so we add notes on this feature now as well.

4469 - default remotes (lfsdefault, lfspushdefault)
5066 - autodetect, searchall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants