{"thread":{"id":"22607","subject":"git rebase -i and the reflog","startedAt":"2010-02-10T22:19:59Z","lastAt":"2010-02-11T07:29:01Z","messageCount":5,"participants":["Sverre Rabbelier","Junio C Hamano","Nicolas Pitre","Patrick Sudowe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"134191","messageId":"fabb9a1e1002101419x40844a42s21108aaa849430c1@mail.gmail.com","threadId":"22607","inReplyTo":null,"subject":"git rebase -i and the reflog","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-02-10T22:19:59Z","receivedAt":"2010-02-10T22:19:59Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nI use \"git rebase -i\" a lot, and as a result the output from 'git log\n-g' and 'git reflog' is a tad messy. That is, it's (afaik) not\npossible to check that after my rebasing did not mess things up using\nsomething like 'git diff HEAD@{1}'. I could of course tag the old head\nor something, but that's not the only problem, due to the clutter it's\nhard to find genuine commits. What I want is a way to see HEAD's\nmovement _excluding_ any rebase activity. So if I change history from\nA-o-B-C to A-o-B'-C', I want to see C and C' in the reflog, but not\nB', since B' is often actually identical to B, the only reason that it\nchanged is that I did 'git rebase -i' on some far-back commit.\n\nIs there an existing solution to this?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"134193","messageId":"7v3a183f3q.fsf@alter.siamese.dyndns.org","threadId":"22607","inReplyTo":"fabb9a1e1002101419x40844a42s21108aaa849430c1@mail.gmail.com","subject":"Re: git rebase -i and the reflog","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-10T22:23:05Z","receivedAt":"2010-02-10T22:23:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sverre Rabbelier <srabbelier@gmail.com> writes:\n\n> I use \"git rebase -i\" a lot, and as a result the output from 'git log\n> -g' and 'git reflog' is a tad messy. That is, it's (afaik) not\n> possible to check that after my rebasing did not mess things up using\n> something like 'git diff HEAD@{1}'.\n\nYes and no.  I too suffer from it but only when I rebase a detached HEAD\nstate.  If you rebased a topic, \"git diff topic@{1}\" (or \"git diff @{1}\")\nwould give you what you want.\n"},{"id":"134196","messageId":"fabb9a1e1002101426p41cba90dw5b3d4afdfb157b5c@mail.gmail.com","threadId":"22607","inReplyTo":"7v3a183f3q.fsf@alter.siamese.dyndns.org","subject":"Re: git rebase -i and the reflog","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-02-10T22:26:39Z","receivedAt":"2010-02-10T22:26:39Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Feb 10, 2010 at 23:23, Junio C Hamano <gitster@pobox.com> wrote:\n> Yes and no.  I too suffer from it but only when I rebase a detached HEAD\n> state.  If you rebased a topic, \"git diff topic@{1}\" (or \"git diff @{1}\")\n> would give you what you want.\n\nAh, mhh, so the reason I'm seeing this cruft is that I'm using 'HEAD@'\ninstead of 'topic@'. It only makes sense that HEAD's reflog includes\nevery commit, and a topic's reflog includes just that topics. Thanks\nfor the quick reply, this'll make my life a bunch easier :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"134204","messageId":"alpine.LFD.2.00.1002102234490.1681@xanadu.home","threadId":"22607","inReplyTo":"fabb9a1e1002101419x40844a42s21108aaa849430c1@mail.gmail.com","subject":"Re: git rebase -i and the reflog","fromName":"Nicolas Pitre","fromEmail":"nico@fluxnic.net","sentAt":"2010-02-11T03:35:49Z","receivedAt":"2010-02-11T03:35:49Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Wed, 10 Feb 2010, Sverre Rabbelier wrote:\n\n> Heya,\n> \n> I use \"git rebase -i\" a lot, and as a result the output from 'git log\n> -g' and 'git reflog' is a tad messy. That is, it's (afaik) not\n> possible to check that after my rebasing did not mess things up using\n> something like 'git diff HEAD@{1}'. I could of course tag the old head\n> or something, but that's not the only problem, due to the clutter it's\n> hard to find genuine commits. What I want is a way to see HEAD's\n> movement _excluding_ any rebase activity. So if I change history from\n> A-o-B-C to A-o-B'-C', I want to see C and C' in the reflog, but not\n> B', since B' is often actually identical to B, the only reason that it\n> changed is that I did 'git rebase -i' on some far-back commit.\n> \n> Is there an existing solution to this?\n\nWhat about looking at the reflog for the branch you're on instead of \nHEAD?  In the reflog space they're different.\n\n\nNicolas\n"},{"id":"134209","messageId":"4B73B1BD.7030606@sudowe.net","threadId":"22607","inReplyTo":"fabb9a1e1002101419x40844a42s21108aaa849430c1@mail.gmail.com","subject":"Re: git rebase -i and the reflog","fromName":"Patrick Sudowe","fromEmail":"git@sudowe.net","sentAt":"2010-02-11T07:29:01Z","receivedAt":"2010-02-11T07:29:01Z","isPatch":false,"sender":{"key":"git@sudowe.net","avatar":null},"body":"\n\nOn Wednesday 2/10 2/10  11:19 PM, Sverre Rabbelier wrote:\n> Heya,\n>\n> I use \"git rebase -i\" a lot, and as a result the output from 'git log\n> -g' and 'git reflog' is a tad messy. That is, it's (afaik) not\n> possible to check that after my rebasing did not mess things up using\n> something like 'git diff HEAD@{1}'. I could of course tag the old head\n> or something, but that's not the only problem, due to the clutter it's\n> hard to find genuine commits. What I want is a way to see HEAD's\n> movement _excluding_ any rebase activity. So if I change history from\n> A-o-B-C to A-o-B'-C', I want to see C and C' in the reflog, but not\n> B', since B' is often actually identical to B, the only reason that it\n> changed is that I did 'git rebase -i' on some far-back commit.\n>\n> Is there an existing solution to this?\n>\n\nSince nobody else mentioned it on the list.\n\nYou could also use ORIG_HEAD.\nmerge, rebase and am (maybe others?) record the position of HEAD to \nORIG_HEAD before their operation.\nSo to check for the differences directly after one of these commands\na diff between HEAD and ORIG_HEAD should do.\n\nI really liked the shortcut of ORIG_HEAD when I found out about it\njust a couple days ago.\n\n-Patrick\n"}]}