technicalpickles / homesick

Your home directory is your castle. Don't leave your dotfiles behind.
MIT License
2.39k stars 125 forks source link

Crash with the symlink command #112

Closed nickserv closed 10 years ago

nickserv commented 10 years ago

This may have been caused by some of our recent refactoring work. In case you're curious, I'm currently on 41f3f9d374 and I'm using https://github.com/nicolasmccurdy/dotfiles for testing.

~/Repos/homesick → git status
## master...origin/master
~/Repos/homesick → bundle exec rake install
[warnings redacted]
  Successfully built RubyGem
  Name: homesick
  Version: 1.0.0
  File: homesick-1.0.0.gem
Executing "ruby -S gem install ./pkg/homesick-1.0.0.gem":
ruby -S gem install ./pkg/homesick-1.0.0.gem
Successfully installed homesick-1.0.0
1 gem installed
~/Repos/homesick → homesick symlink
   identical  /Users/nick/.ackrc
   identical  /Users/nick/.aliases
   identical  /Users/nick/.awesomerc.lua
   identical  /Users/nick/.bashrc
   identical  /Users/nick/.conkyrc
   identical  /Users/nick/.gemrc
    conflict  /Users/nick/.gitconfig exists
/Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:136:in `collision_accepted?': undefined local variable or method `destination' for #<Homesick:0x007fa66421d6a0> (NameError)
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/actions.rb:164:in `handle_symlink_action'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/actions.rb:147:in `ln_s'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:184:in `block in symlink_each'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:171:in `block (2 levels) in each_file'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:145:in `each'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:145:in `block in each_file'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:184:in `block in inside'
    from /usr/local/Cellar/ruby/2.1.1_1/lib/ruby/2.1.0/fileutils.rb:125:in `chdir'
    from /usr/local/Cellar/ruby/2.1.1_1/lib/ruby/2.1.0/fileutils.rb:125:in `cd'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:184:in `inside'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:141:in `each_file'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick/utils.rb:183:in `symlink_each'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick.rb:135:in `block in link'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:184:in `block in inside'
    from /usr/local/Cellar/ruby/2.1.1_1/lib/ruby/2.1.0/fileutils.rb:125:in `chdir'
    from /usr/local/Cellar/ruby/2.1.1_1/lib/ruby/2.1.0/fileutils.rb:125:in `cd'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:184:in `inside'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/lib/homesick.rb:131:in `link'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/nick/.gem/ruby/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/nick/.gem/ruby/2.0.0/gems/homesick-1.0.0/bin/homesick:9:in `<top (required)>'
    from /Users/nick/.gem/ruby/2.0.0/bin/homesick:23:in `load'
    from /Users/nick/.gem/ruby/2.0.0/bin/homesick:23:in `<main>'
nickserv commented 10 years ago

This is not an issue on v1.0.0. I'm going to try using git-bisect on this.

JCook21 commented 10 years ago

@nicolasmccurdy can you write a spec test that fails? That should then make it easier to work on this issue with git bisect.

nickserv commented 10 years ago

I was originally just going to try running homesick symlink manually or with a bisect script, but I think it would be a great idea to write regression tests for this. I'll hopefully have a pull request ready, and a fix if I figure it out soon.