git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to find all the commits that comprise a branch?

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
May 31, 2012, 03:22 UTC
Message-ID
<CAMK1S_i5-ALrMA+iJ1Q4R5FuVbjVdFLfxKoEF4BVHERHSzmjeg@mail.gmail.com>
In-Reply-To
<CAMP44s2kEMK8ik2NTiP4uiN4FPWFNYNJfY5qh5QE_hRH2AiNYA@mail.gmail.com>

On Wed, May 30, 2012 at 11:09 PM, Felipe Contreras <felipe.contreras@gmail.com> wrote:

Show 8 quoted lines
> Hi,
>
> Basically what I want to do is:
>
>  % git log branch ^<any-other-branch>
>
> IOW; all the commits were 'git branch --contains' would show 'branch'
> and nothing else.

I have a script called "otb" (only this branch, I guess; I tend to use crappily short names for stuff I don't make public!) that looks like this:

#!/bin/bash

m=$(git rev-parse HEAD) n=$(git rev-parse --branches | grep -v $m) git log --oneline $m --not $n

I think that fits your description, but it's not *one* command.
Show 10 quoted lines
> Is there any easy way to do that?
>
> Cheers.
>
> --
> Felipe Contreras
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Sitaram
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 5 in “How to find all the commits that comprise a branch?”
  1. Felipe ContrerasMay 30, 2012
  2. Junio C HamanoMay 30, 2012
  3. Felipe ContrerasMay 30, 2012
  4. Sitaram ChamartyMay 31, 2012
  5. Felipe ContrerasMay 31, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.