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

Fixes git_compare_version() in lib/git.zsh and refactors the whole file #2386

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

LFDM
Copy link
Contributor

@LFDM LFDM commented Dec 30, 2013

git_compare_version() is used to determine whether dirty submodules should be ignored or not, but git has to be more recent than version 1.7.2 to know about that option.

With the former comparison logic a check if git version 1.8.1 is more recent than 1.7.2 turned out negative, which is fixed through this pull request.

UPDATE: In addition to #2401 I refactored the whole file.

  • Cleans up it's functions
  • Less duplication of code and logic
  • Less querying of git and the general status,
  • Adds functions that where buried inside of others before (git_stash_status, git_change_status) to gain better modularity.
  • Adds a big documentation section where every function and customization variable is explained.
  • Adds a function to hide/show the git prompt in specific large repositories - toggle_git_prompt_visibility

Might need some more testing if anything was broken, though I don't have any troubles locally.

Possibly breaking changes:

  • Cuts the duplicated variables to show the git_remote_status.

@LFDM LFDM mentioned this pull request Jan 5, 2014
@LFDM
Copy link
Contributor Author

LFDM commented Jan 7, 2014

Could also fix #2404, if people approve.

Reenables local hiding of a git prompt for large repositories.
Can be toggled through this new function. - Also doesn't falter when a
user has no permission to read the git config.
@bric3
Copy link
Contributor

bric3 commented Jan 18, 2014

I'm using my own version of oh-my-git now which doesn't rely on oh-my-zsh git functions, so I didn't yet test it, but it seems ok by just reading the code. However I think proper tests need to be done.

@robbyrussell
Copy link
Member

We need some testers!

@simonbuchan
Copy link
Contributor

@robbyrussell As this resolves my #2928, I'm going to be running this, but I'm not exactly a tester.

Merge seems to resolve fine taking all from this (git.zsh conflicts look like they're all done here too)

@simonbuchan
Copy link
Contributor

My merge in simonbuchan/oh-my-zsh pull-2386

@simonbuchan
Copy link
Contributor

@LFDM This seems to be missing git_stash_status, unless my merge broke it?

@simonbuchan
Copy link
Contributor

Updated my merge, looks like I missed some stuff last try.

Looks like git_prompt_status was using current_branch instead of git_current_branch?

Might want to get new git_{prompt,commits}_ahead into git_prompt_status somehow?

cinaeco pushed a commit to cinaeco/dotfiles that referenced this pull request Mar 24, 2016
Minor fix until ohmyzsh/ohmyzsh#2386 or similar
is implemented.
@mcornella mcornella added Area: core Issue or PR related to core parts of the project Status: conflicts Pull Request that has conflicts with the master branch labels Mar 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Issue or PR related to core parts of the project Status: conflicts Pull Request that has conflicts with the master branch
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

None yet

5 participants