Skip to content

Commit 8ead1bf

Browse files
committed
Merge tag 'gitgui-0.17.0' of git://repo.or.cz/git-gui
git-gui 0.17.0 * tag 'gitgui-0.17.0' of git://repo.or.cz/git-gui: git-gui 0.17 git-gui: Don't prepend the prefix if value looks like a full path git-gui: Detect full path when parsing arguments git-gui: remove .git/CHERRY_PICK_HEAD after committing git-gui: Fix a loose/lose mistake git-gui: Fix semi-working shortcuts for unstage and revert git-gui: de.po: translate "remote" as "extern" git-gui: de.po: translate "bare" as "bloß" git-gui: de.po: consistently add untranslated hook names within braces git-gui: preserve commit messages in utf-8 git-gui: open console when using --trace on windows git-gui: fix a typo in po/ files git-gui: Use PWD if it exists on Mac OS X git-gui: fix git-gui crash due to uninitialized variable
2 parents 87a5461 + f6dd784 commit 8ead1bf

File tree

15 files changed

+65
-37
lines changed

15 files changed

+65
-37
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.16.GITGUI
4+
DEF_VER=0.17.GITGUI
55

66
LF='
77
'

git-gui/git-gui.sh

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ set _trace [lsearch -exact $argv --trace]
154154
if {$_trace >= 0} {
155155
set argv [lreplace $argv $_trace $_trace]
156156
set _trace 1
157+
if {[tk windowingsystem] eq "win32"} { console show }
157158
} else {
158159
set _trace 0
159160
}
@@ -1463,7 +1464,7 @@ proc rescan {after {honor_trustmtime 1}} {
14631464
(![$ui_comm edit modified]
14641465
|| [string trim [$ui_comm get 0.0 end]] eq {})} {
14651466
if {[string match amend* $commit_type]} {
1466-
} elseif {[load_message GITGUI_MSG]} {
1467+
} elseif {[load_message GITGUI_MSG utf-8]} {
14671468
} elseif {[run_prepare_commit_msg_hook]} {
14681469
} elseif {[load_message MERGE_MSG]} {
14691470
} elseif {[load_message SQUASH_MSG]} {
@@ -1549,7 +1550,7 @@ proc rescan_stage2 {fd after} {
15491550
fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
15501551
}
15511552
1552-
proc load_message {file} {
1553+
proc load_message {file {encoding {}}} {
15531554
global ui_comm
15541555
15551556
set f [gitdir $file]
@@ -1558,6 +1559,9 @@ proc load_message {file} {
15581559
return 0
15591560
}
15601561
fconfigure $fd -eofchar {}
1562+
if {$encoding ne {}} {
1563+
fconfigure $fd -encoding $encoding
1564+
}
15611565
set content [string trim [read $fd]]
15621566
close $fd
15631567
regsub -all -line {[ \r\t]+$} $content {} content
@@ -2266,6 +2270,7 @@ proc do_quit {{rc {1}}} {
22662270
&& $msg ne {}} {
22672271
catch {
22682272
set fd [open $save w]
2273+
fconfigure $fd -encoding utf-8
22692274
puts -nonewline $fd $msg
22702275
close $fd
22712276
}
@@ -2998,10 +3003,19 @@ blame {
29983003
set jump_spec {}
29993004
set is_path 0
30003005
foreach a $argv {
3001-
if {$is_path || [file exists $_prefix$a]} {
3006+
if {[file exists $a]} {
3007+
if {$path ne {}} usage
3008+
set path [normalize_relpath $a]
3009+
break
3010+
} elseif {[file exists $_prefix$a]} {
30023011
if {$path ne {}} usage
30033012
set path [normalize_relpath $_prefix$a]
30043013
break
3014+
}
3015+
3016+
if {$is_path} {
3017+
if {$path ne {}} usage
3018+
break
30053019
} elseif {$a eq {--}} {
30063020
if {$path ne {}} {
30073021
if {$head ne {}} usage
@@ -3023,8 +3037,13 @@ blame {
30233037
unset is_path
30243038
30253039
if {$head ne {} && $path eq {}} {
3026-
set path [normalize_relpath $_prefix$head]
3027-
set head {}
3040+
if {[string index $head 0] eq {/}} {
3041+
set path [normalize_relpath $head]
3042+
set head {}
3043+
} else {
3044+
set path [normalize_relpath $_prefix$head]
3045+
set head {}
3046+
}
30283047
}
30293048
30303049
if {$head eq {}} {
@@ -3710,6 +3729,8 @@ bind $ui_diff <$M1B-Key-v> {break}
37103729
bind $ui_diff <$M1B-Key-V> {break}
37113730
bind $ui_diff <$M1B-Key-a> {%W tag add sel 0.0 end;break}
37123731
bind $ui_diff <$M1B-Key-A> {%W tag add sel 0.0 end;break}
3732+
bind $ui_diff <$M1B-Key-j> {do_revert_selection;break}
3733+
bind $ui_diff <$M1B-Key-J> {do_revert_selection;break}
37133734
bind $ui_diff <Key-Up> {catch {%W yview scroll -1 units};break}
37143735
bind $ui_diff <Key-Down> {catch {%W yview scroll 1 units};break}
37153736
bind $ui_diff <Key-Left> {catch {%W xview scroll -1 units};break}
@@ -3742,6 +3763,8 @@ bind . <$M1B-Key-s> do_signoff
37423763
bind . <$M1B-Key-S> do_signoff
37433764
bind . <$M1B-Key-t> do_add_selection
37443765
bind . <$M1B-Key-T> do_add_selection
3766+
bind . <$M1B-Key-u> do_unstage_selection
3767+
bind . <$M1B-Key-U> do_unstage_selection
37453768
bind . <$M1B-Key-j> do_revert_selection
37463769
bind . <$M1B-Key-J> do_revert_selection
37473770
bind . <$M1B-Key-i> do_add_all
@@ -3835,7 +3858,7 @@ if {[is_enabled transport]} {
38353858
}
38363859
38373860
if {[winfo exists $ui_comm]} {
3838-
set GITGUI_BCK_exists [load_message GITGUI_BCK]
3861+
set GITGUI_BCK_exists [load_message GITGUI_BCK utf-8]
38393862
38403863
# -- If both our backup and message files exist use the
38413864
# newer of the two files to initialize the buffer.
@@ -3872,6 +3895,7 @@ if {[winfo exists $ui_comm]} {
38723895
} elseif {$m} {
38733896
catch {
38743897
set fd [open [gitdir GITGUI_BCK] w]
3898+
fconfigure $fd -encoding utf-8
38753899
puts -nonewline $fd $msg
38763900
close $fd
38773901
set GITGUI_BCK_exists 1

git-gui/lib/commit.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ proc commit_commitmsg {curHEAD msg_p} {
268268
&& [is_config_true gui.warndetachedcommit]} {
269269
set msg [mc "You are about to commit on a detached head.\
270270
This is a potentially dangerous thing to do because if you switch\
271-
to another branch you will loose your changes and it can be difficult\
271+
to another branch you will lose your changes and it can be difficult\
272272
to retrieve them later from the reflog. You should probably cancel this\
273273
commit and create a new branch to continue.\n\
274274
\n\
@@ -409,6 +409,7 @@ A rescan will be automatically started now.
409409
catch {file delete [gitdir MERGE_MSG]}
410410
catch {file delete [gitdir SQUASH_MSG]}
411411
catch {file delete [gitdir GITGUI_MSG]}
412+
catch {file delete [gitdir CHERRY_PICK_HEAD]}
412413

413414
# -- Let rerere do its thing.
414415
#

git-gui/lib/status_bar.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ method start {msg uds} {
7777

7878
method update {have total} {
7979
set pdone 0
80+
set cdone 0
8081
if {$total > 0} {
8182
set pdone [expr {100 * $have / $total}]
8283
set cdone [expr {[winfo width $w_c] * $have / $total}]

git-gui/macosx/AppMain.tcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ if {[file tail [lindex $argv 0]] eq {gitk}} {
1212
} else {
1313
set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]]
1414
set AppMain_source [file join $gitguilib git-gui.tcl]
15-
if {[pwd] eq {/}} {
15+
if {[info exists env(PWD)]} {
16+
cd $env(PWD)
17+
} elseif {[pwd] eq {/}} {
1618
cd $env(HOME)
1719
}
1820
}

git-gui/po/de.po

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ msgstr ""
7272

7373
#: git-gui.sh:1154
7474
msgid "Cannot use bare repository:"
75-
msgstr "Leeres Projektarchiv kann nicht benutzt werden:"
75+
msgstr "Bloßes Projektarchiv kann nicht benutzt werden:"
7676

7777
#: git-gui.sh:1162
7878
msgid "No working directory"
@@ -88,7 +88,7 @@ msgstr "Nach geänderten Dateien suchen..."
8888

8989
#: git-gui.sh:1454
9090
msgid "Calling prepare-commit-msg hook..."
91-
msgstr "Aufrufen der Eintragen-Vorbereiten-Kontrolle..."
91+
msgstr "Aufrufen der Eintragen-Vorbereiten-Kontrolle (»prepare-commit hook«)..."
9292

9393
#: git-gui.sh:1471
9494
msgid "Commit declined by prepare-commit-msg hook."
@@ -188,7 +188,7 @@ msgstr "Zusammenführen"
188188

189189
#: git-gui.sh:2465 lib/choose_rev.tcl:557
190190
msgid "Remote"
191-
msgstr "Andere Archive"
191+
msgstr "Externe Archive"
192192

193193
#: git-gui.sh:2468
194194
msgid "Tools"
@@ -478,7 +478,7 @@ msgstr "Zusammenführungswerkzeug"
478478

479479
#: git-gui.sh:3328
480480
msgid "Use Remote Version"
481-
msgstr "Entfernte Version benutzen"
481+
msgstr "Externe Version benutzen"
482482

483483
#: git-gui.sh:3332
484484
msgid "Use Local Version"
@@ -771,7 +771,7 @@ msgstr "Bitte wählen Sie einen Übernahmezweig."
771771
#: lib/branch_create.tcl:140
772772
#, tcl-format
773773
msgid "Tracking branch %s is not a branch in the remote repository."
774-
msgstr "Übernahmezweig »%s« ist kein Zweig im anderen Projektarchiv."
774+
msgstr "Übernahmezweig »%s« ist kein Zweig im externen Projektarchiv."
775775

776776
#: lib/branch_create.tcl:153 lib/branch_rename.tcl:86
777777
msgid "Please supply a branch name."
@@ -1446,15 +1446,15 @@ msgstr ""
14461446

14471447
#: lib/commit.tcl:234
14481448
msgid "Calling pre-commit hook..."
1449-
msgstr "Aufrufen der Vor-Eintragen-Kontrolle..."
1449+
msgstr "Aufrufen der Vor-Eintragen-Kontrolle (»pre-commit hook«)..."
14501450

14511451
#: lib/commit.tcl:249
14521452
msgid "Commit declined by pre-commit hook."
14531453
msgstr "Eintragen abgelehnt durch Vor-Eintragen-Kontrolle (»pre-commit hook«)."
14541454

14551455
#: lib/commit.tcl:272
14561456
msgid "Calling commit-msg hook..."
1457-
msgstr "Aufrufen der Versionsbeschreibungs-Kontrolle..."
1457+
msgstr "Aufrufen der Versionsbeschreibungs-Kontrolle (»commit-message hook«)..."
14581458

14591459
#: lib/commit.tcl:287
14601460
msgid "Commit declined by commit-msg hook."
@@ -2134,19 +2134,19 @@ msgstr "Optionen konnten nicht gespeichert werden:"
21342134

21352135
#: lib/remote_add.tcl:19
21362136
msgid "Add Remote"
2137-
msgstr "Anderes Archiv hinzufügen"
2137+
msgstr "Externes Archiv hinzufügen"
21382138

21392139
#: lib/remote_add.tcl:24
21402140
msgid "Add New Remote"
2141-
msgstr "Neues anderes Archiv hinzufügen"
2141+
msgstr "Neues externes Archiv hinzufügen"
21422142

21432143
#: lib/remote_add.tcl:28 lib/tools_dlg.tcl:36
21442144
msgid "Add"
21452145
msgstr "Hinzufügen"
21462146

21472147
#: lib/remote_add.tcl:37
21482148
msgid "Remote Details"
2149-
msgstr "Einzelheiten des anderen Archivs"
2149+
msgstr "Einzelheiten des externen Archivs"
21502150

21512151
#: lib/remote_add.tcl:50
21522152
msgid "Location:"
@@ -2162,25 +2162,25 @@ msgstr "Gleich anfordern"
21622162

21632163
#: lib/remote_add.tcl:71
21642164
msgid "Initialize Remote Repository and Push"
2165-
msgstr "Anderes Archiv initialisieren und dahin versenden"
2165+
msgstr "Externes Archiv initialisieren und dahin versenden"
21662166

21672167
#: lib/remote_add.tcl:77
21682168
msgid "Do Nothing Else Now"
21692169
msgstr "Nichts tun"
21702170

21712171
#: lib/remote_add.tcl:101
21722172
msgid "Please supply a remote name."
2173-
msgstr "Bitte geben Sie einen Namen des anderen Archivs an."
2173+
msgstr "Bitte geben Sie einen Namen des externen Archivs an."
21742174

21752175
#: lib/remote_add.tcl:114
21762176
#, tcl-format
21772177
msgid "'%s' is not an acceptable remote name."
2178-
msgstr "»%s« ist kein zulässiger Name eines anderen Archivs."
2178+
msgstr "»%s« ist kein zulässiger Name eines externen Archivs."
21792179

21802180
#: lib/remote_add.tcl:125
21812181
#, tcl-format
21822182
msgid "Failed to add remote '%s' of location '%s'."
2183-
msgstr "Fehler beim Hinzufügen des anderen Archivs »%s« aus Herkunftsort »%s«."
2183+
msgstr "Fehler beim Hinzufügen des externen Archivs »%s« aus Herkunftsort »%s«."
21842184

21852185
#: lib/remote_add.tcl:133 lib/transport.tcl:6
21862186
#, tcl-format
@@ -2195,7 +2195,7 @@ msgstr "»%s« anfordern"
21952195
#: lib/remote_add.tcl:157
21962196
#, tcl-format
21972197
msgid "Do not know how to initialize repository at location '%s'."
2198-
msgstr "Initialisieren eines anderen Archivs an Adresse »%s« ist nicht möglich."
2198+
msgstr "Initialisieren eines externen Archivs an Adresse »%s« ist nicht möglich."
21992199

22002200
#: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:63
22012201
#: lib/transport.tcl:81
@@ -2210,15 +2210,15 @@ msgstr "Einrichten von »%s« an »%s«"
22102210

22112211
#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34
22122212
msgid "Delete Branch Remotely"
2213-
msgstr "Zweig in anderem Archiv löschen"
2213+
msgstr "Zweig in externem Archiv löschen"
22142214

22152215
#: lib/remote_branch_delete.tcl:47
22162216
msgid "From Repository"
22172217
msgstr "In Projektarchiv"
22182218

22192219
#: lib/remote_branch_delete.tcl:50 lib/transport.tcl:134
22202220
msgid "Remote:"
2221-
msgstr "Anderes Archiv:"
2221+
msgstr "Externes Archiv:"
22222222

22232223
#: lib/remote_branch_delete.tcl:66 lib/transport.tcl:149
22242224
msgid "Arbitrary Location:"
@@ -2281,7 +2281,7 @@ msgstr "»%s« laden..."
22812281

22822282
#: lib/remote.tcl:163
22832283
msgid "Remove Remote"
2284-
msgstr "Anderes Archiv entfernen"
2284+
msgstr "Externes Archiv entfernen"
22852285

22862286
#: lib/remote.tcl:168
22872287
msgid "Prune from"
@@ -2397,7 +2397,7 @@ msgid "Generation failed."
23972397
msgstr "Schlüsselerzeugung fehlgeschlagen."
23982398

23992399
#: lib/sshkey.tcl:118
2400-
msgid "Generation succeded, but no keys found."
2400+
msgid "Generation succeeded, but no keys found."
24012401
msgstr "Schlüsselerzeugung erfolgreich, aber keine Schlüssel gefunden."
24022402

24032403
#: lib/sshkey.tcl:121

git-gui/po/fr.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ msgid "Generation failed."
23992399
msgstr "La génération a échoué."
24002400

24012401
#: lib/sshkey.tcl:118
2402-
msgid "Generation succeded, but no keys found."
2402+
msgid "Generation succeeded, but no keys found."
24032403
msgstr "La génération a réussi, mais aucune clé n'a été trouvée."
24042404

24052405
#: lib/sshkey.tcl:121

git-gui/po/git-gui.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2203,7 +2203,7 @@ msgid "Generation failed."
22032203
msgstr ""
22042204

22052205
#: lib/sshkey.tcl:118
2206-
msgid "Generation succeded, but no keys found."
2206+
msgid "Generation succeeded, but no keys found."
22072207
msgstr ""
22082208

22092209
#: lib/sshkey.tcl:121

git-gui/po/hu.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ msgid "Generation failed."
23542354
msgstr "A generálás nem sikerült."
23552355

23562356
#: lib/sshkey.tcl:118
2357-
msgid "Generation succeded, but no keys found."
2357+
msgid "Generation succeeded, but no keys found."
23582358
msgstr "A generálás sikeres, de egy kulcs se található."
23592359

23602360
#: lib/sshkey.tcl:121

git-gui/po/it.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ msgid "Generation failed."
23972397
msgstr "Errore durante la creazione della chiave."
23982398

23992399
#: lib/sshkey.tcl:118
2400-
msgid "Generation succeded, but no keys found."
2400+
msgid "Generation succeeded, but no keys found."
24012401
msgstr "La chiave è stata creata con successo, ma non è stata trovata."
24022402

24032403
#: lib/sshkey.tcl:121

git-gui/po/ja.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ msgid "Generation failed."
23622362
msgstr "生成に失敗しました。"
23632363

23642364
#: lib/sshkey.tcl:118
2365-
msgid "Generation succeded, but no keys found."
2365+
msgid "Generation succeeded, but no keys found."
23662366
msgstr "生成には成功しましたが、鍵が見つかりません。"
23672367

23682368
#: lib/sshkey.tcl:121

git-gui/po/nb.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ msgid "Generation failed."
22862286
msgstr "Generering feilet."
22872287

22882288
#: lib/sshkey.tcl:118
2289-
msgid "Generation succeded, but no keys found."
2289+
msgid "Generation succeeded, but no keys found."
22902290
msgstr "Generering vellykket, men ingen nøkler er funnet."
22912291

22922292
#: lib/sshkey.tcl:121

git-gui/po/pt_br.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ msgid "Generation failed."
23752375
msgstr "A geração da chave falhou."
23762376

23772377
#: lib/sshkey.tcl:118
2378-
msgid "Generation succeded, but no keys found."
2378+
msgid "Generation succeeded, but no keys found."
23792379
msgstr "A geração da chave foi bem-sucedida, mas nenhuma chave foi encontrada."
23802380

23812381
#: lib/sshkey.tcl:121

git-gui/po/ru.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,7 @@ msgid "Generation failed."
23702370
msgstr "Ключ не создан."
23712371

23722372
#: lib/sshkey.tcl:118
2373-
msgid "Generation succeded, but no keys found."
2373+
msgid "Generation succeeded, but no keys found."
23742374
msgstr "Создание ключа завершилось, но результат не был найден"
23752375

23762376
#: lib/sshkey.tcl:121

0 commit comments

Comments
 (0)