7 set lily_dir
$env(HOME
)/lilypond
10 proc write_to_output
{s
} {
11 .output.
text insert insert
$s
15 proc write_file_to_output
{f
} {
18 fconfigure $f -blocking true
19 if {[catch {close $f} err
]} {
20 tk_messageBox -type ok
-message "Git aborted: $err"
24 write_to_output
[read $f 24]
29 global lily_dir git_command
31 set git_command
[linsert $args 0 "|git" "--git-dir=$lily_dir/.git"]
32 set git_command
"$git_command 2>@1"
33 #.output.text insert end "$git_command\n"
34 set git
[open $git_command r
]
35 fconfigure $git -blocking false
36 fileevent $git readable
[list write_file_to_output
$git]
42 set p
[open [linsert $args 0 "|git" --git-dir
=$lily_dir/.git config
] r
]
43 set result
[regsub "\n\$" [read $p] ""]
44 if {[catch {close $p} err
]} {
45 tk_messageBox -type ok
-message "config failed: $err"
50 proc config_quiet
{args
} {
52 set p
[open [linsert $args 0 "|git" --git-dir
=$lily_dir/.git config
] r
]
53 set result
[regsub "\n\$" [read $p] ""]
54 if {[catch {close $p} err
]} {
60 proc update_lilypond
{} {
62 if {![file exists
$lily_dir]} {
65 git config core.bare false
66 git remote add
-t master
\
67 origin git
://repo.or.cz
/lilypond.git
69 git reset
--hard origin
/master
70 git config branch.master.remote origin
71 git config branch.master.merge refs
/heads
/master
72 .
update configure
-text "Update LilyPond"
77 git rebase origin
/master
79 git merge origin
/master
82 write_to_output
"Done.\n"
85 proc toggle_rebase
{} {
87 config
--bool branch.master.rebase
$rebase
92 wm title .
"LilyPond Contributor's GUI"
97 button .buttons.
update -text "Update LilyPond" -command update_lilypond
98 label .buttons.rebase_label
-text "Rebase"
99 if {![file exists
$lily_dir]} {
100 .
update configure
-text "Clone LilyPond"
103 if {[config_quiet
--bool branch.master.rebase
] == true
} {
106 checkbutton .buttons.rebase
-variable rebase
-command toggle_rebase
107 pack .buttons.
update -side left
108 pack .buttons.rebase
-side right
109 pack .buttons.rebase_label
-side right
114 text .output.
text -width 80 -height 15 \
115 -xscrollcommand [list .output.horizontal
set] \
116 -yscrollcommand [list .output.vertical
set]
117 scrollbar .output.horizontal
-orient h
-command [list .output.
text xview
]
118 scrollbar .output.vertical
-orient v
-command [list .output.
text yview
]
119 pack .output.horizontal
-side bottom
-fill x
120 pack .output.vertical
-side right
-fill y
121 pack .output.
text -expand true
-anchor nw
-fill both
123 pack .buttons .output