zsh-workers
 help / color / mirror / code / Atom feed
* Git commands or aliases first?
@ 2011-07-22 11:40 Nikolai Weibull
  2011-07-22 11:58 ` Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolai Weibull @ 2011-07-22 11:40 UTC (permalink / raw)
  To: Zsh Workers

Hi!

What is the desired tag order for Git commands and aliases?

My conclusion is that the current behavior is incorrect.  My reasoning
is that git will prefer invoking a command over an alias with the same
name.

Does anyone have a contradictory opinion, or should I merge this change?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git commands or aliases first?
  2011-07-22 11:40 Git commands or aliases first? Nikolai Weibull
@ 2011-07-22 11:58 ` Mikael Magnusson
  2011-07-22 12:04   ` Nikolai Weibull
  2011-07-22 12:06   ` Frank Terbeck
  0 siblings, 2 replies; 5+ messages in thread
From: Mikael Magnusson @ 2011-07-22 11:58 UTC (permalink / raw)
  To: Nikolai Weibull; +Cc: Zsh Workers

On 22 July 2011 13:40, Nikolai Weibull <now@bitwi.se> wrote:
> Hi!
>
> What is the desired tag order for Git commands and aliases?
>
> My conclusion is that the current behavior is incorrect.  My reasoning
> is that git will prefer invoking a command over an alias with the same
> name.
>
> Does anyone have a contradictory opinion, or should I merge this change?

We could show aliases first, but leave out ones that are also
commands? On the one hand, I would want to complete my aliases before
the commands, on the other hand I usually make alias names short
enough to not need completing. On the third hand it's configurable
with group-order anyway, so either is fine with me :). Ie
zstyle ':completion:*:git:*' group-order main-porcelain-commands

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git commands or aliases first?
  2011-07-22 11:58 ` Mikael Magnusson
@ 2011-07-22 12:04   ` Nikolai Weibull
  2011-07-22 12:06   ` Frank Terbeck
  1 sibling, 0 replies; 5+ messages in thread
From: Nikolai Weibull @ 2011-07-22 12:04 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Zsh Workers

On Fri, Jul 22, 2011 at 13:58, Mikael Magnusson <mikachu@gmail.com> wrote:
> On 22 July 2011 13:40, Nikolai Weibull <now@bitwi.se> wrote:
>> Hi!
>>
>> What is the desired tag order for Git commands and aliases?
>>
>> My conclusion is that the current behavior is incorrect.  My reasoning
>> is that git will prefer invoking a command over an alias with the same
>> name.
>>
>> Does anyone have a contradictory opinion, or should I merge this change?
>
> We could show aliases first, but leave out ones that are also
> commands? On the one hand, I would want to complete my aliases before
> the commands, on the other hand I usually make alias names short
> enough to not need completing. On the third hand it's configurable
> with group-order anyway, so either is fine with me :). Ie
> zstyle ':completion:*:git:*' group-order main-porcelain-commands

Yes, I realize that it’s configurable, but I’d prefer the default to
be what most users want.

Hm, perhaps __git_aliases_or_commands is doing this wrong.  Perhaps
adding the filtering that you suggest is the best way to do it.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git commands or aliases first?
  2011-07-22 11:58 ` Mikael Magnusson
  2011-07-22 12:04   ` Nikolai Weibull
@ 2011-07-22 12:06   ` Frank Terbeck
  2011-07-22 12:40     ` Nikolai Weibull
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Terbeck @ 2011-07-22 12:06 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Nikolai Weibull, Zsh Workers

Mikael Magnusson wrote:
> On 22 July 2011 13:40, Nikolai Weibull <now@bitwi.se> wrote:
>> Hi!
>>
>> What is the desired tag order for Git commands and aliases?
>>
>> My conclusion is that the current behavior is incorrect.  My reasoning
>> is that git will prefer invoking a command over an alias with the same
>> name.
>>
>> Does anyone have a contradictory opinion, or should I merge this change?
>
> We could show aliases first, but leave out ones that are also
> commands? On the one hand, I would want to complete my aliases before
> the commands, on the other hand I usually make alias names short
> enough to not need completing. On the third hand it's configurable
> with group-order anyway, so either is fine with me :). Ie
> zstyle ':completion:*:git:*' group-order main-porcelain-commands

If there is a git alias "add", git will still use the command, not the
alias. So that would make sense.

I also think aliases should be completed before commands, since that
will probably be "commands" the user calls regularly.

Regards, Frank


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git commands or aliases first?
  2011-07-22 12:06   ` Frank Terbeck
@ 2011-07-22 12:40     ` Nikolai Weibull
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolai Weibull @ 2011-07-22 12:40 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: Mikael Magnusson, Zsh Workers

On Fri, Jul 22, 2011 at 14:06, Frank Terbeck <ft@bewatermyfriend.org> wrote:
> Mikael Magnusson wrote:
>> On 22 July 2011 13:40, Nikolai Weibull <now@bitwi.se> wrote:
>>> Hi!
>>>
>>> What is the desired tag order for Git commands and aliases?
>>>
>>> My conclusion is that the current behavior is incorrect.  My reasoning
>>> is that git will prefer invoking a command over an alias with the same
>>> name.
>>>
>>> Does anyone have a contradictory opinion, or should I merge this change?
>>
>> We could show aliases first, but leave out ones that are also
>> commands? On the one hand, I would want to complete my aliases before
>> the commands, on the other hand I usually make alias names short
>> enough to not need completing. On the third hand it's configurable
>> with group-order anyway, so either is fine with me :). Ie
>> zstyle ':completion:*:git:*' group-order main-porcelain-commands
>
> If there is a git alias "add", git will still use the command, not the
> alias. So that would make sense.
>
> I also think aliases should be completed before commands, since that
> will probably be "commands" the user calls regularly.

OK, I’ve implemented it this way now.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-22 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22 11:40 Git commands or aliases first? Nikolai Weibull
2011-07-22 11:58 ` Mikael Magnusson
2011-07-22 12:04   ` Nikolai Weibull
2011-07-22 12:06   ` Frank Terbeck
2011-07-22 12:40     ` Nikolai Weibull

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).