aboutsummaryrefslogtreecommitdiff
path: root/git-gui/lib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-15 01:31:15 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-15 01:31:15 -0700
commit1fbb58b4153e90eda08c2b022ee32d90729582e6 (patch)
treeab3b850ab1c4f7d46be319133193d7fd7c0d6cb2 /git-gui/lib
parent58949bb18a1610d109e64e997c41696e0dfe97c3 (diff)
parent76bb40cde0e15e8d0e8493abb0bd18a5d6386ad7 (diff)
downloadgit-1fbb58b4153e90eda08c2b022ee32d90729582e6.tar.gz
git-1fbb58b4153e90eda08c2b022ee32d90729582e6.tar.xz
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui: Delete branches with 'git branch -D' to clear config git-gui: Setup branch.remote,merge for shorthand git-pull git-gui: Update German translation git-gui: Don't use '$$cr master' with aspell earlier than 0.60 git-gui: Report less precise object estimates for database compression
Diffstat (limited to 'git-gui/lib')
-rw-r--r--git-gui/lib/branch_create.tcl3
-rw-r--r--git-gui/lib/branch_delete.tcl2
-rw-r--r--git-gui/lib/checkout_op.tcl24
-rw-r--r--git-gui/lib/database.tcl4
-rw-r--r--git-gui/lib/spellcheck.tcl14
5 files changed, 39 insertions, 8 deletions
diff --git a/git-gui/lib/branch_create.tcl b/git-gui/lib/branch_create.tcl
index 53dfb4ce6..3817771b9 100644
--- a/git-gui/lib/branch_create.tcl
+++ b/git-gui/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/git-gui/lib/branch_delete.tcl b/git-gui/lib/branch_delete.tcl
index 86c4f7337..ef1930b49 100644
--- a/git-gui/lib/branch_delete.tcl
+++ b/git-gui/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"
}
}
diff --git a/git-gui/lib/checkout_op.tcl b/git-gui/lib/checkout_op.tcl
index 6e1411711..caca88831 100644
--- a/git-gui/lib/checkout_op.tcl
+++ b/git-gui/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.
diff --git a/git-gui/lib/database.tcl b/git-gui/lib/database.tcl
index d66aa3fe3..a18ac8b43 100644
--- a/git-gui/lib/database.tcl
+++ b/git-gui/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.
diff --git a/git-gui/lib/spellcheck.tcl b/git-gui/lib/spellcheck.tcl
index 9be748683..78f344f08 100644
--- a/git-gui/lib/spellcheck.tcl
+++ b/git-gui/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 {}} {