Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Wed, 20 Feb 2008 05:40:13 +0000 (00:40 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 20 Feb 2008 05:40:13 +0000 (00:40 -0500)
* maint:
git-gui: relax "dirty" version detection

1  2 
git-gui.sh
diff --combined git-gui.sh
index 5d65272e26dd08fc3abb8bf8cdbf57065da53bcc,04bd42576eae325b848b1438f1a4ff2820645df3..238a2393ff7811675003e0e846f3d9409fb04e0c
@@@ -612,7 -612,6 +612,7 @@@ set default_config(gui.pruneduringfetch
  set default_config(gui.trustmtime) false
  set default_config(gui.diffcontext) 5
  set default_config(gui.newbranchtemplate) {}
 +set default_config(gui.spellingdictionary) {}
  set default_config(gui.fontui) [font configure font_ui]
  set default_config(gui.fontdiff) [font configure font_diff]
  set font_descs {
@@@ -663,7 -662,7 +663,7 @@@ if {![regsub {^git version } $_git_vers
  }
  
  set _real_git_version $_git_version
- regsub -- {-dirty$} $_git_version {} _git_version
+ regsub -- {[\-\.]dirty$} $_git_version {} _git_version
  regsub {\.[0-9]+\.g[0-9a-f]+$} $_git_version {} _git_version
  regsub {\.rc[0-9]+$} $_git_version {} _git_version
  regsub {\.GIT$} $_git_version {} _git_version
@@@ -1684,7 -1683,6 +1684,7 @@@ set is_quitting 
  proc do_quit {} {
        global ui_comm is_quitting repo_config commit_type
        global GITGUI_BCK_exists GITGUI_BCK_i
 +      global ui_comm_spell
  
        if {$is_quitting} return
        set is_quitting 1
                        }
                }
  
 +              # -- Cancel our spellchecker if its running.
 +              #
 +              if {[info exists ui_comm_spell]} {
 +                      $ui_comm_spell stop
 +              }
 +
                # -- Remove our editor backup, its not needed.
                #
                after cancel $GITGUI_BCK_i
@@@ -2462,7 -2454,7 +2462,7 @@@ $ctxm add separato
  $ctxm add command \
        -label [mc "Sign Off"] \
        -command do_signoff
 -bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
 +set ui_comm_ctxm $ctxm
  
  # -- Diff Header
  #
@@@ -2865,30 -2857,6 +2865,30 @@@ if {[winfo exists $ui_comm]} 
        }
  
        backup_commit_buffer
 +
 +      # -- If the user has aspell available we can drive it
 +      #    in pipe mode to spellcheck the commit message.
 +      #
 +      set spell_cmd [list |]
 +      set spell_dict [get_config gui.spellingdictionary]
 +      lappend spell_cmd aspell
 +      if {$spell_dict ne {}} {
 +              lappend spell_cmd --master=$spell_dict
 +      }
 +      lappend spell_cmd --mode=none
 +      lappend spell_cmd --encoding=utf-8
 +      lappend spell_cmd pipe
 +      if {$spell_dict eq {none}
 +       || [catch {set spell_fd [open $spell_cmd r+]} spell_err]} {
 +              bind_button3 $ui_comm [list tk_popup $ui_comm_ctxm %X %Y]
 +      } else {
 +              set ui_comm_spell [spellcheck::init \
 +                      $spell_fd \
 +                      $ui_comm \
 +                      $ui_comm_ctxm \
 +              ]
 +      }
 +      unset -nocomplain spell_cmd spell_fd spell_err spell_dict
  }
  
  lock_index begin-read