Skip to content

fish git prompt ignores untracked files above current directory #6086

@marcvangend

Description

@marcvangend

Hi all, thanks for your work on fish-shell. I'm using fish (version 3.0.2) on MacOS (10.14.6) in an Iterm2 (build 3.3.2) terminal. Using fish_config I have selected the "Informative Vcs" prompt.

I am not sure if this is considered a bug, but at least I'm wondering why the fish git prompt does not always show that untracked files are present. To be precise: the "untrackedfiles" character () only appears in the prompt when untracked files are present in or below the current directory. When untracked files are present above the current directory (off course still within the same git repo) the git prompt seems to ignore them.

This behavior seems to be caused by the __fish_git_prompt_informative_status command. By contrast, the __fish_git_prompt_untracked command always returns the expected value.

To illustrate what I mean, I made this screenshot reproducing the issue:
Screenshot 2019-09-02 at 11 11 00
As you can see, file.txt is untracked, but once you descend into the "sub" directory, the prompt shows the "cleanstate" check mark even though __fish_git_prompt_untracked recognizes the presence of an untracked file.

I also tested this without third-party customizations (sh -c 'env HOME=$(mktemp -d) fish'), with the "Informative Vcs" prompt as only customization. The same behavior occurred.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions