📜 ⬆️ ⬇️

We meet Veracity - a new distributed version control system


Hello, my inquisitive % username% !

A few months ago, I accidentally stumbled upon another promising version control system - Veracity , which I would like to tell you today, so that you have something to dig into on the weekend. Despite the fact that the development of Veracity has been going on for over a year, on Habré her name was only a couple of times casually mentioned in the comments. Under the cat you will find a brief description of Veracity and links where you can get more detailed information about it.

So, Veracity (English “truthfulness”, “reliability”, “accuracy”) is a distributed version control system, similar to Git, developed under the Apache 2.0 license from SourceGear.
')

Main differences from Git

  1. Availability of local revision numbers. Veracity, like Git, uses cryptographic hash functions for version control of individual files. However, in the local repository, each commit receives a unique revision number, as it happens in Subversion. The revision number and hash can be used interchangeably and are often indicated by a colon.
  2. Support multiple hash functions. Everyone knows that Git uses the SHA-1 function in its work. Veracity allows you to choose between SHA-1 , SHA-2 or Skein .
  3. Formal file renaming. Git, when renaming files, actually deletes the file, and then creates a file with the same content and new name. Veracity does exactly rename the existing file.
  4. Support file locks. Centralized version control systems like Subversion support 2 work schemes: file locking (svn lock \ svn unlock) and merging changes (svn merge). Although Git and other distributed version control systems often use a central repository in their work, they lack a file locking mechanism. Veracity corrects this flaw. It is clear that to block files, you need access to remote repositories through the network.
  5. Stamp support. Veracity includes a completely new functionality, called stamps. A stamp is a stamp from arbitrary text that a developer can attach to any commit. Unlike tags, which associate a unique name for each commit, the same stamp can mark an arbitrary number of commits. For example, when using a continuous integration system, you can put a “Tests passed” stamp on commits that have passed a series of tests without errors, just like the manufacturers of equipment put a “qc pass” stamp (quality controll passed) on each sample produced.
  6. Decentralized repository database. Many version control systems store repository data within the working directory. For example, Git has a .git folder in which binary objects, trees, commit objects, an index, a configuration, hooks, etc. are stored. Veracity stores most of the service information on the repository outside the working directory in a special database. This, for example, allows you to have several working directories for one repository at once.
  7. Built-in Javascript interpreter. Veracity uses Javascript as the main scripting language. For example, you can write hooks in the form of Javascript functions. There is also a built-in Javascript API that can be used to write server-side web applications using Veracity. It is logical that JSON is used to store the serialized data.
  8. Embedded web application for repository review. With one command, you can start the embedded web server with an application that allows you to view the contents of the repository, the change history, the project build status, or the bug tracker.

Installation

The installation procedure is the most common and has 2 possible alternatives:
  1. Build from source codes. The system is written in C, like some other version control systems (for example, Git, Subversion or Fossil), so we will have to deal with installing source dependencies and utilities like cmake and make. For those who like these things, here are build instructions for Linux and for Windows .
  2. Install from binary package. To start picking Veracity faster, it will be much easier to use binary packages that can be downloaded on the download page . There are binary packages for Debian-compatible systems (* .deb: x86, x64) and for Windows (* .msi: x86, x64).

Basic commands

To work with Veracity used short command vv . Below is a list of the basic operations of Veracity and examples of commands:
TeamDescriptionExample
vv addPlace file under version control. Unlike Git, Veracity surprisingly has no concept of staging. All changes in the file fall into commit.
$vv add filename1 filename2 ~/thisdir 
vv addremoveAdd new files to version control and remove no longer existing files from version control.
 $vv addremove dirname1 
vv branchList current branches or change branches
 $vv branch $vv branch add devel 
vv catPrint file contents under version control
 $vv cat filename 
vv checkoutCreate a new working copy of the local repository (there may be several)
 $vv checkout 
vv cloneCreate a new copy of an existing repository. Then from the newly created repository, you can create the desired number of working copies. It works like git clone. Veracity only supports the HTTP protocol for working with remote repositories.
 $vv clone http://example.com/repos/reponame reponame 
vv commentAdd another comment to the commit in addition to the one specified when creating the commit. Each command call adds a new line with a comment. Old lines are saved.
 $vv comment --rev=123 --message='A new comment' 
vv commitCreate commit
 $vv commit --message='Commit message' 
vv configReconfigure Veracity. It allows you not only to set the values ​​of specific options, but also to import and export the configuration into a JSON document, as well as reset the configuration to default values.
 $vv config set whoami/username vania-pooh 
vv diffDistinguish between the current revision and the specified revision.
 $vv diff --rev=3 filename 
vv diffmergeSame as diff, but for comparison, a third-party DiffMerge program is used , which must be installed separately, otherwise the command gives an error.
 $vv diffmerge --rev=3 filename 
vv exportCopies all files under version control to a separate directory.
 $vv export reponame ~/copyhere 
vv fast-exportAllows you to save the full state of the repository (the contents of files + metadata) into one text file. This file can then be imported on another computer with the vv fast-import command.
 $vv fast-export reponame ~/backupname.fi 
vv fast-importInitializes a new repository from a file created by the vv fast-import command.
 $vv fast-import --hash=SHA2/512 ~/backupname.fi 
vv headsDisplays descriptions of the latest commits in each of the active repository branches (branches can be closed using the vv branch close ).
 $vv heads 
vv helpBuilt-in help system for commands Veracity.
 $vv help branch new 
vv historyAllows you to view a list of previous commits. Same as git log .
 $vv history 
vv incomingShows what changes will be uploaded from a remote server.
 $vv incoming 
vv initCreate a new local repository. It requires specifying the repository name and which directory to make working. Later you can add other working directories.
 $vv init reponame dirname 
vv leavesShows a list of "leaves", i.e. recent commits in branches.
 $vv leaves 
vv lockLocks the file for editing.
 $vv lock filename 
vv locksShows a list of files locked for editing.
 $vv locks 
vv mergePuts changes to the specified commit into the current state of the files in the working directory.
 $vv merge -r 37939b07309af8232c44048ca0a1633c982b7506 
vv moveMoves the specified file or directory to a new location.
 $vv move filename ~/newdir 
vv outgoingShows a list of changes that will be uploaded to the current or specified remote repository.
 $vv outgoing 
vv parentsShows a list of parent commits for currently modified files.
 $vv parents 
vv pullGet changes from remote repository. Same as git pull .
 $vv pull # ,          vv update 
vv pushSend changes to a remote repository. Same as git push .
 $vv push # ,           
vv removeDelete the file from version control and erase it.
 $vv remove ~/repo/filename 
vv renameRename file.
 $vv rename ~/repo/oldfile ~/repo/newfile 
vv repoCreate, edit, delete repositories, and list them.
 $vv repo info 
vv resolveResolve file association conflicts.
 $vv resolve ~/filename #         
vv revertRoll back current changes.
 $vv revert ~/filename1 ~/filename2 
vv serveAllows you to run the built-in Veracity application to manage the repository.
 $vv serve --port=8080 --public 
vv stampAllows you to add and remove stamps to specified commits.
 $vv stamp add approved --rev=3 
vv statusShow the status of files in the current working directory.
 $vv status 
vv tagAssign a unique text name to a commit.
 $vv tag add tagname --rev=3 
vv unlockUnlocks the file locked with vv lock .
 $vv unlock filename 
vv updateUpdate the working directory status from the repository (applied after vv pull is completed ).
 $vv update 
vv userAllows you to manage user accounts using repositories.
 $vv user create vania-pooh 
vv versionShows the current installed version of Veracity.
 $vv version 
vv whoamiShows or sets the current user account.
 $vv whoami anotherUser 
vv zipSaves the contents of the repository to a zip archive.
 $vv zip ~/backup/archive.zip 

File location

As mentioned earlier, Veracity stores repository metadata separately from the working directory files. This allows you to have several working directories. The Veracity documentation says that it supports several different storage engines, however, by default, the FS3 engine is used. This engine uses SQLite3 database and text files that store database queries. In order to be able to view the contents of the database, you can install the SQLite Manager extension for Firefox. By default, all repository data is stored in the ~ / .sgcloset / directory . In addition, each working copy has a hidden .sgdrawer directory containing a link to the repository name and some other metadata. If you want to ignore the repository files, put them in a .sgignores or .vvignores file, as shown here . Veracity currently has only 2 executable files - vv and vscript . The first is responsible for the execution of version control commands, and the second allows you to run scripts written in Javascript.

Veracity embedded application

As mentioned above, Veracity contains an embedded web server and a web application for managing a project using Veracity. To launch the web application, simply enter the command:
 $vv serve --port=8080 --public # --public     . 
The application starts on the specified port and becomes available from the browser. Here's what it looks like:

The picture shows that the specified commit has 3 comments. One was added when creating a commit, the rest with the vv comment command.

Hosting projects Veracity

Veracity developers understand that it will be very difficult to compete with Git without hosting projects like Github. That is why onveracity.com was recently launched. In general, the site repeats the functionality of Github, and screenshots can be viewed on its main page.

Links


Conclusion

Information on Veracity is not so much. The developers themselves answer the questions of users on the questions page . Some information can be found in the book above. Hopefully, this project will also find its place in the sun.

Source: https://habr.com/ru/post/150191/


All Articles