{"thread":{"id":"44104","subject":"Finding a commit based on the diff index line?","startedAt":"2016-09-17T14:33:16Z","lastAt":"2016-09-18T19:37:36Z","messageCount":3,"participants":["Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"302101","messageId":"3C23ED270E0C486EB2063BC5AEC25678@PhilipOakley","threadId":"44104","inReplyTo":null,"subject":"Finding a commit based on the diff index line?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2016-09-17T14:33:10Z","receivedAt":"2016-09-17T14:33:16Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi,\n\nI'm curating some of my old patch series (i.e. doing some tidying up) and \nI'm trying to determine the commits that generated some of my patches so \nthat I can see if I still have them after they were rebased (a 'name that \ndangling branch' problem).\n\nIs there an easy way of finding the commit sha1 that contains the given diff \nindex line.\n\nFor example.\nindex fa05269..57033dd 100755\nor\nindex 8ebcded..d9ab360 100644\n\nwhich both should get back to Jeff King's 36d6792 (t0006: test various date \nformats, 2016-06-20).\n\nIt feels like it is something that should already possible without a \nmini-script. We have the rev range which should limit the range to a single \ncommit, though if random blob revs were given the commit range would be \n'scattered'.\n\n\nIs there a simple quick way of achieving this?\n\n--\nPhilip \n\n"},{"id":"302109","messageId":"FD07B781038A4C878F6D0152A4ECE580@PhilipOakley","threadId":"44104","inReplyTo":"CAPc5daUdM4wwY7C_YKx0DkW3kty+VewksMMXG39bBr1K-JxBag@mail.gmail.com","subject":"Re: Finding a commit based on the diff index line?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2016-09-17T19:23:42Z","receivedAt":"2016-09-17T19:23:47Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"> From: Junio C Hamano\n> Sent: Saturday, September 17, 2016 5:30 PM\n>\n> Does it count as simple to use pager's search feature in\n> \"log --raw\" output piped to it?\n>\n> Pardon typos & html; typed on a phone\n>\n\nThe `log --raw` looks useful, though I think (IIUC) I also have a problem \nthat (obviously?) these commits are not linked behind any existing ref \n(except maybe the reflogs which I'm not up to speed on).\n\nI had somehow hoped for some neat magic command or rev specifier that took \nthe revs as alternates to the `-- <paths>` in rev-parse or some such....\n\nIt's tricky curating old mistakes ;-)\n\nThanks for the pointer.\n\n> On Sep 17, 2016 07:33, \"Philip Oakley\" <philipoakley@iee.org> wrote:\n>\n> > Hi,\n> >\n> > I'm curating some of my old patch series (i.e. doing some tidying up) \n> > and\n> > I'm trying to determine the commits that generated some of my patches so\n> > that I can see if I still have them after they were rebased (a 'name \n> > that\n> > dangling branch' problem).\n> >\n> > Is there an easy way of finding the commit sha1 that contains the given \n> > diff\n> > index line.\n> >\n> > For example.\n> > index fa05269..57033dd 100755\n> > or\n> > index 8ebcded..d9ab360 100644\n> >\n> > which both should get back to Jeff King's 36d6792 (t0006: test various \n> > date\n> > formats, 2016-06-20).\n> >\n> > It feels like it is something that should already possible without a\n> > mini-script. We have the rev range which should limit the range to a \n> > single\n> > commit, though if random blob revs were given the commit range would be\n> > 'scattered'.\n> >\n> >\n> > Is there a simple quick way of achieving this?\n> >\n> > --\n> > Philip\n\n"},{"id":"302120","messageId":"4BB675F0AED14A309DC90DDDB08F441B@PhilipOakley","threadId":"44104","inReplyTo":"FD07B781038A4C878F6D0152A4ECE580@PhilipOakley","subject":"Re: Finding a commit based on the diff index line?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2016-09-18T19:37:31Z","receivedAt":"2016-09-18T19:37:36Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Philip Oakley\" <philipoakley@iee.org>\n>> From: Junio C Hamano\n>> Sent: Saturday, September 17, 2016 5:30 PM\n>>\n>> Does it count as simple to use pager's search feature in\n>> \"log --raw\" output piped to it?\n>>\n>> Pardon typos & html; typed on a phone\n>>\n>\n> The `log --raw` looks useful, though I think (IIUC) I also have a problem \n> that (obviously?) these commits are not linked behind any existing ref \n> (except maybe the reflogs which I'm not up to speed on).\n>\nFor others that may be reading... The command I eventually ended up using to \nfind old series was:\n\ngit reflog HEAD --grep-reflog='rebase -i (finish)' | cut -c1-7 | xargs -n1 \ngit quote\n\nwhere the alias.quote = log -1 --pretty='tformat:%h (%s, %ad)' --date=short\n\nI can then compare the dates of my corrective rebases to the patch \nsubmission dates to find the (local sha1 of) missing series.\n\n> I had somehow hoped for some neat magic command or rev specifier that took \n> the revs as alternates to the `-- <paths>` in rev-parse or some such....\n\nThough locating a commit based on a diff's index line does still feel to be \nsomething that should be possible.\n>\n> It's tricky curating old mistakes ;-)\n>\n> Thanks for the pointer.\n>\n>> On Sep 17, 2016 07:33, \"Philip Oakley\" <philipoakley@iee.org> wrote:\n>>\n>> > Hi,\n>> >\n>> > I'm curating some of my old patch series (i.e. doing some tidying up) \n>> > and\n>> > I'm trying to determine the commits that generated some of my patches \n>> > so\n>> > that I can see if I still have them after they were rebased (a 'name \n>> > that\n>> > dangling branch' problem).\n>> >\n>> > Is there an easy way of finding the commit sha1 that contains the given \n>> > diff\n>> > index line.\n>> >\n>> > For example.\n>> > index fa05269..57033dd 100755\n>> > or\n>> > index 8ebcded..d9ab360 100644\n>> >\n>> > which both should get back to Jeff King's 36d6792 (t0006: test various \n>> > date\n>> > formats, 2016-06-20).\n>> >\n>> > It feels like it is something that should already possible without a\n>> > mini-script. We have the rev range which should limit the range to a \n>> > single\n>> > commit, though if random blob revs were given the commit range would be\n>> > 'scattered'.\n>> >\n>> >\n>> > Is there a simple quick way of achieving this?\n>> >\n>> > --\n>> > Philip\n>\n> \n\n"}]}