Add option to keep no-fileop svn commits with a changed property `svn:externals`
- Use case: some svn commits change only properties (in this case,
svn:externals
-- I've been manually creating .gitmodules blobs) - svn repository: https://josm.openstreetmap.de/osmsvn/
- Sample commit: https://josm.openstreetmap.de/changeset/2546/osm (
r2546
)
Sample script:
# Load the svn repo into reposurgeon; the dump filter used was `repocutter pathrename '^utils' 'trunk/utils' '^applications' 'trunk/applications' '^editors' 'trunk/editors'`.
# I saved the dump to josm_plugins.svn
% read --preserve <josm_plugins.svn
% <2546> list
Poor workaround:
diff --git a/surgeon/svnread.go b/surgeon/svnread.go
index c560d2d8..f2aa6a91 100644
--- a/surgeon/svnread.go
+++ b/surgeon/svnread.go
@@ -3058,6 +3058,9 @@ func svnProcessJunk(ctx context.Context, sp *StreamParser, options stringSet, ba
// Should the argument commit be tagified?
doignores := !options.Contains("--no-automatic-ignore")
tagifyable := func(commit *Commit) bool {
+ if preserve {
+ return false
+ }
// Tagify empty commits
if len(commit.operations()) == 0 {
return true
Additionally, add tagify
to the script (at the end, in my case) to remove the remaining empty commits.
TBH, I probably should look at modifying the code to autogenerate the .gitmodules and the directory data.