Thanks to visit codestin.com
Credit goes to github.com

Skip to content

push optimizations (take 2)#1128

Merged
technoweenie merged 7 commits into
masterfrom
skip-pre-push-dupes-2
Apr 8, 2016
Merged

push optimizations (take 2)#1128
technoweenie merged 7 commits into
masterfrom
skip-pre-push-dupes-2

Conversation

@technoweenie

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread git/git.go Outdated
return nil, fmt.Errorf("Failed to call git show-ref: %v", err)
}
cmd.Start()
defer cmd.Wait()

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 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
Copy Markdown
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

sinbad commented Apr 7, 2016

Copy link
Copy Markdown
Contributor

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

@technoweenie

Copy link
Copy Markdown
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

sinbad commented Apr 8, 2016

Copy link
Copy Markdown
Contributor

👍 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.

Comment thread commands/uploader.go Outdated

// 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
Copy Markdown
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
Copy Markdown
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.

2 participants