Skip to content

include ref in upload request - #1456

Closed
technoweenie wants to merge 10 commits into
masterfrom
dluksza-include-ref-in-upload-request
Closed

technoweenie wants to merge 10 commits into
masterfrom
dluksza-include-ref-in-upload-request

Conversation

@technoweenie

@technoweenie technoweenie commented Aug 16, 2016 •

Copy link
Copy Markdown
Contributor

Updates #969 against the current master. This was not a straight forward update because the code base has gone through a pretty major refactoring since then.

To-do:

  • Ensure we're always sending full server side refs: refs/tags/v1.0, refs/heads/master. Never client ref names.
  • Integration tests that test git lfs push, git lfs fetch on repos where the local and remote branches don't match.

dluksza and others added 10 commits February 3, 2016 12:17
Adds "ref" parameter extracted from git pre-push hook into the upload
request. This way servers with branch access permissions can enforce
them before large objects are transfered.

Issue: #845
In push hook refs comes from user and points to local
branches. Transporting them to server doesn't make sense.
Don't add empty "ref" parameter to the lfs-request object when its value
is empty.
Instead of passing around additional string parameter with destination
ref, we pass special struct called UploadMetadata.

For now UploadMetadata contains only ref field but in the future more
metadata like file name (or path) can be added.
Move "ref" property of batch request into "meta" object, this way all
meta data have a common place to live instead of being spread all around
the batch request.
Since we also want to have metadata included in fetch request the
UploadMetadata struct is renamed to TransferMetadata.

Patch that adds metadata to fetch request will follow.
Include meta.ref property in download request object, same as it is in
the upload request.

In case of download meta.ref contain name of currently check out local
branch and can be only a suggestion to server implementation.
Normalize the value of meta.ref parameter of batch request
object. Previously ref parameter format differs between "download" and
"upload" objects.

The "upload" always was using the fully qualified branch
name (eg. refs/heads/master), when the "download" used short
name (eg. master).

Right now meta.ref will have consistent values. When "refs/heads/"
prefix will be appended when it is not present. Special "HEAD" reference
will be replaced with empty string, which will result in meta.ref
parameter not being included in the request object.
moved lfs.TransferMetadata to api.BatchMetadata to remove cyclical
dependency
@ttaylorr

Copy link
Copy Markdown
Contributor

Are the checkboxes to-do items?

@technoweenie

Copy link
Copy Markdown
Contributor Author

Yup. Add to it if you think of anything else.

@ttaylorr

ttaylorr commented May 1, 2017

Copy link
Copy Markdown
Contributor

Tentatively milestone-ing this into v2.2.0 per #2190 (comment).

@technoweenie

Copy link
Copy Markdown
Contributor Author

Superseded by #2706

@technoweenie
technoweenie deleted the dluksza-include-ref-in-upload-request branch October 31, 2017 17:33
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.

3 participants