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