Skip to content

Commit

Permalink
gitk: Fix switch statement in parseviewargs
Browse files Browse the repository at this point in the history
In Tcl, a comment in a switch command where a pattern would be expected
doesn't do what one would expect, so this moves the comments inside the
actions.  Doing that shows up an extra "-" which this also removes.

With this, --merge is now handled properly.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Nov 18, 2008
1 parent 28593d3 commit 2958228
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -155,46 +155,46 @@ proc parseviewargs {n arglist} {
set origargs [lreplace $origargs $i $i]
incr i -1
}
# These request or affect diff output, which we don't want.
# Some could be used to set our defaults for diff display.
"-[puabwcrRBMC]" -
"--no-renames" - "--full-index" - "--binary" - "--abbrev=*" -
"--find-copies-harder" - "-l*" - "--ext-diff" - "--no-ext-diff" -
"--src-prefix=*" - "--dst-prefix=*" - "--no-prefix" -
"-O*" - "--text" - "--full-diff" - "--ignore-space-at-eol" -
"--ignore-space-change" - "-U*" - "--unified=*" {
# These request or affect diff output, which we don't want.
# Some could be used to set our defaults for diff display.
lappend diffargs $arg
}
# These cause our parsing of git log's output to fail, or else
# they're options we want to set ourselves, so ignore them.
"--raw" - "--patch-with-raw" - "--patch-with-stat" -
"--name-only" - "--name-status" - "--color" - "--color-words" -
"--log-size" - "--pretty=*" - "--decorate" - "--abbrev-commit" -
"--cc" - "-z" - "--header" - "--parents" - "--boundary" -
"--no-color" - "-g" - "--walk-reflogs" - "--no-walk" -
"--timestamp" - "relative-date" - "--date=*" - "--stdin" -
"--objects" - "--objects-edge" - "--reverse" {
# These cause our parsing of git log's output to fail, or else
# they're options we want to set ourselves, so ignore them.
}
# These are harmless, and some are even useful
"--stat=*" - "--numstat" - "--shortstat" - "--summary" -
"--check" - "--exit-code" - "--quiet" - "--topo-order" -
"--full-history" - "--dense" - "--sparse" -
"--follow" - "--left-right" - "--encoding=*" {
# These are harmless, and some are even useful
lappend glflags $arg
}
# These mean that we get a subset of the commits
"--diff-filter=*" - "--no-merges" - "--unpacked" -
"--max-count=*" - "--skip=*" - "--since=*" - "--after=*" -
"--until=*" - "--before=*" - "--max-age=*" - "--min-age=*" -
"--author=*" - "--committer=*" - "--grep=*" - "-[iE]" -
"--remove-empty" - "--first-parent" - "--cherry-pick" -
"-S*" - "--pickaxe-all" - "--pickaxe-regex" - {
"-S*" - "--pickaxe-all" - "--pickaxe-regex" {
# These mean that we get a subset of the commits
set filtered 1
lappend glflags $arg
}
# This appears to be the only one that has a value as a
# separate word following it
"-n" {
# This appears to be the only one that has a value as a
# separate word following it
set filtered 1
set nextisval 1
lappend glflags $arg
Expand All @@ -211,8 +211,8 @@ proc parseviewargs {n arglist} {
# git rev-parse doesn't understand --merge
lappend revargs --gitk-symmetric-diff-marker MERGE_HEAD...HEAD
}
# Other flag arguments including -<n>
"-*" {
# Other flag arguments including -<n>
if {[string is digit -strict [string range $arg 1 end]]} {
set filtered 1
} else {
Expand All @@ -222,8 +222,8 @@ proc parseviewargs {n arglist} {
}
lappend glflags $arg
}
# Non-flag arguments specify commits or ranges of commits
default {
# Non-flag arguments specify commits or ranges of commits
if {[string match "*...*" $arg]} {
lappend revargs --gitk-symmetric-diff-marker
}
Expand Down

0 comments on commit 2958228

Please sign in to comment.