isacikgoz / gitbatch

manage your git repositories in one place
MIT License
1.54k stars 53 forks source link

gitbatch stays stuck (no new output) when run from $HOME #98

Closed teto closed 4 years ago

teto commented 4 years ago

I've packaged gitbatch for nixos since it looks exactly what I was looking for. It works in a folder with 5 repositories but when I run it in my $HOME which contains ~15/20 git repositories (with a few big ones kernel, nixpkgs, wireshark, several worktrees), it seems stuck. I am surprised it considers some dotfiles as directories as well ? (Ia have a few dotfiles that are symlinks to readonly files, maybe that confuses gitbatch ?).

➜ /nix/store/bbd0ihqs9cn092c77vkf9pr49shqii8y-gitbatch-0.5.0-bin/bin/gitbatch --log-level=trace                                                                                               ~
TRAC[0000] logging level has been set                    fields.level=trace
TRAC[0000] App configuration completed                  
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.irssi error="open /home/teto/.irssi: no such file or directory" file="<nil>"
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.steampath error="open /home/teto/.steampath: no such file or directory" file="<nil>"
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.wgetrc error="open /home/teto/.wgetrc: no such file or directory" file="<nil>"
TRAC[0000] Failed to open file in the directory          directory=/home/teto/bzImage_francois error="open /home/teto/bzImage_francois: no such file or directory" file="<nil>"
TRAC[0000] Failed to open file in the directory          directory=/home/teto/lkl error="open /home/teto/lkl: no such file or directory" file="<nil>"
TRAC[0000] Can't read directory                          directory=/home/teto/.Xauthority
TRAC[0000] Can't read directory                          directory=/home/teto/.Xdefaults
TRAC[0000] Can't read directory                          directory=/home/teto/.Xmodmap
TRAC[0000] Can't read directory                          directory=/home/teto/.apvlvinfo
TRAC[0000] Can't read directory                          directory=/home/teto/.bakerc
TRAC[0000] Can't read directory                          directory=/home/teto/.bash_login
TRAC[0000] Can't read directory                          directory=/home/teto/.bash_profile
TRAC[0000] Can't read directory                          directory=/home/teto/.bashrc
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.config/bash_completion.d error="open /home/teto/.config/bash_completion.d: no such file or directory" file="<nil>"
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.config/newsbeuter error="open /home/teto/.config/newsbeuter: no such file or directory" file="<nil>"
TRAC[0000] Can't read directory                          directory=/home/teto/.conkyrc
TRAC[0000] Can't read directory                          directory=/home/teto/.ctags
TRAC[0000] Can't read directory                          directory=/home/teto/.digrc
TRAC[0000] Can't read directory                          directory=/home/teto/.dmrc
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.dropbox/command_socket error="open /home/teto/.dropbox/command_socket: no such device or address" file="<nil>"
TRAC[0000] Failed to open file in the directory          directory=/home/teto/.dropbox/iface_socket error="open /home/teto/.dropbox/iface_socket: no such device or address" file="<nil>"
TRAC[0000] Can't read directory                          directory=/home/teto/.esd_auth
TRAC[0000] Can't read directory                          directory=/home/teto/.exports
TRAC[0000] Can't read directory                          directory=/home/teto/.fehbg
TRAC[0000] Can't read directory                          directory=/home/teto/.flentrc
TRAC[0000] Can't read directory                          directory=/home/teto/.gdbinit
TRAC[0000] Can't read directory                          directory=/home/teto/.gksu.lock
TRAC[0000] Can't read directory                          directory=/home/teto/.grip
TRAC[0000] Can't read directory                          directory=/home/teto/.grip-lame
TRAC[0000] Can't read directory                          directory=/home/teto/.gtk-bookmarks
TRAC[0000] Can't read directory                          directory=/home/teto/.gtkrc-2.0
TRAC[0000] Can't read directory                          directory=/home/teto/.history
TRAC[0000] Can't read directory                          directory=/home/teto/.lesshst
TRAC[0000] Can't read directory                          directory=/home/teto/.mailcap
TRAC[0000] Can't read directory                          directory=/home/teto/.mbsyncrc
TRAC[0000] Can't read directory                          directory=/home/teto/.neomuttdebug4
TRAC[0000] Can't read directory                          directory=/home/teto/.nix-channels
TRAC[0000] Can't read directory                          directory=/home/teto/.node_repl_history
TRAC[0000] Can't read directory                          directory=/home/teto/.npmrc
TRAC[0000] Can't read directory                          directory=/home/teto/.pfstore.lock
TRAC[0000] Can't read directory                          directory=/home/teto/.profile
TRAC[0000] Can't read directory                          directory=/home/teto/.pypirc
TRAC[0000] Can't read directory                          directory=/home/teto/.python_history
TRAC[0000] Can't read directory                          directory=/home/teto/.recently-used
TRAC[0000] Can't read directory                          directory=/home/teto/.rnd
TRAC[0000] Can't read directory                          directory=/home/teto/.screenrc

I let it run for 20 minutes without any new output. htop shows no cpu or mem usage :s

isacikgoz commented 4 years ago

Hey @teto, thanks for the feedback! I appreciated that you supplied the logs :)

Actually the program only checks if any entry in the path is a git directory, since you set log level to trace it is normal to see this output. Nothing unusual.

It shouldn't be a problem to find your repositories in the home folder. Are they located directly under the $HOME or somewhere deeper? If it is the case you can try recursive option.

Some large repositories cause problem only if you focus into them (by pressing tab) since go-git is a little bit slow and the interface should be handled in a better way, which I have an intention to fix. Nevertheless, the initial loading is somewhat lazy loading, that means it actually just opens the repository in a shallow way.

Also, the program should open up anyway if there is even a single repository. I'm really curious about the issue right now.

ps. I cloned linux kernel to my home folder and it open up without errors.

teto commented 4 years ago

I've uploaded an strace in case it helps, https://transfer.sh/sDBtf/log

I wonder why it's going into hidden directories, and recursively ? Is it recursive by default ? (seems the depth was 0). There seems to be many futex calls timing out. Some of my directories are symlinks too so I wonder if it's an issue as well.

isacikgoz commented 4 years ago

Actually it turns out there was a subtle bug in the recursive function. I've fixed it. But this issue is not something related with recursion I believe. But we can give it a try. I will prepare a release soon.

Symlinks are not making an issue for gitbatch. I also use some repositories with symlinks. For the futex calls side: I will look at the strace but it may be related to go runtime since I am loading repositories not sequentially but concurrently with mutexes.

teto commented 4 years ago

I confirm the recent changes don't fix it.

teto commented 4 years ago

Dunno what changed but retried recently and it worked :s closing ;)