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 pushInsteadOf aliases when determining endpoints #3353

Merged
merged 4 commits into from
Nov 2, 2018

Conversation

bk2204
Copy link
Member

@bk2204 bk2204 commented Oct 31, 2018

Git understands how to specify aliases that differ between fetch and pull by using pushInsteadOf aliases. This series introduces support for this type of alias in Git LFS so that we can authenticate to the right endpoint when performing a push, as the user intended.

The first patch updates various callers; the second and third patches split out functions and should have no functional changes. The fourth patch introduces the new alias support. Note that we use the same mutex for protecting all the aliases since there's no reason to distinguish between them.

This fixes #2433.

In a future commit, we're going to need to know the operation when
performing Git URL replacement, so ensure that the operation is passed
whenever we're creating an endpoint.
In a future commit, we're going to handle both regular and push aliases,
so split the storage out into a separate function to avoid repetition.
This commit should introduce no functional change.
In a future commit, we'll be replacing multiple types of aliases.
Split out most of the URL alias replacement code into a separate
function.  Make that function additionally return a boolean indicating
whether a replacement occurred.

This commit should have no functional change.
For pushes, Git looks at both the insteadOf and pushInsteadOf aliases,
and uses the latter in preference to the former.  Teach Git LFS to honor
pushInsteadOf as well when uploading.
@bk2204 bk2204 requested a review from a team October 31, 2018 15:23
Copy link
Contributor

@ttaylorr ttaylorr left a comment

Choose a reason for hiding this comment

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

This looks great, thanks!

@bk2204 bk2204 merged commit e365f7c into git-lfs:master Nov 2, 2018
@bk2204 bk2204 deleted the pushinsteadof branch November 2, 2018 15:05
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.

git-lfs asks for a password for SSH push urls with an HTTPS fetch url
2 participants