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

Re: [PATCH v2] gitk: Fix missing commits when using -S or -G

From
Stefan Dotterweich <stefandotterweich@gmx.de>
Date
May 6, 2016, 12:16 UTC
Message-ID
<572C8B36.2000106@gmx.de>
In-Reply-To
<572C8665.8090707@gmx.de>

When -S or -G is used as a filter option, the resulting commit list rarely contains all matching commits. Only a certain number of commits are displayed and the rest are missing.

"git log --boundary -S" does not return as many boundary commits as you might expect. gitk makes up for this in closevargs() by adding missing parent (boundary) commits. However, it does not change $numcommits, which limits how many commits are shown. In the end, some commits at the end of the commit list are simply not shown.

Change $numcommits whenever a missing parent is added.
Signed-off-by: Stefan Dotterweich <stefandotterweich@gmx.de>
---
 gitk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 805a1c7..b0da174 100755
--- a/gitk
+++ b/gitk
@@ -1315,7 +1315,7 @@ proc commitonrow {row} {
 
 proc closevarcs {v} {
     global varctok varccommits varcid parents children
-    global cmitlisted commitidx vtokmod
+    global cmitlisted commitidx vtokmod numcommits
 
     set missing_parents 0
     set scripts {}
@@ -1339,7 +1339,7 @@ proc closevarcs {v} {
 		modify_arc $v $b
 	    }
 	    lappend varccommits($v,$b) $p
-	    incr commitidx($v)
+	    set numcommits [incr commitidx($v)]
 	    set scripts [check_interest $p $scripts]
 	}
     }
-- 
2.7.4
Previous: Stefan DotterweichNext: Paul Mackerras
Message 2 of 6 in “gitk: Fix missing commits when using -S or -G”
  1. gitk: Fix missing commits when using -S or -GStefan Dotterweich, May 6, 2016
  2. Stefan DotterweichMay 6, 2016
  3. Paul MackerrasMay 9, 2016
  4. Stefan DotterweichMay 9, 2016
  5. gitk: Fix missing commits when using -S or -GStefan Dotterweich, Jun 4, 2016
  6. Paul MackerrasDec 12, 2016

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.