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

Re: git switch/restore, still experimental?

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 11, 2021, 07:15 UTC
Message-ID
<609a2f0c7353b_5d5d3208a7@natae.notmuch>
In-Reply-To
<8735uuvois.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> On Thu, May 06 2021, Felipe Contreras wrote:
> 
> First of all, I think we're in rather violent agreement about the real
> matter at hand here, and are at best talking about the design of the
> keychain for the bikeshed...
Indeed. The design of the hypothetical keychain for future bikesheds.
Show 11 quoted lines
> > Which command is that?
> >
> >   git create branch --checkout?
> >
> > I'm following the order of the words from left to right.
> 
> I'm just pointing out that git in general and certainly not the *nix
> tradition it follows tries to make commands readable in anything like
> English sentence order. If you attempt to read "log", "status", "rebase"
> etc. commands like that you'll at best end up sounding somewhat like
> Yoda.

Right, but git is infamous for having a UI that leaves a lot to be desired. I'm less concerned about the status quo of git's UI than I am of what could be.

Inertia is something that just can't be ignored on commands that people have been using for 15 years.

My point is that new commands should not follow the inertia of old commands, especially when we know that historically the UI is the thing that needs more improvements. In fact, we should do the *opposite*. It's the less-than-stellar UI that created the need for switch/restore in the first place.

Show 12 quoted lines
> > In this case however we have a rare occasion in which both consistency and
> > natural language meet, we should not squander it.
> >
> > In fact, to be even more consistent we could add a -n option to git
> > branch, which would be reduntant but more explicit, like --list.
> 
> Indeed, I agree with all of that. I.e. we should move to "switch" to
> "-n" instead of "-c" etc., and add a "-n" to "branch" for
> consistency. After all that's my upthread proposal...
> 
> I just don't think it's worth trying to make the argv readable as a
> sentence, even if we had no backwards compatibility to worry about.

Well, we would need to look at particular examples to see if the counter-examples make more sene or not.

Either way my contention is that it doesn't hurt.

I will take a look at switch/restore and see if a linguist approach gives more low-hanging fruit.

Fortunately none of that matters for your particular proposal which is just good.

Cheers.
-- 
Felipe Contreras
Previous: Ævar Arnfjörð BjarmasonNext: Johannes Schindelin
Message 21 of 25 in “git switch/restore, still experimental?”
  1. Gábor FarkasMay 4, 2021
  2. Felipe ContrerasMay 4, 2021
  3. Elijah NewrenMay 5, 2021
  4. Eric SunshineMay 5, 2021
  5. Ævar Arnfjörð BjarmasonMay 5, 2021
  6. Felipe ContrerasMay 5, 2021
  7. Sergey OrganovMay 5, 2021
  8. Sergey OrganovMay 5, 2021
  9. Junio C HamanoMay 6, 2021
  10. Sergey OrganovMay 6, 2021
  11. Ævar Arnfjörð BjarmasonMay 6, 2021
  12. Sergey OrganovMay 6, 2021
  13. Junio C HamanoMay 6, 2021
  14. Ævar Arnfjörð BjarmasonMay 6, 2021
  15. Ævar Arnfjörð BjarmasonMay 10, 2021
  16. Junio C HamanoMay 10, 2021
  17. Felipe ContrerasMay 6, 2021
  18. Ævar Arnfjörð BjarmasonMay 6, 2021
  19. Felipe ContrerasMay 6, 2021
  20. Ævar Arnfjörð BjarmasonMay 10, 2021
  21. Felipe ContrerasMay 11, 2021
  22. Johannes SchindelinMay 5, 2021
  23. Randall S. BeckerMay 5, 2021
  24. Junio C HamanoMay 6, 2021
  25. Felipe ContrerasMay 5, 2021

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.