Commit Graph

9 Commits

Author SHA1 Message Date
Fabian Homborg
a649c5293e functions/fish_git_prompt: Fix space prefix for verbose showupstream
This created another local version of the variable just for the if-block.

Can't say I love the space prefix, but then I think we have too many
of these modes anyway.
2019-03-19 10:27:52 +01:00
Fabian Homborg
f6226f0802 functions/fish_git_prompt: Useful status for show_upstream
Returns 0 if there is no diversion, 1 otherwise.
2019-03-19 10:24:40 +01:00
Fabian Homborg
632c47be54 functions/fish_git_prompt: Remove literal tabs 2019-03-19 10:24:34 +01:00
Fabian Homborg
05ef157757 functions/fish_git_prompt: Let helper functions return useful status
If you use these to figure out if there _are_ staged files, or dirty
or whatever, you currently need to check the output, which relies on
the configured character.

Instead, we let them also return a useful status.
Notably, this is *not* simply the status of the git call.

__fish_git_prompt_X returns 0 if the repo is X.

This works for untracked, but the "diff" things return 1 if there is a
diff, so we invert the status for them.

See #5748.

[ci skip]
2019-03-19 10:11:37 +01:00
Fabian Homborg
18d7123ff4 fish_git_prompt: Use count from stdin
Removes any uses of `wc` in our codebase.
2019-03-15 14:31:36 +01:00
hyperfekt
8a0d794337 fish_git_prompt: optionally show stash state in informative mode 2019-03-12 18:47:28 +01:00
Max Nordlund
44ad92ef50 Fix typo 2019-02-20 16:00:59 -08:00
Fabian Homborg
df28f76698 git-prompt: Test untracked the right way around
This only showed untracked files if showuntrackedfiles was != true.

That's just exactly wrong.

Fortunately this wasn't in a release.

[ci skip]
2019-02-10 14:54:32 +01:00
Fabian Homborg
cb7762b7c0 Move __fish_git_prompt -> fish_git_prompt
This exposes it more, since it's quite an important function.

We should do the same with the other vcs functions.

We leave a compatibility shim in place for now.
2019-02-10 14:44:50 +01:00