{"thread":{"id":"30869","subject":"[RFE] option for find branches in a remote repo which contain a certain commit","startedAt":"2012-06-22T14:58:12Z","lastAt":"2012-06-22T18:52:10Z","messageCount":4,"participants":["ryenus","Ævar Arnfjörð Bjarmason","Junio C Hamano","Neal Kreitzinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"194071","messageId":"CAKkAvazRfb0kTphLKoRQxSEBZwHfVZeaM0xEbcxEw7Mt5RMg8A@mail.gmail.com","threadId":"30869","inReplyTo":"CAKkAvazNqZWk=QRmSFsFL33M6z+nZZ_yyxxbxwAh=fQk5DVt-Q@mail.gmail.com","subject":"[RFE] option for find branches in a remote repo which contain a certain commit","fromName":"ryenus","fromEmail":"ryenus@gmail.com","sentAt":"2012-06-22T14:58:12Z","receivedAt":"2012-06-22T14:58:12Z","isPatch":false,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"Given a certain commit, I want there's a command/option for git to\nmake it search the remote repo (e.g. origin) and tell me the\nbranches there which contain that commit.\n\nSo that I can pick the wanted branch and fetch it afterward.\n\nThe reason I need this is that there are hundreds of (could be more)\nbranches, but I just need a few of them, and don't want to fetch all\nother branches.\n\nI guess this could be an option for git-remote, so that with a given\nremote and commit, it returns a list of branches (or even tags).\nThe list size might default to a number and should be customizable.\n\nThanks\n"},{"id":"194072","messageId":"CACBZZX6nbWCFWWy5NTMSAPOf4RHUAbC9TuffPPy=2Ehn7KSnaA@mail.gmail.com","threadId":"30869","inReplyTo":"CAKkAvazRfb0kTphLKoRQxSEBZwHfVZeaM0xEbcxEw7Mt5RMg8A@mail.gmail.com","subject":"Re: [RFE] option for find branches in a remote repo which contain a certain commit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-06-22T15:24:41Z","receivedAt":"2012-06-22T15:24:41Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jun 22, 2012 at 4:58 PM, ryenus <ryenus@gmail.com> wrote:\n> Given a certain commit, I want there's a command/option for git to\n> make it search the remote repo (e.g. origin) and tell me the\n> branches there which contain that commit.\n\ngit branch --contains <commit>\ngit branch -a --contains <commit>\ngit tag --contains <commit>\n"},{"id":"194087","messageId":"7vtxy3p61o.fsf@alter.siamese.dyndns.org","threadId":"30869","inReplyTo":"CACBZZX6nbWCFWWy5NTMSAPOf4RHUAbC9TuffPPy=2Ehn7KSnaA@mail.gmail.com","subject":"Re: [RFE] option for find branches in a remote repo which contain a certain commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-22T18:14:59Z","receivedAt":"2012-06-22T18:14:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Fri, Jun 22, 2012 at 4:58 PM, ryenus <ryenus@gmail.com> wrote:\n>> Given a certain commit, I want there's a command/option for git to\n>> make it search the remote repo (e.g. origin) and tell me the\n>> branches there which contain that commit.\n>\n> git branch --contains <commit>\n> git branch -a --contains <commit>\n> git tag --contains <commit>\n\nYes and no.  These are all local operations, so you would need to do\na \"git clone\" before starting to dig history like that.\n"},{"id":"194090","messageId":"4FE4BEDA.20608@gmail.com","threadId":"30869","inReplyTo":"CACBZZX6nbWCFWWy5NTMSAPOf4RHUAbC9TuffPPy=2Ehn7KSnaA@mail.gmail.com","subject":"Re: [RFE] option for find branches in a remote repo which contain a certain commit","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-06-22T18:52:10Z","receivedAt":"2012-06-22T18:52:10Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 6/22/2012 10:24 AM, Ævar Arnfjörð Bjarmason wrote:\n> On Fri, Jun 22, 2012 at 4:58 PM, ryenus <ryenus@gmail.com> wrote:\n>> Given a certain commit, I want there's a command/option for git to\n>> make it search the remote repo (e.g. origin) and tell me the\n>> branches there which contain that commit.\n>\n> git branch --contains <commit>\n> git branch -a --contains <commit>\n> git tag --contains <commit>\n>\n\n >> ...The reason I need this is that there are hundreds of...\n >> branches, but I just need a few of them, and don't want to fetch all\n >> other branches...\n\nYou could have a 'query repo' that is a local clone of the remote repo.\n  Fetch all branches to the local query repo and then use AEvar's\nsuggested commands.  Once you find the branches you want then you can \ngit remote add -t them.\n\nv/r,\nneal\n"}]}