1
0
mirror of https://github.com/git/git.git synced 2024-11-18 20:13:59 +01:00
git/git-gui/lib/branch.tcl
Junio C Hamano b9dcf846e2 Merge commit 'git-gui/master'
* commit 'git-gui/master': (36 commits)
  git-gui: Change prior tree SHA-1 verification to use git_read
  git-gui: Include a space in Cygwin shortcut command lines
  git-gui: Use sh.exe in Cygwin shortcuts
  git-gui: Paper bag fix for Cygwin shortcut creation
  git-gui: Improve the Windows and Mac OS X shortcut creators
  git-gui: Teach console widget to use git_read
  git-gui: Perform our own magic shbang detection on Windows
  git-gui: Treat `git version` as `git --version`
  git-gui: Assume unfound commands are known by git wrapper
  git-gui: Correct gitk installation location
  git-gui: Always use absolute path to all git executables
  git-gui: Show a progress meter for checking out files
  git-gui: Change the main window progress bar to use status_bar
  git-gui: Extract blame viewer status bar into mega-widget
  git-gui: Allow double-click in checkout dialog to start checkout
  git-gui: Default selection to first matching ref
  git-gui: Unabbreviate commit SHA-1s prior to display
  git-gui: Refactor branch switch to support detached head
  git-gui: Refactor our ui_status_value update technique
  git-gui: Better handling of detached HEAD
  ...
2007-07-12 14:14:51 -07:00

39 lines
839 B
Tcl

# git-gui branch (create/delete) support
# Copyright (C) 2006, 2007 Shawn Pearce
proc load_all_heads {} {
global some_heads_tracking
set rh refs/heads
set rh_len [expr {[string length $rh] + 1}]
set all_heads [list]
set fd [git_read for-each-ref --format=%(refname) $rh]
while {[gets $fd line] > 0} {
if {!$some_heads_tracking || ![is_tracking_branch $line]} {
lappend all_heads [string range $line $rh_len end]
}
}
close $fd
return [lsort $all_heads]
}
proc load_all_tags {} {
set all_tags [list]
set fd [git_read for-each-ref \
--sort=-taggerdate \
--format=%(refname) \
refs/tags]
while {[gets $fd line] > 0} {
if {![regsub ^refs/tags/ $line {} name]} continue
lappend all_tags $name
}
close $fd
return $all_tags
}
proc radio_selector {varname value args} {
upvar #0 $varname var
set var $value
}