geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
921 stars 94 forks source link

Git reports errors in git submodules #285

Closed JokeNeverSoke closed 4 years ago

JokeNeverSoke commented 4 years ago

On some git directories, the following error pops out: fatal: this operation must be run in a work tree three times

Running on Catalina OS

Can't find any similarities in which git directories share, all I can see is that they're all repos related to web development

jedahan commented 4 years ago

can you point me towards a git repo I can clone locally to reproduce? one way to narrow down where the issue happens, is trying each geometrygit function separately than the whole geometry_git

For example, GEOMETRY_RPROMPT=(geometry_git_stashes geometry_git_time geometry_git_branch geometry_git_status geometry_git_rebase geometry_git_remote geometry_git_conflicts)

Then remove one by one until the issue is gone. The one that was last removed exhibits the issue. Or you can start from nothing and add each one so I can go from there.

JokeNeverSoke commented 4 years ago

Seems that when I test individual git functions they work fine, but once they're all together something happens

JokeNeverSoke commented 4 years ago

Aha, I get it! It doesn't work when inside a submodule, or a "nested git repo"

JokeNeverSoke commented 4 years ago

To bad I could barely understand shell-code or I'll be able to help

jedahan commented 4 years ago

Thanks for doing the legwork! Unfortunately it’s hard for me to recommend a good guide on starting shell scripting, but if you are interested I’d say hang out on #zsh on freenode’s irc network, or just ask here.

I guess the first workaround would be to check if we are in a sub module, and if so echo “submodule” or find some sorta submarine ish or water bubble iconography. We can then figure out something better