Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

git - How do I remove an SVN tag completely that contains spaces?

I tried to clean up the svn repository and remove a tag that contains a space, so all tags and branches are git conform:

PROJECT=myproject
svnrepo=svn+ssh://[email protected]/var/svn-repos/$PROJECT
svn rm "$svnrepo/tags/version 3.6.2"

but it seems, that doesn't do the job here: How do I convert an svn repo to git using reposurgeon?

How do I remove it entirely?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You have to supply commit log message when you use svn rm to delete the file in remote repository. When doing delete, rename, copy etc via URL, the action results into immediate commit, i.e. new revision in SVN repository which log message is required.

So the command should be :

PROJECT=myproject
svnrepo=svn+ssh://[email protected]/var/svn-repos/$PROJECT
svn rm -m "Removed the tag" "$svnrepo/tags/version 3.6.2"

Beware that using svn rm will not remove the tag completely. The revision where this tag was created will still exist in repository history.

The only option to remove the path completely is to filter the repository history with svndumpfilter tool:

  1. Dump the repository using svnadmin dump /var/svn-repos/$PROJECT > /tmp/$PROJECT.dump
  2. Filter the repository history using svndumpfilter:

    svndumpfilter exclude "tags/version 3.6.2" --drop-empty-revs < /tmp/$PROJECT.dump > /tmp/filtered.dump 2>/tmp/filterlog.txt

  3. Look though the filterlog.txt to make sure that the history filtration has completed as expected.

  4. Create new empty repository using svnadmin create command.

  5. Load the filtered dump to the new repository using svnadmin load command. The repository will have the whole history but commits related to "tags/version 3.6.2" do not exist anymore.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...