{"thread":{"id":"43840","subject":"Getting the \"message\" given a branch designation and conversely","startedAt":"2016-08-14T14:58:25Z","lastAt":"2016-08-24T14:39:35Z","messageCount":4,"participants":["norm@dad.org","Philip Oakley","Jeff King","Jakub Narębski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"299277","messageId":"201608141458.u7EEwF8P099500@shell1.rawbw.com","threadId":"43840","inReplyTo":null,"subject":"Getting the \"message\" given a branch designation and conversely","fromName":"","fromEmail":"norm@dad.org","sentAt":"2016-08-14T14:58:14Z","receivedAt":"2016-08-14T14:58:25Z","isPatch":false,"sender":{"key":"norm@dad.org","avatar":null},"body":"I am learning how to use git. I would like to know how:\n\nGiven a branch's designation, such as \"master~4\", how can I see the message I\nfurnished when I created the branch using \"git commit\"?\n\nConversely, given the message I furnished to \"git commit\", when I created a\nbranch, how can I see the branch's designation?\n\nContext:\n\n    Operating System: Red Hat Enterprise Linux Workstation release 6.8\n\n    git version: 1.7.1\n\nThank you, very much.\n\n    Norman Shapiro\n"},{"id":"299282","messageId":"4B56CDE3883A4341994E6382DF68C438@PhilipOakley","threadId":"43840","inReplyTo":"201608141458.u7EEwF8P099500@shell1.rawbw.com","subject":"Re: Getting the \"message\" given a branch designation and conversely","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2016-08-14T17:32:00Z","receivedAt":"2016-08-14T17:32:07Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: <norm@dad.org>\n>I am learning how to use git. I would like to know how:\n>\n> Given a branch's designation, such as \"master~4\", how can I see the \n> message I\n> furnished when I created the branch using \"git commit\"?\n>\n> Conversely, given the message I furnished to \"git commit\", when I created \n> a\n> branch, how can I see the branch's designation?\n>\n> Context:\n>\n>    Operating System: Red Hat Enterprise Linux Workstation release 6.8\n>\n>    git version: 1.7.1\n>\n> Thank you, very much.\n>\n>    Norman Shapiro\n> --\n\nNorman,\n\nTo see the commit message try 'git log'. You will need a revision range, so \ntry 'git help revisions' to set a guide about all the different ways you can \nspell that. While at it, it's worth 'git help glossary' just to understand \nsome of the terminology.\n\n--\nPhilip\n'git log HEAD~4^!' \n\n"},{"id":"299331","messageId":"20160815122820.msajaamgmlexe2jd@sigill.intra.peff.net","threadId":"43840","inReplyTo":"201608141458.u7EEwF8P099500@shell1.rawbw.com","subject":"Re: Getting the \"message\" given a branch designation and conversely","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-08-15T12:28:20Z","receivedAt":"2016-08-15T12:28:43Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Aug 14, 2016 at 07:58:14AM -0700, norm@dad.org wrote:\n\n> I am learning how to use git. I would like to know how:\n> \n> Given a branch's designation, such as \"master~4\", how can I see the message I\n> furnished when I created the branch using \"git commit\"?\n\nSomebody already pointed you at \"git log\", which is the right tool for\nlooking at commit messages (or perhaps \"git show\" if you only want to\nsee a single entry).\n\n> Conversely, given the message I furnished to \"git commit\", when I created a\n> branch, how can I see the branch's designation?\n\nTry \"git log --grep=some.regex\" to find a particular commit. Usually we\nrefer to commits by their sha1 id, which will be shown by git-log.\nHowever, you can use git-describe to generate a name for any commit that\nis based on traversing from a tag. Try:\n\n  git describe --contains --all <sha1>\n\nfor example. Using \"--all\" tells git to consider names based on branches\nas well as tags. Using \"--contains\" will generate a name based on\ntraversing backwards from the tags and branches (like \"master~4\") rather\nthan basing the name on a tag that you build off of.\n\n-Peff\n"},{"id":"300051","messageId":"d75b165c-0b68-bd8e-31c0-cf7e704d6e61@gmail.com","threadId":"43840","inReplyTo":"20160815122820.msajaamgmlexe2jd@sigill.intra.peff.net","subject":"Re: Getting the \"message\" given a branch designation and conversely","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2016-08-24T14:39:25Z","receivedAt":"2016-08-24T14:39:35Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 15.08.2016 o 14:28, Jeff King pisze:\n> On Sun, Aug 14, 2016 at 07:58:14AM -0700, norm@dad.org wrote:\n> \n>> I am learning how to use git. I would like to know how:\n>>\n>> Given a branch's designation, such as \"master~4\", how can I see the message I\n>> furnished when I created the branch using \"git commit\"?\n> \n> Somebody already pointed you at \"git log\", which is the right tool for\n> looking at commit messages (or perhaps \"git show\" if you only want to\n> see a single entry).\n\nI think you would want \"git log -1 master~4\" or \"git show master~4\" to\nsee the commit message of a single commit (without diff).\n\n>> Conversely, given the message I furnished to \"git commit\", when I created a\n>> branch, how can I see the branch's designation?\n> \n> Try \"git log --grep=some.regex\" to find a particular commit. Usually we\n> refer to commits by their sha1 id, which will be shown by git-log.\n\nThere is also :/<search> and <rev>^{/<search>} syntax, if you want \ncomposability (see gitrevisions(7)).\n\n> However, you can use git-describe to generate a name for any commit that\n> is based on traversing from a tag. Try:\n> \n>   git describe --contains --all <sha1>\n> \n> for example. Using \"--all\" tells git to consider names based on branches\n> as well as tags. Using \"--contains\" will generate a name based on\n> traversing backwards from the tags and branches (like \"master~4\") rather\n> than basing the name on a tag that you build off of.\n\nThe \"git describe --contains\" is interface to \"git name-rev\" plumbing\n\n-- \nJakub Narębski\n\n"}]}