Commit graph

5 commits

Author SHA1 Message Date
Kevin Ballard
b604321169 Fix showupstream behavior in __fish_git_prompt
The __fish_git_prompt_show_upstream helper function was inadvertently
looking at the misnamed variable __fish_git_prompt_show_upstream in some
cases, including when implementing the bash.showUpstream override.
Fixing the script to use __fish_git_prompt_showupstream triggered an
infinite loop because the --on-variable hook does not distinguish
between local and global variables.

Update the script to set a completely different local variable to
__fish_git_prompt_showupstream and to override this local variable for
bash.showUpstream.

Also update the code that looks at bash.showUpstream to also read
bash.showupstream, because the bash script appears to have a bug where
it looks for bash.showupstream despite documenting bash.showUpstream.
2012-07-26 15:32:27 -07:00
Kevin Ballard
b1281c3fb9 Update __fish_git_prompt.fish to handle git-svn better
Git-svn remotes can have a prefix for their remotes. If I set a prefix
of 'svn/' then my remote trunk branch is called svn/trunk. Update the
script to use the svn-remote.*.fetch key to figure out how the 'trunk'
branch is mapped into the remotes namespace and apply this to the
current branch. This assumes branches are mapped into the same
namespace, which is likely. It also doesn't work for tags, but neither
did the old code.
2012-07-13 21:46:57 -07:00
Kevin Ballard
1eddc79a90 Remove __fish_git_prompt's switch bug workaround
With the switch bug fixed, __fish_git_prompt can be very slightly
simplified by not recording the exit status of every case in the
describe style switch individually.
2012-06-25 15:19:47 -07:00
Kevin Ballard
3f7fe94009 Tweak documentation for __fish_git_prompt
Add mention of the __fish_git_prompt_color variable.
2012-06-21 11:14:01 -07:00
Kevin Ballard
ae593decfc Replace __fish_git_branch_prompt.fish with __fish_git_prompt.fish
__fish_git_prompt.fish is a complete port of the __git_ps1 function from
git-completion.bash, with the relevant configuration variables changed
and some extra configuration added (namely, control over individual
colors and the status indicator characters).
2012-06-21 11:03:15 -07:00