Re: [PATCH] completion: move private shopt shim for zsh to __git_ namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felipe Contreras wrote:

> I have been looking for a way to have local aliases or functions, but
> I can't find any.

It is possible to do

	if [[ -n ${ZSH_VERSION-} ]]; then
		alias __git_local="typeset -h"
	else
		alias __git_local=local
	fi

but let's consider that for a moment.

 1. It's ugly (it means completion code would use a dialect where the
    ordinary "local" keyword has to be spelled differently).

 2. It's ugly (use of aliases in scripts sets off alarm bells.  As
    Almquist's sh manual says:

	Aliases provide a convenient way for naÃve users to create
	shorthands for commands without having to learn how to create
	functions with arguments.  They can also be used to create
	lexically obscure code.  This use is discouraged.)

 3. It's fragile (maybe some day a function from zsh's completion
    library that we call will look at $words and get utterly confused).

I don't mean to sound so negative; actually I am very happy to see us
getting closer to a full understanding of the problem and relevant
constraints.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]