Skip to content

Commit b4955fb

Browse files
committed
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui 0.12 git-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL git-gui: Update Hungarian translation for 0.12 git-gui: Fixed typos in Swedish translation. git-gui: Updated Swedish translation (515t0f0u). git gui: update Italian translation git-gui: Update Japanese translation for 0.12 git-gui: Starting translation for Norwegian git-gui: Update German (completed) translation. git-gui: Update po template to include 'Mirroring %s' message git-gui: Fix commit encoding handling. git-gui: Fix handling of relative paths in blame.
2 parents 1df2713 + e612120 commit b4955fb

File tree

11 files changed

+3157
-423
lines changed

11 files changed

+3157
-423
lines changed

git-gui/GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
GVF=GIT-VERSION-FILE
4-
DEF_VER=0.11.GITGUI
4+
DEF_VER=0.12.GITGUI
55

66
LF='
77
'

git-gui/git-gui.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,20 @@ proc usage {} {
26302630
exit 1
26312631
}
26322632
2633+
proc normalize_relpath {path} {
2634+
set elements {}
2635+
foreach item [file split $path] {
2636+
if {$item eq {.}} continue
2637+
if {$item eq {..} && [llength $elements] > 0
2638+
&& [lindex $elements end] ne {..}} {
2639+
set elements [lrange $elements 0 end-1]
2640+
continue
2641+
}
2642+
lappend elements $item
2643+
}
2644+
return [eval file join $elements]
2645+
}
2646+
26332647
# -- Not a normal commit type invocation? Do that instead!
26342648
#
26352649
switch -- $subcommand {
@@ -2648,7 +2662,7 @@ blame {
26482662
foreach a $argv {
26492663
if {$is_path || [file exists $_prefix$a]} {
26502664
if {$path ne {}} usage
2651-
set path $_prefix$a
2665+
set path [normalize_relpath $_prefix$a]
26522666
break
26532667
} elseif {$a eq {--}} {
26542668
if {$path ne {}} {
@@ -2671,7 +2685,7 @@ blame {
26712685
unset is_path
26722686
26732687
if {$head ne {} && $path eq {}} {
2674-
set path $_prefix$head
2688+
set path [normalize_relpath $_prefix$head]
26752689
set head {}
26762690
}
26772691
@@ -3315,7 +3329,6 @@ by %s:
33153329
{^GIT_PAGER$} -
33163330
{^GIT_TRACE$} -
33173331
{^GIT_CONFIG$} -
3318-
{^GIT_CONFIG_LOCAL$} -
33193332
{^GIT_(AUTHOR|COMMITTER)_DATE$} {
33203333
append msg " - $name\n"
33213334
incr ignored_env

git-gui/lib/blame.tcl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,8 @@ method _showcommit {cur_w lno} {
940940
catch {
941941
set fd [git_read cat-file commit $cmit]
942942
fconfigure $fd -encoding binary -translation lf
943-
if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
944-
set enc utf-8
945-
}
943+
# By default commits are assumed to be in utf-8
944+
set enc utf-8
946945
while {[gets $fd line] > 0} {
947946
if {[string match {encoding *} $line]} {
948947
set enc [string tolower [string range $line 9 end]]

git-gui/lib/commit.tcl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
2727
if {[catch {
2828
set fd [git_read cat-file commit $curHEAD]
2929
fconfigure $fd -encoding binary -translation lf
30-
if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
31-
set enc utf-8
32-
}
30+
# By default commits are assumed to be in utf-8
31+
set enc utf-8
3332
while {[gets $fd line] > 0} {
3433
if {[string match {parent *} $line]} {
3534
lappend parents [string range $line 7 end]
@@ -208,7 +207,7 @@ A good commit message has the following format:
208207
if {$use_enc ne {}} {
209208
fconfigure $msg_wt -encoding $use_enc
210209
} else {
211-
puts stderr [mc "warning: Tcl does not support encoding '%s'." $enc]
210+
error_popup [mc "warning: Tcl does not support encoding '%s'." $enc]
212211
fconfigure $msg_wt -encoding utf-8
213212
}
214213
puts $msg_wt $msg

0 commit comments

Comments
 (0)