From: Johannes Schindelin Date: Fri, 16 Oct 2009 00:43:17 GMT Subject: Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was Message-ID: In-Reply-To: <885649360910151647v27a15334x63fe3b6f5035dbd2@mail.gmail.com> Hi, On Thu, 15 Oct 2009, James Pickens wrote: > On Thu, Oct 15, 2009 at 3:08 PM, Junio C Hamano wrote: > > Junio C Hamano writes: > > > >> $ git checkout origin/next ;# ditto > >> $ git symbolic-ref HEAD > >> refs/remotes/origin/next > > > > Ok, after reading Daniel's message to remind us that "git fetch" after > > this will get us into trouble, I agree that detaching HEAD is inevitable. > > Some people liked the idea, so let's not give up just yet. Here are a few > things Git could do when a fetch wants to update the currently checked out > branch: > > 1. Refuse the fetch. > 2. Update the ref, leaving the user with a work tree and index that don't > match their HEAD. > 3. Detach the HEAD, then update the ref. > 4. Update the ref, then check it out. Everything but 1 and 4 would blatantly violate the law of the Least Surprise. And that very much includes what our beloved maintainer proposes. BTW I appreciate that finally a few users join discussion. It felt awfully lonely for a while. Ciao, Dscho