{"thread":{"id":"8666","subject":"[PATCH] Set correct date for tags.","startedAt":"2007-06-21T02:15:03Z","lastAt":"2007-06-21T21:48:56Z","messageCount":3,"participants":["Dave O'Neill","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45454","messageId":"11823921031931-git-send-email-dmo@roaringpenguin.com","threadId":"8666","inReplyTo":null,"subject":"[PATCH] Set correct date for tags.","fromName":"Dave O'Neill","fromEmail":"dmo@roaringpenguin.com","sentAt":"2007-06-21T02:15:03Z","receivedAt":"2007-06-21T02:15:03Z","isPatch":true,"sender":{"key":"dmo@roaringpenguin.com","avatar":null},"body":"Without this, all tags show up as 'unknown' time in gitweb (and probably\nelsewhere)\n---\n git-svnimport.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 7076f41..9526f3d 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -891,7 +891,7 @@ sub commit {\n \t\tprint $out (\"object $cid\\n\".\n \t\t    \"type commit\\n\".\n \t\t    \"tag $dest\\n\".\n-\t\t    \"tagger $committer_name <$committer_email> 0 +0000\\n\") and\n+\t\t    \"tagger $committer_name <$committer_email> $date +0000\\n\") and\n \t\tclose($out)\n \t\t    or die \"Cannot create tag object $dest: $!\\n\";\n \n-- \n1.5.2.2.239.g89630\n"},{"id":"45456","messageId":"7vzm2u3tov.fsf@assigned-by-dhcp.pobox.com","threadId":"8666","inReplyTo":"11823921031931-git-send-email-dmo@roaringpenguin.com","subject":"Re: [PATCH] Set correct date for tags.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-21T02:52:32Z","receivedAt":"2007-06-21T02:52:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I suspect (I haven't looked at the evolution history of these\nimport scripts) this was copied from git-cvsimport.perl.  I\nwould prefer to fix it the same way as 5c08931, which looks like\nthis:\n\ncommit 5c08931dfc9fa0acbf8667581e4c98d643e66dbe\nAuthor: Elvis Pranskevichus <el@prans.net>\n\n    Use git-tag in git-cvsimport\n---\n git-cvsimport.perl |   26 ++------------------------\n 1 files changed, 2 insertions(+), 24 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 4e6c9c6..524c9bb 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -771,31 +771,9 @@ sub commit {\n \t\t$xtag =~ s/\\s+\\*\\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **\n \t\t$xtag =~ tr/_/\\./ if ( $opt_u );\n \t\t$xtag =~ s/[\\/]/$opt_s/g;\n-\t\t\n-\t\tmy $pid = open2($in, $out, 'git-mktag');\n-\t\tprint $out \"object $cid\\n\".\n-\t\t    \"type commit\\n\".\n-\t\t    \"tag $xtag\\n\".\n-\t\t    \"tagger $author_name <$author_email>\\n\"\n-\t\t    or die \"Cannot create tag object $xtag: $!\\n\";\n-\t\tclose($out)\n-\t\t    or die \"Cannot create tag object $xtag: $!\\n\";\n-\n-\t\tmy $tagobj = <$in>;\n-\t\tchomp $tagobj;\n-\n-\t\tif ( !close($in) or waitpid($pid, 0) != $pid or\n-\t\t     $? != 0 or $tagobj !~ /^[0123456789abcdef]{40}$/ ) {\n-\t\t    die \"Cannot create tag object $xtag: $!\\n\";\n-\t        }\n-\t\t\n-\n-\t\topen(C,\">$git_dir/refs/tags/$xtag\")\n+\n+\t\tsystem('git-tag', $xtag, $cid) == 0\n \t\t\tor die \"Cannot create tag $xtag: $!\\n\";\n-\t\tprint C \"$tagobj\\n\"\n-\t\t\tor die \"Cannot write tag $xtag: $!\\n\";\n-\t\tclose(C)\n-\t\t\tor die \"Cannot write tag $xtag: $!\\n\";\n \n \t\tprint \"Created tag '$xtag' on '$branch'\\n\" if $opt_v;\n \t}\n"},{"id":"45528","messageId":"11824625361092-git-send-email-dmo@roaringpenguin.com","threadId":"8666","inReplyTo":"7vzm2u3tov.fsf@assigned-by-dhcp.pobox.com","subject":"[PATCH] Generate tags with correct timestamp (git-svnimport)","fromName":"Dave O'Neill","fromEmail":"dmo@roaringpenguin.com","sentAt":"2007-06-21T21:48:56Z","receivedAt":"2007-06-21T21:48:56Z","isPatch":true,"sender":{"key":"dmo@roaringpenguin.com","avatar":null},"body":"Now uses git-tag instead of manually constructing the tag.  This gives us a\ncorrect timestamp, removes some crufty code, and makes it work the same as\ngit-cvsimport.\n\nThe generated tags are now lightweight tags instead of tag objects, which may\nor may not be the behaviour we want.\n\nAlso, remove two unused variables from git-cvsimport.\n---\n git-cvsimport.perl |    1 -\n git-svnimport.perl |   24 ++----------------------\n 2 files changed, 2 insertions(+), 23 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 433b7fd..69ccb88 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -774,7 +774,6 @@ sub commit {\n \t\tor die \"Cannot write branch $branch for update: $!\\n\";\n \n \tif ($tag) {\n-\t\tmy ($in, $out) = ('','');\n \t        my ($xtag) = $tag;\n \t\t$xtag =~ s/\\s+\\*\\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **\n \t\t$xtag =~ tr/_/\\./ if ( $opt_u );\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex f459762..32832ad 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -868,33 +868,13 @@ sub commit {\n \t}\n \n \tif($tag) {\n-\t\tmy($in, $out) = ('','');\n \t\t$last_rev = \"-\" if %$changed_paths;\n \t\t# the tag was 'complex', i.e. did not refer to a \"real\" revision\n \n \t\t$dest =~ tr/_/\\./ if $opt_u;\n-\t\t$branch = $dest;\n-\n-\t\tmy $pid = open2($in, $out, 'git-mktag');\n-\t\tprint $out (\"object $cid\\n\".\n-\t\t    \"type commit\\n\".\n-\t\t    \"tag $dest\\n\".\n-\t\t    \"tagger $committer_name <$committer_email> 0 +0000\\n\") and\n-\t\tclose($out)\n-\t\t    or die \"Cannot create tag object $dest: $!\\n\";\n-\n-\t\tmy $tagobj = <$in>;\n-\t\tchomp $tagobj;\n-\n-\t\tif ( !close($in) or waitpid($pid, 0) != $pid or\n-\t\t\t\t$? != 0 or $tagobj !~ /^[0123456789abcdef]{40}$/ ) {\n-\t\t\tdie \"Cannot create tag object $dest: $!\\n\";\n-\t\t}\n \n-\t\topen(C,\">$git_dir/refs/tags/$dest\") and\n-\t\tprint C (\"$tagobj\\n\") and\n-\t\tclose(C)\n-\t\t\tor die \"Cannot create tag $branch: $!\\n\";\n+\t\tsystem('git-tag', $dest, $cid) == 0\n+\t\t\tor die \"Cannot create tag $dest: $!\\n\";\n \n \t\tprint \"Created tag '$dest' on '$branch'\\n\" if $opt_v;\n \t}\n-- \n1.5.2.2.239.g89630\n"}]}