modulesync icon indicating copy to clipboard operation
modulesync copied to clipboard

unable to use msync on already checked out module

Open bastelfreak opened this issue 8 years ago • 4 comments

I'm not sure if I'm using it wrong or if it is really broken: I've synced the zabbix module in the past, it is already checked out at modules/puppet-zabbix. I'm unable to do a new modulesync:

$ bundle exec msync update -f zabbix --message "modulesync 0.8.1" 
Syncing puppet-zabbix
Overriding any local changes to repositories in ./modules
Creating local branch modulesync from origin/modulesync
bundler: failed to load command: msync (/home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/bin/msync)
Git::GitExecuteError: git '--git-dir=/home/bastelfreak/modulesync_config/modules/puppet-zabbix/.git' '--work-tree=/home/bastelfreak/modulesync_config/modules/puppet-zabbix' checkout 'origin/modulesync'  2>&1:error: pathspec 'origin/modulesync' did not match any file(s) known to git.
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/git-1.3.0/lib/git/lib.rb:937:in `command'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/git-1.3.0/lib/git/lib.rb:644:in `checkout'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/git-1.3.0/lib/git/base.rb:306:in `checkout'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync/git.rb:23:in `switch_branch'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync/git.rb:54:in `block in pull'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync/git.rb:49:in `chdir'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync/git.rb:49:in `pull'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync.rb:61:in `block in run'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync.rb:57:in `each'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/lib/modulesync.rb:57:in `run'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/gems/modulesync-0.6.1/bin/msync:8:in `<top (required)>'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/bin/msync:23:in `load'
  /home/bastelfreak/modulesync_config/.vendor/ruby/2.3.0/bin/msync:23:in `<top (required)>'

I think the issue is that it tries to checkout a remote branch called modulesync, but it doesn't exist.

bastelfreak avatar Jun 26 '16 10:06 bastelfreak

Have you edited your gitconfig file at all? I remember igalic had a mysterious issue at some point due to his git config.

rski avatar Jun 26 '16 12:06 rski

My git config should be fine:

[user]
    email = [email protected]
    name = Tim Meusel
    signingkey = BF1C4CC0
[push]
  default = simple
[alias]
  # Usage: git signoff-rebase [base-commit]
  signoff-rebase = "!EDITOR='sed -i -re s/^pick/e/' sh -c 'git rebase -i $1 && while test -f .git/rebase-merge/interactive; do git commit --amend --signoff --no-edit && git rebase --continue; done' -"
  # Ideally we would use GIT_SEQUENCE_EDITOR in the above instead of EDITOR but that's not supported for git < 1.7.8.
  # See http://cat.pdx.edu/~hunner/git-lg.png for an example
  lg = "log --pretty=format:'%C(yellow)%h%C(reset) %C(blue)%an%C(reset) %C(cyan)%cr%C(reset) %s %C(green)%d%C(reset)' --graph --date-order"
[commit]
    gpgsign = true

bastelfreak avatar Jun 26 '16 13:06 bastelfreak

Have you tried a git clean -ffdx to make sure cached files aren't causing this?

Rob Nelson [email protected]

rnelson0 avatar Jun 26 '16 13:06 rnelson0

I have seen a similar issue when the module has msync'ed before and the resulting remote branch was removed post merge, I suspect that is the issue being seen here... to confirm removing modules/#{mod} should clear the issue.

james-powis avatar Jan 05 '17 04:01 james-powis