-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
empty git status (:|✔) shows up even in non git directories #103
Comments
I have same issue on fresh install of debian 9... |
I also have this issue on Manjaro |
I have the same issue on ArchLinux. Every directory have (:|✔) in the prompt, even if it's not a git initialized directory. |
It happens because the python script doesn't find "fatal: Not a git repository" in error message and doesn't exit as author's designed it (line 15 in gitstatus.py) If your system is in english and you still have the problem, can you print the result of A simple fix could be this :
@olivierverdier, would you accept such a fix, or isn't it clean enough for you ? (I haven't tested it to see if this introduces new bugs...) |
@nimag42 your guessed right : my system is set on French as well. |
Just found this; there was a regression as well that changed the case. #117 fixes this on my (English) system. |
I'm seeing this again as well. |
My suggested fix for this: diff --git a/gitstatus.py b/gitstatus.py
index d944fd4..28bdad4 100755
--- a/gitstatus.py
+++ b/gitstatus.py
@@ -12,7 +12,7 @@ branch, error = gitsym.communicate()
error_string = error.decode('utf-8')
-if 'fatal: Not a git repository' in error_string:
+if 'fatal: not a git repository' in error_string.lower():
sys.exit(0)
branch = branch.decode("utf-8").strip()[11:] That way the system doesn't care in which case the git binary returns this error. |
@nimag42 solves for me Loaded with |
check what the output of |
@Segaja
|
Hm this should work. did you apply the entire change? the lowercasing of the first string and the |
Hi @Segaja , I used @QuinnyPig patch (branch in his fork) in my |
That is not enough. According to #117 he only added the So essentially this line checks if the string "fatal: Not a git repository" is present in the output of the |
Upon thinking more about this and reading above that some people have non-english system, maybe it makes more sense not to check the error string, but the return code of the command. |
@Segaja clever thought, nice seeing someone that understand english is not the only language on earth :p |
@Segaja your newer solution that checks for the error code works for me, thank you! |
Can we merge a fix here or is this project dead (last file change 2 years ago)? By the way another fix without changing the source code is to set the option: |
Ouch, this does seem dead/dying. Another ancient issue and still not fixed. Someone should fork this. Stash support and fixes would be nice. Too many open PRs. |
@Kynde I'm not going to fork and mantain that project, if someone wants to do that, please tell us! |
Hmmm, well this is disappointing that the project not really being maintained. I don't write Haskell really, do know a fair bit of python and shells. I am poking around now because like others my prompt stopped behaving well with recent changes, had to fix up my fork. @fam4r What did you have in mind, we just make an issue and direct people to another fork? You guys can see mine at: https://github.com/starcraftman/zsh-git-prompt It is unfortunately a bit of a faux pas in its current state. I forked 4 years ago and haven't looked in much. I wanted parity with bash-git-prompt both thematically and functionally. I may have been rather ham fisted and less experienced. I suppose the main change is a large refactor of Current state isn't super ideal, I should probably tidy it up and replay the good bits over current Olivier master. I suppose not deleting the Haskell stuff would help too. Without a Haskell collaborator it will likely languish behind on changes though. |
@olivierverdier Are you about or looking for a maintainer? |
@starcraftman Haskell fan over here, i would fix the Haskell part, if someone wants to maintain a fork and work through all open issues and pull requests |
I have since rebased my master to align with this project and replayed my changes into a single commit on top. So should be much more coherent if anyone looking. It is a lot of edited lines, I'll have to check more thoroughly that everything still works as expected. Don't normally try the Haskell implementation. @madnight Thanks, will keep that in mind. I suppose depends now if Olivier is about to deputize a maintainer. Will wait a while. Otherwise I guess we can just work on my fork. In that case unfortunately we'd have low visibility. |
@starcraftman yes, it can be a good way, the problem comes when other people make new issues: the one that points to new repo will be not be so longer visible. In my (little) experience I saw something like that: https://github.com/eBrnd/i3lock-color/blob/master/README.md. Putting a message in first lines of README could be a good way to let people follow right directions to the new repo/fork. If @olivierverdier is ok with that, obviously. |
Otherwise, if @olivierverdier cannot do that for some reason, then just fix all existing bugs and do MR's and put a link in this repo issues to the fork, where those issues have been fixed. Monitor this repo issues and on any new issue put a link to our maintained fork. It takes a while, but after some time people will start to accept the fork as new upstream, even more so when this repo becomes fundamentally broken (unusable) in the future. |
Quick fix: git_super_status() {
precmd_update_git_vars
[[ "$GIT_BRANCH" == ":" ]] && return
... Of course, if you have a branch named ":" your git prompt won't print. |
@madnight Yeah, that seems like what I'll have to do. Olivier doesn't seem responsive. Quite annoying. Github needs a better solution to dead original repositories. Though git is decentralized, their site only really promotes originals. It happens often and is much worse in larger more elaborate projects. Sadly looking at some old issues on github they've yet to agree on a plan. I'll make some notes in my forked readme on my changes and that I can atm only personally guarantee the python interface. If you want to assist, I've added a few things to the python version that should be mirrored to Haskell. See issue 5 on my fork. Basically just points 8-10 and a small change on behaviour of 1 for customization. @robeirne If you just want a working prompt this has already been fixed on my active fork, along with some other extra features like stashed support and displaying the upstream. See here: https://github.com/starcraftman/zsh-git-prompt To be clear I'll be maintaining mine. Please star it for visibility. I'll have to make some formal announcement eventually. |
Announcement made, hopefully other people make use of the fork. |
@Segaja thank you, it's worked. ps: it happened after macOS(10.13.6) installed command line tools update today. |
@starcraftman I see you haven't been maintaining your fork either - should we hand it off to someone else? |
The command
RPROMPT='$(git_super_status)'
in my .zshrc has for effect that in a non git directory I get (:|✔)
This wasn't the case until my recent switch to fedora 26. Any idea on how to fix this issue ?
The text was updated successfully, but these errors were encountered: