2007-05-08 05:35:48 +02:00
|
|
|
# git-gui branch (create/delete) support
|
|
|
|
# Copyright (C) 2006, 2007 Shawn Pearce
|
|
|
|
|
|
|
|
proc load_all_heads {} {
|
2007-07-04 06:15:41 +02:00
|
|
|
global some_heads_tracking
|
2007-05-08 05:35:48 +02:00
|
|
|
|
2007-07-04 06:15:41 +02:00
|
|
|
set rh refs/heads
|
|
|
|
set rh_len [expr {[string length $rh] + 1}]
|
2007-05-08 05:35:48 +02:00
|
|
|
set all_heads [list]
|
2007-07-09 07:17:09 +02:00
|
|
|
set fd [git_read for-each-ref --format=%(refname) $rh]
|
2019-12-07 01:29:09 +01:00
|
|
|
fconfigure $fd -translation binary -encoding utf-8
|
2007-05-08 05:35:48 +02:00
|
|
|
while {[gets $fd line] > 0} {
|
2007-07-04 06:15:41 +02:00
|
|
|
if {!$some_heads_tracking || ![is_tracking_branch $line]} {
|
|
|
|
lappend all_heads [string range $line $rh_len end]
|
|
|
|
}
|
2007-05-08 05:35:48 +02:00
|
|
|
}
|
|
|
|
close $fd
|
|
|
|
|
2007-07-09 00:40:56 +02:00
|
|
|
return [lsort $all_heads]
|
2007-05-08 05:35:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
proc load_all_tags {} {
|
|
|
|
set all_tags [list]
|
2007-07-09 07:17:09 +02:00
|
|
|
set fd [git_read for-each-ref \
|
|
|
|
--sort=-taggerdate \
|
|
|
|
--format=%(refname) \
|
|
|
|
refs/tags]
|
2019-12-07 01:29:09 +01:00
|
|
|
fconfigure $fd -translation binary -encoding utf-8
|
2007-05-08 05:35:48 +02:00
|
|
|
while {[gets $fd line] > 0} {
|
|
|
|
if {![regsub ^refs/tags/ $line {} name]} continue
|
|
|
|
lappend all_tags $name
|
|
|
|
}
|
|
|
|
close $fd
|
2007-07-05 06:07:11 +02:00
|
|
|
return $all_tags
|
2007-05-08 05:35:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
proc radio_selector {varname value args} {
|
|
|
|
upvar #0 $varname var
|
|
|
|
set var $value
|
|
|
|
}
|