The annoying thing about temporary branch names like "bisect" and "seek"
is that:
a) They clutter up the nae space available to the repository user.
Users have to know that those are reserved names.
b) If a repository is cloned while they're in use, they might get
into a "remotes" file, with even more confusing results.
This is somewhat heretical, but how about making a truly unnamed branch by
having .git/HEAD *not* be a symlink, but rather hold a commit ID directly?
It's already well established that files in the .git directory directly
are strictly local to this working directory, so it seems a much better
home for such temporary state.
Admittedly, this requires more invasive edits (particularly adding a third
legitimate case to validate_symref()), but it seems to make more sense.
And be ultimately simpler than workarounds for the above problems.
Just loosen the rules from ".git/HEAD must be a symlink" to
".git/HEAD must be a symlink before you can check in".
Yes, I know it's radical. At least I'm not questioning the
power and efficacy of indulgences. :-)
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:42:20
Hi,
On Fri, 23 Feb 2006, linux@horizon.com wrote:
This is somewhat heretical, but how about making a truly unnamed branch by
having .git/HEAD *not* be a symlink, but rather hold a commit ID directly?
Not heretical. How do you intend to switch branches now? And how do you
intend to record the starting point of git-seek to which you want to
return to? All leads back to .git/HEAD pointing to a branch (or whatever
you want to call it). And BTW, .git/HEAD is no symlink these days, but a
symref.
Hth,
Dscho
Not heretical. How do you intend to switch branches now?
Point .git/HEAD at the branch like usual.
.git/HEAD would not be a symref *only* when on the unnamed temporary
branch (which doesn't accept commits).
And how do you intend to record the starting point of git-seek to
which you want to return to?
Te same way it's done now for git-seek or git-bisect: by copying the
old HEAD to a temporary location like .git/head-name.
All leads back to .git/HEAD pointing to a branch (or whatever
you want to call it).
In the usual case, yes it should. Any time you want to be able to
develop on a branch, you need .git/HEAD pointing to a branch.
You only make it point to a commit directly is when exploring the
history with no intention of developing from it.
(Note that you can easily change your mind with a simple
"git checkout -b <branch>".)
And BTW, .git/HEAD is no symlink these days, but a symref.
Yes, I'm sorry; I was just being lazy with my terminology.
From: "H. Peter Anvin" <hpa@zytor.com> Date: 2016-06-15 22:42:20
linux@horizon.com wrote:
The annoying thing about temporary branch names like "bisect" and "seek"
is that:
a) They clutter up the nae space available to the repository user.
Users have to know that those are reserved names.
b) If a repository is cloned while they're in use, they might get
into a "remotes" file, with even more confusing results.
This is somewhat heretical, but how about making a truly unnamed branch by
having .git/HEAD *not* be a symlink, but rather hold a commit ID directly?
It's already well established that files in the .git directory directly
are strictly local to this working directory, so it seems a much better
home for such temporary state.
It might be easier to just reserve part of the namespace, e.g. ".bisect"
and ".seek" instead.
-hpa
From: Andreas Ericsson <hidden> Date: 2016-06-15 22:42:20
H. Peter Anvin wrote:
linux@horizon.com wrote:
quoted
The annoying thing about temporary branch names like "bisect" and "seek"
is that:
a) They clutter up the nae space available to the repository user.
Users have to know that those are reserved names.
b) If a repository is cloned while they're in use, they might get
into a "remotes" file, with even more confusing results.
This is somewhat heretical, but how about making a truly unnamed
branch by
having .git/HEAD *not* be a symlink, but rather hold a commit ID
directly?
It's already well established that files in the .git directory directly
are strictly local to this working directory, so it seems a much better
home for such temporary state.
It might be easier to just reserve part of the namespace, e.g. ".bisect"
and ".seek" instead.
Ach, no. Not specific names. ^\.-.* would be acceptable, but I sometimes
use '.name' or '-name' to mark a temporary branch. Making .- or some
such reserved would perhaps make sense, but not with specific names.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231