Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] vcs_info: git: Support stagedstr(%c) without unstagedstr(%u)



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