From: Petr Baudis Date: Tue, 14 Feb 2006 21:41:24 GMT Subject: Re: several quick questions Message-ID: <20060214214123.GI31278@pasky.or.cz> In-Reply-To: <200602142230.11442.Josef.Weidendorfer@gmx.de> Dear diary, on Tue, Feb 14, 2006 at 10:30:11PM CET, I got a letter where Josef Weidendorfer said that... > Why not allow something like > > git-checkout master~5 > > which implicitly does create a read-only branch "seek-point"? > I do not think that it is important to remember the branch name you seek > from. > > A branch could be marked readonly by above command with > > chmod a-w .git/refs/heads/seek > > And git-commit should refuse to commit on a readonly ref, telling > the user to create a writable branch before with "git-branch new". We just abolished symlinks. Can we afford doing this, from the portability standpoint? > This would also help "cg-seek" to prohibit the user to commit on > "cg-seek-point" via "git-commit" (by setting cg-seek-point read-only). For now, this is accomplished (in Cogito, but we just introduced this to git-bisect as well) by creating .git/head-name. This has the advantage that you know to which branch to return after the seeking is over, and it also marks the current head "read-only" (in the commit sense) for Cogito (and git-bisect start). It is obviously less flexible since it lets you mark only the current head read-only, but noone asked for more before. ;) -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ Of the 3 great composers Mozart tells us what it's like to be human, Beethoven tells us what it's like to be Beethoven and Bach tells us what it's like to be the universe. -- Douglas Adams