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

[PATCH rev-list.c] max-count in terms of intersection

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Nov 18, 2005, 21:47 UTC
Message-ID
<20051118214722.4449.qmail@web31813.mail.mud.yahoo.com>

diff-tree 768b79de9eadc38a839332df0fcce021f7174d6d (from 2e67a5f449f4026097494569f871d79bf263ab28) tree 6403fc730f8d5843043788f4c2f466727ba94bc0 parent 2e67a5f449f4026097494569f871d79bf263ab28 author Luben Tuikov <ltuikov@yahoo.com> 1132349344 -0500 committer Luben Tuikov <ltuikov@yahoo.com> 1132349344 -0500

    [PATCH rev-list.c] max-count in terms of intersection
    
    When a path designation is given, max-count counts the number
    of commits therein (intersection), not globally.
    
    This avoids the case where in case path has been inactive
    for the last N commits, --max-count=N and path designation
    at git-rev-list is given, would give no commits.
    
    Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
diff --git a/rev-list.c b/rev-list.c
index 6e6ffde..e17f928 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -124,8 +124,6 @@ static int filter_commit(struct commit *
                stop_traversal=1;
                return CONTINUE;
        }
-       if (max_count != -1 && !max_count--)
-               return STOP;
        if (no_merges && (commit->parents && commit->parents->next))
                return CONTINUE;
        if (paths && dense) {
@@ -148,6 +146,9 @@ static int process_commit(struct commit 
                return CONTINUE;
        }
 
+       if (max_count != -1 && !max_count--)
+               return STOP;
+
        show_commit(commit);
 
        return CONTINUE;
Next: Junio C Hamano
Message 1 of 4 in “max-count in terms of intersection”
  1. max-count in terms of intersectionLuben Tuikov, Nov 18, 2005
  2. Junio C HamanoNov 18, 2005
  3. Luben TuikovNov 18, 2005
  4. Junio C HamanoNov 18, 2005

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.