{"thread":{"id":"17981","subject":"A couple of minor branching questions","startedAt":"2009-02-24T00:38:47Z","lastAt":"2009-02-24T01:29:10Z","messageCount":2,"participants":["Alan","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"105946","messageId":"1235435927.12677.2.camel@rottwang.fnordora.org","threadId":"17981","inReplyTo":null,"subject":"A couple of minor branching questions","fromName":"Alan","fromEmail":"alan@clueserver.org","sentAt":"2009-02-24T00:38:47Z","receivedAt":"2009-02-24T00:38:47Z","isPatch":false,"sender":{"key":"alan@clueserver.org","avatar":null},"body":"Is there an easy way to tell what commit a branch is branched off from?\nAlso, it there a way to tell what branch the branch is branched off\nfrom? \n\nI know I can use gitk to give a visual diagram, but I want something I\ncan feed into a program.\n\nThanks!\n"},{"id":"105950","messageId":"m3tz6kvd0b.fsf@localhost.localdomain","threadId":"17981","inReplyTo":"1235435927.12677.2.camel@rottwang.fnordora.org","subject":"Re: A couple of minor branching questions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-02-24T01:29:10Z","receivedAt":"2009-02-24T01:29:10Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Alan <alan@clueserver.org> writes:\n\n> Is there an easy way to tell what commit a branch is branched off from?\n> Also, it there a way to tell what branch the branch is branched off\n> from? \n> \n> I know I can use gitk to give a visual diagram, but I want something I\n> can feed into a program.\n\nFirst you can check branch.<branchname>.merge configuration option\n(with git-config) to check what branch (by _remote_ name) given branch\nis based on.\n\nSecond, you can use \"git merge-base <branchname> <second branch>\" to\nfind common ancestor, i.e. branching point of two branches. By the\nway, there is shortcut a..b and a...b for revision ranges: see\ndocumentation in git-rev-parse (or was it git-rev-list?).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}