Skip to content

Add option to push object ID(s) directly. - #449

Merged
technoweenie merged 13 commits into
git-lfs:masterfrom
larsxschneider:lars/push-object-ids
Jul 6, 2015
Merged

technoweenie merged 13 commits into
git-lfs:masterfrom
larsxschneider:lars/push-object-ids

Conversation

@larsxschneider

Copy link
Copy Markdown
Member

Adds a new option "--objectid" to the push command to upload objects generated by BFG. Click here for an example how to use it with BFG.

Note:
I am learning golang. Please point out to me anything that could be improved. Even if pedantic 😄

Comment thread lfs/upload_queue.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I'd rather have NewUploadable just respect a "" filename, instead of a new function.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok 29f6944
although I am not particular happy with the variable name pathForStats. Ideas appreciated 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

statsPath ?

On Mon, Jul 6, 2015 at 5:07 AM, Lars Schneider [email protected]
wrote:

In lfs/upload_queue.go
#449 (comment):

@@ -34,6 +34,20 @@ func NewUploadable(oid, filename string, index, totalFiles int) (*Uploadable, *W
return &Uploadable{oid: oid, OidPath: path, Filename: filename, size: fi.Size()}, nil
}

+func NewUploadableWithoutFilename(oid string) (*Uploadable, *WrappedError) {

ok ce20dd4
ce20dd4
although I am not particular happy with the variable name pathForStats.
Ideas appreciated [image: 😄]

—
Reply to this email directly or view it on GitHub
https://github.com/github/git-lfs/pull/449/files#r33924229.

Rick Olson

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok 431db15

@technoweenie

Copy link
Copy Markdown
Contributor

Other than my comments above, I'm 👍 on this. Curious what others think though.

Comment thread lfs/upload_queue.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could replace this with:

pathForStats := localMediaPath

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks! I am still learning go 😄!
92ea3b5

@larsxschneider
larsxschneider force-pushed the lars/push-object-ids branch from b7d31bd to c84c7d0 Compare July 6, 2015 11:49
Comment thread test/testhelpers.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This helper isn't saving any lines of code, and only obscures the simple unix command. I'd rather keep the tests straight forward as much as possible.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It doesn't save any lines, but I think it makes this assert easier to read and use. Anyways, I want this PR merged therefore I will revert this change 😩

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fixed dee8383

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"easier to read and use" really depends on the context. In this case I'm preferring short shell commands to extra overhead from helpers. Thanks for reverting.

Comment thread commands/command_push.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we toss a tracerx line in here similar to the above function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed. However checking_asset doesn't seem right to me. Is is ok if I rename it to prepare upload ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

alright!
08c00bb
853e114

@rubyist

rubyist commented Jul 6, 2015

Copy link
Copy Markdown
Contributor

👍 from me, seems like it'll be some useful tooling

@technoweenie

Copy link
Copy Markdown
Contributor

Thanks for hanging in there, @larsxschneider :)

technoweenie added a commit that referenced this pull request Jul 6, 2015
Add option to push object ID(s) directly.
@technoweenie
technoweenie merged commit 63f9449 into git-lfs:master Jul 6, 2015
This was referenced Jul 6, 2015
@michael-k

Copy link
Copy Markdown
Contributor

@larsxschneider Can you update docs/man/git-lfs-push.1.ronn accordingly?

@larsxschneider

Copy link
Copy Markdown
Member Author

@michael-k Thanks for the hint. I will fix it ASAP.

technoweenie added a commit that referenced this pull request Jul 22, 2015
Backport #449 for v0.5.x: Add option to push object ID(s) directly.
@technoweenie

Copy link
Copy Markdown
Contributor

Since I'm prepping a new release, I went ahead and did it: #509

Though this makes me consider making it a boolean flag in v0.6.x:

$ git lfs push <remote> --object-id="oid1 oid2 oid3"

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.

4 participants