matchai/spacefish

.git directory and subsequent folders do not show

Closed this issue · 3 comments

Bug

Expected Behaviour

Expected .git and inner directories names to be shown in the terminal, in the space where the current directory name is normally displayed.

Actual Behaviour

Instead we have an empty space as shown in this screenshot:
screen shot 2018-03-05 at 12 27 25 am

Reproduction Steps

➜ mkdir coolest-repo
➜ cd coolest-repo
➜ git init
➜ cd .git

The behavior can be seen here. You can also see that going further in (i.e.: cd hooks) will continue the issue. cd-ing out of git solves it.

Probable Cause

Most likely the cause is the from one of the fish files that deal with git (i.e. spacefish/functions/__sf_section_git.fish)

It looks like the error occurs at this line: https://github.com/matchai/spacefish/blob/master/functions/__sf_section_dir.fish#L26
When attempting to get the root folder of a git repo, the command fails while in the .git directory or its subdirectories.

All future discussion of this issue will take place in the same issue on spaceship's repo: spaceship-prompt/spaceship-prompt#388

Due to #45, this issue has been reopened.
We may not be able to correctly truncate the directory to the git project root, but at the very least we should be showing the directory name.