Skip to content

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.

git/git.go Outdated
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.

👍

@technoweenie technoweenie merged commit 3598328 into master Apr 8, 2016
@technoweenie technoweenie deleted the skip-pre-push-dupes-2 branch April 8, 2016 16:19
@technoweenie technoweenie mentioned this pull request Apr 11, 2016
17 tasks
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.

3 participants