Commit Graph

21 Commits

Author SHA1 Message Date
Arnaud Thimel 47c04d921e feat(git-prompt): display stash count in prompt 2021-01-15 19:03:29 +01:00
Stimim Chen 1ac40cd445
fix(git-prompt): make `gitstatus.py` python3-compatible (#9186)
check_output() in get_tagname_or_hash() returns bytes instead of str in
python3.  Decode the return value to utf-8, this works in both python2
and python3.

Co-authored-by: Stimim Chen <stimim@google.com>
2020-12-03 12:00:56 +01:00
lieryan e204c596ef Rewrite gitstatus collection to be more robust (#7322)
Fix the finicky parsing logic and just ask git the necessary information
directly.
2019-12-20 23:33:39 -08:00
Marc Cornellà 3c8f73c312 git-prompt: fix LANG override for git status call
The previous version modified the whole environment leading to
problems (see #7757). This version *adds* LANG=C to the current
env, without overriding it completely.

Fixes #7757.
2019-04-10 20:30:30 +02:00
sheveko 3cfcf5e0aa git-prompt: run git status with LANG=C (#6087)
As described in #6086 there will be an error when one set another
language than English.
2019-04-07 20:21:54 +02:00
Thanh Ha 5fa7824ea5 git-prompt: fix error when multiple tags exist (#6998)
When a commit has multiple tags associated to it, the git-prompt will
throw the following error:

git_super_status:[:4: integer expression expected: v0.21.x\ntags/v0.21.5,
git_super_status:[:7: integer expression expected: origin/v0.21.x,
git_super_status:[:11: integer expression expected: origin/v0.21.x,
git_super_status:[:14: integer expression expected: v0.21.x
git_super_status:[:23: integer expression expected: v0.21.x

This is due to the prompt expecting the tag field to be a single word
with no spaces in between but if there are multiple tags the python
script returns a string with ', ' space separated list of tags.
This throws off the parser. The solution is to ensure that the python
script returns a space-less string ensuring the git-prompt parser to
properly parse the data.

Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-07-29 17:45:35 +02:00
Oliver Baumann 493c30954b Parse branch-name for fresh repo (#6302)
Inside a fresh git repo, i.e. immediately after a `git init`, usually no
commit template exists yet. In this case, git renders a different
status message than "Initial commit on". We should consider this message
when attempting to parse out the branch name.

Fixes #6301
2018-04-30 16:25:02 +02:00
Kentaro Wada c4ba3065a1 Show tag name when detached status if possible 2015-08-17 18:22:27 +09:00
Marc Cornellà 3c698743fa Clean up gitstatus.py 2015-08-16 23:21:48 +02:00
Kentaro Wada 45473c3a81 Fix for initial or detached status branch info 2015-08-16 23:02:17 +02:00
Marc Cornellà 30bed07e9c Parse UTF-8 output from git status 2015-08-16 23:02:16 +02:00
Kentaro Wada 94007f7db2 git-prompt: collect all git status information by one cmd
This commit uses the `git status --porcelain -b` format to gather the
number of ahead and behind commits related to the remote branch.
2015-08-16 23:02:15 +02:00
Marc Cornellà 1d133ff11f Cleanup the rest of gitstatus.py 2015-08-16 23:02:13 +02:00
Marc Cornellà 5642014ff1 Pull in simplified version from @wkentaro
This version uses `git status --porcelain` instead of making
multiple calls to `git status`.
2015-08-16 23:02:12 +02:00
Marc Cornellà 6443626a6b Pull in latest version from olivierverdier/zsh-git-prompt 2015-08-16 23:02:11 +02:00
ncanceill 5756ea0101 Revert "specify python2 in shebang"
"/usr/bin/python2" does not exist on Mac OSX (see #2382), so fuck people who have
"python" symlinked to "python3"

This reverts commit e5ed07e2b5
2014-07-16 12:27:01 +02:00
ncanceill e5ed07e2b5 specify python2 in shebang
as suggested in #2382
2014-06-04 12:36:34 +02:00
Paweł Tomak cee52283d8 Fix for Python3
In Python3 without universal_newlines set to True
output from Popen was byte-encoded.
2014-04-18 23:09:38 +02:00
Chris Jones c397000b3b grab last item in list which is the branch instead of relying on position. 2014-02-21 22:48:38 -08:00
Chris Jones 7a546362d3 Much needed PEP8 love. Use spaces, not tabs. 2014-02-21 22:47:56 -08:00
Justin Riley e5f77b8f04 add git-prompt plugin from olivierverdier/zsh-git-prompt 2011-04-28 15:05:52 -04:00