From: Nicolas Pitre <nico@cam.org>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Deleting remote branches with git-branch and reflog questions
Date: Tue, 23 Jan 2007 22:18:56 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0701232206130.3011@xanadu.home> (raw)
In-Reply-To: <ep6fre$2i2$1@sea.gmane.org>
[ please CC me when replying, please ]
On Wed, 24 Jan 2007, Jakub Narebski wrote:
> Nicolas Pitre wrote:
>
> > On Tue, 23 Jan 2007, Junio C Hamano wrote:
> >
> >> Nicolas Pitre <nico@cam.org> writes:
> >>
> >>> On Tue, 23 Jan 2007, Junio C Hamano wrote:
> >>>
> >>>> And we might want to allow reflogs on detached HEAD someday,
> >>>> although I personally think it goes against what detached HEAD
> >>>> is -- it is of a very temporary nature.
> >>>
> >>> Didn't we agree already that reflog with detached head was simply
> >>> insane?
> >>
> >> Perhaps, perhaps not.
> >>
> >> $ git checkout v2.6.14
> >> $ git checkout v2.6.15
> >> $ git checkout v2.6.16
> >>
> >> Ah, which one did I check-out the last time?
> >>
> >> $ git describe HEAD@{1}
> >
> > And what does HEAD@{1} means if not detached?
> >
> > If there is a reflog for HEAD independently of what branch HEAD is
> > attached to then it could make sense. Meaning that if you're on branch
> > "master" and perform a commit, then both reflogs for "master" and "HEAD"
> > are updated at the same time. If you then checkout branch "next" then
> > only the "HEAD" reflog is updated since no changes to any branch did
> > occur but just HEAD changed.
> >
> > Then moving around and/or committing with a detached head would just
> > update the "HEAD reflog.
>
> I think it would be best to maintain mixed approach. When we are on some
> branch, the HEAD@{1} would mean <current branch>@{1}. When HEAD is detached
> (is not symlink or symref), HEAD@{1} means it's latest state. Detaching
> a head creates reflog, de-detaching deletes it...
Please no. I think this is exactly the absolutely worst thing you could
have. Better not have any reflog for detached heads at all.
First, if you're not playing with detached heads then you don't care
since it makes no difference.
But if you do use a detached head then having HEAD@{n} suddenly change
from one universe to another just because you detached or attached HEAD
from/to a branch is insane.
Consider HEAD@{1} when you just detached from a branch? According to
your suggestion it would point into the void.
And why wouldn't HEAD@{1} refer back to a detached state right after
checking out a branch? According to your suggestion the last detached
position is now lost. Worse, it will point to a commit which might have
nothing to do with the previous operation I performed with my repository
which is IMHO against the spirit of a reflog for "HEAD".
Nicolas
next prev parent reply other threads:[~2007-01-24 3:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 12:59 Deleting remote branches with git-branch and reflog questions Andy Parkins
2007-01-23 13:02 ` Andreas Ericsson
2007-01-23 13:14 ` Andy Parkins
2007-01-23 21:25 ` Junio C Hamano
2007-01-23 21:35 ` Johannes Schindelin
2007-01-23 21:52 ` Nicolas Pitre
2007-01-23 22:06 ` Johannes Schindelin
2007-01-24 1:46 ` Junio C Hamano
2007-01-24 2:12 ` Nicolas Pitre
2007-01-24 2:22 ` Jakub Narebski
2007-01-24 3:18 ` Nicolas Pitre [this message]
2007-01-24 9:58 ` Johannes Schindelin
2007-01-23 13:12 ` Jakub Narebski
2007-01-23 14:32 ` Andy Parkins
2007-01-23 14:59 ` Johannes Schindelin
2007-01-23 15:29 ` Andy Parkins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0701232206130.3011@xanadu.home \
--to=nico@cam.org \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).