Skip to content
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

Update README.md #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update README.md #138

wants to merge 1 commit into from

Conversation

voltuer
Copy link

@voltuer voltuer commented Dec 20, 2019

The original PROMPT example looks weird when outside a git repo. Example: air~(:|✔) %
This new example makes the prompt look like original zsh when outside a git repo. Example: seb@air ~ %

The original PROMPT example looks weird when outside a git repo. Example: **air~(:|✔) %**
This new example makes the prompt look like original zsh when outside a git repo. Example: **seb@air ~ %**
@thomasrebele
Copy link

thomasrebele commented Dec 28, 2019

This has probably been fixed in the currently maintained fork.
See https://github.com/zsh-git-prompt/zsh-git-prompt
Contributions are welcome!

@voltuer
Copy link
Author

voltuer commented Jan 14, 2020

This has probably been fixed in the currently maintained fork.
See https://github.com/zsh-git-prompt/zsh-git-prompt
Contributions are welcome!

it's not a bug, it's a usage suggestion:

    git_prompt() {
      if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then echo '%B%m%~%b'$(git_super_status)' %# '
      else echo '%n@%m %1~ %# '
      fi
    }
    PROMPT='$(git_prompt)'

@thomasrebele
Copy link

thomasrebele commented Jan 22, 2020

Indeed, this would allow to have custom prompts depending on whether the current working directory is within a git repository.

A similar check is done in https://github.com/zsh-git-prompt/zsh-git-prompt at gitstatus.sh line 15. So the new version should not appear as air~(:|✔) % in the first place.

Copy link

@JOJ0 JOJ0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes a change like that absolutely is required for a prompt changing thing like zsh-git-prompt. It should only do it's stuff when actually inside a repo.

I have a similar slightly shorter version here, I'll post it in a few days when I'm back at work.

@olivierverdier do you think you would merge a PR like this or no time/interest? I do appreciate your work and this repo but it feels very much abandonend currently :-/ What do you think?

@thomasrebele
Copy link

@JOJ0, I think this repo is abandoned. You might have a better chance with https://github.com/zsh-git-prompt/zsh-git-prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants