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

Re: Re* [PATCH] doc: glossary: add entry for revision range

From
Jeff King <peff@peff.net>
Date
May 18, 2021, 06:55 UTC
Message-ID
<YKNk+5k3hKW/xPBZ@coredump.intra.peff.net>
In-Reply-To
<60a34a7616cda_14d1bc20818@natae.notmuch>
On Tue, May 18, 2021 at 12:02:46AM -0500, Felipe Contreras wrote:
Show 20 quoted lines
> > Why would people need to use "git remote set-head" most of the time? The
> > symlink is set up properly by git-clone, and has been for many years.
> 
> First instructions from GitHub:
> 
>   echo "# test" >> README.md
>   git init
>   git add README.md
>   git commit -m "first commit"
>   git branch -M main
>   git remote add origin git@github.com:felipec/test.git
>   git push -u origin main
> 
> Second instructions from GitHub:
> 
>   git remote add origin git@github.com:felipec/test.git
>   git branch -M main
>   git push -u origin main
> 
> None of these use `git clone`.
So? Here are some other instructions from GitHub[0]:
  Type git clone, and then paste the URL you copied earlier.
    $ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
[0] https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository

Not to mention that every single repository page mentions cloning under the "Code" button (including the command-line "gh repo clone" if you are using their recommended tool).

People clone a lot more than they create new repositories.
> Of 31 repositories I work on and have quickly at hand only 8 have
> origin/HEAD.

And of 141 repositories I have on my workstation, 137 have origin/HEAD (and of the 4 without, one does not even have a remote at all, and one is a git-svn repository).

I don't think that proves anything except that your workflow is different than mine. But I contend that most people get repositories by cloning them.

Show 5 quoted lines
> And even *if* origin/HEAD did work on most repositories (hardly the
> case), most people are not going to train their fingers to type `git cmd
> $x` when the only $x where the command works is "origin"; they would
> rather train their fingers to do $x/master which works on many more
> repositories.

I guess I'm not most people, because I sure have enjoyed typing the shorter thing all these years.

Look, I get that you didn't know or care about the "origin/HEAD" feature until recently. But it's been part of Git for over 15 years, and has been used as the documentation examples for revision ranges in both git-rev-list(1) and gitrevisions(7), as well as the user-manual.

I'm perfectly happy to use placeholder ref names in the glossary documentation, but it's not like the use of "origin" as a name is some obscure secret.

-Peff
Previous: Felipe ContrerasNext: Felipe Contreras
Message 16 of 19 in “doc: glossary: add entry for revision range”
  1. doc: glossary: add entry for revision rangeFelipe Contreras, May 16, 2021
  2. Re* [PATCH] doc: glossary: add entry for revision rangeJunio C Hamano, May 17, 2021
  3. Felipe ContrerasMay 17, 2021
  4. Jeff KingMay 17, 2021
  5. Felipe ContrerasMay 17, 2021
  6. Jeff KingMay 18, 2021
  7. Felipe ContrerasMay 18, 2021
  8. Junio C HamanoMay 17, 2021
  9. Felipe ContrerasMay 17, 2021
  10. Junio C HamanoMay 18, 2021
  11. Felipe ContrerasMay 18, 2021
  12. Jeff KingMay 18, 2021
  13. Junio C HamanoMay 18, 2021
  14. Felipe ContrerasMay 18, 2021
  15. Felipe ContrerasMay 18, 2021
  16. Jeff KingMay 18, 2021
  17. Felipe ContrerasMay 18, 2021
  18. Jeff KingMay 18, 2021
  19. Felipe ContrerasMay 18, 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.