{"thread":{"id":"6488","subject":"Deleting remote branches with git-branch and reflog questions","startedAt":"2007-01-23T12:59:23Z","lastAt":"2007-01-24T09:58:19Z","messageCount":16,"participants":["Andy Parkins","Andreas Ericsson","Jakub Narebski","Johannes Schindelin","Junio C Hamano","Nicolas Pitre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32389","messageId":"200701231259.27719.andyparkins@gmail.com","threadId":"6488","inReplyTo":null,"subject":"Deleting remote branches with git-branch and reflog questions","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-01-23T12:59:23Z","receivedAt":"2007-01-23T12:59:23Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Hello,\n\nAs per subject.\n\nIf anything, these are safer to delete than local branches because they will \nbe restored automatically with the next fetch, so why do we require the extra \nswitch for remote branches?\n\nWould it be simpler for the user if the following worked?\n$ git branch -a\n* master\n  origin/master\n$ git branch -D origin/master\n\ni.e. that the -r switch was unnecessary in unambiguous cases.\n\nreflogs\n-------\n\nWhy does the reflog directory .git/logs need to store the refs/ directory?  \nAren't /all/ the refs under \"refs/\" these days?\n\nIs it right that the reflog for a branch is deleted when the branch is \ndeleted?  Doesn't this kill one of the advantages of reflogs?  In particular, \nif I accidentally deleted a branch, I would have no way of getting it back \nbecause the reflog has been deleted too?  Personally I'd prefer that a reflog \nline was added saying\n  XXXXXXXXXXXXXXX 00000000000000 Deleted\nOr similar.  After all; it's only disk space.  If the ref was later created \nagain, then the log can continue to be added to, but it will have a \"Created \nfrom\" in the middle instead of at the end.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"},{"id":"32390","messageId":"45B6076F.5060503@op5.se","threadId":"6488","inReplyTo":"200701231259.27719.andyparkins@gmail.com","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-01-23T13:02:39Z","receivedAt":"2007-01-23T13:02:39Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Andy Parkins wrote:\n> \n> reflogs\n> -------\n> \n> Why does the reflog directory .git/logs need to store the refs/ directory?  \n> Aren't /all/ the refs under \"refs/\" these days?\n> \n\nNo. HEAD isn't, nor is ORIG_HEAD, and possibly others.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"32392","messageId":"ep51ie$i23$1@sea.gmane.org","threadId":"6488","inReplyTo":"200701231259.27719.andyparkins@gmail.com","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-23T13:12:33Z","receivedAt":"2007-01-23T13:12:33Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andy Parkins wrote:\n\n> reflogs\n> -------\n> \n> Why does the reflog directory .git/logs need to store the refs/ directory?  \n> Aren't /all/ the refs under \"refs/\" these days?\n\nHEAD is not under refs/. Although IIRC we don't reflog HEAD, with detached\nHEAD we could reflog at least detached state.\n\n> Is it right that the reflog for a branch is deleted when the branch is \n> deleted?  Doesn't this kill one of the advantages of reflogs?  In particular, \n> if I accidentally deleted a branch, I would have no way of getting it back \n> because the reflog has been deleted too?  Personally I'd prefer that a reflog \n> line was added saying\n>   XXXXXXXXXXXXXXX 00000000000000 Deleted\n> Or similar.  After all; it's only disk space.  If the ref was later created \n> again, then the log can continue to be added to, but it will have a \"Created \n> from\" in the middle instead of at the end.\n\nThe problem is when you delete branch 'foo', and then create branch\n'foo/bar'. You can't have both 'foo' and 'foo/bar' reflog.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"32394","messageId":"200701231314.53361.andyparkins@gmail.com","threadId":"6488","inReplyTo":"45B6076F.5060503@op5.se","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-01-23T13:14:52Z","receivedAt":"2007-01-23T13:14:52Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 January 23 13:02, Andreas Ericsson wrote:\n\n> > Why does the reflog directory .git/logs need to store the refs/\n> > directory? Aren't /all/ the refs under \"refs/\" these days?\n>\n> No. HEAD isn't, nor is ORIG_HEAD, and possibly others.\n\nThey're all special cases aren't they?  They are symrefs.  I don't think they \nare reflogged at all (they certainly don't appear in my .git/logs directory.\n\nPerhaps I should rephrase... aren't /all/ the logged refs under \"refs/\" these \ndays?\n\n\nAndy\n\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"},{"id":"32408","messageId":"200701231432.24225.andyparkins@gmail.com","threadId":"6488","inReplyTo":"ep51ie$i23$1@sea.gmane.org","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-01-23T14:32:22Z","receivedAt":"2007-01-23T14:32:22Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 January 23 13:12, Jakub Narebski wrote:\n\n> The problem is when you delete branch 'foo', and then create branch\n> 'foo/bar'. You can't have both 'foo' and 'foo/bar' reflog.\n\nAh; yes of course.  That is a bit of a deal breaker isn't it?\n\nOn the other hand, why delete it instantly?  Since the reflog is currently \ndeleted by git-branch anyway, couldn't the deletion be delayed until the \ncreation of foo/bar?  At least then the deletion only hits if it really has \nto.  In most circumstances foo then foo/bar is fairly unlikely.\n\n\nAndy\n\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"},{"id":"32410","messageId":"Pine.LNX.4.63.0701231558080.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6488","inReplyTo":"200701231432.24225.andyparkins@gmail.com","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-23T14:59:06Z","receivedAt":"2007-01-23T14:59:06Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Jan 2007, Andy Parkins wrote:\n\n> On Tuesday 2007 January 23 13:12, Jakub Narebski wrote:\n> \n> > The problem is when you delete branch 'foo', and then create branch\n> > 'foo/bar'. You can't have both 'foo' and 'foo/bar' reflog.\n> \n> Ah; yes of course.  That is a bit of a deal breaker isn't it?\n> \n> On the other hand, why delete it instantly?\n\nYou mean, kind of like a waste bin? Where you delete stuff, but come back \nand whine that you did not meant to delete it after all?\n\n:-))\n\nCiao,\nDscho\n"},{"id":"32415","messageId":"200701231529.40362.andyparkins@gmail.com","threadId":"6488","inReplyTo":"Pine.LNX.4.63.0701231558080.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-01-23T15:29:38Z","receivedAt":"2007-01-23T15:29:38Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 January 23 14:59, Johannes Schindelin wrote:\n\n> You mean, kind of like a waste bin? Where you delete stuff, but come back\n> and whine that you did not meant to delete it after all?\n\nNo, no; I'm whining that the reflog was deleted, not the branch.  I think \nthat \"ref deleted\" is just as valid for logging as anything else, and \ndeleting the log makes it impossible to view that operation.\n\nGiven how powerful the reflog is; it doesn't seem unreasonable to want to be \nable to do\n\n$ git branch -D some-branch\n$ git show some-branch@{2 days ago}\n\n\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"},{"id":"32452","messageId":"7v1wllo2p6.fsf@assigned-by-dhcp.cox.net","threadId":"6488","inReplyTo":"200701231314.53361.andyparkins@gmail.com","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-23T21:25:41Z","receivedAt":"2007-01-23T21:25:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> writes:\n\n> Aren't /all/ the logged refs under \"refs/\" these \n> days?\n\nYes, so what.  It's not a big deal, and it's too late to change,\nisn't it?\n\nSeriously, I think with addition of 'git log --walk-reflogs' and\n'git show-branch --reflog', there is less reason for an end user\nto look at the raw .git/logs/ directory these days.  They might\nnot fully expose the information recorded in reflog yet, but I\nthink what they do show is useful and adequate.  If some useful\ninformation is lacking from their output, we should solve that\nby enhancing them, not by moving .git/logs/refs up one level to\nsave the end user five keystrokes to allow him to run less head\nor tail on \".git/logs/heads/master\".\n\nAnd we might want to allow reflogs on detached HEAD someday,\nalthough I personally think it goes against what detached HEAD\nis -- it is of a very temporary nature.\n"},{"id":"32455","messageId":"Pine.LNX.4.63.0701232232480.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6488","inReplyTo":"7v1wllo2p6.fsf@assigned-by-dhcp.cox.net","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-23T21:35:00Z","receivedAt":"2007-01-23T21:35:00Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Jan 2007, Junio C Hamano wrote:\n\n> Andy Parkins <andyparkins@gmail.com> writes:\n> \n> > Aren't /all/ the logged refs under \"refs/\" these \n> > days?\n> \n> Yes, so what.  It's not a big deal, and it's too late to change,\n> isn't it?\n> \n> Seriously, I think with addition of 'git log --walk-reflogs' and\n> 'git show-branch --reflog', there is less reason for an end user\n> to look at the raw .git/logs/ directory these days.\n\nHow about introducing the shortcut \"-g\" for \"--walk-reflogs\"? It is not \nyet taken AFAICT.\n\n> And we might want to allow reflogs on detached HEAD someday, although I \n> personally think it goes against what detached HEAD is -- it is of a \n> very temporary nature.\n\nBut so are reflogs. They go away after some time.\n\nDisk space is cheap.\n\nCiao,\nDscho\n"},{"id":"32457","messageId":"Pine.LNX.4.64.0701231649520.3011@xanadu.home","threadId":"6488","inReplyTo":"7v1wllo2p6.fsf@assigned-by-dhcp.cox.net","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-01-23T21:52:41Z","receivedAt":"2007-01-23T21:52:41Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 23 Jan 2007, Junio C Hamano wrote:\n\n> And we might want to allow reflogs on detached HEAD someday,\n> although I personally think it goes against what detached HEAD\n> is -- it is of a very temporary nature.\n\nDidn't we agree already that reflog with detached head was simply \ninsane?\n\n\nNicolas\n"},{"id":"32460","messageId":"Pine.LNX.4.63.0701232303040.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6488","inReplyTo":"Pine.LNX.4.64.0701231649520.3011@xanadu.home","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-23T22:06:07Z","receivedAt":"2007-01-23T22:06:07Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Jan 2007, Nicolas Pitre wrote:\n\n> On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> \n> > And we might want to allow reflogs on detached HEAD someday,\n> > although I personally think it goes against what detached HEAD\n> > is -- it is of a very temporary nature.\n> \n> Didn't we agree already that reflog with detached head was simply \n> insane?\n\nMaybe you did. I did not agree on that.\n\nAlso I have yet to see a valid reason against tracking HEAD.\n\n(Yes, it is better to think about that first, be restrictive, and if it \nturns out to make sense, allow that -- rather than allow it, decide that \nit does not make sense, and then forbid it.)\n\nCiao,\nDscho\n"},{"id":"32473","messageId":"7vbqkpkxhk.fsf@assigned-by-dhcp.cox.net","threadId":"6488","inReplyTo":"Pine.LNX.4.64.0701231649520.3011@xanadu.home","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-24T01:46:31Z","receivedAt":"2007-01-24T01:46:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n> On Tue, 23 Jan 2007, Junio C Hamano wrote:\n>\n>> And we might want to allow reflogs on detached HEAD someday,\n>> although I personally think it goes against what detached HEAD\n>> is -- it is of a very temporary nature.\n>\n> Didn't we agree already that reflog with detached head was simply \n> insane?\n\nPerhaps, perhaps not.\n\n\t$ git checkout v2.6.14\n        $ git checkout v2.6.15\n        $ git checkout v2.6.16\n\nAh, which one did I check-out the last time?\n\n\t$ git describe HEAD@{1}\n\nI suspect that we could re-implement \"git bisect\" without using\nthe special \"bisect\" branch (we would still be using refs/bisect\nnamespace).\n"},{"id":"32478","messageId":"Pine.LNX.4.64.0701232103290.3011@xanadu.home","threadId":"6488","inReplyTo":"7vbqkpkxhk.fsf@assigned-by-dhcp.cox.net","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-01-24T02:12:48Z","receivedAt":"2007-01-24T02:12:48Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 23 Jan 2007, Junio C Hamano wrote:\n\n> Nicolas Pitre <nico@cam.org> writes:\n> \n> > On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> >\n> >> And we might want to allow reflogs on detached HEAD someday,\n> >> although I personally think it goes against what detached HEAD\n> >> is -- it is of a very temporary nature.\n> >\n> > Didn't we agree already that reflog with detached head was simply \n> > insane?\n> \n> Perhaps, perhaps not.\n> \n> \t$ git checkout v2.6.14\n>         $ git checkout v2.6.15\n>         $ git checkout v2.6.16\n> \n> Ah, which one did I check-out the last time?\n> \n> \t$ git describe HEAD@{1}\n\nAnd what does HEAD@{1} means if not detached?\n\nIf there is a reflog for HEAD independently of what branch HEAD is \nattached to then it could make sense.  Meaning that if you're on branch \n\"master\" and perform a commit, then both reflogs for \"master\" and \"HEAD\" \nare updated at the same time.  If you then checkout branch \"next\" then \nonly the \"HEAD\" reflog is updated since no changes to any branch did \noccur but just HEAD changed.\n\nThen moving around and/or committing with a detached head would just \nupdate the \"HEAD reflog.\n\n\nNicolas\n"},{"id":"32480","messageId":"ep6fre$2i2$1@sea.gmane.org","threadId":"6488","inReplyTo":"Pine.LNX.4.64.0701232103290.3011@xanadu.home","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-24T02:22:29Z","receivedAt":"2007-01-24T02:22:29Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nicolas Pitre wrote:\n\n> On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> \n>> Nicolas Pitre <nico@cam.org> writes:\n>> \n>>> On Tue, 23 Jan 2007, Junio C Hamano wrote:\n>>>\n>>>> And we might want to allow reflogs on detached HEAD someday,\n>>>> although I personally think it goes against what detached HEAD\n>>>> is -- it is of a very temporary nature.\n>>>\n>>> Didn't we agree already that reflog with detached head was simply \n>>> insane?\n>> \n>> Perhaps, perhaps not.\n>> \n>>      $ git checkout v2.6.14\n>>      $ git checkout v2.6.15\n>>      $ git checkout v2.6.16\n>> \n>> Ah, which one did I check-out the last time?\n>> \n>>      $ git describe HEAD@{1}\n> \n> And what does HEAD@{1} means if not detached?\n> \n> If there is a reflog for HEAD independently of what branch HEAD is \n> attached to then it could make sense.  Meaning that if you're on branch \n> \"master\" and perform a commit, then both reflogs for \"master\" and \"HEAD\" \n> are updated at the same time.  If you then checkout branch \"next\" then \n> only the \"HEAD\" reflog is updated since no changes to any branch did \n> occur but just HEAD changed.\n> \n> Then moving around and/or committing with a detached head would just \n> update the \"HEAD reflog.\n\nI think it would be best to maintain mixed approach. When we are on some\nbranch, the HEAD@{1} would mean <current branch>@{1}. When HEAD is detached\n(is not symlink or symref), HEAD@{1} means it's latest state. Detaching\na head creates reflog, de-detaching deletes it...\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"32481","messageId":"Pine.LNX.4.64.0701232206130.3011@xanadu.home","threadId":"6488","inReplyTo":"ep6fre$2i2$1@sea.gmane.org","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-01-24T03:18:56Z","receivedAt":"2007-01-24T03:18:56Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"[ please CC me when replying, please ]\n\nOn Wed, 24 Jan 2007, Jakub Narebski wrote:\n\n> Nicolas Pitre wrote:\n> \n> > On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> > \n> >> Nicolas Pitre <nico@cam.org> writes:\n> >> \n> >>> On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> >>>\n> >>>> And we might want to allow reflogs on detached HEAD someday,\n> >>>> although I personally think it goes against what detached HEAD\n> >>>> is -- it is of a very temporary nature.\n> >>>\n> >>> Didn't we agree already that reflog with detached head was simply \n> >>> insane?\n> >> \n> >> Perhaps, perhaps not.\n> >> \n> >>      $ git checkout v2.6.14\n> >>      $ git checkout v2.6.15\n> >>      $ git checkout v2.6.16\n> >> \n> >> Ah, which one did I check-out the last time?\n> >> \n> >>      $ git describe HEAD@{1}\n> > \n> > And what does HEAD@{1} means if not detached?\n> > \n> > If there is a reflog for HEAD independently of what branch HEAD is \n> > attached to then it could make sense.  Meaning that if you're on branch \n> > \"master\" and perform a commit, then both reflogs for \"master\" and \"HEAD\" \n> > are updated at the same time.  If you then checkout branch \"next\" then \n> > only the \"HEAD\" reflog is updated since no changes to any branch did \n> > occur but just HEAD changed.\n> > \n> > Then moving around and/or committing with a detached head would just \n> > update the \"HEAD reflog.\n> \n> I think it would be best to maintain mixed approach. When we are on some\n> branch, the HEAD@{1} would mean <current branch>@{1}. When HEAD is detached\n> (is not symlink or symref), HEAD@{1} means it's latest state. Detaching\n> a head creates reflog, de-detaching deletes it...\n\nPlease no.  I think this is exactly the absolutely worst thing you could \nhave.  Better not have any reflog for detached heads at all.\n\nFirst, if you're not playing with detached heads then you don't care \nsince it makes no difference.\n\nBut if you do use a detached head then having HEAD@{n} suddenly change \nfrom one universe to another just because you detached or attached HEAD \nfrom/to a branch is insane.\n\nConsider HEAD@{1} when you just detached from a branch?  According to \nyour suggestion it would point into the void.\n\nAnd why wouldn't HEAD@{1} refer back to a detached state right after \nchecking out a branch?  According to your suggestion the last detached \nposition is now lost.  Worse, it will point to a commit which might have \nnothing to do with the previous operation I performed with my repository \nwhich is IMHO against the spirit of a reflog for \"HEAD\".\n\n\nNicolas\n"},{"id":"32498","messageId":"Pine.LNX.4.63.0701241054330.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6488","inReplyTo":"Pine.LNX.4.64.0701232103290.3011@xanadu.home","subject":"Re: Deleting remote branches with git-branch and reflog questions","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-24T09:58:19Z","receivedAt":"2007-01-24T09:58:19Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Jan 2007, Nicolas Pitre wrote:\n\n> On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> \n> > Nicolas Pitre <nico@cam.org> writes:\n> > \n> > > On Tue, 23 Jan 2007, Junio C Hamano wrote:\n> > >\n> > >> And we might want to allow reflogs on detached HEAD someday,\n> > >> although I personally think it goes against what detached HEAD\n> > >> is -- it is of a very temporary nature.\n> > >\n> > > Didn't we agree already that reflog with detached head was simply \n> > > insane?\n> > \n> > Perhaps, perhaps not.\n> > \n> > \t$ git checkout v2.6.14\n> >         $ git checkout v2.6.15\n> >         $ git checkout v2.6.16\n> > \n> > Ah, which one did I check-out the last time?\n> > \n> > \t$ git describe HEAD@{1}\n> \n> And what does HEAD@{1} means if not detached?\n> \n> If there is a reflog for HEAD independently of what branch HEAD is \n> attached to then it could make sense.  Meaning that if you're on branch \n> \"master\" and perform a commit, then both reflogs for \"master\" and \"HEAD\" \n> are updated at the same time.  If you then checkout branch \"next\" then \n> only the \"HEAD\" reflog is updated since no changes to any branch did \n> occur but just HEAD changed.\n> \n> Then moving around and/or committing with a detached head would just \n> update the \"HEAD reflog.\n\nThis would also be my idea. I agree with you that mixing approaches like \nJakub proposed is insane.\n\nBut given the idea of reflogs (\"Where was this yesterday\"), I think it \nwould make sense to reflog HEAD -- independent on which branch it happens \nto refer to.\n\nWarning! It _changes_ the behaviour. As of now, \"git log --walk-reflogs \nHEAD\" shows the local view of the _branch_ that HEAD points to \n_currently_. But I think that the current is difficult to explain to new \nusers, whereas the \"jumping HEAD\" is not.\n\nCiao,\nDscho\n"}]}