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

Re: Missing features in git

From
Karl Hasselström <kha@treskal.com>
Date
Nov 14, 2006, 17:36 UTC
Message-ID
<20061114173657.GC5453@diana.vm.bytemark.co.uk>
In-Reply-To
<200611141815.24236.jnareb@gmail.com>
On 2006-11-14 18:15:23 +0100, Jakub Narebski wrote:
> Karl Hasselström wrote:
Show 15 quoted lines
> > On 2006-11-14 15:53:18 +0100, Jakub Narebski wrote:
>
> > > And what would happen if you want to checkout other branch?
> > > Where the ID in the HEAD would go to? HEAD just _has_ to be
> > > reference to _branch_.
> >
> > The id that used to be HEAD would not be saved anywhere. It would
> > still be reachable from your refs, presumably, just like before
> > you checked it out. (It would not be the case that you had made
> > commits on an unnamed branch that would now get lost, because the
> > tool would refuse to commit until you had created a name for the
> > branch.)
>
> If HEAD would contain an commit ID directly, then you shouldn't be
> able to commit at all.

I agree. You aren't on a branch, so you can't commit. (Of course, creating a branch for the commit you're on is trivial: "git checkout -b <branchname>".)

> Not very useful, it is.

Well, as long as you only want to visit the past, not change it, it can be useful. For example, we could skip the "bisect" branch, since you aren't supposed to commit to that anyway.

-- 
Karl Hasselström, kha@treskal.com
Previous: Jakub NarebskiNext: Jakub Narebski
Message 5 of 12 in “Missing features in git”
  1. linux@horizon.comNov 14, 2006
  2. Jakub NarebskiNov 14, 2006
  3. Karl HasselströmNov 14, 2006
  4. Jakub NarebskiNov 14, 2006
  5. Karl HasselströmNov 14, 2006
  6. Jakub NarebskiNov 14, 2006
  7. Shawn PearceNov 14, 2006
  8. Linus TorvaldsNov 14, 2006
  9. Petr BaudisNov 14, 2006
  10. Junio C HamanoNov 14, 2006
  11. Karl HasselströmNov 14, 2006
  12. Junio C HamanoNov 14, 2006

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.