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 11, 2005, 23:45 UTC
Message-ID
<Pine.LNX.4.58.0507111636030.17536@g5.osdl.org>
In-Reply-To
<20050711222046.GA21376@buici.com>
On Mon, 11 Jul 2005, Marc Singer wrote:
Show 8 quoted lines
> 
> I picked 2.6.12
> 
>   # git checkout -f v2.6.12
> 
> applied the patch and was greeted with an error about being unable to
> commit telling me that I LONG_HEX_NUMBER is not a valid commit object.
> Isn't 2.6.12 later than 2.6.12-rcX?
Yes.

However, that's not how "git checkout" ends up working, which is probably (almost certainly) a misfeature of git checkout. In particular, when you use a tag to checkout something, it will checkout the _state_ at that point (ie v2.6.12), but it won't have reset your HEAD to point to it.

And your earlier adventures made your HEAD be something that isn't a commit (although I quite frankly don't know quite how you succeeded at that: "git checkout" should refuse to write a HEAD unless you check out a specific branch, and all branch pointers are proper commit points).

Anyway, here's how you fix it right now, and I'll have to figure out how to make a nice interface:

	#
	# Reset the "master" branch to v2.6.12
	#
	git-rev-list --max-count=1 v2.6.12 > .git/refs/heads/master
	#
	# Switch to the master branch
	#
	git checkout -f master
which should get you to be at a known point (which is v2.6.12).
		Linus
Previous: Daniel BarkalowNext: Marc Singer
Message 28 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.