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 29, 2013, 03:37 UTC
Message-ID
<CAMP44s12c2_nEkwzgWXYzaJTeymSyLbDMWoRygMwZv8-m8wG4g@mail.gmail.com>
In-Reply-To
<52479C04.8060000@alum.mit.edu>
On Sat, Sep 28, 2013 at 10:18 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 42 quoted lines
> On 09/29/2013 12:41 AM, Felipe Contreras wrote:
>> On Tue, Sep 24, 2013 at 1:39 PM, Jonathan Nieder <jrnieder@gmail.com> 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
>>>>
>>>> [...]
>>
>>> 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.
>
> ...and in scripts.
>
>> It might, or...
>>
>>> 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.
>
> My experience contradicts your prediction.  I have 'ci'/'co' aliases in
> my own configuration.  But even though I am aware of the fact that other
> people might not have the same aliases, I have on multiple occasions
> used them in documentation and/or scripts meant for other people.  The
> muscle memory is just too strong.

If you are already making that error, then this patch wouldn't make it any worst. In fact, it would make the situation better.

If previously you had 10 persons complaining about the "ci" command not working, now 9 of them wouldn't complain because "git ci" does actually work, even if you have aliased it to something slightly different, like "commit -v". Instead, you would have 1 person complaining, because he has a different alias, which makes the command fail somehow. In reality, that 1 person might not even exist.

The solution before and after my patch is the same; avoid the 'ci'/'co' aliases.
> My error was discovered by other people who didn't have those aliases.
And after this patch it still will.
> If *most* people had the same aliases as I did, and others had defined
> their own slightly different ones, then the scripts would have subtly
> malfunctioned for the latter set of users and I would have had trouble
> reproducing the errors.

Doubtful. But a warning that a default alias is being used, or simply showing the actual command in the standard output would fix the problem.

It certainly looks like you are not even looking for solutions for the hypothetical problems you put forward.

> So, even though I think such aliases are a great convenience factor, I
> am -0 on including pre-defined but overrideable aliases and -1 on
> including pre-defined and non-overrideable aliases.

And still, somehow every other VCS out there manages default aliases just fine, and Mercurial even allows overriding commands. How do you explain that the world hasn't ended for them?

-- 
Felipe Contreras
Previous: Michael HaggertyNext: Jonathan Nieder
Message 14 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.