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

Re: Listing commits that are _exclusively_ available on a given branch

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2012, 19:39 UTC
Message-ID
<7v4ntft8c9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120323175007.GA13410@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 32 quoted lines
> On Fri, Mar 23, 2012 at 10:38:32AM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@peff.net> writes:
>> 
>> > No, I think that is the only way to do it. The algorithm run by rev-list
>> > in that case should be optimal, so there is nothing to improve there.
>> > Syntactically, it's a little bit of a pain because there is no way to
>> > tell rev-list "--all, except for this one branch" short of using grep.
>> > We could add a new syntax for that, but I'm not sure what it would look
>> > like (or if it would be any easier on the eyes than what you have).
>> 
>> We discussed --exclude-refs="refs/tags/expermental-*" that would affect
>> how --all, --heads, and friends are processed several weeks ago, didn't
>> we?
>
> Gmane seems to be down at the moment, but I think the thread you are
> talking about can be found here:
>
>   http://mid.gmane.org/7v4nuvghfk.fsf@alter.siamese.dyndns.org
>   http://mid.gmane.org/4F391F5C.1000400@alum.mit.edu
>   http://mid.gmane.org/7vaa4meat5.fsf@alter.siamese.dyndns.org
>
> It talks about excluding from the positive side, like:
>
>   git rev-list --all --exclude-ref=refs/heads/foo
>
> That can also be extended to the negative side, like:
>
>   git rev-list refs/heads/foo --not --all --exclude-ref=refs/heads/foo
>
> though it is slightly confusing to read due to the double negation (you
> are "--not" "--exclude"-ing the ref).

The confusion comes only if you do not differentiate two independent concepts, I think. --all and --exclude-ref are about what the starting points of the traversal (i.e. what we would call add_rev_cmdline() and add_pending_sha1() with), and --not is about the color in which these pending objects will be painted.

The callpath leading to revisions.c::handle_one_ref() from setup_revisions() must be revamped, so that "--all" does not immediately put them directly in the pending array, but later "--exclude-ref" can subtract from the set, before the starting points are determined and painted in their colors, once we add --exclude-ref support.

Previous: Jeff King
Message 5 of 5 in “Listing commits that are _exclusively_ available on a given branch”
  1. Johan HerlandMar 23, 2012
  2. Jeff KingMar 23, 2012
  3. Junio C HamanoMar 23, 2012
  4. Jeff KingMar 23, 2012
  5. Junio C HamanoMar 23, 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.