@matheusbsbs / matheus-bagliano / commits / 2958228430
Fork 0

gitk: Fix switch statement in parseviewargs

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>

Paul Mackerras committed Nov 18, 2008 at 19:44 UTC 2958228430b63f2e38c55519d1f98d8d6d9e23f3
1 file changed +11 -11
gitk
+11 -11
@@ -155,18 +155,16 @@ proc parseviewargs {n arglist} {
155 set origargs [lreplace $origargs $i $i]
156 incr i -1
157 }
158 - # These request or affect diff output, which we don't want.
159 - # Some could be used to set our defaults for diff display.
158 "-[puabwcrRBMC]" -
159 "--no-renames" - "--full-index" - "--binary" - "--abbrev=*" -
160 "--find-copies-harder" - "-l*" - "--ext-diff" - "--no-ext-diff" -
161 "--src-prefix=*" - "--dst-prefix=*" - "--no-prefix" -
162 "-O*" - "--text" - "--full-diff" - "--ignore-space-at-eol" -
163 "--ignore-space-change" - "-U*" - "--unified=*" {
164 + # These request or affect diff output, which we don't want.
165 + # Some could be used to set our defaults for diff display.
166 lappend diffargs $arg
167 }
168 - # These cause our parsing of git log's output to fail, or else
169 - # they're options we want to set ourselves, so ignore them.
168 "--raw" - "--patch-with-raw" - "--patch-with-stat" -
169 "--name-only" - "--name-status" - "--color" - "--color-words" -
170 "--log-size" - "--pretty=*" - "--decorate" - "--abbrev-commit" -
@@ -174,27 +172,29 @@ proc parseviewargs {n arglist} {
172 "--no-color" - "-g" - "--walk-reflogs" - "--no-walk" -
173 "--timestamp" - "relative-date" - "--date=*" - "--stdin" -
174 "--objects" - "--objects-edge" - "--reverse" {
175 + # These cause our parsing of git log's output to fail, or else
176 + # they're options we want to set ourselves, so ignore them.
177 }
178 - # These are harmless, and some are even useful
178 "--stat=*" - "--numstat" - "--shortstat" - "--summary" -
179 "--check" - "--exit-code" - "--quiet" - "--topo-order" -
180 "--full-history" - "--dense" - "--sparse" -
181 "--follow" - "--left-right" - "--encoding=*" {
182 + # These are harmless, and some are even useful
183 lappend glflags $arg
184 }
185 - # These mean that we get a subset of the commits
185 "--diff-filter=*" - "--no-merges" - "--unpacked" -
186 "--max-count=*" - "--skip=*" - "--since=*" - "--after=*" -
187 "--until=*" - "--before=*" - "--max-age=*" - "--min-age=*" -
188 "--author=*" - "--committer=*" - "--grep=*" - "-[iE]" -
189 "--remove-empty" - "--first-parent" - "--cherry-pick" -
191 - "-S*" - "--pickaxe-all" - "--pickaxe-regex" - {
190 + "-S*" - "--pickaxe-all" - "--pickaxe-regex" {
191 + # These mean that we get a subset of the commits
192 set filtered 1
193 lappend glflags $arg
194 }
195 - # This appears to be the only one that has a value as a
196 - # separate word following it
195 "-n" {
196 + # This appears to be the only one that has a value as a
197 + # separate word following it
198 set filtered 1
199 set nextisval 1
200 lappend glflags $arg
@@ -211,8 +211,8 @@ proc parseviewargs {n arglist} {
211 # git rev-parse doesn't understand --merge
212 lappend revargs --gitk-symmetric-diff-marker MERGE_HEAD...HEAD
213 }
214 - # Other flag arguments including -<n>
214 "-*" {
215 + # Other flag arguments including -<n>
216 if {[string is digit -strict [string range $arg 1 end]]} {
217 set filtered 1
218 } else {
@@ -222,8 +222,8 @@ proc parseviewargs {n arglist} {
222 }
223 lappend glflags $arg
224 }
225 - # Non-flag arguments specify commits or ranges of commits
225 default {
226 + # Non-flag arguments specify commits or ranges of commits
227 if {[string match "*...*" $arg]} {
228 lappend revargs --gitk-symmetric-diff-marker
229 }