Reposurgeon: Difference between revisions

No edit summary
m tag tools
 
(5 intermediate revisions by 3 users not shown)
Line 6: Line 6:


[http://esr.ibiblio.org/?p=4071 From January 2012]:
[http://esr.ibiblio.org/?p=4071 From January 2012]:
<blockquote>One of my requirements was that the user should not have to declare the branch structure! be able to read the detailed rules on reposurgeon 2.manual page; the short version is that if trunk is present, then trunk, branches/*, and tags/* are treated as candidate branches, and so is every other directory immediately under the repository root. But: a candidate branch is turned into a tag if there are no commits after the copy that created it.
<blockquote>One of my requirements was that the user should not have to declare the branch structure! You'll be able to read the detailed rules on reposurgeon 2.0's manual page; the short version is that if trunk is present, then trunk, branches/*, and tags/* are treated as candidate branches, and so is every other directory immediately under the repository root. But: a candidate branch is turned into a tag if there are no commits after the copy that created it.
</blockquote>
</blockquote>


Line 21: Line 21:


grundlett@hq-1:~$ cat bin/reposurgeon-myheart.sh
grundlett@hq-1:~$ cat bin/reposurgeon-myheart.sh
<source lang="bash">
<syntaxhighlight lang="bash">
#!/bin/bash
#!/bin/bash
PROJECT=myheart
PROJECT=myheart
Line 57: Line 57:
  --prune-empty --tag-name-filter cat -- --all
  --prune-empty --tag-name-filter cat -- --all


</source>
</syntaxhighlight>


Why does reposurgeon generate .gitignore files<ref>http://www.catb.org/~esr/reposurgeon/dvcs-migration-guide.html</ref>?  Partly because it converts <code>svn:ignore</code> properties.  Partly because some tools (git-svn) introduce .gitignore files to the svn repo.  I also believe it may have to do with empty directory commits.<ref>https://stackoverflow.com/questions/22822020/convert-an-svn-repository-to-git-with-reposurgeon-without-creating-gitignore-fi</ref>
Why does reposurgeon generate .gitignore files<ref>http://www.catb.org/~esr/reposurgeon/dvcs-migration-guide.html</ref>?  Partly because it converts <code>svn:ignore</code> properties.  Partly because some tools ([[git-svn]]) introduce .gitignore files to the svn repo.  I also believe it may have to do with empty directory commits.<ref>https://stackoverflow.com/questions/22822020/convert-an-svn-repository-to-git-with-reposurgeon-without-creating-gitignore-fi</ref>


See below for a description of the <code>git filter-branch</code> command  
See below for a description of the <code>git filter-branch</code> command  
Line 72: Line 72:
<ul>
<ul>
<li>drop all empty changesets
<li>drop all empty changesets
<source lang="bash">
<syntaxhighlight lang="bash">
git filter-branch --commit-filter 'git_commit_non_empty_tree "$@"'
git filter-branch --commit-filter 'git_commit_non_empty_tree "$@"'
</source>
</syntaxhighlight>
</ul>
</ul>


== Verification ==
== Verification ==
List branches sorted by date
List branches sorted by date
<source lang="bash">
<syntaxhighlight lang="bash">
git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/
git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/
</source>
</syntaxhighlight>


== Other ==  
== Other ==  


* [https://svn.apache.org/repos/asf/subversion/trunk/contrib/server-side/svncutter/svncutter svncutter] is another tool, written in Python, by Eric Raymond.  svncutter is for stream surgery on SVN dump files.
* [https://svn.apache.org/repos/asf/subversion/trunk/contrib/server-side/svncutter/svncutter svncutter] is another tool, written in Python, by Eric Raymond.  svncutter is for stream surgery on SVN dump files.
* [http://www.catb.org/~esr/reposurgeon/repopuller.html repopuller] comes with reposurgeon
* [http://www.catb.org/~esr/reposurgeon/repopuller.html repopuller] comes with reposurgeon, and is a bash script for using <code>svnsync</code> to create a repo 'mirror' that can be used for reposurgery without having to hit the production repository.


{{References}}
{{References}}
[[Category:Version Control]]
[[Category:Git]]
[[Category:Project Management]]
[[Category:Tools]]