threads / patch / 3450

patchRe: [PATCH] New git-seek command with documentation and test.

Subject: Re: [PATCH] New git-seek command with documentation and test.

## tl;dr

5 messages between Feb 24, 2006 and Feb 24, 2006. Diffs are folded; open one to read it.

replies: 4people: 4as markdown or json

linux@horizon.com· Feb 24, 2006, 00:29 UTC · lore
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. :-)

Johannes Schindelin· Feb 24, 2006, 00:54 UTC · re: linux@horizon.com · lore
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

linux@horizon.com· Feb 24, 2006, 01:23 UTC · re: Johannes Schindelin · lore
> 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.
H. Peter Anvin· Feb 24, 2006, 06:53 UTC · re: linux@horizon.com · lore
linux@horizon.com wrote:
Show 13 quoted lines
> 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
Andreas Ericsson· Feb 24, 2006, 10:11 UTC · re: H. Peter Anvin · lore
H. Peter Anvin wrote:
Show 21 quoted lines
> 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.
> 

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

← back to recent threads