Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an advantage to using --no-metadata in git svn clone?

I'm doing a one-way convert from an SVN repository to a Git repository using git svn clone. Most examples do this with the --no-metadata flag - is there an advantage to using this flag?

I understand that the flag removes the SVN revision numbers. I can think of reasons why it may be useful to keep these around (such as referring back to specific commits mentioned in bug tracking software).

What are the arguments for using the --no-metadata flag? Is there any benefit other than a sensation of breaking all ties?

like image 594
Eric Avatar asked Nov 30 '11 22:11

Eric


People also ask

What is SVN metadata?

Subversion metadata directory (. svn) was found on your any website. The metadata is used to keep track of all the changes in the source code of the application before it is committed to the central repository. The . svn gets ended up on the live server if the files are copied directly from the repository.

Which feature of Git makes attractive over SVN?

Git has the advantage that it's MUCH better suited if some developers are not always connected to the master repository. Also, it's much faster than SVN. And from what I hear, branching and merging support is a lot better (which is to be expected, as these are the core reasons it was written).

What are the advantages of SVN?

SVN also enables you to quickly retrieve versions of a code repository through the checkout process. While SVN doesn't support nested repositories, you can still retrieve and combine changes found in multiple code repositories into one working copy of the code using the command svn:externals.

What does git SVN clone do?

The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.

How do I rebuild a Git SVN repository with no metadata?

In a repository where the noMetadata option is not set, this can be rebuilt from the git-svn-id: lines that are at the end of every commit (see the svn.noMetadata section above for details). git svn fetch and git svn rebase automatically update the rev_map if it is missing or not up to date. git svn reset automatically rewinds it.

What is gitgit SVN?

git svn is a simple conduit for changesets between Subversion and Git. It provides a bidirectional flow of changes between a Subversion and a Git repository. git svn can track a standard Subversion repository, following the common trunk/branches/tags layout, with the --stdlayout option.

How does Git SVN clone-s work?

git svn clone -s will then create a branch sub. It will also create new Git commits for r.100 through r.199 and use these as the history of branch sub. Thus there will be two Git commits for each revision from r.100 to r.199 (one

Is the import by Git SVN accurate?

The import by git svn does a valiant job; however, there are some additional steps that can be taken to perform a more accurate import that cleans up and reformats the history information to look more like Git history. First, let’s look at the author information.


1 Answers

One argument for using --no-metadata is that it doesn't change your commit messages. So even if you fetch from different locations, the commit messages will be the same and thus the commit hashes will be the same.

As an example, if I git svn init a repo from a local file: URL and later pull from an https: URL, every commit in the repo will be duplicated, since all of the commits with git-svn-id: file:///... will be fetched as git-svn-id: https:///... and encoded with new SHA1's.

If I specify --no-metadata then the commit message and this sha1 has will be the same and I can fetch from either the local filesystem or the subversion server because there will only be a single copy of any given svn commit in the git repo.

Personally I would prefer it if there were a minimal metadata option, which recorded the subversion revision id, but not the full metadata, but without messing around with git-filter-branch we are stuck with all or nothing.

like image 61
Mark Booth Avatar answered Sep 21 '22 15:09

Mark Booth