Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-gui: Create new branches from a tag.
author
Martin Koegler
<mkoegler@auto.tuwien.ac.at>
Thu, 15 Feb 2007 06:28:34 +0000
(
01:28
-0500)
committer
Shawn O. Pearce
<spearce@spearce.org>
Thu, 15 Feb 2007 06:34:40 +0000
(
01:34
-0500)
I'm missing the possibility to base a new branch on a tag.
The following adds a tag drop down to the new branch dialog.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
26370f7
)
diff --git
a/git-gui.sh
b/git-gui.sh
index 04afb36343410ca235b2fd5b8b8b4b7b8859d931..9ce5a3bdc3805ed0054ee1c3a7b1cd1d06a9e8c1 100755
(executable)
--- a/
git-gui.sh
+++ b/
git-gui.sh
@@
-1916,11
+1916,24
@@
proc all_tracking_branches {} {
return [lsort -unique $all_trackings]
}
return [lsort -unique $all_trackings]
}
+proc load_all_tags {} {
+ set all_tags [list]
+ set fd [open "| git for-each-ref --format=%(refname) refs/tags" r]
+ while {[gets $fd line] > 0} {
+ if {![regsub ^refs/tags/ $line {} name]} continue
+ lappend all_tags $name
+ }
+ close $fd
+
+ return [lsort $all_tags]
+}
+
proc do_create_branch_action {w} {
global all_heads null_sha1 repo_config
global create_branch_checkout create_branch_revtype
global create_branch_head create_branch_trackinghead
global create_branch_name create_branch_revexp
proc do_create_branch_action {w} {
global all_heads null_sha1 repo_config
global create_branch_checkout create_branch_revtype
global create_branch_head create_branch_trackinghead
global create_branch_name create_branch_revexp
+ global create_branch_tag
set newbranch $create_branch_name
if {$newbranch eq {}
set newbranch $create_branch_name
if {$newbranch eq {}
@@
-1959,6
+1972,7
@@
proc do_create_branch_action {w} {
switch -- $create_branch_revtype {
head {set rev $create_branch_head}
tracking {set rev $create_branch_trackinghead}
switch -- $create_branch_revtype {
head {set rev $create_branch_head}
tracking {set rev $create_branch_trackinghead}
+ tag {set rev $create_branch_tag}
expression {set rev $create_branch_revexp}
}
if {[catch {set cmt [git rev-parse --verify "${rev}^0"]}]} {
expression {set rev $create_branch_revexp}
}
if {[catch {set cmt [git rev-parse --verify "${rev}^0"]}]} {
@@
-2004,6
+2018,8
@@
trace add variable create_branch_head write \
[list radio_selector create_branch_revtype head]
trace add variable create_branch_trackinghead write \
[list radio_selector create_branch_revtype tracking]
[list radio_selector create_branch_revtype head]
trace add variable create_branch_trackinghead write \
[list radio_selector create_branch_revtype tracking]
+trace add variable create_branch_tag write \
+ [list radio_selector create_branch_revtype tag]
trace add variable delete_branch_head write \
[list radio_selector delete_branch_checktype head]
trace add variable delete_branch_head write \
[list radio_selector delete_branch_checktype head]
@@
-2015,6
+2031,7
@@
proc do_create_branch {} {
global create_branch_checkout create_branch_revtype
global create_branch_head create_branch_trackinghead
global create_branch_name create_branch_revexp
global create_branch_checkout create_branch_revtype
global create_branch_head create_branch_trackinghead
global create_branch_name create_branch_revexp
+ global create_branch_tag
set w .branch_editor
toplevel $w
set w .branch_editor
toplevel $w
@@
-2078,6
+2095,19
@@
proc do_create_branch {} {
$all_trackings
grid $w.from.tracking_r $w.from.tracking_m -sticky w
}
$all_trackings
grid $w.from.tracking_r $w.from.tracking_m -sticky w
}
+ set all_tags [load_all_tags]
+ if {$all_tags ne {}} {
+ set create_branch_tag [lindex $all_tags 0]
+ radiobutton $w.from.tag_r \
+ -text {Tag:} \
+ -value tag \
+ -variable create_branch_revtype \
+ -font font_ui
+ eval tk_optionMenu $w.from.tag_m \
+ create_branch_tag \
+ $all_tags
+ grid $w.from.tag_r $w.from.tag_m -sticky w
+ }
radiobutton $w.from.exp_r \
-text {Revision Expression:} \
-value expression \
radiobutton $w.from.exp_r \
-text {Revision Expression:} \
-value expression \