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

push optimizations (take 2) #1128

Merged
merged 7 commits into from Apr 8, 2016
Merged

push optimizations (take 2) #1128

merged 7 commits into from Apr 8, 2016

Conversation

technoweenie
Copy link
Contributor

This PR brings back the push optimizations from #1040. Hit up #1040 and #1071 to get the original context. This makes a few changes based on feedback:

@technoweenie
Copy link
Contributor Author

@dluksza: I applied #969 on top of this in https://github.com/github/git-lfs/compare/skip-pre-push-dupes-2...include-refs-in-transfers?expand=1. Still working on it :)

I wouldn't check that branch out yet, I plan to rebase it against this PR once it's merged.

return nil, fmt.Errorf("Failed to call git show-ref: %v", err)
}
cmd.Start()
defer cmd.Wait()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think any error from cmd.Wait() should be returned at the end. (edit) ideally with the contents of stderr, that's proving important in diagnosing git errors instead of getting the generic exit code 128

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0935817.

@sinbad
Copy link
Contributor

sinbad commented Apr 7, 2016

👍 just stylistic & potential optimisation comments from me. This is a really big improvement for overlapping refs.

@technoweenie
Copy link
Contributor Author

Big refactor in 0935817 taking most of your feedback into account.

  • A commands.uploadContext has one main responsibility now: build an lfs.TransferQueue to upload a set of objects, ignoring objects that have been uploaded already in the same process.
  • A commands.uploadContext only creates fewer slices when filtering pointers to upload.
  • commands.upload() handles dry run behavior vs real behavior, and all the cli error handling for it.

@sinbad
Copy link
Contributor

sinbad commented Apr 8, 2016

👍 Like it, lots of iteration has collapsed too & I like the new methods. I have maybe one more suggestion but it's optional, this would be fine.


// AddUpload adds the given oid to the set of oids that have been uploaded in
// the current process.
func (c *uploadContext) AddUpload(oid string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit picky comment: AddUpload sounds like a request to add an upload to be done, how about either AddUploaded or SetUploaded to match HasUploaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants