-
Notifications
You must be signed in to change notification settings - Fork 140
git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: git-gui/master
Are you sure you want to change the base?
Changes from all commits
5897206
cb9f8c8
8cfc935
6025b38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Pratyush Yadav wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Pratyush Yadav wrote (reply to this):
|
||
# Tcl ignores the next line -*- tcl -*- \ | ||
exec wish "$0" -- "$@" | ||
|
||
# This is an implementation of a simple yes no dialog | ||
# which is injected into the git commandline by git gui | ||
# in case a yesno question needs to be answered. | ||
|
||
set NS {} | ||
set use_ttk [package vsatisfies [package provide Tk] 8.5] | ||
if {$use_ttk} { | ||
set NS ttk | ||
} | ||
|
||
set title "Question?" | ||
if {$argc < 1} { | ||
puts stderr "Usage: $argv0 <question>" | ||
exit 1 | ||
} else { | ||
if {$argc > 2 && [lindex $argv 0] == "--title"} { | ||
set title [lindex $argv 1] | ||
set argv [lreplace $argv 0 1] | ||
} | ||
set prompt [join $argv " "] | ||
} | ||
|
||
${NS}::frame .t | ||
${NS}::label .t.m -text $prompt -justify center -width 400px | ||
.t.m configure -wraplength 400px | ||
pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1 | ||
pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1 | ||
|
||
${NS}::frame .b | ||
${NS}::frame .b.left -width 200 | ||
${NS}::button .b.yes -text Yes -command yes | ||
${NS}::button .b.no -text No -command no | ||
|
||
|
||
pack .b.left -side left -expand 1 -fill x | ||
pack .b.yes -side left -expand 1 | ||
pack .b.no -side right -expand 1 -ipadx 5 | ||
pack .b -side bottom -fill x -ipadx 20 -ipady 15 | ||
|
||
bind . <Key-Return> {exit 0} | ||
bind . <Key-Escape> {exit 1} | ||
|
||
proc no {} { | ||
exit 1 | ||
} | ||
|
||
proc yes {} { | ||
exit 0 | ||
} | ||
|
||
if {$::tcl_platform(platform) eq {windows}} { | ||
set icopath [file dirname [file normalize $argv0]] | ||
if {[file tail $icopath] eq {git-core}} { | ||
set icopath [file dirname $icopath] | ||
} | ||
set icopath [file dirname $icopath] | ||
set icopath [file join $icopath share git git-for-windows.ico] | ||
if {[file exists $icopath]} { | ||
wm iconbitmap . -default $icopath | ||
} | ||
} | ||
|
||
wm title . $title | ||
tk::PlaceWindow . |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1248,6 +1248,12 @@ set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}] | |
if {![info exists env(SSH_ASKPASS)]} { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Pratyush Yadav wrote (reply to this):
|
||
set env(SSH_ASKPASS) [gitexec git-gui--askpass] | ||
} | ||
if {![info exists env(GIT_ASKPASS)]} { | ||
set env(GIT_ASKPASS) [gitexec git-gui--askpass] | ||
} | ||
if {![info exists env(GIT_ASK_YESNO)]} { | ||
set env(GIT_ASK_YESNO) [gitexec git-gui--askyesno] | ||
} | ||
|
||
###################################################################### | ||
## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Pratyush Yadav wrote (reply to this):