summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLibravatar Pratyush Yadav <me@yadavpratyush.com>2019-09-24 19:50:33 +0530
committerLibravatar Pratyush Yadav <me@yadavpratyush.com>2019-09-24 20:00:36 +0530
commit60c60b627e81bf84e1cb01729d2ae882178f079d (patch)
tree3c5ac2f526f0b10cd0ccf4d11e644390849520b8 /lib
parentMerge branch 'bp/amend-toggle-bind' (diff)
parenttreewide: correct several "up-to-date" to "up to date" (diff)
downloadtgif-60c60b627e81bf84e1cb01729d2ae882178f079d.tar.xz
Merge branch 'py/git-git-extra-stuff'
Some changes were added directly to git.git's git-gui subtree, instead of being added to the separate git-gui repo and then being pulled back into git.git. This means those changes are now not in the git-gui tree. So pull them back into git-gui so we match with what git.git has (after they pull in the recently added commits). Most of the changes could be added back in via an octopus merge of all the missing branches. But there were two commits (faf420e05a and b71c6c3b64) which touched other parts of git.git along with git-gui, so they had to be added back in via a cherry-pick because directly pulling them in would also pull in all the ancestors of those commits, needlessly bloating git-gui with git.git's history. Thanks to Denton Liu <liu.denton@gmail.com> for providing me with a script to generate and merge all the branches that were missing, which made this task much easier. * py/git-git-extra-stuff: treewide: correct several "up-to-date" to "up to date" Fix build with core.autocrlf=true git-gui: call do_quit before destroying the main window git-gui: workaround ttk:style theme use git-gui: bind CTRL/CMD+numpad ENTER to do_commit git-gui: search for all current SSH key types git-gui: allow Ctrl+T to toggle multiple paths git-gui: fix exception when trying to stage with empty file list git-gui: avoid exception upon Ctrl+T in an empty list git gui: fix staging a second line to a 1-line file git-gui: prevent double UTF-8 conversion git-gui: sort entries in optimized tclIndex Replace Free Software Foundation address in license notices git-gui (MinGW): make use of MSys2's msgfmt
Diffstat (limited to 'lib')
-rw-r--r--lib/commit.tcl12
-rw-r--r--lib/diff.tcl1
-rw-r--r--lib/sshkey.tcl5
-rw-r--r--lib/themed.tcl15
4 files changed, 24 insertions, 9 deletions
diff --git a/lib/commit.tcl b/lib/commit.tcl
index 384f18f226..b516aa2990 100644
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
@@ -25,6 +25,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
set msg {}
set parents [list]
if {[catch {
+ set name ""
+ set email ""
set fd [git_read cat-file commit $curHEAD]
fconfigure $fd -encoding binary -translation lf
# By default commits are assumed to be in utf-8
@@ -34,9 +36,7 @@ You are currently in the middle of a merge that has not been fully completed. Y
lappend parents [string range $line 7 end]
} elseif {[string match {encoding *} $line]} {
set enc [string tolower [string range $line 9 end]]
- } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} {
- set commit_author [list name $name email $email date $time]
- }
+ } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { }
}
set msg [read $fd]
close $fd
@@ -44,7 +44,13 @@ You are currently in the middle of a merge that has not been fully completed. Y
set enc [tcl_encoding $enc]
if {$enc ne {}} {
set msg [encoding convertfrom $enc $msg]
+ set name [encoding convertfrom $enc $name]
+ set email [encoding convertfrom $enc $email]
}
+ if {$name ne {} && $email ne {}} {
+ set commit_author [list name $name email $email date $time]
+ }
+
set msg [string trim $msg]
} err]} {
error_popup [strcat [mc "Error loading commit data for amend:"] "\n\n$err"]
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 96288fcc33..958a0fa219 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -724,6 +724,7 @@ proc apply_or_revert_range_or_line {x y revert} {
set hh [$ui_diff get $i_l "$i_l + 1 lines"]
set hh [lindex [split $hh ,] 0]
set hln [lindex [split $hh -] 1]
+ set hln [lindex [split $hln " "] 0]
# There is a special situation to take care of. Consider this
# hunk:
diff --git a/lib/sshkey.tcl b/lib/sshkey.tcl
index aa6457bbb5..589ff8f78a 100644
--- a/lib/sshkey.tcl
+++ b/lib/sshkey.tcl
@@ -2,7 +2,10 @@
# Copyright (C) 2006, 2007 Shawn Pearce
proc find_ssh_key {} {
- foreach name {~/.ssh/id_dsa.pub ~/.ssh/id_rsa.pub ~/.ssh/identity.pub} {
+ foreach name {
+ ~/.ssh/id_dsa.pub ~/.ssh/id_ecdsa.pub ~/.ssh/id_ed25519.pub
+ ~/.ssh/id_rsa.pub ~/.ssh/identity.pub
+ } {
if {[file exists $name]} {
set fh [open $name r]
set cont [read $fh]
diff --git a/lib/themed.tcl b/lib/themed.tcl
index 351a712c8c..88b3119a75 100644
--- a/lib/themed.tcl
+++ b/lib/themed.tcl
@@ -1,6 +1,14 @@
# Functions for supporting the use of themed Tk widgets in git-gui.
# Copyright (C) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
+proc ttk_get_current_theme {} {
+ # Handle either current Tk or older versions of 8.5
+ if {[catch {set theme [ttk::style theme use]}]} {
+ set theme $::ttk::currentTheme
+ }
+ return $theme
+}
+
proc InitTheme {} {
# Create a color label style (bg can be overridden by widget option)
ttk::style layout Color.TLabel {
@@ -28,10 +36,7 @@ proc InitTheme {} {
}
}
- # Handle either current Tk or older versions of 8.5
- if {[catch {set theme [ttk::style theme use]}]} {
- set theme $::ttk::currentTheme
- }
+ set theme [ttk_get_current_theme]
if {[lsearch -exact {default alt classic clam} $theme] != -1} {
# Simple override of standard ttk::entry to change the field
@@ -248,7 +253,7 @@ proc tspinbox {w args} {
proc ttext {w args} {
global use_ttk
if {$use_ttk} {
- switch -- [ttk::style theme use] {
+ switch -- [ttk_get_current_theme] {
"vista" - "xpnative" {
lappend args -highlightthickness 0 -borderwidth 0
}