Commit Graph

45 Commits

Author SHA1 Message Date
Taylor Blau
4593d0a641 vendor: vendor dependencies in vendor/ using Glide
- script/vendor received an update in order to work with Glide
- import paths have been rewritten to work with GO15VENDOREXPERIMENT
2016-05-23 12:10:35 -06:00
Steve Streeting
c4bbd3724e Major refactor to pull things into config, httputil, tools
Mainly required to avoid cyclical dependencies when separating other things
2016-05-13 17:38:06 +01:00
risk danger olson
231686eae3 refactor *uploadContext, separate lib responsibilities vs cli responsibilities 2016-04-07 10:52:24 -06:00
risk danger olson
abd9b1e456 introduce an uploadContext struct to share in push and pre-push 2016-04-06 13:06:34 -06:00
Steve Streeting
825cf2e708 Merge pull request #1118 from github/scanner-async-errors
Catch previously undetected errors from git exit codes in async scans
2016-04-05 14:21:11 +01:00
Steve Streeting
10a4fb8058 Fix old bug in pre-push hook; would never detect delete branch calls
Reason is that although the first entry in the line is "(delete)", the
check occurs on the result which only includes the SHAs; this is actually
all zeroes in the delete case. This was silently failing before we
error checked more rigorously.
2016-03-31 15:21:20 +01:00
risk danger olson
d52b9832bb better handling on push errors 2016-02-24 11:49:25 -07:00
risk danger olson
6812d0bd01 Backport better-errors from #1023 to release-1.1 2016-02-23 10:57:33 -07:00
risk danger olson
090944ed95 actually print non-fatal errors 2016-02-23 09:11:52 -07:00
risk danger olson
3f89436fd5 validate remote name in pre-push too 2016-02-03 14:23:27 -07:00
risk danger olson
9c3307909b try a merge out 2015-11-09 10:46:29 -07:00
risk danger olson
c3bc64b15f Fixes a race condition accessing the maps inside goroutines 2015-10-28 10:06:36 -06:00
Steve Streeting
cdee4998ac Add StringSet to replace use of map[string]struct{} directly
Tidier and frequently used.
2015-10-02 09:44:27 -07:00
rick
795a1ebc0e remove all Short messages 2015-09-17 16:08:28 -06:00
Rick Olson
0a7e94c6b3 hide the download check queue.
we don't need the output for push or pre-push
2015-09-09 16:27:59 -06:00
rick
ffca2e08ba update push dry-run output so paths and oids line up. 2015-09-08 14:47:13 -06:00
Steve Streeting
6c98f395a2 Refactor to reduce size of nested code in for loop 2015-09-07 15:44:45 +01:00
Steve Streeting
822249a49a Continue rather than return when encountering delete branch in pre-push 2015-09-07 15:44:45 +01:00
Steve Streeting
d7589752a9 Fix pre-push hook when multiple branches are pushed in one git push 2015-09-07 15:44:44 +01:00
Steve Streeting
972efa6303 Go 1.5 fix: Use sync channel, not just queue.Wait() to ensure xfers done
Go 1.5 is genuinely parallel and we cannot guarantee that the transfer
channel from TransferQueue is fully read from before q.Wait() returns;
they can be parallel. Instead use our own sync channel on the closing
of the transfer channel.
2015-09-02 16:49:42 +01:00
rubyist
c57a8992e2 Error context can hold any kind of data, simplify the cleanPointerError 2015-08-28 12:08:57 -04:00
rubyist
e434980035 Merge branch 'master' into errors 2015-08-27 11:20:04 -04:00
Steve Streeting
41cdd013c2 Add oids to push --dry-run output otherwise can't see modifications 2015-08-26 17:47:11 +01:00
rubyist
187c6cb6e1 wErr -> err 2015-08-21 14:31:06 -04:00
rubyist
cd754db91a First pass at getting rid of WrappedError 2015-08-21 11:50:02 -04:00
Billy Gor
f3bf4ea90b major pre-push optimization
this change improves drastically pre-push behaviour, by not sending
lfs objects which are already on a remote. Works perfectly with
pushing new branches and tags.

currently pre-push command analyse "local sha1" vs "remote sha1" of the
ref being pushed and if "remote sha1" is available locally tries to send
only lfs objects introduced with new commits.

why this is broken:
- remote branch might have moved forward (local repo is not up to date).
  In this case you have no chance to isolate new lfs objects ("remote sha1"
  does not exist locally) and git-lfs sends everything from the local
  branch history.
- remote branch does not exist (or new tag is pushed). Same consequences.

But what is important - local repository always have remote references,
from which user created his local branch and started making some local
changes. So, all we have to do is to identify new lfs objects which do
not exist on remote references. And all this can be easily achieved with
the same all mighty git rev-list command.

This change makes git-lfs usable with gerrit, where changes are uploaded
by using magic gerrit branches which does not really exist. i.e.
git push origin master:refs/for/master

in this case "refs/for/master" does not exist and git feeds all 0-s as
"remote sha1".
2015-08-17 10:59:08 +02:00
Steve Streeting
a7d0a36ecb Re-use code between DownloadCheckable and Downloadable
Renamed Checkable to DownloadCheckable because it only applies to download,
upload checks differently and uses different struct fields. Incorporated
with download_queue.go since code is now smaller & common.
2015-08-13 09:33:01 +01:00
Steve Streeting
a94e2a9937 Change the approach, listen on q.Watch() instead since errors not reliable in batch mode
In batch mode you don't get an error from a missing Check(), you just get
a lack of download link (get an upload link instead). Therefore the only
reliable way to judge whether Check() worked is to check the transfer chan.

Also add tests for batch mode to prove this works
2015-08-12 17:36:40 +01:00
Steve Streeting
9f54872176 Rename verify_queue to check_queue to eliminate ambiguity 2015-08-12 11:41:54 +01:00
Steve Streeting
d8a7fb0f3b Make error reporting consistent with previous so tests pass 2015-08-12 11:21:41 +01:00
Steve Streeting
92ef7a1f14 Working on using a VerifyQueue to check oid server presence without downloading 2015-08-11 18:07:41 +01:00
rubyist
46249c9dd4 While I'm in here, this value is always the same, push it down 2015-07-30 10:43:50 -04:00
rubyist
b87386d705 Bake in dry-run-ability and we'll never forget to suppress output 2015-07-30 10:23:01 -04:00
rubyist
20e8a58e1e refine progress output
Go back to requiring a count and size up front, but better track and
display files that are skipped because they don't need to transfer. This
makes it easier to judge what is happening based on the progress output.
2015-07-27 16:41:57 -04:00
rubyist
ab5b35a8c0 Progress meter needs to be more dynamic for batches of n
This removes the `pb` based progress bar for the transfer queue and add
a simpler custom bar. pb really wants to know total counts and byte
sizes up front but when doing batches of n we would prefer to not know
that. This is due to the fact that the batcher will block until it is
drained instead of processing all pointers and storing them in memory
while transfer operations run. This also clarifies when files are
skipped because the server already has them. Progress output here
contains the number of finished transfers/bytes, the number of
transfers/bytes currently in the queue, and the number of files skipped,
if any.
2015-07-27 12:43:41 -04:00
rubyist
38d14c27b5 First pass at extracting progress meter 2015-07-10 15:26:45 -04:00
rubyist
94ecd166e4 Start integrating batcher into transfer queue
Progress bar output temporarily removed, some things still broken
2015-07-09 14:21:49 -04:00
Rick Olson
a7db703c29 merge master 2015-07-06 11:08:38 -06:00
Rick Olson
4b1dd8a7c4 merge master again 2015-07-06 10:57:19 -06:00
Lars Schneider
d52b1880ae Remove unnecessary parameters from NewUploadable function. 2015-07-06 13:48:53 +02:00
Rick Olson
548080154f add options object to ref scanner 2015-07-05 12:18:03 -06:00
Rick Olson
8b3fa6aec1 change message when lfs object is missing 2015-06-28 07:43:28 -06:00
Rick Olson
e2c7d0d186 merge master 2015-05-28 11:52:06 -06:00
rubyist
22d3f4e6d6 Merge branch 'master' into multitransfer
Conflicts:
	lfs/pointer_smudge.go
	lfs/upload_queue.go
2015-05-21 13:47:52 -04:00
rubyist
bf10519579 Naming consistency 2015-05-13 11:27:30 -04:00