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

Added __git_ps1() from official git repository #4014

Closed
wants to merge 1 commit into from
Closed

Added __git_ps1() from official git repository #4014

wants to merge 1 commit into from

Conversation

mbologna
Copy link
Contributor

From git repository, I added the file:
https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
which offer the __git_ps1() function to customize the prompt.

Basically, it keeps track of what changes are
made in the current git repo (if available) and
returns some symbols to put in your prompt (e.g. %
if there are untracked files).

  • In the original version, flags (e.g. SHOWDIRTYSTATE)
    must be enabled to return symbols described above.
    Changed to enable these features by default (removed if)
  • Returned symbols can be customized using OMZ default
    variables (e.g. ZSH_THEME_GIT_PROMPT_STASHED) defined in
    your theme. I modified __git_ps1() in order to use the symbols you specified in those variables instead of git ones'

  contrib section.
  https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh

  Basically, it keeps track of what changes are
  made in the current git repo (if available) and
  returns some symbols to put in your prompt (e.g. %
  if there are untracked files).

* In the original version, flags (e.g. SHOWDIRTYSTATE)
  must be enabled to return symbols described above.
  Changed to enable these features by default (removed ifs)

* Returned symbols can be customized using OMZ default
  variables (e.g. ZSH_THEME_GIT_PROMPT_STASHED) defined in
  your theme. Modified original version to support
  customization
@apjanke
Copy link
Contributor

apjanke commented Jun 15, 2015

I don't think we can use this in OMZ, since this new code is GPL, and Oh My Zsh is MIT licensed. These two licenses are not compatible.

@ncanceill
Copy link
Contributor

Indeed they are not.

@mbologna can you work on a workaround?

@mbologna
Copy link
Contributor Author

Closing this PR, as #4050 solves the problem.

@mbologna
Copy link
Contributor Author

mbologna commented Sep 9, 2015

I would like to point out that the same file from git repo (which is GNU licensed) is already included in omz:
https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/gitfast/git-prompt.sh

@ncanceill @apjanke

@apjanke
Copy link
Contributor

apjanke commented Sep 9, 2015

Looks like most of the files in the gitfast plugin are GPL. Their provenance should be checked and the plugin may need to be revised or removed.

@PageVPetty
Copy link

Mine kept saying, " -bash: __git_ps1: command not found " until I realized that the file " git-prompt.sh " was misspelled. It said " git-promt.sh ". As soon as I changed that everything worked fine.

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.

None yet

4 participants