Skip to content

git-info: modify Ctrl+C behavior to be more explicit #394

Closed
wants to merge 2 commits into from

7 participants

@orenhe
orenhe commented Feb 18, 2013

(Update: looks like it's related to #307)

I find git-info's auto-disable behavior confusing and too implicit. I'm referring to the case of Ctrl+C press while git-info is running.

Even though it prints a warning message once, it's easy to miss it. Happened to me, and I've also seen others with disabled-git-prompts, while they weren't aware to why it was actually disabled. The git prompt is very cool, and I believe that in many cases users don't want it to automatically go away.

I suggest to make the behavior more expected and explicit, that is:
1. Ctrl+C merely aborts the current call, doesn't modify settings, but displays an informative message.
2. Suggests running 'git-info off' to disable git prompt in current repo.
3. Suggests adding a zstyle setting to disable git prompt for all repos.

This way, the user is fully aware of the disable action.

orenhe added some commits Feb 18, 2013
@orenhe orenhe Git-info: remove auto-disable-if-CTRL+C feature
Upon CTRL+C, instruct users on how to manually disable git prompt.
bafc66e
@orenhe orenhe Git-info: add zstyle for disabling prompt for all repos
This might be useful for users who want to avoid the slow git-info call,
but want to keep the aliases. Updated CTRL + C message to indicate this option.
06c604e
@fuadsaud

sounds consistent behaviour.

endorsed :+1:

@lunaryorn

I'd prefer this behavior, too.

@fabiokr
fabiokr commented Feb 28, 2013

:+1:

@sorin-ionescu
Owner

I made some changes on this subject in d5d03fa.

@lunaryorn

@sorin-ionescu Do you plan to merge this into master?

@sorin-ionescu
Owner

Yes, I will merge some form of this into master.

@sorin-ionescu
Owner

It's best to check the branches for code I'm toying with before opening issues or sending pull requests.

@orenhe
orenhe commented Mar 1, 2013

@sorin-ionescu I like your change at d503fa - it's more simple than mine; except I really think that the default settings should be auto-deactive='no'.
(Now comes the question whether or not to print a message to the user upon Ctrl+C, about the two disable methods. I'm not sure about it)

But either way I believe this should be opt-in rather than of opt-out.

(Good point about checking the branches before rushing to commit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.