git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [updated PATCH] Protect current tags, import tags into remote tree
@ 2008-04-27 17:32 Stephen R. van den Berg
  2008-04-28 16:12 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen R. van den Berg @ 2008-04-27 17:32 UTC (permalink / raw)
  To: git

git-cvsimport properly creates a subdir in refs/remotes to put the
branches in from the remote repository, it currently stores any tags
directly in refs/tags, which makes the imported tags overwrite current
ones.  This patch makes sure that imported tags are under the proper
refs/remotes/.../tags subdirectory as well.

Signed-off-by: Stephen R. van den Berg <srb@cuci.nl>
---

 git-cvsimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 95c5eec..73109d6 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -781,7 +781,7 @@ sub commit {
 		$xtag =~ tr/_/\./ if ( $opt_u );
 		$xtag =~ s/[\/]/$opt_s/g;
 
-		system('git-tag', '-f', $xtag, $cid) == 0
+		system("git-update-ref $remote/tags/$xtag $cid") == 0
 			or die "Cannot create tag $xtag: $!\n";
 
 		print "Created tag '$xtag' on '$branch'\n" if $opt_v;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [updated PATCH] Protect current tags, import tags into remote tree
  2008-04-27 17:32 [updated PATCH] Protect current tags, import tags into remote tree Stephen R. van den Berg
@ 2008-04-28 16:12 ` Junio C Hamano
  2008-04-28 18:48   ` Stephen R. van den Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-04-28 16:12 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git

"Stephen R. van den Berg" <srb@cuci.nl> writes:

> ..., it currently stores any tags
> directly in refs/tags,...

which is consistent with the way all the native Porcelain commands handle
tags.  There is no per-remote namespace for tags in git Porcelain.

For some people, the patch would be an improvement, but for some other
people, this would be a regression.

It needs discussion and concensus if we were to do this; currently I am
not very much in favor of this change.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [updated PATCH] Protect current tags, import tags into remote tree
  2008-04-28 16:12 ` Junio C Hamano
@ 2008-04-28 18:48   ` Stephen R. van den Berg
  2008-04-29  6:18     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen R. van den Berg @ 2008-04-28 18:48 UTC (permalink / raw)
  To: git

Junio C Hamano wrote:
>"Stephen R. van den Berg" <srb@cuci.nl> writes:

>> ..., it currently stores any tags
>> directly in refs/tags,...

>which is consistent with the way all the native Porcelain commands handle
>tags.  There is no per-remote namespace for tags in git Porcelain.

There is in git-svn.

>For some people, the patch would be an improvement, but for some other
>people, this would be a regression.

Due to the quirks of CVS (and SVN), over time many CVS/SVN repositories
have picked up a lot of tags which either made sense at the time (but
don't anymore), or have not been wiped because of the
difficulty/impossibility to do so in the old repository.

The usual way to import from CVS is to do the import, then pick the
branches and tags you really want to keep, copy/replicate them outside
remotes and then move on in a clean fashion.

Rerunning cvsimport on a regular basis causes the import to (re)create
all the tags from CVS again; if this is done in your regular tags space,
this is a mess at best, or overwrites whatever renamed tags you
carefully created which happen to match with old CVS tagnames.

git-svn *does* use the tags namespace under remotes, so it does it the
'proper' way.
With respect to the concern that all git porcelain works without a
separate remotes/.../tags namespace, two things:
- git-svn and git-cvsimport cross the boundary to a different VCS and
  therefore can/should use an extra barrier before (auto)converting to
  git native tags (and branches).
- I personally would find it most natural when upon cloning a git
  repository not only the branches cloned end up in a separate remotes
  namespace (like they do now already), but that the tags would do the same
  (e.g. in remotes/.../tags).

Even if this behaviour is not deemed "good" to be a new default, I'd
strongly suggest to at least make it optional using an appropriate flag
(and respective git-config variable to make it the local default).
-- 
Sincerely,                                                          srb@cuci.nl
           Stephen R. van den Berg.
"It is better for civilization to be going down the drain than
 to be coming up it."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [updated PATCH] Protect current tags, import tags into remote tree
  2008-04-28 18:48   ` Stephen R. van den Berg
@ 2008-04-29  6:18     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2008-04-29  6:18 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git

"Stephen R. van den Berg" <srb@cuci.nl> writes:

> Rerunning cvsimport on a regular basis causes the import to (re)create
> all the tags from CVS again; if this is done in your regular tags space,
> this is a mess at best, or overwrites whatever renamed tags you
> carefully created which happen to match with old CVS tagnames.
> ...
> - git-svn and git-cvsimport cross the boundary to a different VCS and
>   therefore can/should use an extra barrier before (auto)converting to
>   git native tags (and branches).

That sounds like a sound argument, and perhaps people may wish we did so
from the day one.  Alas, we didn't.

So the course of action would be to do these over a long period of time.

 - introduce this as an option now;

 - give another option to explicitly ask for the current behaviour;

 - perhaps give an advance warning that this optional behaviour will
   become the default; and

 - finally swap the default behaviour.

if people agree with this change, that is.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-29  6:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-27 17:32 [updated PATCH] Protect current tags, import tags into remote tree Stephen R. van den Berg
2008-04-28 16:12 ` Junio C Hamano
2008-04-28 18:48   ` Stephen R. van den Berg
2008-04-29  6:18     ` Junio C Hamano

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).