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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Stefan Dotterweich
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 <[hidden email]>
---
 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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

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

Stefan Dotterweich
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 <[hidden email]>
---
 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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

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

Paul Mackerras-2
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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

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

Stefan Dotterweich
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html