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

Re: [PATCH/RFC] Add a --bouquet option to git rev-list

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 1, 2009, 08:09 UTC
Message-ID
<4B14CF47.5020808@drmicha.warpmail.net>
In-Reply-To
<4b143a9c.c401be0a.364f.ffffba5b@mx.google.com>
Nathan W. Panike venit, vidit, dixit 30.11.2009 21:55:
Show 18 quoted lines
> Add a command line option to rev-list so the command 'git rev-list --bouquet'
> shows all revisions that are ancestors of refs which share history with HEAD.
> 
> Signed-off-by: Nathan W. Panike <nathan.panike@gmail.com>
> ---
> I have a repository with the following structure:
> 
>       B
>      /
> A'--A--C
>      \
>       D
> 
> E'--E
> 
> Thus the command 'git merge base E A' returns nothing, as there is no common
> history.  The E history contains stuff that is derived from the other history
> (A, B, C, or D).  Often I find myself doing the following:

Either I don't understand the diagram or your term "derived". If "derived" means "on some branch of a merge" and E is derived from A, B, C, or D, then (since B, C, D is derived from A, and from A') E is derived from A', and they will have a merge base.

Are these diagrams really disconnected from each other?
Show 22 quoted lines
> git checkout C
> gitk $(include_forks) &
> <View history, make changes, merges, et cetera>
> git checkout E
> <go back to gitk, only see history for B, C, etc>
> 
> Now the 'include_forks' command is a bash function in my .bashrc:
> 
> include_forks () 
> { 
>     local head="$(git show -s --pretty=format:'%H' HEAD)";
>     echo "HEAD $(git for-each-ref --format='%(refname)' \
> 	refs/heads refs/remotes | while read ref; do \
> 	if test "$(git merge-base HEAD ${ref}^{commit})" != ""; \
> 		then echo ${ref}; fi; done)"
> }
> 
> The shell thus intercepts my command and I must restart gitk to see the history
> of E. 
> 
> With this patch, I can issue the command 'gitk --bouquet' and when I checkout
> E, I can 'reload' in gitk and see the history of E automatically.

What would your patch do in the example you gave above? Which refs would it cause gitk (rev-list) to show?

Michael
Previous: Nathan W. PanikeNext: Nathan W. Panike
Message 2 of 4 in “Add a --bouquet option to git rev-list”
  1. Add a --bouquet option to git rev-listNathan W. Panike, Nov 30, 2009
  2. Michael J GruberDec 1, 2009
  3. Nathan W. PanikeDec 1, 2009
  4. Junio C HamanoDec 1, 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.