@@ -353,6 +353,16 @@ proc parseviewrevs {view revs} {
353
353
return $ret
354
354
}
355
355
356
+ # Escapes a list of filter paths to be passed to git log via stdin. Note that
357
+ # paths must not be quoted.
358
+ proc escape_filter_paths {paths} {
359
+ set escaped [list ]
360
+ foreach path $paths {
361
+ lappend escaped [string map {\\ \\\\ " \ " " \\\ " } $path ]
362
+ }
363
+ return $escaped
364
+ }
365
+
356
366
# Start off a git log process and arrange to read its output
357
367
proc start_rev_list {view} {
358
368
global startmsecs commitidx viewcomplete curview
@@ -405,14 +415,17 @@ proc start_rev_list {view} {
405
415
if {$revs eq {}} {
406
416
return 0
407
417
}
408
- set args [ concat $vflags($view) $revs ]
418
+ set args $vflags($view)
409
419
} else {
420
+ set revs {}
410
421
set args $vorigargs($view)
411
422
}
412
423
413
424
if {[catch {
414
425
set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
415
- --parents --boundary $args " --" $files ] r]
426
+ --parents --boundary $args --stdin \
427
+ " <<[ join [concat $revs " --" \
428
+ [escape_filter_paths $files ] ] " \\ n" ]" ] r]
416
429
} err]} {
417
430
error_popup " [ mc " Error executing git log:" ] $err "
418
431
return 0
@@ -554,13 +567,20 @@ proc updatecommits {} {
554
567
set revs $newrevs
555
568
set vposids($view ) [lsort -unique [concat $oldpos $vposids($view) ]]
556
569
}
557
- set args [concat $vflags($view) $revs --not $oldpos ]
570
+ set args $vflags($view)
571
+ foreach r $oldpos {
572
+ lappend revs " ^$r "
573
+ }
558
574
} else {
575
+ set revs {}
559
576
set args $vorigargs($view)
560
577
}
561
578
if {[catch {
562
579
set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
563
- --parents --boundary $args " --" $vfilelimit($view) ] r]
580
+ --parents --boundary $args --stdin \
581
+ " <<[ join [concat $revs " --" \
582
+ [escape_filter_paths \
583
+ $vfilelimit($view) ] ] " \\ n" ]" ] r]
564
584
} err]} {
565
585
error_popup " [ mc " Error executing git log:" ] $err "
566
586
return
@@ -10228,10 +10248,16 @@ proc getallcommits {} {
10228
10248
foreach id $seeds {
10229
10249
lappend ids " ^$id "
10230
10250
}
10251
+ lappend ids " --"
10231
10252
}
10232
10253
}
10233
10254
if {$ids ne {}} {
10234
- set fd [open [concat $cmd $ids ] r]
10255
+ if {$ids eq " --all" } {
10256
+ set cmd [concat $cmd " --all" ]
10257
+ } else {
10258
+ set cmd [concat $cmd --stdin " <<[ join $ids " \\ n" ] " ]
10259
+ }
10260
+ set fd [open $cmd r]
10235
10261
fconfigure $fd -blocking 0
10236
10262
incr allcommits
10237
10263
nowbusy allcommits
0 commit comments