+
+
+## Submits the user data collected using the git config command
+
+proc submituserdata {} {
+ exec git config --global user.name "$::username"
+ exec git config --global user.email "$::useremail"
+ destroy .b
+ return 0
+}
+
+## Request name and email from user
+
+proc requestuserdata {} {
+ toplevel .b
+ grab .b
+ wm geometry .b -300-300
+ wm title .b "Contributor details"
+ grid [frame .b.c ] -column 0 -row 0 -sticky nwes
+ grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1
+
+ grid [entry .b.c.username -width 20 -textvariable username] -column 2 -row 2 -sticky we
+ grid [entry .b.c.useremail -width 20 -textvariable useremail] -column 2 -row 3 -sticky we
+ grid [button .b.c.submituserdata -text "Submit" -command submituserdata] -column 2 -row 4
+
+ grid [label .b.c.explbl -text "Please enter your name and email for future commits:"] -column 1 -row 1 -columnspan 3 -sticky we
+ grid [label .b.c.nmlbl -text "Name:"] -column 1 -row 2 -sticky w
+ grid [label .b.c.emlbl -text "Email:"] -column 1 -row 3 -sticky w
+
+ foreach w [winfo children .b.c] {grid configure $w -padx 5 -pady 5}
+ focus .b.c.username
+ bind .b <Return> {submituserdata}
+}
+
+## Checks the user's global .gitconfig for name and email and executes requestuserdata if either is not found
+
+if {![file exists "$env(HOME)/.gitconfig"]} {
+ set fileholder [open "$env(HOME)/.gitconfig" a+]
+} else {
+ set fileholder [open "$env(HOME)/.gitconfig" r]
+}
+
+set usercheck [split [read $fileholder] "\n"]
+close $fileholder
+if {![regexp "name" $usercheck] || ![regexp "email" $usercheck]} then {
+ requestuserdata
+ tkwait window .b
+}
+
+## Entry limit routine from jeff at hobbs org, downloaded from
+## http://www.purl.org/net/hobbs/tcl/tclet/entrylimit.html
+
+## For those who aren't using Tk4 with these, make a bell noop:
+if [string match {} [info commands bell]] { proc bell args {} }
+
+proc forceLen {len name el op} {
+ global $name ${name}_len
+ if [string comp $el {}] {
+ set old ${name}_len\($el)
+ set name $name\($el)
+ } else {
+ set old ${name}_len
+ }
+ if {[string length [set $name]] > $len} {
+ set $name [set $old]
+ bell;
+ return
+ }
+ set $old [set $name]
+}
+
+## Here is a wish example to use the routines. Remember that with
+## write traces, a valid value must be set for each variable both
+## before AND after the trace is established.
+
+## The order must be:
+## 1) variable init
+## 1) textvariable specification
+## 3) set trace
+## 4) variable reinit
+
+set commit_header {}
+trace variable commit_header w {forceLen 50}
+set commit_header {}
+
+
+## End of entry limit code
+