}
}
-proc load_config {} {
+proc load_config {include_global} {
global repo_config global_config default_config
array unset global_config
- array unset repo_config
- 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
+ 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
}
- close $fd_rc
}
+
+ array unset repo_config
catch {
set fd_rc [open "| git repo-config --list" r]
while {[gets $fd_rc line] >= 0} {
if {$value == $default_config($name)} {
catch {exec git repo-config --global --unset $name}
} else {
- catch {exec git repo-config --global $name $value}
+ regsub -all "\[{}\]" $value {"} value
+ exec git repo-config --global $name $value
}
set global_config($name) $value
if {$value == $repo_config($name)} {
if {$value == $global_config($name)} {
catch {exec git repo-config --unset $name}
} else {
- catch {exec git repo-config $name $value}
+ regsub -all "\[{}\]" $value {"} value
+ exec git repo-config $name $value
}
set repo_config($name) $value
}
}
unset cdup
+set single_commit 0
if {$appname == {git-citool}} {
set single_commit 1
}
##
## task management
-set single_commit 0
set status_active 0
set diff_active 0
set commit_active 0
}
proc pull_remote {remote branch} {
- global HEAD commit_type
- global file_states
+ global HEAD commit_type file_states repo_config
if {![lock_index update]} return
set w [new_console "pull $remote $branch" \
"Pulling new changes from branch $branch in $remote"]
set cmd [list git pull]
+ if {$repo_config(gui.pullsummary) == {false}} {
+ lappend cmd --no-summary
+ }
lappend cmd $remote
lappend cmd $branch
console_exec $w $cmd [list post_pull_remote $remote $branch]
global repo_config global_config
global repo_config_new global_config_new
- load_config
+ load_config 1
array unset repo_config_new
array unset global_config_new
foreach name [array names repo_config] {
pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
foreach option {
+ {pullsummary {Show Pull Summary}}
{trustmtime {Trust File Modification Timestamps}}
} {
set name [lindex $option 0]
}
proc do_restore_defaults {} {
- global font_descs default_config
+ global font_descs default_config repo_config
global repo_config_new global_config_new
foreach name [array names default_config] {
foreach option $font_descs {
set name [lindex $option 0]
- set repo_config($name) $default_config(gui.$name)
+ set repo_config(gui.$name) $default_config(gui.$name)
}
apply_config
}
set default_config(gui.trustmtime) false
+set default_config(gui.pullsummary) true
set default_config(gui.fontui) [font configure font_ui]
set default_config(gui.fontdiff) [font configure font_diff]
set font_descs {
{fontui font_ui {Main Font}}
{fontdiff font_diff {Diff/Console Font}}
}
-load_config
+load_config 0
apply_config
######################################################################
.mbar add cascade -label Project -menu .mbar.project
.mbar add cascade -label Edit -menu .mbar.edit
.mbar add cascade -label Commit -menu .mbar.commit
-.mbar add cascade -label Fetch -menu .mbar.fetch
-.mbar add cascade -label Pull -menu .mbar.pull
-.mbar add cascade -label Push -menu .mbar.push
+if {!$single_commit} {
+ .mbar add cascade -label Fetch -menu .mbar.fetch
+ .mbar add cascade -label Pull -menu .mbar.pull
+ .mbar add cascade -label Push -menu .mbar.push
+}
. configure -menu .mbar
# -- Project Menu
.mbar.project add command -label Visualize \
-command do_gitk \
-font font_ui
-.mbar.project add command -label {Repack Database} \
- -command do_repack \
- -font font_ui
+if {!$single_commit} {
+ .mbar.project add command -label {Repack Database} \
+ -command do_repack \
+ -font font_ui
+}
.mbar.project add command -label Quit \
-command do_quit \
-accelerator $M1T-Q \
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
-# -- Fetch Menu
-menu .mbar.fetch
+if {!$single_commit} {
+ # -- Fetch Menu
+ menu .mbar.fetch
-# -- Pull Menu
-menu .mbar.pull
+ # -- Pull Menu
+ menu .mbar.pull
-# -- Push Menu
-menu .mbar.push
+ # -- Push Menu
+ menu .mbar.push
+}
# -- Main Window Layout
panedwindow .vpane -orient vertical
wm title . "$appname ([file normalize [file dirname $gitdir]])"
focus -force $ui_comm
-load_all_remotes
-populate_remote_menu .mbar.fetch From fetch_from
-populate_remote_menu .mbar.push To push_to
-populate_pull_menu .mbar.pull
-tkwait visibility .
-update_status
+if {!$single_commit} {
+ load_all_remotes
+ populate_remote_menu .mbar.fetch From fetch_from
+ populate_remote_menu .mbar.push To push_to
+ populate_pull_menu .mbar.pull
+}
+after 1 update_status