-
Notifications
You must be signed in to change notification settings - Fork 1.2k
git url: support CSV form (also support verifying a tag with a commit hash) #5903
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
base: master
Are you sure you want to change the base?
Conversation
} | ||
if isHTTPSourceV { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Use git show --ignore-all-space
to review)
🤔 Wondering why we use the fragment here actually. Wouldn't query parameters make more sense, since there's actually a way of having multiple params there? So instead:
It just feels a bit odd to overload the |
Query params doesn't seem correct here, as it would be sent to the server as an HTTP GET request |
@@ -6,6 +6,7 @@ const AttrAuthHeaderSecret = "git.authheadersecret" | |||
const AttrAuthTokenSecret = "git.authtokensecret" | |||
const AttrKnownSSHHosts = "git.knownsshhosts" | |||
const AttrMountSSHSock = "git.mountsshsock" | |||
const AttrCommitHash = "git.commithash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Bikeshedding: this could be also named AttrGitChecksum
to follow AttrHTTPChecksum
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tonistiigi Which one do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should include existing features like keep-git-dir, #4905 (comment) . Also #4974 seems like a simple addition.
What if a branch/tag starts with #
?
Can be another PR?
Can be another PR? Maybe not as easy as
|
CSV parameters can be now specified after "##" in a git URL. e.g., https://github.com/user/repo.git##ref=v1.0.0,subdir=/dir Fix issue 4905, but the syntax differs from the original proposal. The documents will be added in https://github.com/docker/docs/blob/main/content/manuals/build/concepts/context.md#url-fragments Signed-off-by: Akihiro Suda <[email protected]>
e.g., https://github.com/user/repo.git##ref=mytag,commit=cafebab Fix issue 5871 Signed-off-by: Akihiro Suda <[email protected]>
Commit 1: git url: support CSV form
CSV parameters can be now specified after "##" in a git URL. e.g.,
Fix #4905, but the syntax differs from the original proposal.
The documents will be added in
https://github.com/docker/docs/blob/main/content/manuals/build/concepts/context.md#url-fragments
Commit 2: git url: support specifying ref and commit together
Fix #5871