danhper / fundle

A minimalist package manager for fish shell
MIT License
375 stars 22 forks source link

Upgrade attempts state the packages are not git repositories #15

Closed nesl247 closed 8 years ago

nesl247 commented 8 years ago

When running fundle install -u I receive the following

Upgrading tuvistavie/oh-my-fish-core
fatal: Not a git repository (or any of the parent directories): .git
Upgrading junegunn/fzf
fatal: Not a git repository (or any of the parent directories): .git
Upgrading oh-my-fish/plugin-grc
fatal: Not a git repository (or any of the parent directories): .git
Upgrading oh-my-fish/theme-robbyrussell
fatal: Not a git repository (or any of the parent directories): .git
Upgrading tuvistavie/fish-completion-helpers
fatal: Not a git repository (or any of the parent directories): .git
danhper commented 8 years ago

Hi, thank you for reporting. I am going to take a look. In the meanwhile, if you really need to update just delete ~/.config/fish/fundle and run fundle install.

danhper commented 8 years ago

I just tried to reproduce the issue, but I could not.

I tried in a fresh Ubuntu box with the following config.fish

fundle plugin 'tuvistavie/oh-my-fish-core'
fundle plugin 'junegunn/fzf'
fundle plugin 'oh-my-fish/plugin-grc'
fundle plugin 'oh-my-fish/theme-robbyrussell'
fundle plugin 'tuvistavie/fish-completion-helpers'
fundle init

Have you done anything that could have deleted the .git directory in the plugins directory? Also, do you have any symlink under .config/fish, I do not think it should be an issue, but maybe it could help reproducing. By the way, do you still get the error if you remove ~/.config/fish/fundle and run fundle install then fundle install -u again?

Thank you!

nesl247 commented 8 years ago

After performing a rm -rf ~/.config/fish/fundle and then fundle install, I receive

Installing tuvistavie/oh-my-fish-core
fatal: Not a git repository (or any of the parent directories): .git
Installing junegunn/fzf
fatal: Not a git repository (or any of the parent directories): .git
Installing oh-my-fish/plugin-grc
fatal: Not a git repository (or any of the parent directories): .git
Installing oh-my-fish/theme-robbyrussell
fatal: Not a git repository (or any of the parent directories): .git
Installing tuvistavie/fish-completion-helpers
fatal: Not a git repository (or any of the parent directories): .git

I do not have any symlinks under ~/.config/fish.

nesl247 commented 8 years ago

This is my config.fish if it helps.

fundle plugin 'tuvistavie/oh-my-fish-core'
fundle plugin 'junegunn/fzf'
fundle plugin 'oh-my-fish/plugin-grc'
fundle plugin 'oh-my-fish/theme-robbyrussell'
fundle plugin 'tuvistavie/fish-completion-helpers'

fundle init

# Custom Path
set -x GOPATH $HOME/.go
set -x PATH /usr/local/opt/coreutils/libexec/gnubin ~/Code/scripts ~/.composer/vendor/bin $GOPATH/bin $PATH
set -x EDITOR (which vim)
set -x MANPATH /usr/local/opt/coreutils/libexec/gnuman /usr/local/share/man /usr/share/man

# Sets LS back to default with GRC plugin
set grcplugin_ls --indicator-style=classify --color -xh

# Aliases
alias hcomposer "hhvm /usr/local/bin/composer"

# fasd support
#function -e fish_preexec _run_fasd
#  fasd --proc (fasd --sanitize "$argv") > "/dev/null" 2>&1
#end

#function z
#  builtin cd (fasd -d -e 'printf %s' "$argv")
#end

#complete -c z --no-files -a (printf "%s " (fasd -ld))

# Command history searching with ctrl + r
function fish_user_key_bindings
#  bind \cr 'peco_select_history (commandline -b)'
  bind \cr 'fh'
end

# enhancd
set -gx ENHANCD_FILTER fzf
source $HOME/.enhancd/fish/enhancd.fish
alias z cd::cd

# iTerm2 integration
test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish

# Temporary
if not available hub
  echo "🐎  Please install 'hub' first!"
else
  eval (hub alias -s)
end
danhper commented 8 years ago

Thank you very much for the details. I am going to take a look.

nesl247 commented 8 years ago

I tracked it down to the line in the install function that deals with checking out a specific sha. That's where the error occurs. I am also running fish from HEAD. I just reinstalled it right now to make sure I am at the very latest commit.

danhper commented 8 years ago

Thanks for the details. I just tried building fish from master and using your config.fish but still could not reproduce, I wonder where this error comes from. Maybe it could be an issue with git version?

This is what I got in the box I used to try to reproduce this issue.

➜  fish-shell git --version
git version 1.9.1
hub version 2.2.3

I do not have an OSX machine to try on, so I will give it a try on OSX tomorrow if we do not found a solution until then.

Thank you for helping tracking this down!

danhper commented 8 years ago

I suspect the git work-tree or git-dir option is not working as expected, which would explain the message, but this feature has been in git for quite a while, so maybe an old version of hub could create the issue?

nesl247 commented 8 years ago

I attempted to use the two options and I could complete a status properly. It shouldn't be an issue with git itself (I'm on 2.7.1 iirc). I suspect for some reason that the command is not getting the proper full path for $git_dir. If you notice the error, it only shows .git as the directory, which is odd.

nesl247 commented 8 years ago

Ok, so I narrowed the issue down extremely. Hub is causing checkout to not work while using --git-dir. When specifying the checkout command manually using /usr/local/bin/git instead of just git, it works.

nesl247 commented 8 years ago

Sorry to spam the thread, but I think I found the issue https://github.com/github/hub/commit/40e0cd22fd141d9b98bb69626f338f4fd9d581af. I'm going to close this issue as it's definitely a bug in hub. Thanks so much!

danhper commented 8 years ago

Great you could track down the issue, and thank you for reporting!