Skip to content

Commit

Permalink
Merge git://repo.or.cz/git-gui
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
gitster committed Dec 18, 2008
2 parents 1df2713 + e612120 commit b4955fb
Show file tree
Hide file tree
Showing 11 changed files with 3,157 additions and 423 deletions.
2 changes: 1 addition & 1 deletion git-gui/GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=0.11.GITGUI
DEF_VER=0.12.GITGUI

LF='
'
Expand Down
19 changes: 16 additions & 3 deletions git-gui/git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,20 @@ proc usage {} {
exit 1
}
proc normalize_relpath {path} {
set elements {}
foreach item [file split $path] {
if {$item eq {.}} continue
if {$item eq {..} && [llength $elements] > 0
&& [lindex $elements end] ne {..}} {
set elements [lrange $elements 0 end-1]
continue
}
lappend elements $item
}
return [eval file join $elements]
}
# -- Not a normal commit type invocation? Do that instead!
#
switch -- $subcommand {
Expand All @@ -2648,7 +2662,7 @@ blame {
foreach a $argv {
if {$is_path || [file exists $_prefix$a]} {
if {$path ne {}} usage
set path $_prefix$a
set path [normalize_relpath $_prefix$a]
break
} elseif {$a eq {--}} {
if {$path ne {}} {
Expand All @@ -2671,7 +2685,7 @@ blame {
unset is_path
if {$head ne {} && $path eq {}} {
set path $_prefix$head
set path [normalize_relpath $_prefix$head]
set head {}
}
Expand Down Expand Up @@ -3315,7 +3329,6 @@ by %s:
{^GIT_PAGER$} -
{^GIT_TRACE$} -
{^GIT_CONFIG$} -
{^GIT_CONFIG_LOCAL$} -
{^GIT_(AUTHOR|COMMITTER)_DATE$} {
append msg " - $name\n"
incr ignored_env
Expand Down
5 changes: 2 additions & 3 deletions git-gui/lib/blame.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,8 @@ method _showcommit {cur_w lno} {
catch {
set fd [git_read cat-file commit $cmit]
fconfigure $fd -encoding binary -translation lf
if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
set enc utf-8
}
# By default commits are assumed to be in utf-8
set enc utf-8
while {[gets $fd line] > 0} {
if {[string match {encoding *} $line]} {
set enc [string tolower [string range $line 9 end]]
Expand Down
7 changes: 3 additions & 4 deletions git-gui/lib/commit.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
if {[catch {
set fd [git_read cat-file commit $curHEAD]
fconfigure $fd -encoding binary -translation lf
if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
set enc utf-8
}
# By default commits are assumed to be in utf-8
set enc utf-8
while {[gets $fd line] > 0} {
if {[string match {parent *} $line]} {
lappend parents [string range $line 7 end]
Expand Down Expand Up @@ -208,7 +207,7 @@ A good commit message has the following format:
if {$use_enc ne {}} {
fconfigure $msg_wt -encoding $use_enc
} else {
puts stderr [mc "warning: Tcl does not support encoding '%s'." $enc]
error_popup [mc "warning: Tcl does not support encoding '%s'." $enc]
fconfigure $msg_wt -encoding utf-8
}
puts $msg_wt $msg
Expand Down
Loading

0 comments on commit b4955fb

Please sign in to comment.