From ba5d445b653f874d9e4f2fd97fdd87438f45a70d Mon Sep 17 00:00:00 2001 From: Clemens Buchacher Date: Sat, 21 Jan 2012 18:57:28 +0100 Subject: [PATCH 01/14] git-gui: fix git-gui crash due to uninitialized variable Recently, a clone initiated via git gui on Windows crashed on me due to an "unknown variable cdone". It turns out that there is a code path where this variable is used uninitialized. Signed-off-by: Clemens Buchacher Signed-off-by: Pat Thoyts --- lib/status_bar.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/status_bar.tcl b/lib/status_bar.tcl index 95cb44991f..02111a1742 100644 --- a/lib/status_bar.tcl +++ b/lib/status_bar.tcl @@ -77,6 +77,7 @@ method start {msg uds} { method update {have total} { set pdone 0 + set cdone 0 if {$total > 0} { set pdone [expr {100 * $have / $total}] set cdone [expr {[winfo width $w_c] * $have / $total}] From 446f8226ddb4f1d6e5ce14fb8cc22695af08e32b Mon Sep 17 00:00:00 2001 From: Marcus Karlsson Date: Sat, 10 Mar 2012 00:17:22 +0100 Subject: [PATCH 02/14] git-gui: Use PWD if it exists on Mac OS X The current working directory is set to / when git-gui is invoked using the Git Gui.app bundle on Mac OS X. This means that if it is launched from a directory which contains a repository then git-gui won't automatically find it unless the repository happens to be located in /. The PWD environment variable is however preserved if the bundle is invoked using open(1). If git-gui would check for PWD then a user could for example type open -a 'Git Gui' on a command line in order to launch the program and it would automatically find the repository. Teach git-gui to use the PWD environment variable on Mac OS X. Signed-off-by: Marcus Karlsson Signed-off-by: Junio C Hamano Signed-off-by: Pat Thoyts --- macosx/AppMain.tcl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/macosx/AppMain.tcl b/macosx/AppMain.tcl index ddbe6334a2..738bdd03ed 100644 --- a/macosx/AppMain.tcl +++ b/macosx/AppMain.tcl @@ -12,7 +12,9 @@ if {[file tail [lindex $argv 0]] eq {gitk}} { } else { set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]] set AppMain_source [file join $gitguilib git-gui.tcl] - if {[pwd] eq {/}} { + if {[info exists env(PWD)]} { + cd $env(PWD) + } elseif {[pwd] eq {/}} { cd $env(HOME) } } From ef42057deae1aca6c3716019a3672809785f0a96 Mon Sep 17 00:00:00 2001 From: Benjamin Kerensa Date: Mon, 5 Mar 2012 17:53:23 -0800 Subject: [PATCH 03/14] git-gui: fix a typo in po/ files "succeeded" was misspelled in the code, which propagated throughout the translations. Fixed all of them. Signed-off-by: Benjamin Kerensa ubuntu.com> Signed-off-by: Pat Thoyts --- po/de.po | 2 +- po/fr.po | 2 +- po/git-gui.pot | 2 +- po/hu.po | 2 +- po/it.po | 2 +- po/ja.po | 2 +- po/nb.po | 2 +- po/pt_br.po | 2 +- po/ru.po | 2 +- po/sv.po | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/po/de.po b/po/de.po index 44c5ddc8b6..d9a9ebd635 100644 --- a/po/de.po +++ b/po/de.po @@ -2397,7 +2397,7 @@ msgid "Generation failed." msgstr "Schlüsselerzeugung fehlgeschlagen." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Schlüsselerzeugung erfolgreich, aber keine Schlüssel gefunden." #: lib/sshkey.tcl:121 diff --git a/po/fr.po b/po/fr.po index 81706965f3..40441dbb0d 100644 --- a/po/fr.po +++ b/po/fr.po @@ -2399,7 +2399,7 @@ msgid "Generation failed." msgstr "La génération a échoué." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "La génération a réussi, mais aucune clé n'a été trouvée." #: lib/sshkey.tcl:121 diff --git a/po/git-gui.pot b/po/git-gui.pot index 1ae2aaa0b3..0c94f9c2c6 100644 --- a/po/git-gui.pot +++ b/po/git-gui.pot @@ -2203,7 +2203,7 @@ msgid "Generation failed." msgstr "" #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "" #: lib/sshkey.tcl:121 diff --git a/po/hu.po b/po/hu.po index 0f87bc1cbe..d106dadac8 100644 --- a/po/hu.po +++ b/po/hu.po @@ -2354,7 +2354,7 @@ msgid "Generation failed." msgstr "A generálás nem sikerült." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "A generálás sikeres, de egy kulcs se található." #: lib/sshkey.tcl:121 diff --git a/po/it.po b/po/it.po index aa15a204d8..1bd8b8e04f 100644 --- a/po/it.po +++ b/po/it.po @@ -2397,7 +2397,7 @@ msgid "Generation failed." msgstr "Errore durante la creazione della chiave." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "La chiave è stata creata con successo, ma non è stata trovata." #: lib/sshkey.tcl:121 diff --git a/po/ja.po b/po/ja.po index 15017985e5..9aff249d5f 100644 --- a/po/ja.po +++ b/po/ja.po @@ -2362,7 +2362,7 @@ msgid "Generation failed." msgstr "生成に失敗しました。" #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "生成には成功しましたが、鍵が見つかりません。" #: lib/sshkey.tcl:121 diff --git a/po/nb.po b/po/nb.po index 6de93c28c2..d66aa50263 100644 --- a/po/nb.po +++ b/po/nb.po @@ -2286,7 +2286,7 @@ msgid "Generation failed." msgstr "Generering feilet." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Generering vellykket, men ingen nøkler er funnet." #: lib/sshkey.tcl:121 diff --git a/po/pt_br.po b/po/pt_br.po index b175b9791e..bad116c780 100644 --- a/po/pt_br.po +++ b/po/pt_br.po @@ -2375,7 +2375,7 @@ msgid "Generation failed." msgstr "A geração da chave falhou." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "A geração da chave foi bem-sucedida, mas nenhuma chave foi encontrada." #: lib/sshkey.tcl:121 diff --git a/po/ru.po b/po/ru.po index 30f4b77dac..ca4343b40c 100644 --- a/po/ru.po +++ b/po/ru.po @@ -2370,7 +2370,7 @@ msgid "Generation failed." msgstr "Ключ не создан." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Создание ключа завершилось, но результат не был найден" #: lib/sshkey.tcl:121 diff --git a/po/sv.po b/po/sv.po index 24cc4e3675..fcb063ffa6 100644 --- a/po/sv.po +++ b/po/sv.po @@ -2382,7 +2382,7 @@ msgid "Generation failed." msgstr "Misslyckades med att skapa." #: lib/sshkey.tcl:120 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Lyckades skapa nyckeln, men hittar inte någon nyckel." #: lib/sshkey.tcl:123 From c42939d24e5f48f7bce44771dbe22a879664faa1 Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Fri, 23 Mar 2012 18:46:27 +0100 Subject: [PATCH 04/14] git-gui: open console when using --trace on windows When starting a gui program on windows stdout, stderr and stdin are not connected to the cmd console. As a workaround tk has a console window. Lets open this when the --trace commandline option has been given. This is helpful for debugging. Signed-off-by: Heiko Voigt Signed-off-by: Pat Thoyts --- git-gui.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/git-gui.sh b/git-gui.sh index ba4e5c1330..7dddc7dd24 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -154,6 +154,7 @@ set _trace [lsearch -exact $argv --trace] if {$_trace >= 0} { set argv [lreplace $argv $_trace $_trace] set _trace 1 + if {[tk windowingsystem] eq "win32"} { console show } } else { set _trace 0 } From fda1ba02f3015310c3ac505292640c90bc97b172 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Thu, 19 Apr 2012 11:19:58 +0100 Subject: [PATCH 05/14] git-gui: preserve commit messages in utf-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit message buffer is automatically preserved to a local file but this uses the system encoding which may fail to properly encode unicode text. Forcing this file to use utf-8 preserves the message correctly. Reported-by: Ángel José Riesgo Signed-off-by: Pat Thoyts --- git-gui.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 7dddc7dd24..936b367baf 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1464,7 +1464,7 @@ proc rescan {after {honor_trustmtime 1}} { (![$ui_comm edit modified] || [string trim [$ui_comm get 0.0 end]] eq {})} { if {[string match amend* $commit_type]} { - } elseif {[load_message GITGUI_MSG]} { + } elseif {[load_message GITGUI_MSG utf-8]} { } elseif {[run_prepare_commit_msg_hook]} { } elseif {[load_message MERGE_MSG]} { } elseif {[load_message SQUASH_MSG]} { @@ -1550,7 +1550,7 @@ proc rescan_stage2 {fd after} { fileevent $fd_lo readable [list read_ls_others $fd_lo $after] } -proc load_message {file} { +proc load_message {file {encoding {}}} { global ui_comm set f [gitdir $file] @@ -1559,6 +1559,9 @@ proc load_message {file} { return 0 } fconfigure $fd -eofchar {} + if {$encoding ne {}} { + fconfigure $fd -encoding $encoding + } set content [string trim [read $fd]] close $fd regsub -all -line {[ \r\t]+$} $content {} content @@ -2267,6 +2270,7 @@ proc do_quit {{rc {1}}} { && $msg ne {}} { catch { set fd [open $save w] + fconfigure $fd -encoding utf-8 puts -nonewline $fd $msg close $fd } @@ -3836,7 +3840,7 @@ if {[is_enabled transport]} { } if {[winfo exists $ui_comm]} { - set GITGUI_BCK_exists [load_message GITGUI_BCK] + set GITGUI_BCK_exists [load_message GITGUI_BCK utf-8] # -- If both our backup and message files exist use the # newer of the two files to initialize the buffer. @@ -3873,6 +3877,7 @@ if {[winfo exists $ui_comm]} { } elseif {$m} { catch { set fd [open [gitdir GITGUI_BCK] w] + fconfigure $fd -encoding utf-8 puts -nonewline $fd $msg close $fd set GITGUI_BCK_exists 1 From 3c3737deab03cd4b5f42d9b1bf58e186de26e9ec Mon Sep 17 00:00:00 2001 From: Ralf Thielow Date: Tue, 19 Jun 2012 20:25:39 +0200 Subject: [PATCH 06/14] git-gui: de.po: consistently add untranslated hook names within braces The user might not really know what hook is actually meant if it's translated. To avoid such a confusion we should consistently write it untranslated within braces after. Signed-off-by: Ralf Thielow Signed-off-by: Pat Thoyts --- po/de.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/de.po b/po/de.po index d9a9ebd635..91221efc4e 100644 --- a/po/de.po +++ b/po/de.po @@ -88,7 +88,7 @@ msgstr "Nach geänderten Dateien suchen..." #: git-gui.sh:1454 msgid "Calling prepare-commit-msg hook..." -msgstr "Aufrufen der Eintragen-Vorbereiten-Kontrolle..." +msgstr "Aufrufen der Eintragen-Vorbereiten-Kontrolle (»prepare-commit hook«)..." #: git-gui.sh:1471 msgid "Commit declined by prepare-commit-msg hook." @@ -1446,7 +1446,7 @@ msgstr "" #: lib/commit.tcl:234 msgid "Calling pre-commit hook..." -msgstr "Aufrufen der Vor-Eintragen-Kontrolle..." +msgstr "Aufrufen der Vor-Eintragen-Kontrolle (»pre-commit hook«)..." #: lib/commit.tcl:249 msgid "Commit declined by pre-commit hook." @@ -1454,7 +1454,7 @@ msgstr "Eintragen abgelehnt durch Vor-Eintragen-Kontrolle (»pre-commit hook«). #: lib/commit.tcl:272 msgid "Calling commit-msg hook..." -msgstr "Aufrufen der Versionsbeschreibungs-Kontrolle..." +msgstr "Aufrufen der Versionsbeschreibungs-Kontrolle (»commit-message hook«)..." #: lib/commit.tcl:287 msgid "Commit declined by commit-msg hook." From 774b79fbb8947a12996bcc49b3951d14c0395444 Mon Sep 17 00:00:00 2001 From: Ralf Thielow Date: Tue, 19 Jun 2012 20:25:40 +0200 Subject: [PATCH 07/14] =?UTF-8?q?git-gui:=20de.po:=20translate=20"bare"=20?= =?UTF-8?q?as=20"blo=C3=9F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the translation in git-core, we translate "bare" as "bloß". Signed-off-by: Ralf Thielow Signed-off-by: Pat Thoyts --- po/de.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/de.po b/po/de.po index 91221efc4e..55fde80a7a 100644 --- a/po/de.po +++ b/po/de.po @@ -72,7 +72,7 @@ msgstr "" #: git-gui.sh:1154 msgid "Cannot use bare repository:" -msgstr "Leeres Projektarchiv kann nicht benutzt werden:" +msgstr "Bloßes Projektarchiv kann nicht benutzt werden:" #: git-gui.sh:1162 msgid "No working directory" From 1a8cdacb51ae200c8a209df2e43e2b292680528e Mon Sep 17 00:00:00 2001 From: Ralf Thielow Date: Tue, 19 Jun 2012 20:25:41 +0200 Subject: [PATCH 08/14] git-gui: de.po: translate "remote" as "extern" According to the translation in git-core, we translate "remote" as "extern". Signed-off-by: Ralf Thielow Signed-off-by: Pat Thoyts --- po/de.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/po/de.po b/po/de.po index 55fde80a7a..baebff2fff 100644 --- a/po/de.po +++ b/po/de.po @@ -188,7 +188,7 @@ msgstr "Zusammenführen" #: git-gui.sh:2465 lib/choose_rev.tcl:557 msgid "Remote" -msgstr "Andere Archive" +msgstr "Externe Archive" #: git-gui.sh:2468 msgid "Tools" @@ -478,7 +478,7 @@ msgstr "Zusammenführungswerkzeug" #: git-gui.sh:3328 msgid "Use Remote Version" -msgstr "Entfernte Version benutzen" +msgstr "Externe Version benutzen" #: git-gui.sh:3332 msgid "Use Local Version" @@ -771,7 +771,7 @@ msgstr "Bitte wählen Sie einen Übernahmezweig." #: lib/branch_create.tcl:140 #, tcl-format msgid "Tracking branch %s is not a branch in the remote repository." -msgstr "Übernahmezweig »%s« ist kein Zweig im anderen Projektarchiv." +msgstr "Übernahmezweig »%s« ist kein Zweig im externen Projektarchiv." #: lib/branch_create.tcl:153 lib/branch_rename.tcl:86 msgid "Please supply a branch name." @@ -2134,11 +2134,11 @@ msgstr "Optionen konnten nicht gespeichert werden:" #: lib/remote_add.tcl:19 msgid "Add Remote" -msgstr "Anderes Archiv hinzufügen" +msgstr "Externes Archiv hinzufügen" #: lib/remote_add.tcl:24 msgid "Add New Remote" -msgstr "Neues anderes Archiv hinzufügen" +msgstr "Neues externes Archiv hinzufügen" #: lib/remote_add.tcl:28 lib/tools_dlg.tcl:36 msgid "Add" @@ -2146,7 +2146,7 @@ msgstr "Hinzufügen" #: lib/remote_add.tcl:37 msgid "Remote Details" -msgstr "Einzelheiten des anderen Archivs" +msgstr "Einzelheiten des externen Archivs" #: lib/remote_add.tcl:50 msgid "Location:" @@ -2162,7 +2162,7 @@ msgstr "Gleich anfordern" #: lib/remote_add.tcl:71 msgid "Initialize Remote Repository and Push" -msgstr "Anderes Archiv initialisieren und dahin versenden" +msgstr "Externes Archiv initialisieren und dahin versenden" #: lib/remote_add.tcl:77 msgid "Do Nothing Else Now" @@ -2170,17 +2170,17 @@ msgstr "Nichts tun" #: lib/remote_add.tcl:101 msgid "Please supply a remote name." -msgstr "Bitte geben Sie einen Namen des anderen Archivs an." +msgstr "Bitte geben Sie einen Namen des externen Archivs an." #: lib/remote_add.tcl:114 #, tcl-format msgid "'%s' is not an acceptable remote name." -msgstr "»%s« ist kein zulässiger Name eines anderen Archivs." +msgstr "»%s« ist kein zulässiger Name eines externen Archivs." #: lib/remote_add.tcl:125 #, tcl-format msgid "Failed to add remote '%s' of location '%s'." -msgstr "Fehler beim Hinzufügen des anderen Archivs »%s« aus Herkunftsort »%s«." +msgstr "Fehler beim Hinzufügen des externen Archivs »%s« aus Herkunftsort »%s«." #: lib/remote_add.tcl:133 lib/transport.tcl:6 #, tcl-format @@ -2195,7 +2195,7 @@ msgstr "»%s« anfordern" #: lib/remote_add.tcl:157 #, tcl-format msgid "Do not know how to initialize repository at location '%s'." -msgstr "Initialisieren eines anderen Archivs an Adresse »%s« ist nicht möglich." +msgstr "Initialisieren eines externen Archivs an Adresse »%s« ist nicht möglich." #: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:63 #: lib/transport.tcl:81 @@ -2210,7 +2210,7 @@ msgstr "Einrichten von »%s« an »%s«" #: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34 msgid "Delete Branch Remotely" -msgstr "Zweig in anderem Archiv löschen" +msgstr "Zweig in externem Archiv löschen" #: lib/remote_branch_delete.tcl:47 msgid "From Repository" @@ -2218,7 +2218,7 @@ msgstr "In Projektarchiv" #: lib/remote_branch_delete.tcl:50 lib/transport.tcl:134 msgid "Remote:" -msgstr "Anderes Archiv:" +msgstr "Externes Archiv:" #: lib/remote_branch_delete.tcl:66 lib/transport.tcl:149 msgid "Arbitrary Location:" @@ -2281,7 +2281,7 @@ msgstr "»%s« laden..." #: lib/remote.tcl:163 msgid "Remove Remote" -msgstr "Anderes Archiv entfernen" +msgstr "Externes Archiv entfernen" #: lib/remote.tcl:168 msgid "Prune from" From 44e88ce07838fd20d7187d3031916095ce823255 Mon Sep 17 00:00:00 2001 From: Vitaly _Vi Shukela Date: Sat, 15 Sep 2012 02:36:41 +0300 Subject: [PATCH 09/14] git-gui: Fix semi-working shortcuts for unstage and revert Make Ctrl+U for unstaging and Ctrl+J for reverting selection behave more like Ctrl+T for adding. They were working only when one area was focused (diff or commit message), now they should work everywhere. Acked-by: Bert Wesarg Signed-off-by: Vitaly _Vi Shukela Signed-off-by: Pat Thoyts --- git-gui.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-gui.sh b/git-gui.sh index 936b367baf..5d035d5a17 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3715,6 +3715,8 @@ bind $ui_diff <$M1B-Key-v> {break} bind $ui_diff <$M1B-Key-V> {break} bind $ui_diff <$M1B-Key-a> {%W tag add sel 0.0 end;break} bind $ui_diff <$M1B-Key-A> {%W tag add sel 0.0 end;break} +bind $ui_diff <$M1B-Key-j> {do_revert_selection;break} +bind $ui_diff <$M1B-Key-J> {do_revert_selection;break} bind $ui_diff {catch {%W yview scroll -1 units};break} bind $ui_diff {catch {%W yview scroll 1 units};break} bind $ui_diff {catch {%W xview scroll -1 units};break} @@ -3747,6 +3749,8 @@ bind . <$M1B-Key-s> do_signoff bind . <$M1B-Key-S> do_signoff bind . <$M1B-Key-t> do_add_selection bind . <$M1B-Key-T> do_add_selection +bind . <$M1B-Key-u> do_unstage_selection +bind . <$M1B-Key-U> do_unstage_selection bind . <$M1B-Key-j> do_revert_selection bind . <$M1B-Key-J> do_revert_selection bind . <$M1B-Key-i> do_add_all From 9ef750875abd9cc41d733131a2851b5165fc2197 Mon Sep 17 00:00:00 2001 From: Beat Bolli Date: Sat, 18 Aug 2012 13:24:00 -0700 Subject: [PATCH 10/14] git-gui: Fix a loose/lose mistake Acked-by: Junio C Hamano Signed-off-by: Beat Bolli Signed-off-by: Pat Thoyts --- lib/commit.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commit.tcl b/lib/commit.tcl index 0d81432af5..78c5eeb7bc 100644 --- a/lib/commit.tcl +++ b/lib/commit.tcl @@ -268,7 +268,7 @@ proc commit_commitmsg {curHEAD msg_p} { && [is_config_true gui.warndetachedcommit]} { set msg [mc "You are about to commit on a detached head.\ This is a potentially dangerous thing to do because if you switch\ -to another branch you will loose your changes and it can be difficult\ +to another branch you will lose your changes and it can be difficult\ to retrieve them later from the reflog. You should probably cancel this\ commit and create a new branch to continue.\n\ \n\ From 5a5e4d2599faf51240e5c8f29645eeb2aedff5c2 Mon Sep 17 00:00:00 2001 From: Beat Bolli Date: Sat, 18 Aug 2012 13:28:00 -0700 Subject: [PATCH 11/14] git-gui: remove .git/CHERRY_PICK_HEAD after committing Adding _git_ps1() to one's bash prompt displays various repo status info after each command. After committing a git cherry-pick -n using git-gui, the prompt still contains the "|CHERRY-PICKING" flag. Delete the file causing this flag when cleaning up. Signed-off-by: Beat Bolli Signed-off-by: Pat Thoyts --- lib/commit.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/commit.tcl b/lib/commit.tcl index 78c5eeb7bc..864b687057 100644 --- a/lib/commit.tcl +++ b/lib/commit.tcl @@ -409,6 +409,7 @@ A rescan will be automatically started now. catch {file delete [gitdir MERGE_MSG]} catch {file delete [gitdir SQUASH_MSG]} catch {file delete [gitdir GITGUI_MSG]} + catch {file delete [gitdir CHERRY_PICK_HEAD]} # -- Let rerere do its thing. # From e3d06ca93eebaf5e4bf8438255a30fb6c91ab277 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Tue, 2 Oct 2012 12:25:14 -0400 Subject: [PATCH 12/14] git-gui: Detect full path when parsing arguments When running "git-gui blame" from a subfolder (which means prefix is non-empty), if we pass a full path as argument, the argument parsing will fail to recognize the argument as a file name, because prefix is prepended to the argument. This patch handles that scenario by adding an additional branch that checks the file name without using the prefix. Signed-off-by: Andrew Wong Signed-off-by: Pat Thoyts --- git-gui.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/git-gui.sh b/git-gui.sh index 5d035d5a17..5d7894bd94 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3003,10 +3003,19 @@ blame { set jump_spec {} set is_path 0 foreach a $argv { - if {$is_path || [file exists $_prefix$a]} { + if {[file exists $a]} { + if {$path ne {}} usage + set path [normalize_relpath $a] + break + } elseif {[file exists $_prefix$a]} { if {$path ne {}} usage set path [normalize_relpath $_prefix$a] break + } + + if {$is_path} { + if {$path ne {}} usage + break } elseif {$a eq {--}} { if {$path ne {}} { if {$head ne {}} usage From df46eda3887da7c31cbc3f278550fc8ef9d1ba7a Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Tue, 2 Oct 2012 12:25:15 -0400 Subject: [PATCH 13/14] git-gui: Don't prepend the prefix if value looks like a full path When argument parsing fails to detect a file name, "git-gui" will try to use the previously detected "head" as the file name. We should avoid prepending the prefix if "head" looks like a full path. Signed-off-by: Andrew Wong Signed-off-by: Pat Thoyts --- git-gui.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 5d7894bd94..89f636f496 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3037,8 +3037,13 @@ blame { unset is_path if {$head ne {} && $path eq {}} { - set path [normalize_relpath $_prefix$head] - set head {} + if {[string index $head 0] eq {/}} { + set path [normalize_relpath $head] + set head {} + } else { + set path [normalize_relpath $_prefix$head] + set head {} + } } if {$head eq {}} { From f6dd784ed4c1705d465b1238f9a5971f2733e582 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Wed, 17 Oct 2012 21:57:29 +0100 Subject: [PATCH 14/14] git-gui 0.17 Signed-off-by: Pat Thoyts --- GIT-VERSION-GEN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 65709437ff..49b62ea6eb 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=0.16.GITGUI +DEF_VER=0.17.GITGUI LF=' '