Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] vcs_info: git: Support stagedstr(%c) without unstagedstr(%u)
- X-seq: zsh-workers 32526
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] vcs_info: git: Support stagedstr(%c) without unstagedstr(%u)
- Date: Fri, 04 Apr 2014 11:53:11 +0200
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <20140329094949.GB11569@tarsus.local2> (Daniel Shahaf's message of "Sat, 29 Mar 2014 09:49:49 +0000")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20140329094949.GB11569@tarsus.local2>
Daniel Shahaf wrote:
> Hello.
Hi!
Sorry for the delay.
> I'd like to have my prompt alert me when I have staged changes (because it's a
> pain to keep running 'git diff --staged' before every 'git commit -a').
> However, I don't want to enable detection of unstaged changes too as that's
> more expensive (disk crawl v. metadata crawl).
Yes, makes sense.
[...]
> --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr
> +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr
[...]
> + # TODO: document in zshcontrib that bzr supports check-for-changes
> + # (also in VCS_INFO_bzr_get_info_restricted)
Sounds like a plan. Do you want the job? :)
[...]
> --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
> +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
[...]
> +local querystaged queryunstaged
If you'd make this "local -i ..." the variables would be integers,
defaulting to zero. Then you could do...
[...]
> +if [[ -n $querystaged || -n $queryunstaged ]] && \
+if (( querystaged || queryunstaged )) && \
[...]
> + if [[ -n $queryunstaged ]] ; then
+ if (( queryunstaged )); then
[...]
> + if [[ -n $querystaged ]] ; then
+ if (( querystaged )); then
Which is a little more pleasing to my eyes at least. The rest looks
good.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author