[RFE] option for find branches in a remote repo which contain a certain commit

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFE] option for find branches in a remote repo which contain a certain commit

ryenus ◇
Given a certain commit, I want there's a command/option for git to
make it search the remote repo (e.g. origin) and tell me the
branches there which contain that commit.

So that I can pick the wanted branch and fetch it afterward.

The reason I need this is that there are hundreds of (could be more)
branches, but I just need a few of them, and don't want to fetch all
other branches.

I guess this could be an option for git-remote, so that with a given
remote and commit, it returns a list of branches (or even tags).
The list size might default to a number and should be customizable.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [RFE] option for find branches in a remote repo which contain a certain commit

Ævar Arnfjörð Bjarmason
On Fri, Jun 22, 2012 at 4:58 PM, ryenus <[hidden email]> wrote:
> Given a certain commit, I want there's a command/option for git to
> make it search the remote repo (e.g. origin) and tell me the
> branches there which contain that commit.

git branch --contains <commit>
git branch -a --contains <commit>
git tag --contains <commit>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [RFE] option for find branches in a remote repo which contain a certain commit

Junio C Hamano
Ævar Arnfjörð Bjarmason <[hidden email]> writes:

> On Fri, Jun 22, 2012 at 4:58 PM, ryenus <[hidden email]> wrote:
>> Given a certain commit, I want there's a command/option for git to
>> make it search the remote repo (e.g. origin) and tell me the
>> branches there which contain that commit.
>
> git branch --contains <commit>
> git branch -a --contains <commit>
> git tag --contains <commit>

Yes and no.  These are all local operations, so you would need to do
a "git clone" before starting to dig history like that.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [RFE] option for find branches in a remote repo which contain a certain commit

Neal Kreitzinger-2
In reply to this post by Ævar Arnfjörð Bjarmason
On 6/22/2012 10:24 AM, Ævar Arnfjörð Bjarmason wrote:
> On Fri, Jun 22, 2012 at 4:58 PM, ryenus <[hidden email]> wrote:
>> Given a certain commit, I want there's a command/option for git to
>> make it search the remote repo (e.g. origin) and tell me the
>> branches there which contain that commit.
>
> git branch --contains <commit>
> git branch -a --contains <commit>
> git tag --contains <commit>
>

 >> ...The reason I need this is that there are hundreds of...
 >> branches, but I just need a few of them, and don't want to fetch all
 >> other branches...

You could have a 'query repo' that is a local clone of the remote repo.
  Fetch all branches to the local query repo and then use AEvar's
suggested commands.  Once you find the branches you want then you can
git remote add -t them.

v/r,
neal
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html