Git fork

Merge branch 'ml/misc-simplifications'

* ml/misc-simplifications:
git-gui: simplify using nice(1)
git-gui: simplify PATH de-duplication

+8 -28
+8 -28
git-gui.sh
··· 103 103 set _path_sep {:} 104 104 } 105 105 106 - set _search_path {} 107 106 set _path_seen [dict create] 108 107 foreach p [split $env(PATH) $_path_sep] { 109 108 # Keep only absolute paths, getting rid of ., empty, etc. ··· 112 111 } 113 112 # Keep only the first occurence of any duplicates. 114 113 set norm_p [file normalize $p] 115 - if {[dict exists $_path_seen $norm_p]} { 116 - continue 117 - } 118 114 dict set _path_seen $norm_p 1 119 - lappend _search_path $norm_p 120 115 } 116 + set _search_path [dict keys $_path_seen] 121 117 unset _path_seen 122 118 123 119 set env(PATH) [join $_search_path $_path_sep] ··· 583 579 return [open |$run r] 584 580 } 585 581 586 - proc _lappend_nice {cmd_var} { 587 - global _nice 588 - upvar $cmd_var cmd 589 - 590 - if {![info exists _nice]} { 591 - set _nice [_which nice] 592 - if {[catch {safe_exec [list $_nice git version]}]} { 593 - set _nice {} 594 - } 595 - } 596 - if {$_nice ne {}} { 597 - lappend cmd $_nice 598 - } 599 - } 600 - 601 582 proc git {args} { 602 583 git_redir $args {} 603 584 } ··· 631 612 return [safe_open_command $cmdp $redir] 632 613 } 633 614 615 + set _nice [list [_which nice]] 616 + if {[catch {safe_exec [list {*}$_nice git version]}]} { 617 + set _nice {} 618 + } 619 + 634 620 proc git_read_nice {cmd} { 635 - global _git 636 - set opt [list] 637 - 638 - _lappend_nice opt 639 - 640 - set cmdp [concat [list $_git] $cmd] 641 - 642 - return [safe_open_command [concat $opt $cmdp]] 621 + set cmdp [list {*}$::_nice $::_git {*}$cmd] 622 + return [safe_open_command $cmdp] 643 623 } 644 624 645 625 proc git_write {cmd} {