Thread (13 messages) flat view 13 messages, 4 authors, 2016-08-11

Re: Bootstrapping into git, commit gripes at me

From: Petr Baudis <hidden>
Date: 2016-06-15 22:42:02

Dear diary, on Tue, Jul 12, 2005 at 06:34:33AM CEST, I got a letter
where Linus Torvalds [off-list ref] told me that...
On Mon, 11 Jul 2005, Linus Torvalds wrote:
quoted
    Of course, if you want to create a new branch "my-branch" and _not_
    check it out, you could have done so with just

        git-rev-parse v2.6.12^0 > .git/refs/heads/my-branch

    which I think I will codify as "git branch".
And now we have that "git branch". It's a trivial one-liner, except with
the setup and error checking it's actually more like six lines.
Could we please have the branch name written to .git/head-name in case
we switch the branch? The reason is that .git/HEAD may not be always a
symlink. Specifically, I do this - there's a command cg-seek, which will
seek your working tree to a given commit, while staying on the branch
(committing and some other operations are blocked). In that case, I
remove .git/HEAD and replace it with ID of the commit I'm seeked at, and
when I'm "unseeking" back to the top, I replace it with the symlink
again. With some heuristics, I could create .git/head-name at the time
of seek and hope, but I think it'd be cleaner to just always set it
(except when we are on the master branch), if you agree.

Note that even though Cogito won't let you create/change a local branch
yet, it will understand .git/head-name and hopefully behave properly
(although it's totally untested, of course).

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help