git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mkoegler@auto.tuwien.ac.at (Martin Koegler)
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: git-gui Error
Date: Thu, 15 Feb 2007 07:07:12 +0100	[thread overview]
Message-ID: <20070215060712.GA3761@auto.tuwien.ac.at> (raw)
In-Reply-To: <20070215024014.GA29865@spearce.org>

On Wed, Feb 14, 2007 at 09:40:14PM -0500, Shawn O. Pearce wrote:
> Martin Koegler <mkoegler@auto.tuwien.ac.at> wrote:
> > --- git-gui.sh  2007-02-14 08:51:38.025781229 +0000
> > +++ git-gui     2007-02-14 10:50:13.618870598 +0000
> > @@ -1916,11 +1916,25 @@
> >         return [lsort -unique $all_trackings]
> >  }
> 
> Unfortunately this patch has severe whitespace damage.  All of the
> tabs were received here as spaces, so nothing applies.
> 
> >  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
> 
> The indentation does not line up here.  All of the existing context
> lines were indented with just one tab, until the whitespace damage
> noted above.

This time, the white spaces/tabs should be correct:

--- git-gui.sh	2007-02-14 09:51:38.025781229 +0100
+++ git-gui	2007-02-15 06:53:40.262295256 +0100
@@ -1916,11 +1916,25 @@
 	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
+	global create_branch_tag
 
 	set newbranch $create_branch_name
 	if {$newbranch eq {}
@@ -1959,6 +1973,7 @@
 	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"]}]} {
@@ -2015,6 +2030,7 @@
 	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
@@ -2078,6 +2094,19 @@
 			$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 \

mfg Martin Kögler

  reply	other threads:[~2007-02-15  6:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-13  6:56 git-gui Error Martin Koegler
2007-02-13  7:45 ` Shawn O. Pearce
2007-02-13 21:53   ` Martin Koegler
2007-02-14  2:22     ` Shawn O. Pearce
2007-02-14  6:00       ` Shawn O. Pearce
2007-02-14 17:46         ` Martin Koegler
2007-02-15  2:40           ` Shawn O. Pearce
2007-02-15  6:07             ` Martin Koegler [this message]
2007-02-15  6:38               ` Shawn O. Pearce
2007-02-14 18:09       ` Martin Koegler
2007-02-15  4:07         ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070215060712.GA3761@auto.tuwien.ac.at \
    --to=mkoegler@auto.tuwien.ac.at \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).