git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/UTF-8] gitk: properly deal with tag names containing / (slash)

From
Gerrit Pape <pape@smarden.org>
Date
Feb 11, 2008, 10:57 UTC
Message-ID
<20080211105741.16353.qmail@d33cfe7d8389ec.315fe32.mid.smarden.org>
In-Reply-To
<20080207093415.13241.qmail@945a2ee23beef0.315fe32.mid.smarden.org>

When creating a tag through gitk, and the tag name includes a slash (or slashes), gitk errors out in a popup window. This patch makes gitk use 'git tag' to create the tag instead of modifying files in refs/tags/, which fixes the issue; if 'git tag' throws an error, gitk pops up with the error message.

The problem was reported by Fr�d�ric Bri�re through
 http://bugs.debian.org/464104
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 gitk-git/gitk |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 5560e4d..00d791f 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -6137,11 +6137,7 @@ proc domktag {} {
 	return
     }
     if {[catch {
-	set dir [gitdir]
-	set fname [file join $dir "refs/tags" $tag]
-	set f [open $fname w]
-	puts $f $id
-	close $f
+	exec git tag $tag $id
     } err]} {
 	error_popup "[mc "Error creating tag:"] $err"
 	return
-- 
1.5.4
Previous: Gerrit PapeNext: Paul Mackerras
Message 4 of 5 in “gitk: properly deal with tag names containing / (slash)”
  1. gitk: properly deal with tag names containing / (slash)Gerrit Pape, Feb 6, 2008
  2. Junio C HamanoFeb 6, 2008
  3. gitk: properly deal with tag names containing / (slash)Gerrit Pape, Feb 7, 2008
  4. gitk: properly deal with tag names containing / (slash)Gerrit Pape, Feb 11, 2008
  5. Paul MackerrasFeb 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.