Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Support for configurable git command aliases (v2)

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:28

Petr Baudis [off-list ref] writes:
  Then again, as pointed out on IRC you might get very confused as well
if you do git log | less. Besides, this is not going to help you with
aliases like commit = commit -a.

  So, some other possibilities are to:

  (i) Test stdin. Even in scripts, stdin is frequently terminal, but you
might add </dev/null after each git invocation and get a serious case of
RSI.

  (ii) Add a --no-alias git argument. This way lies madness, too.

  (iii) Check a $GIT_NO_ALIAS environment variable. This might work
best, after all. Opinions? Or some other clever idea?
Perhaps the simplest:

    (iv) Refuse/ignore an alias that hides existing command, and
         train users to write portable scripts by not using
         aliases.  E.g. "alias.log = log --pretty=raw" is
         ignored, and you would do "alias.l = log --pretty=raw"
         instead.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help