Commit graph

17 commits

Author SHA1 Message Date
Robert Bittle
2ae671be76
Improve the regex used by git-prompt to extract tagname
To get the name of the current checked out tag the gitstatus.py script
calls `git log -1 --format="%h%d"`.  Ordinarily this will output
something similar to `(HEAD, tag: foo)`.  Then the regex grabs
everything from `tag:` to the closing `)` and then drops the last
character to give the tag name.  This causes a problem when the current
tag is equal to another tag or branch and the output looks like this:
`(HEAD, tag: foo, origin/master)` and  the tagname gets set to
`tag: foo, origin/master`.  This breaks the whole script because its
output is space delimited and GIT_AHEAD which is supposed to be an
integer gets set to `origin/master` (branch also get set to `foo,`
instead of `foo`, but it's not as big of a problem).  To fix this we
change the regex to be nongreedy so that it will only grab one item from
the list and let the closing match either `, `(comma space) or `)`.  We
also have to use a lookahead since we can't just drop 1 character (`, `
is 2 characters).
2017-05-10 08:55:47 -04: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à
6ff53d173b Cleanup of git-prompt plugin file 2015-08-16 23:02:14 +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
Marc Cornellà
2193135ebc Clean up appearance lib file and redundant colors calls in other files 2015-02-10 19:22:50 +01: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