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

Re: Multi-word aliases?



On Tue, Nov 04, 2014 at 11:59:09AM +0100, Mikael Magnusson wrote:
> On Tue, Nov 4, 2014 at 11:43 AM, Dominik Vogt <vogt@xxxxxxxxxxxxxxxxxx> wrote:
> > According to the man page, you can only define new aliases, not
> > overwrite subcommands.
> >
> >   $ man git-config
> >   ...
> >   To avoid confusion and troubles with script usage, aliases that
> >   hide existing git commands are ignored.
> 
> Is there a strong reason you don't want to write "git rk" or whatever
> at the command line?

Yes: I don't want to create my own syntax that nobody understands
but me and then be unable to work on a plain system without silly
"custom" configuration.  I tried it but found the mechanism
awkward and confusing - and the colleagues did not understand what
I was doing.

> I'm quite lazy with typing so I have a set of
> aliases like git rc, git rs for --continue, --skip, and git amend for
> git commit --amend.

I have some handy shell aliases for some lengthy commands that
nobody else would ever use, but I wouldn't bother bother to do
that in an application specific way.  I don't really mind the
typing (because it's usually just "git reb<Up><Up><Return>".
What's really annoying is that rebase silently dumps empty commits
without that option (I use empty commits with comments like "--
ready-to-submit --" or "-- submitted --" in my work repo to sort
patches).

> As for the global command line regex replace, yes, you can do that if
> you hook into the accept-line family of widgets but there's a huge
> caveat; it will only do literal replacements (obviously), so if you
> want to respect any form of quoting you'll have to reimplement the
> full zsh parser in shell script

Ouch!

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany



Messages sorted by: Reverse Date, Date, Thread, Author