summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-02 16:52:22 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-03 04:21:50 (GMT)
commit1952aa1d5735ccbedd832620e43db3e03fc77088 (patch)
tree66e919f794f04783a5a9154295b99dbdc0a02b52 /lib
parente73bfa7709b108575e6ea73d6e97fc3efd967b38 (diff)
downloadgit-1952aa1d5735ccbedd832620e43db3e03fc77088.zip
git-1952aa1d5735ccbedd832620e43db3e03fc77088.tar.gz
git-1952aa1d5735ccbedd832620e43db3e03fc77088.tar.bz2
git-gui: Allow forced push into remote repository
Some workflows allow the user to forcefully update a remote branch, such as in a "proposed updates" (aka "pu") branch where the branch is rewound and rebuilt on a daily basis against the current master branch. In such a case the "--force" or leading + must be used to make git-push execute anyway, even though it may be discarding one or more commits on the remote side. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/transport.tcl10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/transport.tcl b/lib/transport.tcl
index 3b05b8f..8e6a9d0 100644
--- a/lib/transport.tcl
+++ b/lib/transport.tcl
@@ -32,6 +32,7 @@ proc push_to {remote} {
proc start_push_anywhere_action {w} {
global push_urltype push_remote push_url push_thin push_tags
+ global push_force
set r_url {}
switch -- $push_urltype {
@@ -45,6 +46,9 @@ proc start_push_anywhere_action {w} {
if {$push_thin} {
lappend cmd --thin
}
+ if {$push_force} {
+ lappend cmd --force
+ }
if {$push_tags} {
lappend cmd --tags
}
@@ -76,6 +80,7 @@ trace add variable push_remote write \
proc do_push_anywhere {} {
global all_remotes current_branch
global push_urltype push_remote push_url push_thin push_tags
+ global push_force
set w .push_setup
toplevel $w
@@ -151,6 +156,10 @@ proc do_push_anywhere {} {
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
labelframe $w.options -text [mc "Transfer Options"]
+ checkbutton $w.options.force \
+ -text [mc "Force overwrite existing branch (may discard changes)"] \
+ -variable push_force
+ grid $w.options.force -columnspan 2 -sticky w
checkbutton $w.options.thin \
-text [mc "Use thin pack (for slow network connections)"] \
-variable push_thin
@@ -163,6 +172,7 @@ proc do_push_anywhere {} {
pack $w.options -anchor nw -fill x -pady 5 -padx 5
set push_url {}
+ set push_force 0
set push_thin 0
set push_tags 0