* [PATCH] Set correct date for tags.
@ 2007-06-21 2:15 Dave O'Neill
2007-06-21 2:52 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Dave O'Neill @ 2007-06-21 2:15 UTC (permalink / raw)
To: git; +Cc: Dave O'Neill
Without this, all tags show up as 'unknown' time in gitweb (and probably
elsewhere)
---
git-svnimport.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 7076f41..9526f3d 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -891,7 +891,7 @@ sub commit {
print $out ("object $cid\n".
"type commit\n".
"tag $dest\n".
- "tagger $committer_name <$committer_email> 0 +0000\n") and
+ "tagger $committer_name <$committer_email> $date +0000\n") and
close($out)
or die "Cannot create tag object $dest: $!\n";
--
1.5.2.2.239.g89630
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Set correct date for tags.
2007-06-21 2:15 [PATCH] Set correct date for tags Dave O'Neill
@ 2007-06-21 2:52 ` Junio C Hamano
2007-06-21 21:48 ` [PATCH] Generate tags with correct timestamp (git-svnimport) Dave O'Neill
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-06-21 2:52 UTC (permalink / raw)
To: Dave O'Neill; +Cc: git
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;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Generate tags with correct timestamp (git-svnimport)
2007-06-21 2:52 ` Junio C Hamano
@ 2007-06-21 21:48 ` Dave O'Neill
0 siblings, 0 replies; 3+ messages in thread
From: Dave O'Neill @ 2007-06-21 21:48 UTC (permalink / raw)
To: git; +Cc: Dave O'Neill
Now uses git-tag instead of manually constructing the tag. This gives us a
correct timestamp, removes some crufty code, and makes it work the same as
git-cvsimport.
The generated tags are now lightweight tags instead of tag objects, which may
or may not be the behaviour we want.
Also, remove two unused variables from git-cvsimport.
---
git-cvsimport.perl | 1 -
git-svnimport.perl | 24 ++----------------------
2 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 433b7fd..69ccb88 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -774,7 +774,6 @@ sub commit {
or die "Cannot write branch $branch for update: $!\n";
if ($tag) {
- my ($in, $out) = ('','');
my ($xtag) = $tag;
$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
$xtag =~ tr/_/\./ if ( $opt_u );
diff --git a/git-svnimport.perl b/git-svnimport.perl
index f459762..32832ad 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -868,33 +868,13 @@ sub commit {
}
if($tag) {
- my($in, $out) = ('','');
$last_rev = "-" if %$changed_paths;
# the tag was 'complex', i.e. did not refer to a "real" revision
$dest =~ tr/_/\./ if $opt_u;
- $branch = $dest;
-
- my $pid = open2($in, $out, 'git-mktag');
- print $out ("object $cid\n".
- "type commit\n".
- "tag $dest\n".
- "tagger $committer_name <$committer_email> 0 +0000\n") and
- close($out)
- or die "Cannot create tag object $dest: $!\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 $dest: $!\n";
- }
- open(C,">$git_dir/refs/tags/$dest") and
- print C ("$tagobj\n") and
- close(C)
- or die "Cannot create tag $branch: $!\n";
+ system('git-tag', $dest, $cid) == 0
+ or die "Cannot create tag $dest: $!\n";
print "Created tag '$dest' on '$branch'\n" if $opt_v;
}
--
1.5.2.2.239.g89630
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-06-21 21:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-21 2:15 [PATCH] Set correct date for tags Dave O'Neill
2007-06-21 2:52 ` Junio C Hamano
2007-06-21 21:48 ` [PATCH] Generate tags with correct timestamp (git-svnimport) Dave O'Neill
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).