git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: Fix missing commits when using -S or -G
@ 2016-05-06 11:56 Stefan Dotterweich
  2016-05-06 12:16 ` [PATCH v2] " Stefan Dotterweich
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Dotterweich @ 2016-05-06 11:56 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] gitk: Fix missing commits when using -S or -G
  2016-05-06 11:56 [PATCH] gitk: Fix missing commits when using -S or -G Stefan Dotterweich
@ 2016-05-06 12:16 ` Stefan Dotterweich
  2016-05-09  3:45   ` Paul Mackerras
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Dotterweich @ 2016-05-06 12:16 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] gitk: Fix missing commits when using -S or -G
  2016-05-06 12:16 ` [PATCH v2] " Stefan Dotterweich
@ 2016-05-09  3:45   ` Paul Mackerras
  2016-05-09  5:33     ` Stefan Dotterweich
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Mackerras @ 2016-05-09  3:45 UTC (permalink / raw)
  To: Stefan Dotterweich; +Cc: git

On Fri, May 06, 2016 at 02:16:54PM +0200, Stefan Dotterweich wrote:
> 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.

Nice catch; however, we should only update numcommits if the commits
are for the current view, i.e. if $v == $curview.

Do you want to update the patch?  If you prefer, I can update the
patch and put a note in the commit message about the issue.

Paul.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] gitk: Fix missing commits when using -S or -G
  2016-05-09  3:45   ` Paul Mackerras
@ 2016-05-09  5:33     ` Stefan Dotterweich
  2016-06-04  8:47       ` [PATCH v3] " Stefan Dotterweich
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Dotterweich @ 2016-05-09  5:33 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

> Nice catch; however, we should only update numcommits if the commits
> are for the current view, i.e. if $v == $curview.
>
> Do you want to update the patch?  If you prefer, I can update the
> patch and put a note in the commit message about the issue.

Sure, feel free to update the patch as you see fit.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] gitk: Fix missing commits when using -S or -G
  2016-05-09  5:33     ` Stefan Dotterweich
@ 2016-06-04  8:47       ` Stefan Dotterweich
  2016-12-12  0:39         ` Paul Mackerras
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Dotterweich @ 2016-06-04  8:47 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

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>
---

Here is an updated version of the patch. Feel free to change it if
anything is missing.

 gitk-git/gitk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 805a1c7..572da4a 100755
--- a/gitk-git/gitk
+++ b/gitk-git/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 curview numcommits
 
     set missing_parents 0
     set scripts {}
@@ -1340,6 +1340,9 @@ proc closevarcs {v} {
 	    }
 	    lappend varccommits($v,$b) $p
 	    incr commitidx($v)
+	    if {$v == $curview} {
+		set numcommits $commitidx($v)
+	    }
 	    set scripts [check_interest $p $scripts]
 	}
     }
-- 
2.8.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] gitk: Fix missing commits when using -S or -G
  2016-06-04  8:47       ` [PATCH v3] " Stefan Dotterweich
@ 2016-12-12  0:39         ` Paul Mackerras
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Mackerras @ 2016-12-12  0:39 UTC (permalink / raw)
  To: Stefan Dotterweich; +Cc: git

On Sat, Jun 04, 2016 at 10:47:16AM +0200, Stefan Dotterweich wrote:
> 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>

Thanks, applied, with slight tweaks to the commit message.

Paul.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-12  1:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-06 11:56 [PATCH] gitk: Fix missing commits when using -S or -G Stefan Dotterweich
2016-05-06 12:16 ` [PATCH v2] " Stefan Dotterweich
2016-05-09  3:45   ` Paul Mackerras
2016-05-09  5:33     ` Stefan Dotterweich
2016-06-04  8:47       ` [PATCH v3] " Stefan Dotterweich
2016-12-12  0:39         ` Paul Mackerras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).