Junio C Hamano < gits...@pobox.com> writes:

> Isn't the right way to improve the situation to let the command line tools
> know how the user wants to push things out and just have Git-GUI delegate
> the choice to the underlying "git push"?

Thank you for all the constructive feedback. I realize that it is not the way 
forward to remove the selection of branches to push.

What I consider now, is to pursue the idea that Junio presents above: just let 
the gui tool use whatever is configured for the selected remote. I have, 
however not been able to come up with a solution that looks nice. What I have 
been trying now is the following little modification:

diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl
index e5d211e..1709464 100644
--- a/git-gui/lib/transport.tcl
+++ b/git-gui/lib/transport.tcl
@@ -95,7 +95,9 @@ proc start_push_anywhere_action {w} {
                set cnt 0
                foreach i [$w.source.l curselection] {
                        set b [$w.source.l get $i]
-                       lappend cmd "refs/heads/$b:refs/heads/$b"
+                       if {$b nw {<default>}}{
+                               lappend cmd "refs/heads/$b:refs/heads/$b"
+                       }
                        incr cnt
                }
                if {$cnt == 0} {
@@ -149,6 +151,7 @@ proc do_push_anywhere {} {
                -height 10 \
                -width 70 \
                -selectmode extended
+       $w.source.l insert end <default>
        foreach h [load_all_heads] {
                $w.source.l insert end $h
                if {$h eq $current_branch} {

The idea is to insert a "<default>" entry in the branch selection list, and 
then skip that when building the command. Then you can avoid having refs on the 
command line and just let git act according to configuration.

How about that? Any smarter way to do it?

BR Jørgen

Reply via email to