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

Add vcsinfo plugin #121

Closed
wants to merge 7 commits into from
Closed

Add vcsinfo plugin #121

wants to merge 7 commits into from

Conversation

rphillips
Copy link

Fixes issue 43.

I believe it would be better to remove the lib/git.zsh support in favor of the vcsinfo plugin. Native zsh has support for bzr, cdv, cvs, darcs, git, hg, mtn, p4, svk, svn, tla, git-p4, and git-svn. This makes for a more flexible SCM solution within oh-my-zsh.

Regards,
Ryan

http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#SEC273

@rphillips
Copy link
Author

migrated functionality to top level support. the lib/git.zsh file is largely antiquated now.

@robbyrussell
Copy link
Member

Ryan,

Have you been running off of these changes for a while? Everything sem smooth still?

@rphillips
Copy link
Author

Yes... I have not run into any issues.

@superbobry
Copy link

Would be nice to see this merged into master :)

@gwjo
Copy link
Contributor

gwjo commented Apr 22, 2011

Definitely agree that this would be a better approach to take. I'd like to see this merged or at least integrated as an alternative in the themes that could be used by people that don't just use git.

@robbyrussell
Copy link
Member

rphillips,

It appears that this will not merge automatically at the moment. Can you take a look and help us get it ready to be merged? If necessary, we can put a hold on any new theme additions for a few days while you sort it out.

@rphillips
Copy link
Author

I'll take a look

Conflicts:
	lib/git.zsh
	themes/Soliah.zsh-theme
	themes/theunraveler.zsh-theme
@rphillips
Copy link
Author

Fixed the merge conflicts and things still seem to be working.

@rphillips
Copy link
Author

Is there anything else needed to get this merged?

@sorin-ionescu
Copy link
Contributor

There are some who want more Git control than vcsinfo provides. As an only Git user, I am more likely to use @ashleydev's work. However, if I were to use multiple version control systems, I would certainly use vcsinfo. Flexibility is needed to allow people to use whatever version control system plugin they desire.

@iandol
Copy link

iandol commented Sep 10, 2011

Another vote for merging this, I have bazaar and git repositories and would love to get a consistent interface.

@superbobry
Copy link

@iandol you won't -- even though vcsinfo does add some uniformity, each vcs will still require some extra configuration.

@sorin-ionescu
Copy link
Contributor

Some themes like steeef and nicoulaj use vcs_info. There may be more. Switch to one.

@iandol
Copy link

iandol commented Sep 11, 2011

OK, steeef does what I want (after adding bzr to the setup) so thank you for the suggestion. I'd still imagine that using the built-in zsh VCS support that supports many different systems has a benefit for oh-my-zsh as the default (and let plugins/themes handle the more advanced users).

@sorin-ionescu
Copy link
Contributor

I disagree. vcs_info is not that great because it targets the lowest common denominator.

Git is the most used VCS. Bazaar is only used by Canonical/Ubuntu and a few GNU projects. Thus, it's not a priority.

@rphillips
Copy link
Author

I could rewrite this functionality to use vcsinfo to hook the vcs detection, then write a plugin system within oh-my-zsh which would preserve the current functionality for git, and add support for the other version control systems. Thoughts?

@sorin-ionescu
Copy link
Contributor

@rphillips There is no need. There are not enough non-Git users. vcs_info themes are good enough.

@superbobry
Copy link

not enough non-Git users

I hope you aren't serious on that ...

@iandol
Copy link

iandol commented Sep 12, 2011

Using vcs_info does seem the more generic default going forward, obviously discussing this on Github and this being a Github project selects a Git heavy commenting community, but I assume there have to be OMZ users who will use VCSs other than Git or collaborate with people who do! I have SVN, mercurial, Bazaar and git repositories for various projects I follow, is that really uncommon?

@sorin-ionescu
Copy link
Contributor

Since there is not enough noise, one can only concluded that there are either few non-Git users or that said non-Git users are satisfied.

The following themes use vcs_info; use one.

  • jnrowe
  • kolo
  • linuxonly
  • mikeh
  • nicoulaj
  • steeef
  • trapd00r

@superbobry
Copy link

Well, it's not surprising to see not that many non-Git users on GitHub :)

@sorin-ionescu
Copy link
Contributor

Considering that GitHub is this project's home, where else would one submit non-Git issues?

If I have a problem with a project hosted in a SourceForge Subversion repository, I will submit an issue on SourceForge even though I do not use Subversion because the VCS and the issue tracker are mutually exclusive.

Sorin Ionescu

On Monday, 12 September 2011 at 14:56, Sergei Lebedev wrote:

Well, it's not surprising to see not that many non-Git users on GitHub :)

Reply to this email directly or view it on GitHub:
#121 (comment)

@wjkoh
Copy link

wjkoh commented Sep 16, 2011

Based on statistics, I guess that many zsh users use a non-Git VCS. Then, why are there few comments from non-Git users? In my case, I use Mercurial mainly and I create this GitHub account yesterday to request pull. Therefore, if I don't come back here to check a status of my request, I also don't know there is a discussion for non-Git VCS in this "Pull Requests" section... behind the "Show more" button.

Like others, I am also disappointed when I find there is no Mercurial prompt on default theme. However, OMZ is hosted on GitHub and it looks so Git-oriented and -friendly project (see that default prompt and examples!), I don't want to disturb people who already use it and are satisfied with it. "Mercurial? Who uses that, maybe you and only few?"

Like me, most of users come in, install OMZ, find that it only supports Git (it's not true), and they just quit or use as it is. It is natural that only few of them are enthusiastic enough to create account and suggest their opinion, and lucky enough to find this thread. I have tested and quit hundreds of applications without mentioning its inconvenience to its creator. Is it only me who follows this routine?

Before I see those mentions about few non-Git users, I think that developers also want to support other VCS but just don’t have resources to do that. I leave this comment as another non-Git user who wants more VCS supports, even though I had to struggle to write this long comment in English. If there is any rudeness here, it’s my fault. However, please understand that I don’t intend it.

@sorin-ionescu
Copy link
Contributor

@wjkoh, Welcome to GitHub. You can use GitHub with Mercurial. See http://hg-git.github.com. Make sure you have the bookmarks plugin enabled.

The problem with making the default theme a vcs_info theme is that Git users will whine since vcs_info targets the lowest common denominator and is missing certain Git functionality.

A good approach would be to list vcs_info themes in the README for non-Git users, but then there is a problem with people not reading READMEs.

In the effort to make #377 a reality, in my fork, I have rewritten the Git plugin and converted a few themes to the native ZSH theming system. Right now, I have a dedicated Git plugin and delegate all other version control systems to vcs_info via themes, and the people who need multiple version control systems can use one of those themes.

Since vcs_info, unfortunately, targets the lowest common denominator, people who need more that it provides can either use vcs_info hooks or clone the Git plugin to rewrite it to fit their VCS, and if that's the case, a wrapper plugin around one or more VCS plugins is very easy to create.

if git-info && [[ -n "$git_prompt_info" ]] || [[ -n "$git_rprompt_info" ]]; then
  vcs_prompt_info="$git_prompt_info"
  vcs_rprompt_info="$git_rprompt_info"
elif hg-info && [[ -n "$hg_prompt_info" ]] || [[ -n "$hg_rprompt_info" ]]; then
  vcs_prompt_info="$hg_prompt_info"
  vcs_rprompt_info="$hg_rprompt_info"
else
  unset vcs_prompt_info
  unset vcs_rprompt_info
fi

In the theme file, one would replace the word 'git' with 'vcs', and it should just work.

Perhaps, @sjl will clone my rewritten Git plugin and make it work for Mercurial using his hg-prompt.

TL;DR: Trying to please everybody always results in pleasing nobody.

@nicoulaj
Copy link
Contributor

Why don't you try improving vcs_info and contribute it back to the Zsh project instead of reinventing the wheel ?

@sorin-ionescu
Copy link
Contributor

I have looked into improving vcs_info and decided against it.

I am not reinventing the wheel. I have written a Git plugin since, at the moment, I only care about Git.

That said, I have given, in the post above, non-Git users options if they don't like vcs_info — write hooks or write a plugin.

Since I do not expect anyone, except maybe @sjl, to write an awesome Mercurial plugin, that wrapper above, which you distaste for reinventing vcs_info, will never materialise.

habnabit pushed a commit to habnabit/oh-my-zsh that referenced this pull request Aug 28, 2015
…5741

3dc5741 Merge pull request ohmyzsh#140 from randomize/pr_fix_issue_#77
10391d0 Merge pull request ohmyzsh#134 from sonnym/enable_quick_history_substitution_highlighting
443908b Merge pull request ohmyzsh#142 from jcassee/master
eb9870f Merge pull request ohmyzsh#143 from vincentbernat/fix/yank-pop
74a1834 zle: don't override yank/yank-pop
d7d4dff Add 'line' highlighter for the whole buffer
7edd081 Chaned main highlighter alorithm to resolve issue ohmyzsh#77
e8cc271 Resolves slow performance in brackets highlighter
5320f1e Merge pull request ohmyzsh#135 from arcan1s/patch-1
dcb5da9 Update README.md
c83e266 ohmyzsh#110: Now using :A modifier, bump zsh version requirement
072c064 Merge pull request ohmyzsh#110 from xaocon/master
04f9c88 highlight ^old^new pattern
f289a9f Merge pull request ohmyzsh#125 from acatton/fix-121
8ac9641 Merge pull request ohmyzsh#131 from MarkLodato/array-assignments
ffce2a0 Merge pull request ohmyzsh#133 from lucc/master
63a720a Merge pull request ohmyzsh#128 from knu/patch-1
784a5dc protect alias expansion from interpreting aliases as options
441f1a8 highlight array assignments of the form x[y]=...
c62cb54 do not remove quotes when checking assignments
0fc6b07 Do not leak a variable: cdpath_dir.
dffbab0 a more simple and universal way (for zsh projects) to find highlight dir path
3b3a58b Fix ohmyzsh#121: sudo syntax highlighting incorrectly
0fcc262 Finds highlighters dir a little better

git-subtree-dir: plugins/zsh-syntax-highlighting
git-subtree-split: 3dc5741
Dannyzen pushed a commit to Dannyzen/oh-my-zsh that referenced this pull request Apr 3, 2016
Parse sudo command line in order to highlight the options correctly
Dannyzen pushed a commit to Dannyzen/oh-my-zsh that referenced this pull request Apr 3, 2016
Fix ohmyzsh#121: sudo syntax highlighting incorrectly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants