-
Notifications
You must be signed in to change notification settings - Fork 181
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 git-info module and update the magicmace theme accordingly #104
Conversation
based on the Prezto git module [function](https:/sorin-ionescu/prezto/blob/master/modules/git/functions/git-info) and further refactored and simplified. What changed: - Commit format only in 'detached HEAD' state, so `$(coalesce "%b" "%c")` is not needed, because you only get one of those. - Removed the `added`, `deleted`, `modified`, `renamed` and `unmerged` verbose contexts. - `git status` is only used in verbose mode. - In non-verbose mode, the `untracked` context is not available, and also untracked files are not considered for computing the `dirty` context. Using `git status` or checking for untracked files is [expensive](https://gist.github.com/sindresorhus/3898739).
@ericbn Thanks for the PR! The results look great. I'm going to look over this tomorrow and give others some time to look this over this as well. |
to fix the "Special Action Contexts" title mistakenly being "Untracked Contexts", and other minor changes.
@Eriner How's the review going? This is the only thing that stops me migrating from prezto to zim personally ;) |
@bartekrutkowski @ericbn Sorry about the delays, the code LGTM for the most part, beyond a few stylistic nitpicks that I can clean up after I merge. I probably won't get around to merging this until after the holidays, but I promise I will get this merged soon after! |
@ericbn do you have any issue with me changing the title of your commits during the merge? I'd like them to match the format of the other commits, specifically |
You can change them as you like, sure. Something I forgot to mention in the list of changes from Prezto is that the default ignore-submodules was changed to "all". You might want to include that too.
On Jan 6, 2017 6:47 AM, Matt Hamilton <[email protected]> wrote:
@ericbn<https:/ericbn> do you have any issue with me changing the title of your commits during the merge?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#104 (comment)>, or mute the thread<https:/notifications/unsubscribe-auth/AD7gHqWekAunUX2hfIX-Ym5x2JVWHIGfks5rPeOQgaJpZM4LDDod>.
|
@Eriner why not make git-info a zsh plugin (into a separate repo) to be used by all. See https:/unixorn/awesome-zsh-plugins/blob/master/Writing_Plugins.md. I fell we are duplicating code by maintaining a {prezto,zim,omg}/git-info module which most prompts need. |
Sure, I can maintain zimframework/git-info. Since Eriner/zim is still being used, can we merge this PR too? |
Yep, done! I'm leaving this open until I get around to creating that repo for you. |
@Eriner, I was able to create https:/zimframework/git-info, so it looks like I have the required permissions. |
Oh, duh, I forgot I added you as a maintainer ;) Thanks! |
Module code was based on the Prezto git module function and further refactored and simplified.
What changed:
$(coalesce "%b" "%c")
is not needed, because you only get one of those.added
,deleted
,modified
,renamed
andunmerged
verbose contexts.git status
is only used in verbose mode.untracked
context is not available, and also untracked files are not considered for computing thedirty
context. Usinggit status
or checking for untracked files is expensive.The change in the magicmace theme shows the simplification power of this module: a reduction of 28 lines of code.
I hope this solves @stefanosc's #82. I've been using this in my custom prompt for a few months.