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

Re: Bootstrapping into git, commit gripes at me

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 12, 2005, 03:18 UTC
Message-ID
<Pine.LNX.4.58.0507112010120.17536@g5.osdl.org>
In-Reply-To
<7voe98g3ws.fsf@assigned-by-dhcp.cox.net>
On Mon, 11 Jul 2005, Junio C Hamano wrote:
Show 5 quoted lines
>
> > Opinions?
> 
> How about treating "master" a temporary thing --- "whatever I
> happen to be working on right now"?

I'd not mind with this in theory, but it has the fundamental problem that we can end up losing sight of commits we have, and then have no way to reach them.

Which is ok per se - sometimes you simply don't care about them, and I occasionally drop some commits on purpose when I've done something I decide to undo and then do a "git prune" to get rid of the objects.

But I don't want this to happen _easily_.
Your examples aren't actually very interesting:
Show 10 quoted lines
>  - git branch <branch-name>       ;# copies master to branch-name;
> 				     if branch-name exists in refs/heads,
>                                      warn and refuse.  Override
> 				     with --force flag.
> 
>  - git checkout <branch-name>     ;# copies branch-name to master; but
>                                      if master does not match any
>                                      of the other refs/heads/, warn
>                                      and refuse.  Override with
>                                      --force flag.
because those two examples end up avoiding the _real_ issue, which is the
	git checkout v2.6.12

case, which is exactly the case that would need a "--force" flag, since master is what you're working on before. And --force would drop that information.

So I want something that naturally works with this (very reasonable) way of working, and does _not_ force people to drop information.

In your world, you'd have to first save the old master with
	git branch work-branch
and then you could do
	git checkout v2.6.12

to start on "master" anew. That's fair, but it's conceptually very wrong: it rquires you to name the _old_ thing, which to me just sounds very confusing indeed. You don't care about the old thing, it's the _new_ thing you care about.

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.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 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.