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

Re:

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 15, 2015, 09:19 UTC
Message-ID
<CACsJy8Be-kY49CxAJTx2R2XG-c_WeuU=yLFT8-XSoaDkTScPGg@mail.gmail.com>
In-Reply-To
<349031438778845@web22j.yandex.ru>
On Wed, Aug 5, 2015 at 7:47 PM, Ivan Chernyavsky <camposer@yandex.ru> wrote:
> Dear community,
>
> For some time I'm wondering why there's no "--grep" option to the "git branch" command, which would request to print only branches having specified string/regexp in their history.

Probably because nobody is interested and steps up to do it. The lack of response to you mail is a sign. Maybe you can try make a patch? I imagine it would not be so different from current --contains code, but this time we need to look into commits, not just commit id.

Show 18 quoted lines
> So for example:
>
>     $ git branch -r --grep=BUG12345
>
> should be roughly equivalent to following expression I'm using now for the same task:
>
>     $ for r in `git rev-list --grep=BUG12345 --remotes=origin`; do git branch -r --list --contains=$r 'origin/*'; done | sort -u
>
> Am I missing something, is there some smarter/simpler way to do this?
>
> Thanks a lot in advance!
>
> --
>   Ivan
> --
> 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
-- 
Duy
Previous: Ivan ChernyavskyNext: Ivan Chernyavsky
Message 5 of 12 in “(unknown)”
  1. Ivan ChernyavskyAug 5, 2015
  2. Which branch(es) contain certain commits? (was Re: (unknown))Junio C Hamano, Aug 5, 2015
  3. Junio C HamanoAug 5, 2015
  4. Ivan ChernyavskyAug 5, 2015
  5. Duy NguyenAug 15, 2015
  6. Ivan ChernyavskyAug 17, 2015
  7. Junio C HamanoAug 17, 2015
  8. Which branch(es) contain certain commits? (was Re: (unknown))Ivan Chernyavsky, Aug 21, 2015
  9. Junio C HamanoAug 21, 2015
  10. Ivan ChernyavskyAug 22, 2015
  11. Ivan ChernyavskyAug 22, 2015
  12. Karthik NayakAug 22, 2015

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.