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

Re: Bootstrapping into git, commit gripes at me

From
Junio C Hamano <junkio@cox.net>
Date
Jul 12, 2005, 03:41 UTC
Message-ID
<7v8y0cg07c.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0507112010120.17536@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 8 quoted lines
> So at least to me it makes much more sense to say "ok, I'll start
> something new, and call it xyzzy", than "ok, I'll start something new, and
> I'll save the old under 'old'".
>
> The "old" thing might not even be anything you worked on (it might be
> something you just cloned from somebody else), so you giving it a name 
> isn't very logical. In contrast, you're clearly doing something active 
> with the new thing, so naming _that_ makes sense.

What I had mind was ``If you do not care about the current "master", just say "checkout --force"''.

When I start working on something I often do not know what the thing I am going to work on ends up to be. So I would start from v2.6.12 tag, do random hacking, and when I got into a reasonable shape, I would say ``Ok, this is worth saving. Let's name it "foobar" branch and continue.'' And I would probably switch to some other subproject when an urgent bugfix comes in, and I would not want to lose my "master" _then_. So (the "branch" one has been revised):

  checkout [--force] <commit-ish>
   In addition to reading the tree and updating the work tree,
   stores "<commit-ish>^0" in .git/refs/heads/master.  However,
   if the current "master" is not something that matches a
   refs/*/*, then the user will be losing the trail between
   "master" before checkout and what is recorded in refs/, so
   the user needs to allow me explicitly to do it.
  branch <branch-name>
   Save the current "master" to branch-name.  If the user makes
   a mistake and tries to store the "master" head into a wrong
   branch, that would lose development trail of the branch being
   overwritten, so if the named branch exists and "master" is
   not a descendent of it, the user needs to explicitly tell me
   that it is OK to do so.

I do not quite follow your objections. I do not think I am forcing anybody to name an old thing. Do you mean that "I've been working on A and now I want to switch to B; so I'll save the current state in A and switch to B" is too redundant, and I should just let the user say "I've been working on something I do not care to remember, now I want to switch to B, so just take me to B and you should remember where I was and save it to A automatically"? That sort of makes sense to me.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 24 of 33 in “Bootstrapping into git, commit gripes at me”
  1. Marc SingerJul 8, 2005
  2. Linus TorvaldsJul 9, 2005
  3. Marc SingerJul 11, 2005
  4. Junio C HamanoJul 11, 2005
  5. Junio C HamanoJul 11, 2005
  6. Linus TorvaldsJul 12, 2005
  7. Linus TorvaldsJul 12, 2005
  8. Marc SingerJul 12, 2005
  9. Linus TorvaldsJul 12, 2005
  10. Linus TorvaldsJul 12, 2005
  11. Linus TorvaldsJul 12, 2005
  12. Marc SingerJul 12, 2005
  13. Linus TorvaldsJul 12, 2005
  14. Marc SingerJul 12, 2005
  15. Petr BaudisJul 12, 2005
  16. Junio C HamanoJul 12, 2005
  17. Matthias UrlichsJul 12, 2005
  18. Petr BaudisJul 24, 2005
  19. Junio C HamanoJul 24, 2005
  20. Linus TorvaldsJul 12, 2005
  21. Petr BaudisAug 12, 2005
  22. Junio C HamanoJul 12, 2005
  23. Linus TorvaldsJul 12, 2005
  24. Junio C HamanoJul 12, 2005
  25. Linus TorvaldsJul 12, 2005
  26. Marc SingerJul 12, 2005
  27. Daniel BarkalowJul 12, 2005
  28. Linus TorvaldsJul 11, 2005
  29. Marc SingerJul 9, 2005
  30. Matthias UrlichsJul 9, 2005
  31. Petr BaudisJul 10, 2005
  32. Marc SingerJul 9, 2005
  33. Junio C HamanoJul 9, 2005

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.