bt
bt copied to clipboard
Running bt-watch against an invalid repository crashes hard
Invalid directory:
$ bt-watch --debug x
D, [2011-07-12T18:02:03.191200 #94329] DEBUG -- : /usr/local/bin/git --git-dir=/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git clone --bare --shared x /var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git
D, [2011-07-12T18:02:03.197165 #94329] DEBUG -- :
D, [2011-07-12T18:02:03.197615 #94329] DEBUG -- : fatal: repository 'x' does not exist
D, [2011-07-12T18:02:03.198127 #94329] DEBUG -- : /usr/local/bin/git --git-dir=/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git remote
D, [2011-07-12T18:02:03.203526 #94329] DEBUG -- :
D, [2011-07-12T18:02:03.203630 #94329] DEBUG -- : fatal: Not a git repository: '/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git'
D, [2011-07-12T18:02:03.203779 #94329] DEBUG -- : /usr/local/bin/git --git-dir=/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git remote add origin x
D, [2011-07-12T18:02:03.207464 #94329] DEBUG -- :
D, [2011-07-12T18:02:03.207562 #94329] DEBUG -- : fatal: Not a git repository: '/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git'
/Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/grit-2.4.1/lib/grit/git.rb:311:in `native': Command exited with 128: /usr/local/bin/git --git-dir=/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94329-1l9tl7q.git remote add origin x (Grit::Git::CommandFailed)
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/grit-2.4.1/lib/grit/git.rb:325:in `method_missing'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:72:in `remote_add'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:53:in `block (2 levels) in mirror'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:90:in `block in initialize'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:90:in `chdir'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:90:in `initialize'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:51:in `new'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:51:in `block in mirror'
from /Users/scott/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:49:in `mirror'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/bin/bt-watch:42:in `<top (required)>'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/bin/bt-watch:19:in `load'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/bin/bt-watch:19:in `<main>'
Invalid URL:
$ bt-watch --debug git://host/repo.git
D, [2011-07-12T18:02:30.395106 #94334] DEBUG -- : /usr/local/bin/git --git-dir=/var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94334-5k027n.git clone --bare --shared git://host/repo.git /var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94334-5k027n.git
D, [2011-07-12T18:02:30.494888 #94334] DEBUG -- : Cloning into bare repository /var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94334-5k027n.git...
D, [2011-07-12T18:02:30.495071 #94334] DEBUG -- : fatal: Unable to look up host (port 9418) (nodename nor servname provided, or not known)
/Users/scott/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:692:in `lstat': No such file or directory - /var/folders/mn/mn-Xv8g8HyahvL5EPn89RU+++TQ/-Tmp-/bt20110712-94334-5k027n.git (Errno::ENOENT)
from /Users/scott/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:692:in `remove_entry_secure'
from /Users/scott/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/tmpdir.rb:85:in `ensure in mktmpdir'
from /Users/scott/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/tmpdir.rb:85:in `mktmpdir'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:49:in `mirror'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/bin/bt-watch:42:in `<top (required)>'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/bin/bt-watch:19:in `load'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/bin/bt-watch:19:in `<main>'
At the very least, we should do what bt-go does:
$ bt-go
/Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/grit-2.4.1/lib/grit/repo.rb:51:in `initialize': /Users/scott/Projects/bt/x (Grit::InvalidGitRepositoryError)
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:88:in `new'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/lib/bt/git.rb:88:in `initialize'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/bin/bt-go:25:in `new'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/gems/build-thing-0.0.1/bin/bt-go:25:in `<top (required)>'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/bin/bt-go:19:in `load'
from /Users/scott/.rvm/gems/ruby-1.9.2-p180@bt/bin/bt-go:19:in `<main>'