git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] build: add default aliases

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Sep 28, 2013, 22:41 UTC
Message-ID
<CAMP44s0UcP5AhWrm7vjBDLvY6CupzL03kys1YXs9cpGJNxkBBA@mail.gmail.com>
In-Reply-To
<20130924183958.GK9464@google.com>
On Tue, Sep 24, 2013 at 1:39 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 17 quoted lines
> Jeff King wrote:
>> On Sat, Sep 21, 2013 at 02:20:21PM -0500, Felipe Contreras wrote:
>
>>> For now simply add a few common aliases.
>>>
>>>   co = checkout
>>>   ci = commit
>>>   rb = rebase
>>>   st = status
>>
>> Are these the best definitions of those shortcuts? It seems[1] that some
>> people define "ci" as "commit -a", and some people define "st" as
>> "status -s" or even "status -sb".
>
> I feel bad about having waited for 4 rounds of this patch to say this,
> but the basic change (providing "co", "ci", etc. as aliases by
> default) does not look well thought through.
To you.
> It would be a different story if this were a patch to update
> documentation to suggest adding such aliases at the same time as
> telling Git what your name is.  The user manual doesn't explain how to
> set up aliases at all yet, and that should be fixed.
That's a completely different subject.
> But making 'ci' a synonym of another command by default while still
> keeping its definition configurable would be doing people a
> disservice, I fear.
And I and many (most) users disagree.
> As long as 'ci' works out of the box, it will
> start showing up in examples and used in suggestions over IRC, etc,
> which is great.
It might, or...
Show 6 quoted lines
> Unfortunately that means that anyone who has 'ci'
> defined to mean something different can no longer use those examples,
> that advice from IRC, and so on.  So in the world where 'ci' is a
> synonym for 'commit' by default, while people still *can* redefine
> 'ci' to include whatever options they like (e.g., "-a"), actually
> carrying out such a personal customization is asking for trouble.

Precisely for this reason it might not. If people know aliases can be different in different machines, they would avoid them in documentation which is meant for all machines.

If you truly want to be pedantic, you could add a warning if the default alias is not used, and this warning gets silenced if the user configures the alias manually.

Show 6 quoted lines
> Incidentally, that is also the reason git already doesn't allow
> aliases to override built-in commands such as "git commit", even
> though it would be convenient to some to not have to remember to add
> "-a" each time.  As consolation we have been able to say "But you can
> take the even shorter-and-sweeter 'git ci' and make it mean whatever
> you want".  Now we should take that avenue away for people?
Who is taking away that avenue? Certainly not this patch.
> Bad idea.

Only if you assume your hypothesis is a fact, which is not, and even if you do, it's still not.

> Hope that helps,

The project? No, it doesn't. Virtually every VCS out there has default aliases, and Git somehow cannot manage to get them done.

And BTW, look what I can do in mercurial:

.hgrc --- [alias] status = status --all ---

OMG! The world is going to end! No, it's not, it's no problem. What you think is so clearly a bad idea, seems to be doing just fine in Mercurial.

-- 
Felipe Contreras
Previous: John SzakmeisterNext: Michael Haggerty
Message 12 of 34 in “build: add default aliases”
  1. build: add default aliasesFelipe Contreras, Sep 21, 2013
  2. Jeff KingSep 24, 2013
  3. Felipe ContrerasSep 24, 2013
  4. Jeff KingSep 24, 2013
  5. Felipe ContrerasSep 24, 2013
  6. Jeff KingSep 24, 2013
  7. Felipe ContrerasSep 24, 2013
  8. Jeff KingSep 24, 2013
  9. Felipe ContrerasSep 24, 2013
  10. Jonathan NiederSep 24, 2013
  11. John SzakmeisterSep 24, 2013
  12. Felipe ContrerasSep 28, 2013
  13. Michael HaggertySep 29, 2013
  14. Felipe ContrerasSep 29, 2013
  15. Jonathan NiederSep 30, 2013
  16. Duy NguyenOct 1, 2013
  17. Junio C HamanoOct 15, 2013
  18. Felipe ContrerasOct 16, 2013
  19. Junio C HamanoOct 17, 2013
  20. Felipe ContrerasOct 17, 2013
  21. John SzakmeisterSep 24, 2013
  22. Felipe ContrerasSep 24, 2013
  23. John SzakmeisterSep 24, 2013
  24. Felipe ContrerasSep 24, 2013
  25. John SzakmeisterSep 25, 2013
  26. Felipe ContrerasSep 25, 2013
  27. Matthieu MoySep 25, 2013
  28. Felipe ContrerasSep 25, 2013
  29. Matthieu MoySep 25, 2013
  30. Felipe ContrerasSep 25, 2013
  31. Matthieu MoySep 25, 2013
  32. Felipe ContrerasSep 25, 2013
  33. SZEDER GáborSep 24, 2013
  34. build: add default aliasesFelipe Contreras, Sep 24, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.