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

Re: [PATCH] Set correct date for tags.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 21, 2007, 02:52 UTC
Message-ID
<7vzm2u3tov.fsf@assigned-by-dhcp.pobox.com>
In-Reply-To
<11823921031931-git-send-email-dmo@roaringpenguin.com>

I suspect (I haven't looked at the evolution history of these import scripts) this was copied from git-cvsimport.perl. I would prefer to fix it the same way as 5c08931, which looks like this:

commit 5c08931dfc9fa0acbf8667581e4c98d643e66dbe
Author: Elvis Pranskevichus <el@prans.net>
    Use git-tag in git-cvsimport
---
 git-cvsimport.perl |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 4e6c9c6..524c9bb 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -771,31 +771,9 @@ sub commit {
 		$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
 		$xtag =~ tr/_/\./ if ( $opt_u );
 		$xtag =~ s/[\/]/$opt_s/g;
-		
-		my $pid = open2($in, $out, 'git-mktag');
-		print $out "object $cid\n".
-		    "type commit\n".
-		    "tag $xtag\n".
-		    "tagger $author_name <$author_email>\n"
-		    or die "Cannot create tag object $xtag: $!\n";
-		close($out)
-		    or die "Cannot create tag object $xtag: $!\n";
-
-		my $tagobj = <$in>;
-		chomp $tagobj;
-
-		if ( !close($in) or waitpid($pid, 0) != $pid or
-		     $? != 0 or $tagobj !~ /^[0123456789abcdef]{40}$/ ) {
-		    die "Cannot create tag object $xtag: $!\n";
-	        }
-		
-
-		open(C,">$git_dir/refs/tags/$xtag")
+
+		system('git-tag', $xtag, $cid) == 0
 			or die "Cannot create tag $xtag: $!\n";
-		print C "$tagobj\n"
-			or die "Cannot write tag $xtag: $!\n";
-		close(C)
-			or die "Cannot write tag $xtag: $!\n";
 
 		print "Created tag '$xtag' on '$branch'\n" if $opt_v;
 	}
Previous: Dave O'NeillNext: Dave O'Neill
Message 2 of 3 in “Set correct date for tags.”
  1. Set correct date for tags.Dave O'Neill, Jun 21, 2007
  2. Junio C HamanoJun 21, 2007
  3. Generate tags with correct timestamp (git-svnimport)Dave O'Neill, Jun 21, 2007

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.