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

Re: search branches which contain a blob id

From
Tomas Carnecky <tom@dbservice.com>
Date
Sep 30, 2009, 13:43 UTC
Message-ID
<1164C259-0573-4F27-990C-743C6710EA59@dbservice.com>
In-Reply-To
<8a906e45ab8e0252a0be11e4d4e9389e@blinkeye.ch>
On Sep 30, 2009, at 2:38 PM, Reto Glauser wrote:
Show 6 quoted lines
> To get a list of branches which contain a specific commit we use:
>
> $ git branch --contains <commit id>
>
> Is there a similar way to get a list of branches with respect to a
> specific blob (e.g. the actual code change a commit introduces)?

Blob == contents of a file. To see what code changed you need to compare two blobs (or trees).

> Obvious use-case: One isn't interested in the commit information  
> (author,
> parent, date) but merely in the set of changes a commit introduces.
git log -S'string to search for'

searches the history for commits which introduced or removed that string from a file.

Or 'git log -p', if you want to see the diff alongside the other information that log gives you.

tom
Previous: Reto Glauser
Message 2 of 2 in “search branches which contain a blob id”
  1. Reto GlauserSep 30, 2009
  2. Tomas CarneckySep 30, 2009

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.