git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: fix --all behavior combined with --not
@ 2019-07-04  8:09 Heiko Voigt
  2019-07-04 10:38 ` Johannes Schindelin
  2019-07-08 19:01 ` Junio C Hamano
  0 siblings, 2 replies; 12+ messages in thread
From: Heiko Voigt @ 2019-07-04  8:09 UTC (permalink / raw)
  To: paulus, max; +Cc: git

In commit 4d5e1b1319 ("gitk: Show detached HEAD if --all is specified",
2014-09-09) the intention was to have detached HEAD shown when the --all
argument is given.

This was solved by appending HEAD to the revs list. By doing that the
behavior using the --not argument is now broken, since that inverts the
meaning of all following arguments passed to git rev-parse.

Lets fix this by prepending HEAD instead of appending, this way there
can not be any '--not' in front.

This was discovered because

	gitk --all --not origin/master

does not display the same revs as

	gitk --all ^origin/master

which it should.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
 gitk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitk b/gitk
index a14d7a1..19d95cd 100755
--- a/gitk
+++ b/gitk
@@ -295,7 +295,7 @@ proc parseviewrevs {view revs} {
     if {$revs eq {}} {
 	set revs HEAD
     } elseif {[lsearch -exact $revs --all] >= 0} {
-	lappend revs HEAD
+	linsert revs 0 HEAD
     }
     if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
 	# we get stdout followed by stderr in $err
-- 
2.21.0


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

end of thread, other threads:[~2019-07-11 18:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-04  8:09 [PATCH] gitk: fix --all behavior combined with --not Heiko Voigt
2019-07-04 10:38 ` Johannes Schindelin
2019-07-04 11:31   ` Heiko Voigt
2019-07-08 19:01 ` Junio C Hamano
2019-07-09  4:55   ` Junio C Hamano
2019-07-09  5:16     ` Junio C Hamano
2019-07-10  7:58       ` Heiko Voigt
2019-07-10 18:40         ` Junio C Hamano
2019-07-11 12:24           ` Heiko Voigt
2019-07-11 18:55             ` Junio C Hamano
2019-07-11 17:11           ` Johannes Sixt
2019-07-10  7:44     ` Heiko Voigt

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