jaspernbrouwer / powerline-gitstatus

A Powerline segment for showing the status of a Git working copy
MIT License
383 stars 52 forks source link

Only branch name is shown, but nothing else #19

Closed Venemo closed 6 years ago

Venemo commented 7 years ago

Hi,

I'm new to powerline, so I might have misconfigured it, but I can't get powerline-gitstatus to show anything but the branch name.

Contents of ~/.config/powerline/config.json:

{
    "ext": {
        "shell": {
            "colorscheme": "default",
            "theme": "default_leftonly"
        }
    }
}

The ~/.config/powerline/themes/shell/default.json and ~/.config/powerline/colorschemes/default.json are copied from the powerline-gitstatus readme as-is.

The output of git status --branch --porcelain is:

## master...origin/master [ahead 2]
 M Doxyfile

However, powerline-gitstatus looks like this: http://imgur.com/a/uNjWo ― the branch name is shown, but it doesn't say how many modified files I have or how many commits I'm ahead of origin/master.

I have git version 2.13.5.

What am I doing wrong?

rgolangh commented 7 years ago

This [1] made the branch name appear finally, but it still missing the dirty state and untracked file status. Maybe its vcs plugin is doing it and not the powerline gitstatus at all.

[1] https://leifmadsen.wordpress.com/2015/09/09/configuring-powerline-to-show-working-git-branch/

Venemo commented 7 years ago

@rgolangh Yes, that's exactly what I mean too.

kangman commented 6 years ago

anyone know how to also show the remote target in the shell config? e.g. origin or upstream?

jaspernbrouwer commented 6 years ago

@Venemo I see you're using default as colorscheme, so I assume you've added the gitstatus groups to colorschemes/default.json?

You're also using default_leftonly as theme, so you'll need to add some configuration to themes/shell/default_leftonly.json. In there you should only have an entry left in segments, right will be ignored in bash.

It's best to remove the entry containing powerline.segments.common.vcs.branch (and powerline.segments.common.vcs.stash as well), so you're sure that when you see a branch-name, it's not this segment.

Then add powerline_gitstatus.gitstatus.

When this still doesn't work, please enable logging (level DEBUG), that should shed some light on what's going on.

PS: You can run powerline-lint to see if your configuration is in order.

jaspernbrouwer commented 6 years ago

anyone know how to also show the remote target in the shell config? e.g. origin or upstream?

@kangman I'm afraid this isn't supported at the moment.

rgolangh commented 6 years ago

@jaspernbrouwer thanks, I got it working now by

I created colorschemes and shell directories under my home dir

mkdir -p ~/.config/powerline/colorschemes  ~/.config/powerline/themes/shell

Place powerline_gitstatus.gitstatus on the left section in shell/default.json and with priority 10

Here is the complete~/.config/powerline/themes/shell/default.json

{
    "segments": {
        "left": [
            {
                "function": "powerline.segments.shell.mode"
            },
            {
                "function": "powerline.segments.common.net.hostname",
                "priority": 10
            },
            {
                "function": "powerline.segments.common.env.user",
                "priority": 30
            },
            {
                "function": "powerline.segments.common.env.virtualenv",
                "priority": 50
            },
            {
                "function": "powerline.segments.shell.cwd",
                "priority": 10
            },
            {
                "function": "powerline.segments.shell.jobnum",
                "priority": 20
            },
                        {
                "function": "powerline_gitstatus.gitstatus",
                "priority": 10
            }
        ],
        "right": [
            {
                "function": "powerline.segments.shell.last_pipe_status",
                "priority": 10
            },
            {
                "function": "powerline.segments.common.vcs.stash",
                "priority": 50
            },
            {
                "function": "powerline.segments.common.vcs.branch",
                "priority": 40
            }
        ]
    }
}
jaspernbrouwer commented 6 years ago

Good to hear you've got it working!

PS: If you're using bash, you might as well remove the entire right section, bash doesn't support a prompt on the right side.

hypr2771 commented 5 years ago

Just for the record and to avoid people crawling each issues 1 by 1 : I had the same issue, but found the solution in here : https://github.com/jaspernbrouwer/powerline-gitstatus/issues/13

For the record, I came across it by running powerline-lint