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

Re: What is missing from Git v2.0

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 22, 2014, 18:33 UTC
Message-ID
<xmqqk3ah5i55.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHGBnuMty-86jfUto=L3muhgEVwVE70FQQY2FJ1bn7AUjfEtLQ@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 10 quoted lines
> On Mon, Apr 21, 2014 at 9:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>>> If we don't standardize this now people will come up with their own
>>> definitions [1] [2] (and many others if you just search GitHub) which
>>> are again likely to differ (slightly), hindering interoperability.
>>
>> I am afraid that that ship has sailed long time ago, though.
>
> That's most likely true, but it does not get better by postponing this
> even more.
As I already said:
    I think it might be OK to implement them as the lowest priority
    fallback alias, so that '[alias] co = "user's definition"'
    anywhere in the various configuration locations will override
    it.  I am a bit hesitant about adding start-up overhead, though.
    Also I am not sure if people can agree with (1) a broadly wide
    selection of aliases and (2) the actual definitions for them (I
    am OK with "co === checkout" myself, but I'd rather not to even
    think about my Git wasting cycles parsing extra configuration
    items to support "br === branch" at all, for example).

I am not fundamentally opposed. I just do not think it would add much value to new people at this point, and it will actively hurt if we shoved barely cooked one in 2.0.

A few thinking points that are necessary to be worked out, even before we start imagining a plan to introduce them, off the top of my head, are these:

 * Should we add many random aliases, or should we limit ourselves
   only to a narrow set that everybody can agree on?
 * What is the additional cognitive load do we feel comfortable
   burdening with the new users?
 * What is the exact mechanism to give these built-in aliases?

Imagine that somebody says "[alias] ci = commit" and a handful of vocal people on this list agree that it is a good idea. Many random websites start mentioning "git ci -a" in their beginner examples.

Users are led to think "ci" is a command just like "commit" and does the same thing. Some of them want to always commit everything before moving to their next task, and want to alias it further, e.g. "[alias] ci = ci -a"---which would not work. At that point, the users need to learn the distinction between native subcommands (e.g. "commit"), built-in fallback aliases (e.g. "ci") and aliases of their own in their ~/.gitconfig, and need to learn that only the first kind and not the second kind cannot be used to define their own alias (and the users need to learn "commit" at that time as well).

That could be solved by making "ci" not a built-in fallback alias, but a new subcommand (then there is no "'foo' in 'git foo' could be a command or a built-in alias and they behave differently" issue), and additionally somehow allowing a native subcommand overriden by end-user alias, but I do not think anybody designed how such an override would work so far.

So even if we agree that it would be a good idea to have some default fallback aliases, the set of such aliases we ship must be limited to a set that everybody can agree on, both in the sense that "adding alias XX is good" and also in the sense that "alias XX must be defined as YY".

As you allueded to, the Git userbase is a lot larger than it used to be back in 2006, one alias, e.g. "[alias] br = branch", that is reported as either useless or needed to be further tweaked by a person on this list would mean that we would be either spending unnecessary start-up cycles (for "useless" case) or adding cognitive load of having to differente between "branch" and "br" (for "needs further tweak" case) for thousands of users who would be better off if we didn't have that specific alias.

So while I understand the desire to have a bit more handholding and am not fundamentally opposed to the desire, I am not optimistic that an attempt to implement these "aliases" would result in a very useful addition to the system, even if done after careful thought.

In any case, this definitely is not a 2.0 material. I agree that it would be good to start discussing it early (rather than later) if we ever want to do such a change.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 13 of 77 in “What is missing from Git v2.0”
  1. Felipe ContrerasApr 20, 2014
  2. Felipe ContrerasApr 20, 2014
  3. Sebastian SchuberthApr 21, 2014
  4. Felipe ContrerasApr 21, 2014
  5. Sebastian SchuberthApr 21, 2014
  6. Theodore Ts'oApr 21, 2014
  7. Felipe ContrerasApr 21, 2014
  8. Sebastian SchuberthApr 22, 2014
  9. Felipe ContrerasApr 22, 2014
  10. Junio C HamanoApr 21, 2014
  11. Sebastian SchuberthApr 22, 2014
  12. Felipe ContrerasApr 22, 2014
  13. Junio C HamanoApr 22, 2014
  14. Felipe ContrerasApr 22, 2014
  15. Matthieu MoyApr 22, 2014
  16. Felipe ContrerasApr 22, 2014
  17. Junio C HamanoApr 22, 2014
  18. Theodore Ts'oApr 22, 2014
  19. Felipe ContrerasApr 22, 2014
  20. David KastrupApr 22, 2014
  21. Felipe ContrerasApr 24, 2014
  22. David KastrupApr 24, 2014
  23. Andreas KreyApr 24, 2014
  24. Felipe ContrerasApr 24, 2014
  25. David KastrupApr 24, 2014
  26. David LangApr 22, 2014
  27. Felipe ContrerasApr 24, 2014
  28. David LangApr 24, 2014
  29. Felipe ContrerasApr 24, 2014
  30. James DenholmApr 24, 2014
  31. Felipe ContrerasApr 24, 2014
  32. James DenholmApr 24, 2014
  33. Felipe ContrerasApr 24, 2014
  34. David KastrupApr 24, 2014
  35. Felipe ContrerasApr 24, 2014
  36. David KastrupApr 24, 2014
  37. Felipe ContrerasApr 24, 2014
  38. David LangApr 24, 2014
  39. Theodore Ts'oApr 24, 2014
  40. Stefan BellerApr 24, 2014
  41. tytso@mit.eduApr 24, 2014
  42. Stefan BellerApr 24, 2014
  43. Jonathan NiederApr 24, 2014
  44. Felipe ContrerasApr 24, 2014
  45. Jeff KingApr 24, 2014
  46. Felipe ContrerasApr 24, 2014
  47. Felipe ContrerasApr 24, 2014
  48. Matthieu MoyApr 25, 2014
  49. Philippe VaucherApr 25, 2014
  50. Felipe ContrerasApr 24, 2014
  51. luc.linux@mailoo.orgApr 24, 2014
  52. Javier Domingo CansinoApr 25, 2014
  53. Felipe ContrerasApr 25, 2014
  54. Philippe VaucherApr 25, 2014
  55. Felipe ContrerasApr 25, 2014
  56. Theodore Ts'oApr 25, 2014
  57. Philippe VaucherApr 25, 2014
  58. Theodore Ts'oApr 25, 2014
  59. Philippe VaucherApr 25, 2014
  60. Felipe ContrerasApr 25, 2014
  61. Felipe ContrerasApr 25, 2014
  62. Jeff KingApr 25, 2014
  63. Felipe ContrerasApr 25, 2014
  64. Jeff KingApr 25, 2014
  65. Felipe ContrerasApr 25, 2014
  66. Jeff KingApr 25, 2014
  67. Felipe ContrerasApr 25, 2014
  68. David KastrupApr 25, 2014
  69. Jonathan NiederApr 25, 2014
  70. David KastrupApr 25, 2014
  71. Jonathan NiederApr 25, 2014
  72. Junio C HamanoApr 22, 2014
  73. Felipe ContrerasApr 24, 2014
  74. brian m. carlsonApr 22, 2014
  75. Felipe ContrerasApr 22, 2014
  76. David AguilarApr 22, 2014
  77. Felipe ContrerasApr 22, 2014

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.