From e2a1bc67d321a0c03737179f331c39a52e7049d7 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Wed, 4 Apr 2007 11:31:49 -0400 Subject: [PATCH 1/9] Allow wish interpreter to be defined with TCLTK_PATH Makefile got one external option: - TCLTK_PATH: the path to the Tcl/Tk interpreter. Users (or build wrappers) may set this variable to the location of the wish executable. Signed-off-by: Eygene Ryabinkin Signed-off-by: Shawn O. Pearce --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index b82789ead6..2316b24e00 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,8 @@ ifndef V QUIET_BUILT_IN = @echo ' ' BUILTIN $@; endif +TCLTK_PATH ?= wish + ifeq ($(findstring $(MAKEFLAGS),s),s) QUIET_GEN = QUIET_BUILT_IN = @@ -55,6 +57,7 @@ all:: $(ALL_PROGRAMS) install: all $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' + sed -i .bak -e'1,3s|^exec .* "$$0"|exec '"$(TCLTK_PATH)"' "$$0"|' git-gui && rm git-gui.bak $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)' $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) From 3cf0bad830c93176acc6e6436da42e1936bb2282 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Tue, 27 Mar 2007 14:29:08 +0400 Subject: [PATCH 2/9] Teach git-gui to use the user-defined UI font everywhere. Some parts of git-gui were not respecting the default GUI font. Most of them were catched and fixed. Signed-off-by: Eygene Ryabinkin Signed-off-by: Shawn O. Pearce --- git-gui.sh | 64 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 60e79ca1b0..8157184381 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -242,6 +242,8 @@ proc error_popup {msg} { if {[reponame] ne {}} { append title " ([reponame])" } + option add *Dialog.msg.font font_ui + option add *Button.font font_ui set cmd [list tk_messageBox \ -icon error \ -type ok \ @@ -258,6 +260,8 @@ proc warn_popup {msg} { if {[reponame] ne {}} { append title " ([reponame])" } + option add *Dialog.msg.font font_ui + option add *Button.font font_ui set cmd [list tk_messageBox \ -icon warning \ -type ok \ @@ -274,6 +278,8 @@ proc info_popup {msg {parent .}} { if {[reponame] ne {}} { append title " ([reponame])" } + option add *Dialog.msg.font font_ui + option add *Button.font font_ui tk_messageBox \ -parent $parent \ -icon info \ @@ -287,6 +293,8 @@ proc ask_popup {msg} { if {[reponame] ne {}} { append title " ([reponame])" } + option add *Dialog.msg.font font_ui + option add *Button.font font_ui return [tk_messageBox \ -parent . \ -icon question \ @@ -2116,7 +2124,10 @@ proc do_create_branch {} { -value head \ -variable create_branch_revtype \ -font font_ui - eval tk_optionMenu $w.from.head_m create_branch_head $all_heads + set lbranchm [eval tk_optionMenu $w.from.head_m create_branch_head \ + $all_heads] + $lbranchm configure -font font_ui + $w.from.head_m configure -font font_ui grid $w.from.head_r $w.from.head_m -sticky w set all_trackings [all_tracking_branches] if {$all_trackings ne {}} { @@ -2126,9 +2137,11 @@ proc do_create_branch {} { -value tracking \ -variable create_branch_revtype \ -font font_ui - eval tk_optionMenu $w.from.tracking_m \ + set tbranchm [eval tk_optionMenu $w.from.tracking_m \ create_branch_trackinghead \ - $all_trackings + $all_trackings] + $tbranchm configure -font font_ui + $w.from.tracking_m configure -font font_ui grid $w.from.tracking_r $w.from.tracking_m -sticky w } set all_tags [load_all_tags] @@ -2139,9 +2152,11 @@ proc do_create_branch {} { -value tag \ -variable create_branch_revtype \ -font font_ui - eval tk_optionMenu $w.from.tag_m \ + set tagsm [eval tk_optionMenu $w.from.tag_m \ create_branch_tag \ - $all_tags + $all_tags] + $tagsm configure -font font_ui + $w.from.tag_m configure -font font_ui grid $w.from.tag_r $w.from.tag_m -sticky w } radiobutton $w.from.exp_r \ @@ -2335,7 +2350,11 @@ proc do_delete_branch {} { -value head \ -variable delete_branch_checktype \ -font font_ui - eval tk_optionMenu $w.validate.head_m delete_branch_head $all_heads + set mergedlocalm [eval tk_optionMenu $w.validate.head_m \ + delete_branch_head \ + $all_heads] + $mergedlocalm configure -font font_ui + $w.validate.head_m configure -font font_ui grid $w.validate.head_r $w.validate.head_m -sticky w set all_trackings [all_tracking_branches] if {$all_trackings ne {}} { @@ -2345,9 +2364,11 @@ proc do_delete_branch {} { -value tracking \ -variable delete_branch_checktype \ -font font_ui - eval tk_optionMenu $w.validate.tracking_m \ + set mergedtrackm [eval tk_optionMenu $w.validate.tracking_m \ delete_branch_trackinghead \ - $all_trackings + $all_trackings] + $mergedtrackm configure -font font_ui + $w.validate.tracking_m configure -font font_ui grid $w.validate.tracking_r $w.validate.tracking_m -sticky w } radiobutton $w.validate.always_r \ @@ -2721,7 +2742,10 @@ proc do_push_anywhere {} { -value remote \ -variable push_urltype \ -font font_ui - eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes + set remmenu [eval tk_optionMenu $w.dest.remote_m push_remote \ + $all_remotes] + $remmenu configure -font font_ui + $w.dest.remote_m configure -font font_ui grid $w.dest.remote_r $w.dest.remote_m -sticky w if {[lsearch -sorted -exact $all_remotes origin] != -1} { set push_remote origin @@ -4686,9 +4710,11 @@ proc do_options {} { frame $w.global.$name label $w.global.$name.l -text "$text:" -font font_ui pack $w.global.$name.l -side left -anchor w -fill x - eval tk_optionMenu $w.global.$name.family \ + set fontmenu [eval tk_optionMenu $w.global.$name.family \ global_config_new(gui.$font^^family) \ - $all_fonts + $all_fonts] + $w.global.$name.family configure -font font_ui + $fontmenu configure -font font_ui spinbox $w.global.$name.size \ -textvariable global_config_new(gui.$font^^size) \ -from 2 -to 80 -increment 1 \ @@ -5083,18 +5109,18 @@ set ui_comm {} # -- Menu Bar # menu .mbar -tearoff 0 -.mbar add cascade -label Repository -menu .mbar.repository -.mbar add cascade -label Edit -menu .mbar.edit +.mbar add cascade -label Repository -menu .mbar.repository -font font_ui +.mbar add cascade -label Edit -menu .mbar.edit -font font_ui if {[is_enabled branch]} { - .mbar add cascade -label Branch -menu .mbar.branch + .mbar add cascade -label Branch -menu .mbar.branch -font font_ui } if {[is_enabled multicommit] || [is_enabled singlecommit]} { - .mbar add cascade -label Commit -menu .mbar.commit + .mbar add cascade -label Commit -menu .mbar.commit -font font_ui } if {[is_enabled transport]} { - .mbar add cascade -label Merge -menu .mbar.merge - .mbar add cascade -label Fetch -menu .mbar.fetch - .mbar add cascade -label Push -menu .mbar.push + .mbar add cascade -label Merge -menu .mbar.merge -font font_ui + .mbar add cascade -label Fetch -menu .mbar.fetch -font font_ui + .mbar add cascade -label Push -menu .mbar.push -font font_ui } . configure -menu .mbar @@ -5370,7 +5396,7 @@ if {[is_MacOSX]} { # -- Help Menu # -.mbar add cascade -label Help -menu .mbar.help +.mbar add cascade -label Help -menu .mbar.help -font font_ui menu .mbar.help if {![is_MacOSX]} { From df0cd69558b826a0f43420ecc808557656961f62 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Tue, 27 Mar 2007 14:31:02 +0400 Subject: [PATCH 3/9] Improve look-and-feel of the git-gui tool. Made the default buttons on the dialog active and focused upon the dialog appearence. Bound 'Escape' and 'Return' keys to the dialog dismissal where it was appropriate: mainly for dialogs with only one button and no editable fields, but on console output dialogs as well. Signed-off-by: Eygene Ryabinkin Signed-off-by: Shawn O. Pearce --- git-gui.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 8157184381..6e55bd45fd 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2705,10 +2705,12 @@ proc do_push_anywhere {} { frame $w.buttons button $w.buttons.create -text Push \ -font font_ui \ + -default active \ -command [list start_push_anywhere_action $w] pack $w.buttons.create -side right button $w.buttons.cancel -text {Cancel} \ -font font_ui \ + -default normal \ -command [list destroy $w] pack $w.buttons.cancel -side right -padx 5 pack $w.buttons -side bottom -fill x -pady 10 -padx 10 @@ -2799,7 +2801,7 @@ proc do_push_anywhere {} { set push_thin 0 set push_tags 0 - bind $w "grab $w" + bind $w "grab $w; focus $w.buttons.create" bind $w "destroy $w" wm title $w "[appname] ([reponame]): Push" tkwait window $w @@ -4131,6 +4133,7 @@ proc console_done {args} { if {[winfo exists $w]} { $w.m.s conf -background green -text {Success} $w.ok conf -state normal + focus $w.ok } } else { if {![winfo exists $w]} { @@ -4138,6 +4141,7 @@ proc console_done {args} { } $w.m.s conf -background red -text {Error: Command Failed} $w.ok conf -state normal + focus $w.ok } array unset console_cr $w @@ -4205,9 +4209,11 @@ proc do_stats {} { frame $w.buttons -border 1 button $w.buttons.close -text Close \ -font font_ui \ + -default active \ -command [list destroy $w] button $w.buttons.gc -text {Compress Database} \ -font font_ui \ + -default normal \ -command "destroy $w;do_gc" pack $w.buttons.close -side right pack $w.buttons.gc -side left @@ -4236,7 +4242,7 @@ proc do_stats {} { } pack $w.stat -pady 10 -padx 10 - bind $w "grab $w; focus $w" + bind $w "grab $w; focus $w.buttons.close" bind $w [list destroy $w] bind $w [list destroy $w] wm title $w "[appname] ([reponame]): Database Statistics" @@ -4533,6 +4539,7 @@ proc do_about {} { frame $w.buttons button $w.buttons.close -text {Close} \ -font font_ui \ + -default active \ -command [list destroy $w] pack $w.buttons.close -side right pack $w.buttons -side bottom -fill x -pady 10 -padx 10 @@ -4578,8 +4585,9 @@ $copyright" \ clipboard append -format STRING -type STRING -- \[$w.vers cget -text\] " - bind $w "grab $w; focus $w" + bind $w "grab $w; focus $w.buttons.close" bind $w "destroy $w" + bind $w "destroy $w" bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w" wm title $w "About [appname]" tkwait window $w @@ -4616,14 +4624,17 @@ proc do_options {} { frame $w.buttons button $w.buttons.restore -text {Restore Defaults} \ -font font_ui \ + -default normal \ -command do_restore_defaults pack $w.buttons.restore -side left button $w.buttons.save -text Save \ -font font_ui \ + -default active \ -command [list do_save_config $w] pack $w.buttons.save -side right button $w.buttons.cancel -text {Cancel} \ -font font_ui \ + -default normal \ -command [list destroy $w] pack $w.buttons.cancel -side right -padx 5 pack $w.buttons -side bottom -fill x -pady 10 -padx 10 @@ -4726,7 +4737,7 @@ proc do_options {} { pack $w.global.$name -side top -anchor w -fill x } - bind $w "grab $w; focus $w" + bind $w "grab $w; focus $w.buttons.save" bind $w "destroy $w" wm title $w "[appname] ([reponame]): Options" tkwait window $w From 53a291a435a173a18969011753104f8ab41234c8 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Tue, 27 Mar 2007 14:31:55 +0400 Subject: [PATCH 4/9] Do not break git-gui messages into multiple lines. Many git-gui messages were broken into a multiple lines to make good paragraph width. Unfortunately in reality it breaks the paragraph width completely, because the dialog window width does not coincide with the paragraph width created by the current font. Tcl/Tk's standard dialog boxes are breaking the long lines automatically, so it is better to make long lines and let the interpreter do the job. Signed-off-by: Eygene Ryabinkin Signed-off-by: Shawn O. Pearce --- git-gui.sh | 64 +++++++++++++++--------------------------------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 6e55bd45fd..6439bee6ac 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -735,12 +735,9 @@ proc handle_empty_diff {} { [short_path $path] has no changes. -The modification date of this file was updated -by another application, but the content within -the file was not changed. +The modification date of this file was updated by another application, but the content within the file was not changed. -A rescan will be automatically started to find -other files which may have the same state." +A rescan will be automatically started to find other files which may have the same state." clear_diff display_file $path __ @@ -1041,8 +1038,7 @@ proc load_last_commit {} { if {[llength $PARENT] == 0} { error_popup {There is nothing to amend. -You are about to create the initial commit. -There is no commit before this to amend. +You are about to create the initial commit. There is no commit before this to amend. } return } @@ -1051,10 +1047,7 @@ There is no commit before this to amend. if {$curType eq {merge}} { error_popup {Cannot amend while merging. -You are currently in the middle of a merge that -has not been fully completed. You cannot amend -the prior commit unless you first abort the -current merge activity. +You are currently in the middle of a merge that has not been fully completed. You cannot amend the prior commit unless you first abort the current merge activity. } return } @@ -1144,9 +1137,7 @@ proc commit_tree {} { } elseif {$commit_type ne $curType || $HEAD ne $curHEAD} { info_popup {Last scanned state does not match repository state. -Another Git program has modified this repository -since the last scan. A rescan must be performed -before another commit can be created. +Another Git program has modified this repository since the last scan. A rescan must be performed before another commit can be created. The rescan will be automatically started now. } @@ -1167,8 +1158,7 @@ The rescan will be automatically started now. U? { error_popup "Unmerged files cannot be committed. -File [short_path $path] has merge conflicts. -You must resolve them and add the file before committing. +File [short_path $path] has merge conflicts. You must resolve them and add the file before committing. " unlock_index return @@ -1284,8 +1274,7 @@ proc commit_committree {fd_wt curHEAD msg} { if {$tree_id eq $old_tree} { info_popup {No changes to commit. -No files were modified by this commit and it -was not a merge commit. +No files were modified by this commit and it was not a merge commit. A rescan will be automatically started now. } @@ -2403,9 +2392,7 @@ proc switch_branch {new_branch} { } elseif {$commit_type ne $curType || $HEAD ne $curHEAD} { info_popup {Last scanned state does not match repository state. -Another Git program has modified this repository -since the last scan. A rescan must be performed -before the current branch can be changed. +Another Git program has modified this repository since the last scan. A rescan must be performed before the current branch can be changed. The rescan will be automatically started now. } @@ -2496,12 +2483,9 @@ Staying on branch '$current_branch'." if {[catch {git symbolic-ref HEAD "refs/heads/$new_branch"} err]} { error_popup "Failed to set current branch. -This working directory is only partially switched. -We successfully updated your files, but failed to -update an internal Git file. +This working directory is only partially switched. We successfully updated your files, but failed to update an internal Git file. -This should not have occurred. [appname] will now -close and give up. +This should not have occurred. [appname] will now close and give up. $err" do_quit @@ -2817,8 +2801,7 @@ proc can_merge {} { if {[string match amend* $commit_type]} { info_popup {Cannot merge while amending. -You must finish amending this commit before -starting any type of merge. +You must finish amending this commit before starting any type of merge. } return 0 } @@ -2832,9 +2815,7 @@ starting any type of merge. if {$commit_type ne $curType || $HEAD ne $curHEAD} { info_popup {Last scanned state does not match repository state. -Another Git program has modified this repository -since the last scan. A rescan must be performed -before a merge can be performed. +Another Git program has modified this repository since the last scan. A rescan must be performed before a merge can be performed. The rescan will be automatically started now. } @@ -2853,9 +2834,7 @@ The rescan will be automatically started now. File [short_path $path] has merge conflicts. -You must resolve them, add the file, and commit to -complete the current merge. Only then can you -begin another merge. +You must resolve them, add the file, and commit to complete the current merge. Only then can you begin another merge. " unlock_index return 0 @@ -2865,9 +2844,7 @@ begin another merge. File [short_path $path] is modified. -You should complete the current commit before -starting a merge. Doing so will help you abort -a failed merge, should the need arise. +You should complete the current commit before starting a merge. Doing so will help you abort a failed merge, should the need arise. " unlock_index return 0 @@ -2943,13 +2920,11 @@ proc finish_merge {revcnt w ok} { Your merge of $revcnt branches has failed. -There are file-level conflicts between the -branches which must be resolved manually. +There are file-level conflicts between the branches which must be resolved manually. The working directory will now be reset. -You can attempt this merge again -by merging only one branch at a time." $w +You can attempt this merge again by merging only one branch at a time." $w set fd [open "| git read-tree --reset -u HEAD" r] fconfigure $fd -blocking 0 -translation binary @@ -3062,8 +3037,7 @@ You must finish amending this commit. if {[ask_popup "Abort $op? -Aborting the current $op will cause -*ALL* uncommitted changes to be lost. +Aborting the current $op will cause *ALL* uncommitted changes to be lost. Continue with aborting the current $op?"] eq {yes}} { set fd [open "| git read-tree --reset -u HEAD" r] @@ -6069,9 +6043,7 @@ if {[is_enabled multicommit]} { if {[ask_popup \ "This repository currently has $objects_current loose objects. -To maintain optimal performance it is strongly -recommended that you compress the database -when more than $object_limit loose objects exist. +To maintain optimal performance it is strongly recommended that you compress the database when more than $object_limit loose objects exist. Compress the database now?"] eq yes} { do_gc From 4372da3441561b3852c0bf466304f1e4f3c06b3f Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 4 Apr 2007 11:45:33 -0400 Subject: [PATCH 5/9] Always bind the return key to the default button If a dialog/window has a default button registered not every platform associates the return key with that button, but all users do. We have to register the binding of the return key ourselves to make sure the user's expectations of pressing return will activate the default button are met. Signed-off-by: Shawn O. Pearce --- git-gui.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-gui.sh b/git-gui.sh index 6439bee6ac..882b90723d 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2787,6 +2787,7 @@ proc do_push_anywhere {} { bind $w "grab $w; focus $w.buttons.create" bind $w "destroy $w" + bind $w [list start_push_anywhere_action $w] wm title $w "[appname] ([reponame]): Push" tkwait window $w } @@ -4713,6 +4714,7 @@ proc do_options {} { bind $w "grab $w; focus $w.buttons.save" bind $w "destroy $w" + bind $w [list do_save_config $w] wm title $w "[appname] ([reponame]): Options" tkwait window $w } From f6f2aa39ef97cae03c71ecfecc334f0df60d7920 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 4 Apr 2007 12:08:46 -0400 Subject: [PATCH 6/9] git-gui: Brown paper bag fix division by 0 in blame If we generate a blame status string before we have obtained any annotation data at all from the input file, or if the input file is empty, our total_lines will be 0. This causes a division by 0 error when we blindly divide by the 0 to compute the total percentage of lines loaded. Instead we should report 0% done. Signed-off-by: Shawn O. Pearce --- git-gui.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 60e79ca1b0..7cbc977ea2 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3604,12 +3604,14 @@ proc read_blame_incremental {fd w w_load w_cmit w_line w_file} { proc blame_incremental_status {w} { global blame_status blame_data + set have $blame_data($w,blame_lines) + set total $blame_data($w,total_lines) + set pdone 0 + if {$total} {set pdone [expr {100 * $have / $total}]} + set blame_status($w) [format \ "Loading annotations... %i of %i lines annotated (%2i%%)" \ - $blame_data($w,blame_lines) \ - $blame_data($w,total_lines) \ - [expr {100 * $blame_data($w,blame_lines) - / $blame_data($w,total_lines)}]] + $have $total $pdone] } proc blame_click {w w_cmit w_line w_file cur_w pos} { From 19c821487b28f56180290aa7d1f30e6bd5316225 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 14 Apr 2007 15:10:48 -0400 Subject: [PATCH 7/9] git-gui: Display the directory basename in the title By showing the basename of the directory very early in the title bar I can more easily locate a particular git-gui session when I have 8 open at once and my Windows taskbar is overflowing with items. Signed-off-by: Shawn O. Pearce --- git-gui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-gui.sh b/git-gui.sh index ef5960cdaf..94067cc5f7 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -5968,7 +5968,7 @@ unset i set file_lists($ui_index) [list] set file_lists($ui_workdir) [list] -wm title . "[appname] ([file normalize [file dirname [gitdir]]])" +wm title . "[appname] ([reponame]) [file normalize [file dirname [gitdir]]]" focus -force $ui_comm # -- Warn the user about environmental problems. Cygwin's Tcl From 69dd97a430d3deebbcade1d38c53110342440890 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 17 Apr 2007 13:15:56 -0400 Subject: [PATCH 8/9] Revert "Allow wish interpreter to be defined with TCLTK_PATH" This reverts commit e2a1bc67d321a0c03737179f331c39a52e7049d7. Junio rightly pointed out this patch doesn't handle the `make install` target very well: Junio C Hamano writes: > You should never generate new files in the source tree from > 'install' target. Otherwise, the usual pattern of "make" as > yourself and then "make install" as root would not work from a > "root-to-nobody-squashing" NFS mounted source tree to local > filesystem. You should know better than accepting such a patch. --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index 2316b24e00..b82789ead6 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,6 @@ ifndef V QUIET_BUILT_IN = @echo ' ' BUILTIN $@; endif -TCLTK_PATH ?= wish - ifeq ($(findstring $(MAKEFLAGS),s),s) QUIET_GEN = QUIET_BUILT_IN = @@ -57,7 +55,6 @@ all:: $(ALL_PROGRAMS) install: all $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' - sed -i .bak -e'1,3s|^exec .* "$$0"|exec '"$(TCLTK_PATH)"' "$$0"|' git-gui && rm git-gui.bak $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)' $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) From 845d377b2880a0c5d74f785244469ab1ac815bde Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 17 Apr 2007 03:31:47 -0700 Subject: [PATCH 9/9] git-gui: Honor TCLTK_PATH if supplied Mimick what we do for gitk. Since you do have a source file, git-gui.sh, which is separate from the target, it should be much easier in git-gui's Makefile. Signed-off-by: Junio C Hamano Signed-off-by: Shawn O. Pearce --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index b82789ead6..b29d7d1e68 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,8 @@ ifndef V QUIET_BUILT_IN = @echo ' ' BUILTIN $@; endif +TCLTK_PATH ?= wish + ifeq ($(findstring $(MAKEFLAGS),s),s) QUIET_GEN = QUIET_BUILT_IN = @@ -36,10 +38,12 @@ endif DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) +TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh $(QUIET_GEN)rm -f $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ + -e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \ -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ $@.sh >$@+ && \ chmod +x $@+ && \