{"thread":{"id":"30749","subject":"show refs points to a commit","startedAt":"2012-06-08T19:37:57Z","lastAt":"2012-06-08T20:10:29Z","messageCount":5,"participants":["Ralf Thielow","Vincent van Ravesteijn","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193178","messageId":"CAN0XMO+G6K0FZgu35OuuqGEp322vLpakXHXBTPpUQmoex68srA@mail.gmail.com","threadId":"30749","inReplyTo":null,"subject":"show refs points to a commit","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@googlemail.com","sentAt":"2012-06-08T19:37:57Z","receivedAt":"2012-06-08T19:37:57Z","isPatch":false,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"After playing around with submodules, I haven't\nfound a builtin way to show refs pointing to a\nspecified commit without using UNIX pipes.\n\nEspecially when you working with submodules, it\nwould be very helpful to know which refs\npoints to this commit in order to switch from\n\"detached HEAD\" to the branch you can (maybe)\nwork with.\n\nOr did I miss something?\n\nThanks\n\nRalf\n"},{"id":"193179","messageId":"4FD256CC.5010801@lyx.org","threadId":"30749","inReplyTo":"CAN0XMO+G6K0FZgu35OuuqGEp322vLpakXHXBTPpUQmoex68srA@mail.gmail.com","subject":"Re: show refs points to a commit","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-06-08T19:47:24Z","receivedAt":"2012-06-08T19:47:24Z","isPatch":false,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Op 8-6-2012 21:37, Ralf Thielow schreef:\n> After playing around with submodules, I haven't\n> found a builtin way to show refs pointing to a\n> specified commit without using UNIX pipes.\n>\n> Especially when you working with submodules, it\n> would be very helpful to know which refs\n> points to this commit in order to switch from\n> \"detached HEAD\" to the branch you can (maybe)\n> work with.\n>\n> Or did I miss something?\n\nIs this what you mean ?\n\n$ git rev-parse master\nf623ca1cae600e97cb0b38131fdd33e4fb669cf8\n$ git name-rev f623ca1cae600\nf623ca1cae600 master\n$ git name-rev --refs=refs/heads/* f344333cd\nf344333cd master~10\n\nVincent\n"},{"id":"193180","messageId":"CAN0XMO+FpCWgf96ffZ0qd7TNEmdBXicvvk23fnXBaTK_7weV-g@mail.gmail.com","threadId":"30749","inReplyTo":"4FD256CC.5010801@lyx.org","subject":"Re: show refs points to a commit","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@googlemail.com","sentAt":"2012-06-08T19:51:06Z","receivedAt":"2012-06-08T19:51:06Z","isPatch":false,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"On Fri, Jun 8, 2012 at 9:47 PM, Vincent van Ravesteijn <vfr@lyx.org> wrote:\n> Is this what you mean ?\n>\n> $ git rev-parse master\n> f623ca1cae600e97cb0b38131fdd33e4fb669cf8\n> $ git name-rev f623ca1cae600\n> f623ca1cae600 master\n> $ git name-rev --refs=refs/heads/* f344333cd\n> f344333cd master~10\n>\n\nI just want to know what's the refs where\nthe *tip* points to my specified commit.\n"},{"id":"193183","messageId":"7v4nqld11k.fsf@alter.siamese.dyndns.org","threadId":"30749","inReplyTo":"CAN0XMO+FpCWgf96ffZ0qd7TNEmdBXicvvk23fnXBaTK_7weV-g@mail.gmail.com","subject":"Re: show refs points to a commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-08T20:03:03Z","receivedAt":"2012-06-08T20:03:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ralf Thielow <ralf.thielow@googlemail.com> writes:\n\n> On Fri, Jun 8, 2012 at 9:47 PM, Vincent van Ravesteijn <vfr@lyx.org> wrote:\n>> Is this what you mean ?\n>>\n>> $ git rev-parse master\n>> f623ca1cae600e97cb0b38131fdd33e4fb669cf8\n>> $ git name-rev f623ca1cae600\n>> f623ca1cae600 master\n>> $ git name-rev --refs=refs/heads/* f344333cd\n>> f344333cd master~10\n>>\n>\n> I just want to know what's the refs where\n> the *tip* points to my specified commit.\n\n\"git for-each-ref\" gives the mapping from the tip of your refs to\nobject names.  We do not keep and give reverse mapping but there\nshould be enough information in for-each-refs output to get the\ninformation yourself, I think.\n"},{"id":"193187","messageId":"CAN0XMOK=KwHSc0oZZJYBSmqYLG31W0vcA=Qt929uCf7PHsuqiw@mail.gmail.com","threadId":"30749","inReplyTo":"7v4nqld11k.fsf@alter.siamese.dyndns.org","subject":"Re: show refs points to a commit","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@googlemail.com","sentAt":"2012-06-08T20:10:29Z","receivedAt":"2012-06-08T20:10:29Z","isPatch":false,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"> \"git for-each-ref\" gives the mapping from the tip of your refs to\n> object names.  We do not keep and give reverse mapping but there\n> should be enough information in for-each-refs output to get the\n> information yourself, I think.\n\nBut you need to grep if you have a big list, don't you?\nMichael H. points me to: \"git log -1 --decorate\"\nwhich works very well to me.\n\nThanks\n"}]}