Skip to content
Snippets Groups Projects
Select Git revision
  • 9208487b34706887fcc10ce6423099134f301f5e
  • passt default
  • master
  • pu
  • todo
  • next
  • maint
  • v2.8.0-rc1
  • v2.8.0-rc0
  • v2.7.2
  • v2.7.1
  • v2.7.0
  • v2.6.5
  • v2.7.0-rc3
  • v2.7.0-rc2
  • v2.7.0-rc1
  • v2.7.0-rc0
  • v2.6.4
  • v2.6.3
  • v2.6.2
  • v2.6.1
  • v2.3.10
  • v2.5.4
  • v2.4.10
  • v2.6.0
  • v2.6.0-rc3
  • v2.5.3
27 results

git-gui

Blame
  • git-gui 87.28 KiB
    #!/bin/sh
    # Tcl ignores the next line -*- tcl -*- \
    exec wish "$0" -- "$@"
    
    set copyright {
    Copyright  2006 Shawn Pearce, Paul Mackerras.
    
    All rights reserved.
    
    This program is free software; it may be used, copied, modified
    and distributed under the terms of the GNU General Public Licence,
    either version 2, or (at your option) any later version.}
    
    set appname [lindex [file split $argv0] end]
    set gitdir {}
    
    ######################################################################
    ##
    ## config
    
    proc is_many_config {name} {
    	switch -glob -- $name {
    	remote.*.fetch -
    	remote.*.push
    		{return 1}
    	*
    		{return 0}
    	}
    }
    
    proc load_config {include_global} {
    	global repo_config global_config default_config
    
    	array unset global_config
    	if {$include_global} {
    		catch {
    			set fd_rc [open "| git repo-config --global --list" r]
    			while {[gets $fd_rc line] >= 0} {
    				if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
    					if {[is_many_config $name]} {
    						lappend global_config($name) $value
    					} else {
    						set global_config($name) $value
    					}
    				}
    			}
    			close $fd_rc
    		}
    	}
    
    	array unset repo_config
    	catch {
    		set fd_rc [open "| git repo-config --list" r]
    		while {[gets $fd_rc line] >= 0} {
    			if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
    				if {[is_many_config $name]} {
    					lappend repo_config($name) $value
    				} else {
    					set repo_config($name) $value
    				}
    			}
    		}
    		close $fd_rc
    	}
    
    	foreach name [array names default_config] {
    		if {[catch {set v $global_config($name)}]} {
    			set global_config($name) $default_config($name)
    		}
    		if {[catch {set v $repo_config($name)}]} {