..:: AsmBB ::..: Bazaar model with Fossil SCM.
<img src="https://board.asm32.info/images/title.svg" alt="Title img">
<h1>AsmBB is ultrafast web forum, written entirely in assembly language. This site is the official support development forum and demo/test installation.</h1>
tag:board.asm32.info,2018-03-06:Thread2692019-03-23T08:24:37Zjohnfound on Bazaar model with Fossil SCM.tag:board.asm32.info,2018-03-06:Post157862019-03-23T08:24:37Z
<p>This article is an attempt to define a <a href="https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar">bazaar model</a> workflow for accepting contributions in AsmBB project.
</p>
<p>The main problem with this workflow is that most of the projects that use Fossil actually use the cathedral model of development. This way, the most of the developed workflows and best practices are related to the cathedral model of development.
</p>
<p>But as long as fossil is really great tool, it deserves to be used more widely. And it actually has the features needed for the bazaar model.
</p>
<p>The most important difference of this workflow, compared with the simple files exchange is that when merged to the repository, all the changes will be labeled with the authors name and will have the original authors comments and the normal development history. This way helping in the future development.
</p>
<p>Notice, that the below workflow is created in accordance with my understanding of fossil. It can be edited in the future, if something works not as expected.
</p>
<p>On the other hand, everything concerning the work on your local computer can vary in accordance with your preferences (for example, the repository location, working directories, etc.)
</p>
<p>In the below code, all placeholders are in UPPER_CASE. Replace them with appropriate values.
</p>
<ol type="">
<li><p>Clone the AsmBB repository:
</p></li>
<pre><code class="">$ fossil clone https://asm32.info/fossil/repo/asmbb MY_FOSSIL_REPOS/asmbb.fossil
</code></pre>
<p>Because every fossil source repository is a single SQLite database file and because fossil does not have special working checkout directory (for example like git has), it is a good practice to keep all your cloned repositories in a special repository directory and then to open as many working directories as you need.
</p>
<p>In the above command, <code>MY_FOSSIL_REPOS</code> is the path to this repository storage directory.
</p>
<li><p>Create working directory and open the repository inside:
</p></li>
<pre><code class="">$ mkdir MY_WORKING_DIRS/asmbb
$ cd MY_WORKING_DIRS/asmbb
$ fossil open MY_FOSSIL_REPOS/asmbb.fossil
</code></pre>
<p>The above commands will open the repository and extract the latest version of the branch <code>trunk</code>. It is not so important, because you will need to create new branch for your changes.
</p>
<li><p>Set the autosync setting to <code>pullonly</code>:
</p></li>
<pre><code class="">$ fossil settings autosync pullonly
</code></pre>
<p>This setting will prevent the automatic synchronization of fossil attempts to push your changes to the central repository, but it will still auto pull the changes and merge them if needed.
</p>
<li><p>Now create new branch for your changes (from the branch <strong>trunk</strong>) and check-out:
</p></li>
<pre><code class="">$ fossil branch new MY_SHINING_FEATURE trunk
$ fossil co MY_SHINING_FEATURE
</code></pre>
<li><p>Now start your development. Edit the files, test, etc. On your estimation (but not too rarely) make commits of the current development state. Don't forget to write meaningful comments on your check-ins.
</p></li>
<pre><code class="">$ fossil commit
</code></pre>
<li><p>When you are ready and want your code to be merged in the project, create a bundle:
</p></li>
<pre><code class="">$ fossil bundle export BUNDLE_NAME.bundle --branch MY_SHINING_FEATURE
</code></pre>
<p>The above command will create a file named "BUNDLE_NAME.bundle". This file is a SQLite database, containing all history of the branch <code>MY_SHINING_FEATURE</code> as you comitted it. And it can be imported in other cloned repository or in the central repository. (the command is <code>fossil bundle import</code>)
</p>
<li><p>Then send this bundle to the project maintainer by any means. You can attach it in a forum post here, or sent it to me by email (johnfound at asm32 dot info) or upload it somewhere and publish a download link.
</p></li>
<p>Although the best way seems to be attaching to the forum post - this way, the changes can be discussed in one place.
</p>
<p>The attachments limit right now is 1MB per file, but my experiments indicates that this size should be enough for pretty serious changes. It is because of the fossil very effective compression mechanism.
</p>
<p>For example a bundle containing the whole branch <a href="https://asm32.info/fossil/repo/asmbb/timeline?r=i18n&c=2019-03-19+13%3A25%3A42">i18n</a> is something like 200kB in size.
</p>
<p>So, after the changes are reviewed and everything is OK, they will be merged into the central repository.
</p>
</ol>
johnfound