From: Andreas Ericsson Date: Wed, 03 Sep 2008 13:46:14 GMT Subject: Re: [RFC] Detached-HEAD reminder on commit? Message-ID: <48BE9526.9030104@op5.se> In-Reply-To: <20080903133446.GA6967@coredump.intra.peff.net> Jeff King wrote: > On Wed, Sep 03, 2008 at 09:15:07AM -0400, Jeff King wrote: > >> Hrm. I thought we decided on a message like: >> >> Previous HEAD position was 1234abcd >> >> when leaving the detached HEAD state, but it seems to have disappeared. >> Maybe with the move to builtin-checkout (sorry, I don't have time to >> bisect right at this second). Was that intentional? > > OK, I lied. I did have time to bisect it. > > It never worked in builtin-checkout, and I am a bit suspicious of the > code (and comment) below. Why would we not want to show such a message > if moving to a branch (as long as it is not a _new_ branch)? The patch > below makes more sense to me. > > --- > diff --git a/builtin-checkout.c b/builtin-checkout.c > index b380ad6..b2c7d3c 100644 > --- a/builtin-checkout.c > +++ b/builtin-checkout.c > @@ -386,12 +386,12 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new) > } > > /* > - * If the new thing isn't a branch and isn't HEAD and we're > + * If the new thing isn't isn't HEAD and we're "isn't isn't" > * not starting a new branch, and we want messages, and we > * weren't on a branch, and we're moving to a new commit, > * describe the old commit. > */ Apart from the typo above, this patch makes a whole lot of sense. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231