* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 11:02 ` Lars Hjemli
@ 2007-02-02 13:02 ` Andy Parkins
2007-02-02 14:55 ` Nicolas Pitre
2007-02-02 15:13 ` Nicolas Pitre
2007-02-02 13:21 ` Jakub Narebski
` (3 subsequent siblings)
4 siblings, 2 replies; 35+ messages in thread
From: Andy Parkins @ 2007-02-02 13:02 UTC (permalink / raw)
To: git; +Cc: Lars Hjemli, Johannes Schindelin, Jakub Narebski
On Friday 2007 February 02 11:02, Lars Hjemli wrote:
> "HEAD@{yesterday}" = current branch, yesterday
> "@{yesterday}" = detached head (no branch), yesterday
I'd vote for this too. It's the only logically consistent view.
HEAD is a symbolic reference, it's a way of referring to a real branch by
another name. HEAD@{} should be the same as branch@{} to be consistent.
Forgetting about detached heads for the moment, imagine that yesterday I did
lots of bouncing around on branches, around 1300 (although I wouldn't
remember the exact time). Oh look, it's about 1300 now. What then is
HEAD@{yesterday} going to tell me? What will it tell me one minute from now?
It would be the most confusing operation in the world; I'd have to remember
which branch I had checked out and what time I checked it out.
I really don't want to be able to answer the question what branch did I have
checked out 15 minutes ago. I do want to ask where was my current branch 15
minutes ago.
Then of course, it's perfectly reasonable to treat the detached HEAD as
meaning that the symref HEAD was pointing at a kind of virtual branch - this
is a branch that isn't in the refs directory but is reflogged. Other than
that it's no different from any other branch.
Any notation would do I think, @{} is as good as any other. In fact, if we
used the name "unnamed branch" instead of "detached head", the notation @{}
is perfect. (Actually I think unnamed branch is a much better term than
detached HEAD, because HEAD is never detached - it must point at something)
Andy
--
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 13:02 ` Andy Parkins
@ 2007-02-02 14:55 ` Nicolas Pitre
2007-02-02 15:13 ` Nicolas Pitre
1 sibling, 0 replies; 35+ messages in thread
From: Nicolas Pitre @ 2007-02-02 14:55 UTC (permalink / raw)
To: Andy Parkins; +Cc: git, Lars Hjemli, Johannes Schindelin, Jakub Narebski
On Fri, 2 Feb 2007, Andy Parkins wrote:
> On Friday 2007 February 02 11:02, Lars Hjemli wrote:
>
> > "HEAD@{yesterday}" = current branch, yesterday
> > "@{yesterday}" = detached head (no branch), yesterday
>
> I'd vote for this too. It's the only logically consistent view.
No it is not.
> HEAD is a symbolic reference, it's a way of referring to a real branch by
> another name. HEAD@{} should be the same as branch@{} to be consistent.
HEAD is _NOT_ a symbolic reference. It _may_ happen to be a symbolic
reference, but it _may_ happen to not be.
And please see my previous email for more arguments.
Nicolas
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 13:02 ` Andy Parkins
2007-02-02 14:55 ` Nicolas Pitre
@ 2007-02-02 15:13 ` Nicolas Pitre
2007-02-02 16:11 ` Andy Parkins
1 sibling, 1 reply; 35+ messages in thread
From: Nicolas Pitre @ 2007-02-02 15:13 UTC (permalink / raw)
To: Andy Parkins; +Cc: git, Lars Hjemli, Johannes Schindelin, Jakub Narebski
On Fri, 2 Feb 2007, Andy Parkins wrote:
> Forgetting about detached heads for the moment,
That is not the way to go about it. You cannot start forgetting about
detached heads and come back to it afterwards like an afterthought.
> imagine that yesterday I did
> lots of bouncing around on branches, around 1300 (although I wouldn't
> remember the exact time). Oh look, it's about 1300 now. What then is
> HEAD@{yesterday} going to tell me? What will it tell me one minute from now?
> It would be the most confusing operation in the world; I'd have to remember
> which branch I had checked out and what time I checked it out.
The exact same argument could be said if you did 1300 operations on a
single branch, say master. What would master@{yesterday} tell you?
What will it tell you one minute from now? Now suppose that you have
only one branch and therefore HEAD reflog would be a duplicate of master
reflog.
Answer: it would carry the same kind of confusion as your example above.
> I really don't want to be able to answer the question what branch did I have
> checked out 15 minutes ago. I do want to ask where was my current branch 15
> minutes ago.
Then simply use @{15 minutes ago}. You'll even save yourself some
typing! It is not like if you have to type HEAD for most operations
anyway since HEAD is the likely default in most cases. So you may even
forget that the HEAD entity exists and be just fine.
But HEAD is still a moving pointer and we might want to know that it
switched from one branch to another at some point. And the only way for
that to be sensible is by having a separate reflog for HEAD that is the
exact log of every operations you perform regardless of the actual
branch you might be on.
> Then of course, it's perfectly reasonable to treat the detached HEAD as
> meaning that the symref HEAD was pointing at a kind of virtual branch - this
> is a branch that isn't in the refs directory but is reflogged. Other than
> that it's no different from any other branch.
>
> Any notation would do I think, @{} is as good as any other. In fact, if we
> used the name "unnamed branch" instead of "detached head", the notation @{}
> is perfect. (Actually I think unnamed branch is a much better term than
> detached HEAD, because HEAD is never detached - it must point at something)
HEAD _does_ get detached. It becomes loose in the air. It doesn't drag
any
branch
pointer with it. And everything you do on top of a detached HEAD will
be forgotten as soon as you leave it (and the eventual reflog for HEAD
expires) if you don't attach it somehow with a tag or a new branch.
There is no notion of a virtual branch at all, not technically, not
conceptually either.
Nicolas
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 15:13 ` Nicolas Pitre
@ 2007-02-02 16:11 ` Andy Parkins
2007-02-02 16:35 ` Simon 'corecode' Schubert
` (2 more replies)
0 siblings, 3 replies; 35+ messages in thread
From: Andy Parkins @ 2007-02-02 16:11 UTC (permalink / raw)
To: git; +Cc: Nicolas Pitre, Lars Hjemli, Johannes Schindelin, Jakub Narebski
On Friday 2007 February 02 15:13, Nicolas Pitre wrote:
> On Fri, 2 Feb 2007, Andy Parkins wrote:
> > Forgetting about detached heads for the moment,
>
> That is not the way to go about it. You cannot start forgetting about
> detached heads and come back to it afterwards like an afterthought.
I don't agree. To avoid confusing people the key thing should be consistency.
What holds true for HEAD in the non-detached case should hold true for the
detached case. Otherwise it's just another variable for the user to
remember.
> The exact same argument could be said if you did 1300 operations on a
> single branch, say master. What would master@{yesterday} tell you?
> What will it tell you one minute from now? Now suppose that you have
It doesn't matter - it will be on the same head, as time ticks by I will at
least find that master@{yesterday} ticks by linearly too. That is not the
case if HEAD@{yesterday} means "whatever HEAD pointed to yesterday". How am
I supposed to remember what it pointed to? Therefore what use is
HEAD@{yesterday}?
> only one branch and therefore HEAD reflog would be a duplicate of master
> reflog.
You misunderstand, I'm suggesting that reflogging HEAD is not the right thing
to do. Asking for HEAD's reflog should be the same as asking for the
pointed-to-branch's reflog.
Instead, the reflog should be kept for the "unnamed branch", which would jump
around each time you detached HEAD.
> Answer: it would carry the same kind of confusion as your example above.
I don't agree. HEAD is always "the branch I'm on now", even when it's
detached it's pointing at the branch I'm working on. It just happens that
that branch has no name.
> Then simply use @{15 minutes ago}. You'll even save yourself some
> typing! It is not like if you have to type HEAD for most operations
I'm not worried about the typing, or about the functionality. I think that
the functionality will be there in either of the proposed cases. I am
arguing which is the least confusing. The amount of typing should certainly
not be a factor in this case.
> anyway since HEAD is the likely default in most cases. So you may even
> forget that the HEAD entity exists and be just fine.
Yep; in my scenario that's true. One could completely forget about HEAD. In
your scenario that isn't the case, because I need to remember that when I'm
detached HEAD suddenly gets special powers to tell me about the detached
movements.
> But HEAD is still a moving pointer and we might want to know that it
> switched from one branch to another at some point. And the only way for
> that to be sensible is by having a separate reflog for HEAD that is the
> exact log of every operations you perform regardless of the actual
> branch you might be on.
I agree. I am arguing about nomenclature. There is no dispute that /that/
reflog (or equivalent) should exist. However, I don't believe it should
be "the log of HEAD" it should be "the log of the unnamed branch".
> HEAD _does_ get detached. It becomes loose in the air. It doesn't drag
Well, we're talking semantics now. HEAD becomes detached from a branch, but
it certainly isn't floating. It points at a particular point in the
repository.
HEAD is always a symref (despite what you say); it's just that when HEAD is
detached from all branches, there is no ref for it to point at, so we store
the ref in the file called HEAD. It's analogous to pointers in C:
HashType hash;
HashType *ref;
HashType **HEAD;
By sometimes treating HEAD as a ref, you break the model.
> pointer with it. And everything you do on top of a detached HEAD will
> be forgotten as soon as you leave it (and the eventual reflog for HEAD
> expires) if you don't attach it somehow with a tag or a new branch.
> There is no notion of a virtual branch at all, not technically, not
> conceptually either.
I disagree that there is no virtual branch. That is what HEAD is when it is
in detached mode. It looks just like a ref - HEAD holds a hash, refs hold a
hash - how is that not a virtual branch? I used the word "virtual" only
because it is not stored in refs/ and vanishes when you move back to a real
branch. Just because the virtual branch is stored in HEAD, I think it is
dangerous to thing of HEAD as being the thing that is logged - it is this
virtual branch that should be logged because that branch is always there and
can be tracked through time as a discrete entity. If you track HEAD itself,
then sometimes it will hold the same as a branch reflog, sometimes it will
hold unique data.
Perhaps this is just a product of my warped mental model of git. Obviously
you chaps who do the actual work get final say. Take the above with my usual
two cents of "I can't be sure of what I'm talking about" :-)
Andy
--
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 16:11 ` Andy Parkins
@ 2007-02-02 16:35 ` Simon 'corecode' Schubert
2007-02-02 17:19 ` Nicolas Pitre
2007-02-03 17:07 ` Mark Wooding
2 siblings, 0 replies; 35+ messages in thread
From: Simon 'corecode' Schubert @ 2007-02-02 16:35 UTC (permalink / raw)
To: Andy Parkins; +Cc: git, Nicolas Pitre
[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]
Andy Parkins wrote:
> Just because the virtual branch is stored in HEAD, I think it is
> dangerous to thing of HEAD as being the thing that is logged - it is this
> virtual branch that should be logged because that branch is always there and
> can be tracked through time as a discrete entity. If you track HEAD itself,
> then sometimes it will hold the same as a branch reflog, sometimes it will
> hold unique data.
hopefully, yes! Having to know "uhm, that time I was detached, oh, no, that was a ref" is the variable. The reflog we are talking about, no matter how it might be called or how its symbol is should track where my index wanders. which is called HEAD, I think (sorry, I'm quite new to git).
So, to make it clear, when I do this:
git checkout master
git checkout build
git checkout master~1
git checkout dbcca21
git checkout master
hack && git commit -a
then i expect the "reflog to be named" to follow *exactly these steps:
master, build, master~1, dbcca21..., master, newmaster
and _not_ just
master~1m, dbcca21...
cheers
simon
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 16:11 ` Andy Parkins
2007-02-02 16:35 ` Simon 'corecode' Schubert
@ 2007-02-02 17:19 ` Nicolas Pitre
2007-02-03 17:07 ` Mark Wooding
2 siblings, 0 replies; 35+ messages in thread
From: Nicolas Pitre @ 2007-02-02 17:19 UTC (permalink / raw)
To: Andy Parkins; +Cc: git, Lars Hjemli, Johannes Schindelin, Jakub Narebski
On Fri, 2 Feb 2007, Andy Parkins wrote:
> On Friday 2007 February 02 15:13, Nicolas Pitre wrote:
> > On Fri, 2 Feb 2007, Andy Parkins wrote:
> > > Forgetting about detached heads for the moment,
> >
> > That is not the way to go about it. You cannot start forgetting about
> > detached heads and come back to it afterwards like an afterthought.
>
> I don't agree. To avoid confusing people the key thing should be
> consistency.
I'm sorry but I can't help the fact that I think it's your argument that
is inconsistent.
> What holds true for HEAD in the non-detached case should hold true for the
> detached case. Otherwise it's just another variable for the user to
> remember.
I completely agree with that.
> > The exact same argument could be said if you did 1300 operations on a
> > single branch, say master. What would master@{yesterday} tell you?
> > What will it tell you one minute from now? Now suppose that you have
>
> It doesn't matter - it will be on the same head, as time ticks by I will at
> least find that master@{yesterday} ticks by linearly too. That is not the
> case if HEAD@{yesterday} means "whatever HEAD pointed to yesterday". How am
> I supposed to remember what it pointed to? Therefore what use is
> HEAD@{yesterday}?
It is there precisely to tell you what it pointed to yesterday, and how
you happened to get there if you care.
If you want a particular branch reflog you just name it explicitly.
If you want the current branch's reflog you use @{...}.
Why would you use HEAD@{...} in that case?
> > only one branch and therefore HEAD reflog would be a duplicate of master
> > reflog.
>
> You misunderstand, I'm suggesting that reflogging HEAD is not the right thing
> to do.
Then I understand that we won't agree on that point.
> Asking for HEAD's reflog should be the same as asking for the
> pointed-to-branch's reflog.
That just has no logic. HEAD is a pointer that can move inside
branches, across branches, and even outside of any branches. Remember
that reflog is a "log", so the most obvious thing to do is simply that:
logging operations affecting the HEAD pointer, _including_ the switching
between branches, should be logged.
Having HEAD@{} named explicitly but changing meaning
entirely depending on an implicit state (the current branch) when the
explicit name doesn't change _is_ inconsistent in my book. This is why
there is now @{...} (no explicit name) that means the current branch
reflog with no potential for confusion what so ever.
> Instead, the reflog should be kept for the "unnamed branch", which would jump
> around each time you detached HEAD.
>
> > Answer: it would carry the same kind of confusion as your example above.
>
> I don't agree. HEAD is always "the branch I'm on now", even when it's
> detached it's pointing at the branch I'm working on. It just happens
> that that branch has no name.
Whatever. But you must admit that, with that same logic, the HEAD
reflog should always be a log of "the branch you were on" at the time it
has been recorded.
But because @{...} carries no name information, it has no _explicit_
meaning and therefore can refer to whatever reflog your current branch
is at the moment. It may change universe when you change branch just
fine.
> > anyway since HEAD is the likely default in most cases. So you may even
> > forget that the HEAD entity exists and be just fine.
>
> Yep; in my scenario that's true. One could completely forget about HEAD. In
> your scenario that isn't the case, because I need to remember that when I'm
> detached HEAD suddenly gets special powers to tell me about the detached
> movements.
No. HEAD is never special. HEAD@{} is a log of all values HEAD had in
the past. So HEAD@{5} will _always_ give you the fifth last position
your checked out tree was at, regardless if it happened to be on branch
x or branch y or detached. The same logic goes for master@{} which will
_always_ return the previous values master might have had.
And because people want a shortcut to mean the reflog of the current
branch then we use @{} without any explicit name. This way the reflog
for @{} being annonymous can change at will depending on the current
branch without semantic confusion.
> > But HEAD is still a moving pointer and we might want to know that it
> > switched from one branch to another at some point. And the only way for
> > that to be sensible is by having a separate reflog for HEAD that is the
> > exact log of every operations you perform regardless of the actual
> > branch you might be on.
>
> I agree. I am arguing about nomenclature. There is no dispute that /that/
> reflog (or equivalent) should exist. However, I don't believe it should
> be "the log of HEAD" it should be "the log of the unnamed branch".
OK... If what you want is an explicit "detached head" reflog then let's
just create one! But that doesn't eliminate the need for a separate
HEAD reflog that includes all moves the HEAD pointer makes.
But IMHO I don't think the detached head should have a reflog of its
own. It is meant to be a volatile thing and since the HEAD reflog
already contains moves made when HEAD is detached should be plenty
enough for the detached head intended use.
> > HEAD _does_ get detached. It becomes loose in the air. It doesn't drag
>
> Well, we're talking semantics now. HEAD becomes detached from a branch, but
> it certainly isn't floating. It points at a particular point in the
> repository.
So? Every ref always point to somewhere. Don't be silly please.
> HEAD is always a symref (despite what you say); it's just that when HEAD is
> detached from all branches, there is no ref for it to point at, so we store
> the ref in the file called HEAD.
Please have a look at the git-symbolic-ref documentation. When the ref
is stored in the file called HEAD, then HEAD is _not_ a symbolic ref
anymore.
> I disagree that there is no virtual branch. That is what HEAD is when it is
> in detached mode. It looks just like a ref - HEAD holds a hash, refs hold a
> hash - how is that not a virtual branch? I used the word "virtual" only
> because it is not stored in refs/ and vanishes when you move back to a real
> branch. Just because the virtual branch is stored in HEAD, I think it is
> dangerous to thing of HEAD as being the thing that is logged - it is this
> virtual branch that should be logged because that branch is always there and
> can be tracked through time as a discrete entity. If you track HEAD itself,
> then sometimes it will hold the same as a branch reflog, sometimes it will
> hold unique data.
Please consider the HEAD reflog as a _log_ of all operation the HEAD
_pointer_ has seen. Because that is all there is about it. Forget that
HEAD is a branch. It is not a branch IT is a pointer. "master" is a
branch, "origin/next" is a (remote) branch. But HEAD is not a branch it
is a pointer.
OK branches are pointers too, but they are _branch_ pointer. HEAD is
_not_ a branch pointer. It is only the current checked-out state
pointer. The HEAD pointer is a totally volatile thing. Branch pointers
are not volatile pointers.
This is why you should have a mental model for a detached head as the
HEAD pointer being totally up in the air. Sure it points to something,
but it keeps its volatile nature. When HEAD is not detached, it drags
the current branch pointer along so the branch state is updated. But
that doesn't make HEAD more a branch pointer even though it might be
pointing to a branch.
Nicolas
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 16:11 ` Andy Parkins
2007-02-02 16:35 ` Simon 'corecode' Schubert
2007-02-02 17:19 ` Nicolas Pitre
@ 2007-02-03 17:07 ` Mark Wooding
2007-02-03 17:54 ` Andy Parkins
2 siblings, 1 reply; 35+ messages in thread
From: Mark Wooding @ 2007-02-03 17:07 UTC (permalink / raw)
To: git
Andy Parkins <andyparkins@gmail.com> wrote:
> to do. Asking for HEAD's reflog should be the same as asking for the
> pointed-to-branch's reflog.
And what do you do when HEAD is detached?
I mean: I detach HEAD, and then ask about HEAD@{yesterday}. It'd be
nonsensical for that to be an error, since HEAD surely did have a value
yesterday. But it can't tell me where my current branch head was
yesterday, because there isn't a current branch to tell me about.
HEAD@{date} referring to the HEAD reflog is the only sane thing to do.
-- [mdw]
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-03 17:07 ` Mark Wooding
@ 2007-02-03 17:54 ` Andy Parkins
0 siblings, 0 replies; 35+ messages in thread
From: Andy Parkins @ 2007-02-03 17:54 UTC (permalink / raw)
To: git; +Cc: Mark Wooding
On Saturday 2007, February 03 17:07, Mark Wooding wrote:
> And what do you do when HEAD is detached?
Well; my proposal was that when head is detached HEAD@{} would return
the "unnamed branch" reflog.
However, that idea has been rejected (which I'm fine with).
> I mean: I detach HEAD, and then ask about HEAD@{yesterday}. It'd be
> nonsensical for that to be an error, since HEAD surely did have a
> value yesterday. But it can't tell me where my current branch head
> was yesterday, because there isn't a current branch to tell me about.
>
> HEAD@{date} referring to the HEAD reflog is the only sane thing to
> do.
Well I don't think "only sane thing" is entirely accurate; I'm happy to
accept counter arguments, but rhetoric doesn't count.
My (abandoned) suggestion was that
HEAD@{..} on a undetached head would be equal to <current-branch>@{..}
HEAD@{..} on a detached head would be equal to unnamed-branch@{..}
@{..} would be equal to <whatever-i-was-on>@{...}
I accept (but not necessarily condone) that the counter proposal is also
valid. My argument is about which is the more consistent. It would
appear to be a judgment call; so I'm happy to bow out. I don't think
calling me insane (by proxy) lends any weight to any argument.
Andy
--
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 11:02 ` Lars Hjemli
2007-02-02 13:02 ` Andy Parkins
@ 2007-02-02 13:21 ` Jakub Narebski
2007-02-02 13:47 ` Simon 'corecode' Schubert
` (2 subsequent siblings)
4 siblings, 0 replies; 35+ messages in thread
From: Jakub Narebski @ 2007-02-02 13:21 UTC (permalink / raw)
To: Lars Hjemli; +Cc: Johannes Schindelin, git, Junio C Hamano
Lars Hjemli wrote:
> On 2/2/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> On Fri, 2 Feb 2007, Jakub Narebski wrote:
>>
>>> Perhaps we should use @{...} to refer to reflog for HEAD, or use yet
>>> another special notation?
>>
>> No.
>>
>> IMHO "bla@{yesterday}" should give you what "bla" pointed to, yesterday.
>> In that sense, the proposed reflog on "HEAD" makes perfect sense.
>
> Since HEAD is a synonym for "current branch" everywhere else in git,
> while .git/logs/HEAD will be a log of detached HEAD (plus branch
> switches, I guess), I think the following makes perfect sense:
>
> "HEAD@{yesterday}" = current branch, yesterday
> "@{yesterday}" = detached head (no branch), yesterday
In the counterproposal, we have
"HEAD@{yesterday}" = where HEAD was at, yesterday
"@{yesterday}" = current branch, yesterday
The side with patch wins (well, the one that can convince Junio).
But serously, that decision is work for maintainer.
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 11:02 ` Lars Hjemli
2007-02-02 13:02 ` Andy Parkins
2007-02-02 13:21 ` Jakub Narebski
@ 2007-02-02 13:47 ` Simon 'corecode' Schubert
2007-02-02 19:40 ` Simon 'corecode' Schubert
2007-02-02 14:52 ` Nicolas Pitre
2007-02-05 11:11 ` Johannes Schindelin
4 siblings, 1 reply; 35+ messages in thread
From: Simon 'corecode' Schubert @ 2007-02-02 13:47 UTC (permalink / raw)
Cc: git
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
Lars Hjemli wrote:
> "HEAD@{yesterday}" = current branch, yesterday
> "@{yesterday}" = detached head (no branch), yesterday
+1 (actually not only "detached head", but "where my workdir was", including named branches as well)
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 13:47 ` Simon 'corecode' Schubert
@ 2007-02-02 19:40 ` Simon 'corecode' Schubert
0 siblings, 0 replies; 35+ messages in thread
From: Simon 'corecode' Schubert @ 2007-02-02 19:40 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 766 bytes --]
Simon 'corecode' Schubert wrote:
> Lars Hjemli wrote:
>> "HEAD@{yesterday}" = current branch, yesterday
>> "@{yesterday}" = detached head (no branch), yesterday
>
> +1 (actually not only "detached head", but "where my workdir was",
> including named branches as well)
okay, I take this back and claim the opposite:
+1 for
@{..} = current branch
HEAD@{..} = log of where HEAD was, detached or not detached, no matter
cheers
simon
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 11:02 ` Lars Hjemli
` (2 preceding siblings ...)
2007-02-02 13:47 ` Simon 'corecode' Schubert
@ 2007-02-02 14:52 ` Nicolas Pitre
2007-02-02 15:39 ` Lars Hjemli
2007-02-05 11:11 ` Johannes Schindelin
4 siblings, 1 reply; 35+ messages in thread
From: Nicolas Pitre @ 2007-02-02 14:52 UTC (permalink / raw)
To: Lars Hjemli; +Cc: Johannes Schindelin, Jakub Narebski, git
On Fri, 2 Feb 2007, Lars Hjemli wrote:
> On 2/2/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Hi,
> >
> > On Fri, 2 Feb 2007, Jakub Narebski wrote:
> >
> > > Perhaps we should use @{...} to refer to reflog for HEAD, or use yet
> > > another special notation?
> >
> > No.
> >
> > IMHO "bla@{yesterday}" should give you what "bla" pointed to, yesterday.
> > In that sense, the proposed reflog on "HEAD" makes perfect sense.
>
> Since HEAD is a synonym for "current branch" everywhere else in git,
> while .git/logs/HEAD will be a log of detached HEAD (plus branch
> switches, I guess), I think the following makes perfect sense:
>
> "HEAD@{yesterday}" = current branch, yesterday
> "@{yesterday}" = detached head (no branch), yesterday
No it doesn't.
HEAD is a moving pointer. Sometimes it means the current branch,
sometimes it doesn't.
So HEAD is _NOT_ a synonym for "current branch" everywhere already.
And it is really nice to reflog the switching between branch which makes
sense only if HEAD has a reflog of its own.
If I want to know where HEAD was yesterday, then the only way to get to
this info is with a separate reflog for HEAD. IF HEAD was a synonym for
the current branch then it is impossible to know where HEAD was
yesterday because you only get the info about where the current branch
was yesterday. But it is all possible that the yesterday's current
branch wasn't the same as today's current branch.
Nicolas
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 14:52 ` Nicolas Pitre
@ 2007-02-02 15:39 ` Lars Hjemli
0 siblings, 0 replies; 35+ messages in thread
From: Lars Hjemli @ 2007-02-02 15:39 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Johannes Schindelin, Jakub Narebski, git
On 2/2/07, Nicolas Pitre <nico@cam.org> wrote:
> On Fri, 2 Feb 2007, Lars Hjemli wrote:
>
> > On 2/2/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > Hi,
> > >
> > > On Fri, 2 Feb 2007, Jakub Narebski wrote:
> > >
> > > > Perhaps we should use @{...} to refer to reflog for HEAD, or use yet
> > > > another special notation?
> > >
> > > No.
> > >
> > > IMHO "bla@{yesterday}" should give you what "bla" pointed to, yesterday.
> > > In that sense, the proposed reflog on "HEAD" makes perfect sense.
> >
> > Since HEAD is a synonym for "current branch" everywhere else in git,
> > while .git/logs/HEAD will be a log of detached HEAD (plus branch
> > switches, I guess), I think the following makes perfect sense:
> >
> > "HEAD@{yesterday}" = current branch, yesterday
> > "@{yesterday}" = detached head (no branch), yesterday
>
> No it doesn't.
>
> HEAD is a moving pointer. Sometimes it means the current branch,
> sometimes it doesn't.
>
> So HEAD is _NOT_ a synonym for "current branch" everywhere already.
All true. I guess I'm just used to thinking about HEAD as a pointer to
the current branch, and that was the reasoning behind my proposal.
But with a detached HEAD this is no longer true, and you end up being right :)
Sorry for the noise
--
larsh
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-02 11:02 ` Lars Hjemli
` (3 preceding siblings ...)
2007-02-02 14:52 ` Nicolas Pitre
@ 2007-02-05 11:11 ` Johannes Schindelin
2007-02-05 11:21 ` Shawn O. Pearce
2007-02-05 23:11 ` Lars Hjemli
4 siblings, 2 replies; 35+ messages in thread
From: Johannes Schindelin @ 2007-02-05 11:11 UTC (permalink / raw)
To: Lars Hjemli; +Cc: Jakub Narebski, git
Hi,
On Fri, 2 Feb 2007, Lars Hjemli wrote:
> I think the following makes perfect sense:
>
> "HEAD@{yesterday}" = current branch, yesterday
> "@{yesterday}" = detached head (no branch), yesterday
Okay, so you say "HEAD@{yesterday}" does _not_ give you what HEAD pointed
to yesterday, but "@{yesterday}" does?
Instead "HEAD@{yesterday}" looks up what HEAD points to _now_, and _then_
goes back to yesterday, finding out what that particular branch pointed to
then, _regardless_ what HEAD was then?
Oh my, that's convoluted.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-05 11:11 ` Johannes Schindelin
@ 2007-02-05 11:21 ` Shawn O. Pearce
2007-02-05 12:43 ` Johannes Schindelin
2007-02-05 23:11 ` Lars Hjemli
1 sibling, 1 reply; 35+ messages in thread
From: Shawn O. Pearce @ 2007-02-05 11:21 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Lars Hjemli, Jakub Narebski, git
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Fri, 2 Feb 2007, Lars Hjemli wrote:
>
> > I think the following makes perfect sense:
> >
> > "HEAD@{yesterday}" = current branch, yesterday
> > "@{yesterday}" = detached head (no branch), yesterday
>
> Okay, so you say "HEAD@{yesterday}" does _not_ give you what HEAD pointed
> to yesterday, but "@{yesterday}" does?
>
> Instead "HEAD@{yesterday}" looks up what HEAD points to _now_, and _then_
> goes back to yesterday, finding out what that particular branch pointed to
> then, _regardless_ what HEAD was then?
>
> Oh my, that's convoluted.
Depends on your point of view:
HEAD: 1) noun. Synonym for the branch I am currently on.
HEAD: 2) noun. Synonym for the commit I am currently on.
Now that we can detach our HEAD anytime we want, I'm in the
latter camp, and your (Dscho's) meaning for HEAD@{yesterday} and
@{yesterday} makes perfect sense.
But I suspect most Git users are still in the former camp, as they
haven't been exposed to the process (or need, or desire) to detach
their HEAD...
--
Shawn.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-05 11:21 ` Shawn O. Pearce
@ 2007-02-05 12:43 ` Johannes Schindelin
0 siblings, 0 replies; 35+ messages in thread
From: Johannes Schindelin @ 2007-02-05 12:43 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Lars Hjemli, Jakub Narebski, git
Hi,
On Mon, 5 Feb 2007, Shawn O. Pearce wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > On Fri, 2 Feb 2007, Lars Hjemli wrote:
> >
> > > I think the following makes perfect sense:
> > >
> > > "HEAD@{yesterday}" = current branch, yesterday
> > > "@{yesterday}" = detached head (no branch), yesterday
> >
> > Okay, so you say "HEAD@{yesterday}" does _not_ give you what HEAD pointed
> > to yesterday, but "@{yesterday}" does?
> >
> > Instead "HEAD@{yesterday}" looks up what HEAD points to _now_, and _then_
> > goes back to yesterday, finding out what that particular branch pointed to
> > then, _regardless_ what HEAD was then?
> >
> > Oh my, that's convoluted.
>
> Depends on your point of view:
>
> HEAD: 1) noun. Synonym for the branch I am currently on.
> HEAD: 2) noun. Synonym for the commit I am currently on.
HEAD: 3) noun. The tip of the current branch.
HEAD: 4) noun. The part of the body I am right now banging on the wall.
> Now that we can detach our HEAD anytime we want, I'm in the latter camp,
> and your (Dscho's) meaning for HEAD@{yesterday} and @{yesterday} makes
> perfect sense.
>
> But I suspect most Git users are still in the former camp, as they
> haven't been exposed to the process (or need, or desire) to detach their
> HEAD...
But has _nothing_ to do with a detachable HEAD.
Once people know what HEAD is, they do
git show HEAD
to see what the tip of their current branch looks like. Now, read out
aloud "HEAD@{12:00.pm.yesterday}". Yes, that's right. It says "HEAD at
noon yesterday".
I mean, it's really easy to see what HEAD is good for. If your head
automatically resolved HEAD to "the current branch, right now, even if I
am talking about another time", I find it convoluted.
That's all.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 3/3] prevent HEAD reflog to be interpreted as current branch reflog
2007-02-05 11:11 ` Johannes Schindelin
2007-02-05 11:21 ` Shawn O. Pearce
@ 2007-02-05 23:11 ` Lars Hjemli
1 sibling, 0 replies; 35+ messages in thread
From: Lars Hjemli @ 2007-02-05 23:11 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Jakub Narebski, git
On 2/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Fri, 2 Feb 2007, Lars Hjemli wrote:
>
> > I think the following makes perfect sense:
> >
> > "HEAD@{yesterday}" = current branch, yesterday
> > "@{yesterday}" = detached head (no branch), yesterday
>
> Okay, so you say "HEAD@{yesterday}" does _not_ give you what HEAD pointed
> to yesterday, but "@{yesterday}" does?
>
> Instead "HEAD@{yesterday}" looks up what HEAD points to _now_, and _then_
> goes back to yesterday, finding out what that particular branch pointed to
> then, _regardless_ what HEAD was then?
>
> Oh my, that's convoluted.
>
Well, luckily Nicolas got me thinking straight again:
http://article.gmane.org/gmane.comp.version-control.git/38507
--
larsh
^ permalink raw reply [flat|nested] 35+ messages in thread