~ubuntu-branches/ubuntu/hardy/git-core/hardy-updates

« back to all changes in this revision

Viewing changes to git-gui/git-gui.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-11-01 08:35:46 UTC
  • mfrom: (1.1.24)
  • Revision ID: package-import@ubuntu.com-20071101083546-w9tywil7o688gow7
Tags: 1:1.5.3.5-1
* new upstream point release.
  * git-config: handle --file option with relative pathname properly;
    git-config: print error message if the config file cannot be read;
    git-config: don't silently ignore options after --list (closes:
    #445208).

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
        global env _search_exe _search_path
306
306
 
307
307
        if {$_search_path eq {}} {
308
 
                if {[is_Cygwin]} {
 
308
                if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} {
309
309
                        set _search_path [split [exec cygpath \
310
310
                                --windows \
311
311
                                --path \
498
498
set _git  [_which git]
499
499
if {$_git eq {}} {
500
500
        catch {wm withdraw .}
501
 
        error_popup "Cannot find git in PATH."
 
501
        tk_messageBox \
 
502
                -icon error \
 
503
                -type ok \
 
504
                -title [mc "git-gui: fatal error"] \
 
505
                -message [mc "Cannot find git in PATH."]
502
506
        exit 1
503
507
}
504
508
 
534
538
regsub {\.[0-9]+\.g[0-9a-f]+$} $_git_version {} _git_version
535
539
regsub {\.rc[0-9]+$} $_git_version {} _git_version
536
540
regsub {\.GIT$} $_git_version {} _git_version
 
541
regsub {\.[a-zA-Z]+\.[0-9]+$} $_git_version {} _git_version
537
542
 
538
543
if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
539
544
        catch {wm withdraw .}
903
908
        }
904
909
}
905
910
 
 
911
if {[is_Cygwin]} {
 
912
        set is_git_info_link {}
 
913
        set is_git_info_exclude {}
 
914
        proc have_info_exclude {} {
 
915
                global is_git_info_link is_git_info_exclude
 
916
 
 
917
                if {$is_git_info_link eq {}} {
 
918
                        set is_git_info_link [file isfile [gitdir info.lnk]]
 
919
                }
 
920
 
 
921
                if {$is_git_info_link} {
 
922
                        if {$is_git_info_exclude eq {}} {
 
923
                                if {[catch {exec test -f [gitdir info exclude]}]} {
 
924
                                        set is_git_info_exclude 0
 
925
                                } else {
 
926
                                        set is_git_info_exclude 1
 
927
                                }
 
928
                        }
 
929
                        return $is_git_info_exclude
 
930
                } else {
 
931
                        return [file readable [gitdir info exclude]]
 
932
                }
 
933
        }
 
934
} else {
 
935
        proc have_info_exclude {} {
 
936
                return [file readable [gitdir info exclude]]
 
937
        }
 
938
}
 
939
 
906
940
proc rescan_stage2 {fd after} {
907
941
        global rescan_active buf_rdi buf_rdf buf_rlo
908
942
 
913
947
        }
914
948
 
915
949
        set ls_others [list --exclude-per-directory=.gitignore]
916
 
        set info_exclude [gitdir info exclude]
917
 
        if {[file readable $info_exclude]} {
918
 
                lappend ls_others "--exclude-from=$info_exclude"
 
950
        if {[have_info_exclude]} {
 
951
                lappend ls_others "--exclude-from=[gitdir info exclude]"
919
952
        }
920
953
        set user_exclude [get_config core.excludesfile]
921
954
        if {$user_exclude ne {} && [file readable $user_exclude]} {
1093
1126
}
1094
1127
 
1095
1128
proc ui_status {msg} {
1096
 
        $::main_status show $msg
 
1129
        global main_status
 
1130
        if {[info exists main_status]} {
 
1131
                $main_status show $msg
 
1132
        }
1097
1133
}
1098
1134
 
1099
1135
proc ui_ready {{test {}}} {
1100
 
        $::main_status show {Ready.} $test
 
1136
        global main_status
 
1137
        if {[info exists main_status]} {
 
1138
                $main_status show [mc "Ready."] $test
 
1139
        }
1101
1140
}
1102
1141
 
1103
1142
proc escape_path {path} {
1436
1475
        if {! [file exists $exe]} {
1437
1476
                error_popup "Unable to start gitk:\n\n$exe does not exist"
1438
1477
        } else {
 
1478
                global env
 
1479
 
 
1480
                if {[info exists env(GIT_DIR)]} {
 
1481
                        set old_GIT_DIR $env(GIT_DIR)
 
1482
                } else {
 
1483
                        set old_GIT_DIR {}
 
1484
                }
 
1485
 
 
1486
                set pwd [pwd]
 
1487
                cd [file dirname [gitdir]]
 
1488
                set env(GIT_DIR) [file tail [gitdir]]
 
1489
 
1439
1490
                eval exec $cmd $revs &
 
1491
 
 
1492
                if {$old_GIT_DIR eq {}} {
 
1493
                        unset env(GIT_DIR)
 
1494
                } else {
 
1495
                        set env(GIT_DIR) $old_GIT_DIR
 
1496
                }
 
1497
                cd $pwd
 
1498
 
1440
1499
                ui_status $::starting_gitk_msg
1441
1500
                after 10000 {
1442
1501
                        ui_ready $starting_gitk_msg
1648
1707
                set font [lindex $option 1]
1649
1708
                if {[catch {
1650
1709
                        foreach {cn cv} $repo_config(gui.$name) {
1651
 
                                font configure $font $cn $cv
 
1710
                                font configure $font $cn $cv -weight normal
1652
1711
                        }
1653
1712
                        } err]} {
1654
1713
                        error_popup "Invalid font specified in gui.$name:\n\n$err"