aboutsummaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-12-12 22:44:38 -0500
committerShawn O. Pearce <spearce@spearce.org>2007-01-21 02:54:16 -0500
commit51e7e568c0a7854b2f93b86d6085695ce80053cc (patch)
tree1563c55fd5b420c5e2b9774a3988585dca0fe28f /git-gui
parent557afe820baccb21206c974fbd4afa65bd7f1e03 (diff)
downloadgit-51e7e568c0a7854b2f93b86d6085695ce80053cc.tar.gz
git-51e7e568c0a7854b2f93b86d6085695ce80053cc.tar.xz
git-gui: Show all fetched branches for remote pulls.
Loop through every remote.<name>.fetch entry and add it as a valid option in the Pull menu. This way users can pull any remote branch that they track, without needing to leave the gui. Its a rather crude work around for not having a full merge interface. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui17
1 files changed, 9 insertions, 8 deletions
diff --git a/git-gui b/git-gui
index 36979afd7..0c88e4c7c 100755
--- a/git-gui
+++ b/git-gui
@@ -1819,28 +1819,29 @@ proc populate_pull_menu {m} {
global gitdir repo_config all_remotes disable_on_lock
foreach remote $all_remotes {
- set rb {}
+ set rb_list [list]
if {[array get repo_config remote.$remote.url] ne {}} {
if {[array get repo_config remote.$remote.fetch] ne {}} {
- regexp {^([^:]+):} \
- [lindex $repo_config(remote.$remote.fetch) 0] \
- line rb
+ foreach line $repo_config(remote.$remote.fetch) {
+ if {[regexp {^([^:]+):} $line line rb]} {
+ lappend rb_list $rb
+ }
+ }
}
} else {
catch {
set fd [open [file join $gitdir remotes $remote] r]
while {[gets $fd line] >= 0} {
if {[regexp {^Pull:[ \t]*([^:]+):} $line line rb]} {
- break
+ lappend rb_list $rb
}
}
close $fd
}
}
- set rb_short $rb
- regsub ^refs/heads/ $rb {} rb_short
- if {$rb_short ne {}} {
+ foreach rb $rb_list {
+ regsub ^refs/heads/ $rb {} rb_short
$m add command \
-label "Branch $rb_short from $remote..." \
-command [list pull_remote $remote $rb] \