Fossil SCM

Added the "Converting Repositories on Windows" section to the inout doc to cover a problem case involving PowerShell and to give solutions.

wyoung 2023-09-11 08:16 trunk
Commit 19c347b460042460fd06f47abb89d2a98dfea4298f471ef6ec4f183e116e6b66
1 file changed +36 -3
+36 -3
--- www/inout.wiki
+++ www/inout.wiki
@@ -6,19 +6,18 @@
66
import/export a Fossil repository to most version control systems using
77
Git as an intermediary.
88
99
<h2>Git → Fossil</h2>
1010
11
-To import a Git repository into Fossil, run commands like this:
11
+To import a Git repository into Fossil, say something like:
1212
1313
<blockquote><pre>
1414
cd git-repo
1515
git fast-export --all | fossil import --git new-repo.fossil
1616
</pre></blockquote>
1717
18
-In other words, simply pipe the output of the "git fast-export" command
19
-into the "fossil import --git" command. The 3rd argument to the "fossil import"
18
+The 3rd argument to the "fossil import"
2019
command is the name of a new Fossil repository that is created to hold the Git
2120
content.
2221
2322
The --git option is not actually required. The git-fast-export file format
2423
is currently the only VCS interchange format that Fossil understands. But
@@ -33,10 +32,44 @@
3332
[/help?cmd=import | <code>--attribute</code>] option can be passed to have all
3433
commits by a given committer attributed to a desired username. This will create
3534
and populate the new <code>fx_git</code> table in the repository database to
3635
maintain a record of correspondent usernames and email addresses that can be
3736
used in subsequent exports or incremental imports.
37
+
38
+<h3>Converting Repositories on Windows</h3>
39
+
40
+The above commands work best on proper POSIX systems like Linux, macOS,
41
+and the BSDs, where everything <tt>git</tt> sends is consumed by
42
+<tt>fossil</tt> as soon as it can manage, with both programs working
43
+concurrently.
44
+
45
+Windows has problems in this area which we can trace back to MS-DOS,
46
+where <tt>command.com</tt> emulated pipes in terms of temporary files.
47
+The source program's output was written to disk, and only when that
48
+executable stopped was the consuming program launched, with its input
49
+silently redirected in from the temporary file in the background. This
50
+problem isn't likely to affect you these days unless you boot up an old
51
+copy of Windows 98 or similar, being DOS-based, thus having
52
+<tt>command.com</tt> as its shell.
53
+
54
+You may therefore wonder why we dig this historical fact up. Didn't
55
+Microsoft correct that in rebuilding their shell as <tt>cmd.exe</tt> for
56
+the Windows NT era? Yes, they did, but they then went and broke this
57
+underlying assumption <i>again</i> when they later designed PowerShell.
58
+Because PS wants to believe everything is an object stream between .NET
59
+programs and thus needs to translate expected data formats between them,
60
+it falls down when you try to run a command like the above when the size
61
+of the translated repository is greater than the size of available
62
+memory. PowerShell tries to load the entire fast-export output before
63
+sending it out to "<tt>fossil import</tt>," and that only works on
64
+sufficiently small repositories.
65
+
66
+Mirosoft's own [https://learn.microsoft.com/en-us/windows/wsl/ | Windows
67
+Subsystem for Linux] solves this problem, as do userspace clones like
68
+Cygwin and the MSYS2 underpinnings of the two major "Git for Windows"
69
+products. You may successfully use any of these systems to do the
70
+conversion directly.
3871
3972
<h2>Fossil → Git</h2>
4073
4174
To convert a Fossil repository into a Git repository, run commands like
4275
this:
4376
--- www/inout.wiki
+++ www/inout.wiki
@@ -6,19 +6,18 @@
6 import/export a Fossil repository to most version control systems using
7 Git as an intermediary.
8
9 <h2>Git → Fossil</h2>
10
11 To import a Git repository into Fossil, run commands like this:
12
13 <blockquote><pre>
14 cd git-repo
15 git fast-export --all | fossil import --git new-repo.fossil
16 </pre></blockquote>
17
18 In other words, simply pipe the output of the "git fast-export" command
19 into the "fossil import --git" command. The 3rd argument to the "fossil import"
20 command is the name of a new Fossil repository that is created to hold the Git
21 content.
22
23 The --git option is not actually required. The git-fast-export file format
24 is currently the only VCS interchange format that Fossil understands. But
@@ -33,10 +32,44 @@
33 [/help?cmd=import | <code>--attribute</code>] option can be passed to have all
34 commits by a given committer attributed to a desired username. This will create
35 and populate the new <code>fx_git</code> table in the repository database to
36 maintain a record of correspondent usernames and email addresses that can be
37 used in subsequent exports or incremental imports.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
39 <h2>Fossil → Git</h2>
40
41 To convert a Fossil repository into a Git repository, run commands like
42 this:
43
--- www/inout.wiki
+++ www/inout.wiki
@@ -6,19 +6,18 @@
6 import/export a Fossil repository to most version control systems using
7 Git as an intermediary.
8
9 <h2>Git → Fossil</h2>
10
11 To import a Git repository into Fossil, say something like:
12
13 <blockquote><pre>
14 cd git-repo
15 git fast-export --all | fossil import --git new-repo.fossil
16 </pre></blockquote>
17
18 The 3rd argument to the "fossil import"
 
19 command is the name of a new Fossil repository that is created to hold the Git
20 content.
21
22 The --git option is not actually required. The git-fast-export file format
23 is currently the only VCS interchange format that Fossil understands. But
@@ -33,10 +32,44 @@
32 [/help?cmd=import | <code>--attribute</code>] option can be passed to have all
33 commits by a given committer attributed to a desired username. This will create
34 and populate the new <code>fx_git</code> table in the repository database to
35 maintain a record of correspondent usernames and email addresses that can be
36 used in subsequent exports or incremental imports.
37
38 <h3>Converting Repositories on Windows</h3>
39
40 The above commands work best on proper POSIX systems like Linux, macOS,
41 and the BSDs, where everything <tt>git</tt> sends is consumed by
42 <tt>fossil</tt> as soon as it can manage, with both programs working
43 concurrently.
44
45 Windows has problems in this area which we can trace back to MS-DOS,
46 where <tt>command.com</tt> emulated pipes in terms of temporary files.
47 The source program's output was written to disk, and only when that
48 executable stopped was the consuming program launched, with its input
49 silently redirected in from the temporary file in the background. This
50 problem isn't likely to affect you these days unless you boot up an old
51 copy of Windows 98 or similar, being DOS-based, thus having
52 <tt>command.com</tt> as its shell.
53
54 You may therefore wonder why we dig this historical fact up. Didn't
55 Microsoft correct that in rebuilding their shell as <tt>cmd.exe</tt> for
56 the Windows NT era? Yes, they did, but they then went and broke this
57 underlying assumption <i>again</i> when they later designed PowerShell.
58 Because PS wants to believe everything is an object stream between .NET
59 programs and thus needs to translate expected data formats between them,
60 it falls down when you try to run a command like the above when the size
61 of the translated repository is greater than the size of available
62 memory. PowerShell tries to load the entire fast-export output before
63 sending it out to "<tt>fossil import</tt>," and that only works on
64 sufficiently small repositories.
65
66 Mirosoft's own [https://learn.microsoft.com/en-us/windows/wsl/ | Windows
67 Subsystem for Linux] solves this problem, as do userspace clones like
68 Cygwin and the MSYS2 underpinnings of the two major "Git for Windows"
69 products. You may successfully use any of these systems to do the
70 conversion directly.
71
72 <h2>Fossil → Git</h2>
73
74 To convert a Fossil repository into a Git repository, run commands like
75 this:
76

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button