From dd70f3dbe48b9e30589c5832e95229b474651d6a Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 14 Apr 2008 10:51:33 +0200 Subject: git-gui: Report less precise object estimates for database compression On startup, git-gui warns if there are many loose objects. It does so by saying, e.g., that there are "approximately 768 loose objects". But isn't "768" a very accurate number? Lets say "750", which (while still being a very precise number) sounds much more like an estimation. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce diff --git a/lib/database.tcl b/lib/database.tcl index d66aa3f..a18ac8b 100644 --- a/lib/database.tcl +++ b/lib/database.tcl @@ -102,8 +102,8 @@ proc hint_gc {} { *]] if {$objects_current >= $object_limit} { - set objects_current [expr {$objects_current * 256}] - set object_limit [expr {$object_limit * 256}] + set objects_current [expr {$objects_current * 250}] + set object_limit [expr {$object_limit * 250}] if {[ask_popup \ [mc "This repository currently has approximately %i loose objects. -- cgit v0.10.2-6-g49f6 From ddc360314544a21638fd0658218bbc37aafedd6f Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 23 Apr 2008 21:34:58 -0400 Subject: git-gui: Don't use '$$cr master' with aspell earlier than 0.60 Apparently aspell 0.50 does not recognize "$$cr master" as a command, but instead tries to offer suggestions for how to correctly spell the word "cr". This is not quite what we are after when we want the name of the current dictionary. Instead of locking up git-gui waiting for a response that may never come back from aspell we avoid sending this command if the binary we have started claims to be before version 0.60. Signed-off-by: Shawn O. Pearce diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl index 9be7486..78f344f 100644 --- a/lib/spellcheck.tcl +++ b/lib/spellcheck.tcl @@ -84,13 +84,19 @@ method _connect {pipe_fd} { regexp \ {International Ispell Version .* \(but really (Aspell .*?)\)$} \ $s_version _junk s_version + regexp {^Aspell (\d)+\.(\d+)} $s_version _junk major minor puts $pipe_fd ! ; # enable terse mode - puts $pipe_fd {$$cr master} ; # fetch the language - flush $pipe_fd - gets $pipe_fd s_lang - regexp {[/\\]([^/\\]+)\.[^\.]+$} $s_lang _ s_lang + # fetch the language + if {$major > 0 || ($major == 0 && $minor >= 60)} { + puts $pipe_fd {$$cr master} + flush $pipe_fd + gets $pipe_fd s_lang + regexp {[/\\]([^/\\]+)\.[^\.]+$} $s_lang _ s_lang + } else { + set s_lang {} + } if {$::default_config(gui.spellingdictionary) eq {} && [get_config gui.spellingdictionary] eq {}} { -- cgit v0.10.2-6-g49f6 From 259cd0fddb1dea649d15e9cd5039c55dc30845b0 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Thu, 1 May 2008 11:51:47 +0200 Subject: git-gui: Update German translation Signed-off-by: Shawn O. Pearce diff --git a/po/de.po b/po/de.po index 022b816..f20955c 100644 --- a/po/de.po +++ b/po/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: git-gui\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-03-14 07:18+0100\n" -"PO-Revision-Date: 2008-02-16 21:52+0100\n" +"PO-Revision-Date: 2008-05-01 11:51+0200\n" "Last-Translator: Christian Stimming \n" "Language-Team: German\n" "MIME-Version: 1.0\n" @@ -1754,9 +1754,8 @@ msgid "Number of Diff Context Lines" msgstr "Anzahl der Kontextzeilen beim Vergleich" #: lib/option.tcl:127 -#, fuzzy msgid "Commit Message Text Width" -msgstr "Versionsbeschreibung:" +msgstr "Textbreite der Versionsbeschreibung" #: lib/option.tcl:128 msgid "New Branch Name Template" @@ -1895,40 +1894,36 @@ msgstr "Fehler beim Erstellen des Icons:" #: lib/spellcheck.tcl:57 msgid "Unsupported spell checker" -msgstr "" +msgstr "Rechtschreibprüfungsprogramm nicht unterstützt" #: lib/spellcheck.tcl:65 -#, fuzzy msgid "Spell checking is unavailable" -msgstr "Rechtschreibprüfung fehlgeschlagen" +msgstr "Rechtschreibprüfung nicht verfügbar" #: lib/spellcheck.tcl:68 msgid "Invalid spell checking configuration" -msgstr "" +msgstr "Unbenutzbare Konfiguration der Rechtschreibprüfung" #: lib/spellcheck.tcl:70 #, tcl-format msgid "Reverting dictionary to %s." -msgstr "" +msgstr "Wörterbuch auf %s zurückgesetzt." #: lib/spellcheck.tcl:73 -#, fuzzy msgid "Spell checker silently failed on startup" -msgstr "Rechtschreibprüfung fehlgeschlagen" +msgstr "Rechtschreibprüfungsprogramm mit Fehler abgebrochen" #: lib/spellcheck.tcl:80 -#, fuzzy msgid "Unrecognized spell checker" -msgstr "Unbekannte Version von »aspell«" +msgstr "Unbekanntes Rechtschreibprüfungsprogramm" #: lib/spellcheck.tcl:180 msgid "No Suggestions" msgstr "Keine Vorschläge" #: lib/spellcheck.tcl:381 -#, fuzzy msgid "Unexpected EOF from spell checker" -msgstr "Unerwartetes EOF von »aspell«" +msgstr "Unerwartetes EOF vom Rechtschreibprüfungsprogramm" #: lib/spellcheck.tcl:385 msgid "Spell Checker Failed" @@ -2002,6 +1997,3 @@ msgstr "Kompaktes Datenformat benutzen (für langsame Netzverbindungen)" #: lib/transport.tcl:168 msgid "Include tags" msgstr "Mit Markierungen übertragen" - -#~ msgid "Not connected to aspell" -#~ msgstr "Keine Verbindung zu »aspell«" -- cgit v0.10.2-6-g49f6 From fe70225dc730c5af4c491106d1e0226d1c014d1e Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 8 May 2008 20:16:43 -0400 Subject: git-gui: Setup branch.remote,merge for shorthand git-pull When creating new branches if branch.autosetupmerge is not set, or is set to true or always and we have been given a remote tracking branch as the starting point for a new branch we want to create the necessary configuration options in .git/config for the new branch so that a no argument git-pull on the command line pulls from the remote repository's branch. Signed-off-by: Shawn O. Pearce diff --git a/git-gui.sh b/git-gui.sh index 7c25bb9..9df4971 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -601,6 +601,7 @@ proc apply_config {} { } } +set default_config(branch.autosetupmerge) true set default_config(merge.diffstat) true set default_config(merge.summary) false set default_config(merge.verbosity) 2 diff --git a/lib/branch_create.tcl b/lib/branch_create.tcl index 53dfb4c..3817771 100644 --- a/lib/branch_create.tcl +++ b/lib/branch_create.tcl @@ -183,6 +183,9 @@ method _create {} { if {$spec ne {} && $opt_fetch} { $co enable_fetch $spec } + if {$spec ne {}} { + $co remote_source $spec + } if {[$co run]} { destroy $w diff --git a/lib/checkout_op.tcl b/lib/checkout_op.tcl index 6e14117..caca888 100644 --- a/lib/checkout_op.tcl +++ b/lib/checkout_op.tcl @@ -16,6 +16,7 @@ field merge_base {}; # merge base if we have another ref involved field fetch_spec {}; # refetch tracking branch if used? field checkout 1; # actually checkout the branch? field create 0; # create the branch if it doesn't exist? +field remote_source {}; # same as fetch_spec, to setup tracking field reset_ok 0; # did the user agree to reset? field fetch_ok 0; # did the fetch succeed? @@ -44,6 +45,10 @@ method enable_fetch {spec} { set fetch_spec $spec } +method remote_source {spec} { + set remote_source $spec +} + method enable_checkout {co} { set checkout $co } @@ -145,7 +150,7 @@ method _finish_fetch {ok} { } method _update_ref {} { - global null_sha1 current_branch + global null_sha1 current_branch repo_config set ref $new_ref set new $new_hash @@ -172,6 +177,23 @@ method _update_ref {} { set reflog_msg "branch: Created from $new_expr" set cur $null_sha1 + + if {($repo_config(branch.autosetupmerge) eq {true} + || $repo_config(branch.autosetupmerge) eq {always}) + && $remote_source ne {} + && "refs/heads/$newbranch" eq $ref} { + + set c_remote [lindex $remote_source 1] + set c_merge [lindex $remote_source 2] + if {[catch { + git config branch.$newbranch.remote $c_remote + git config branch.$newbranch.merge $c_merge + } err]} { + _error $this [strcat \ + [mc "Failed to configure simplified git-pull for '%s'." $newbranch] \ + "\n\n$err"] + } + } } elseif {$create && $merge_type eq {none}} { # We were told to create it, but not do a merge. # Bad. Name shouldn't have existed. -- cgit v0.10.2-6-g49f6 From 76bb40cde0e15e8d0e8493abb0bd18a5d6386ad7 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 8 May 2008 20:29:42 -0400 Subject: git-gui: Delete branches with 'git branch -D' to clear config If we are deleting a local branch from refs/heads/ we need to make sure any associated configuration stored in .git/config is also removed (such as branch.$name.remote and branch.$name.merge). The easiest way to do this is to use git-branch as that automatically will look for and delete configuration keys as necessary. Signed-off-by: Shawn O. Pearce diff --git a/lib/branch_delete.tcl b/lib/branch_delete.tcl index 86c4f73..ef1930b 100644 --- a/lib/branch_delete.tcl +++ b/lib/branch_delete.tcl @@ -127,7 +127,7 @@ method _delete {} { foreach i $to_delete { set b [lindex $i 0] set o [lindex $i 1] - if {[catch {git update-ref -d "refs/heads/$b" $o} err]} { + if {[catch {git branch -D $b} err]} { append failed " - $b: $err\n" } } -- cgit v0.10.2-6-g49f6