This is the first special on Infra Weekly. This time I want to talk about SCM, Source Code Management.
I finished a contract a few weeks ago and now I am looking for my next contract (or collaboration) so if you know anybody looking for a platform engineer, please let me know. I might also be interested in permanent work.
https://www.linkedin.com/in/riccardotacconi/
Introduction
Below is a brief timeline of Source Code Management (SCM) systems, including SVN, Git, Mercurial, and Perforce:
1972: The Source Code Control System (SCCS) was developed at Bell Labs for the Unix operating system. This was one of the earliest forms of SCM.
1982: Revision Control System (RCS) was developed by Walter F. Tichy at Purdue University. RCS introduced a more sophisticated file-differencing technology than SCCS.
1986: Concurrent Versions System (CVS), a free software package for Unix-like systems, was created by Dick Grune. It extended the capabilities of RCS and allowed multiple developers to work on a project simultaneously.
1990: Perforce was developed as a commercial, proprietary version control system. It gained popularity due to its speed, security, and simplicity.
2000: Apache Subversion, or SVN, was created as a project of the Apache Software Foundation to replace CVS. It introduced atomic commits and versioning of directories.
2005: Linus Torvalds, the creator of the Linux kernel, developed Git to manage the source code for the Linux kernel project. The Kernel project was using Perforce which is commercial and he decided to develop an Open Source alternative. Git is a distributed version control system, which means that every user has a full copy of the repository, enhancing the speed and allowing for development even when offline.
2005: Almost simultaneously with Git, Mercurial was developed by Matt Mackall. Like Git, Mercurial is a distributed version control system, but it is known for its simplicity and ease of use.
The advent of Git and Mercurial marked a new era in SCM, shifting from centralized to distributed systems. These tools paved the way for modern development workflows, with features like branch management, merging, and rebasing. They also led to the rise of platforms like GitHub, Bitbucket, and GitLab, which provide hosting for Git and Mercurial repositories and added features like pull requests, issue tracking, and CI/CD integration.
Today, these systems are fundamental tools in software development, allowing for efficient collaboration and version control in both small and large teams. Git, in particular, has become the de facto standard for many open-source projects and companies around the world.
Mercurial
Mercurial is a free, distributed source control management tool developed in 2005 by Matt Mackall. It was designed to simplify many of the complexities present in other SCM systems, such as CVS, SVN, and even Git. Like Git, Mercurial is distributed, meaning that every clone is a full copy of the repository with complete history, which allows for offline work and enhances speed.
One of the key features that distinguishes Mercurial from Git is its simplicity and ease of use. Mercurial has a smaller and simpler command set than Git, making it more accessible for beginners or those who prefer a less complicated interface. The commands in Mercurial are generally more intuitive and consistent in their design. For instance, in Git, undoing a local change can require different commands based on the state of the change, while in Mercurial, there's a single command that can handle this.
Another notable difference is Mercurial's handling of branches. While Git has local branches that are distinct from remote-tracking branches, in Mercurial, branches are global and are a permanent part of the repository's history. Mercurial also supports an anonymous branching model through bookmarks, which function similarly to Git branches.
While Git stores change as snapshots, Mercurial records change as changesets, a more intuitive way of storing changes. This results in a linear and easier-to-follow commit history. Also, Mercurial's storage model often results in faster performance for certain operations, such as diff computations.
Mercurial's philosophy is to be a reliable tool with a simple, intuitive, and consistent interface. Therefore, it takes a conservative approach to introducing new features, focusing more on the stability and reliability of the tool. In contrast, Git is more feature-heavy and versatile, and it tends to offer multiple ways to achieve the same goal.
The most important feature of Mercurial is that it is better than GIT at managing mono repositories. The video below shows the scaling of the biggest Mercurial mono repo.
This article from Stackoverflow Blog talks mainly about Mercurial and Git, and why Git won.
https://stackoverflow.blog/2023/01/09/beyond-git-the-other-version-control-systems-developers-use/
GIT
While both Git and Mercurial are distributed version control systems and have many similarities, there are several areas where Git excels and offers benefits over Mercurial.
Popularity and Community Support: Git's adoption is widespread, and it's the de facto standard for many open-source projects and companies. This widespread use means that there is extensive community support, and a large number of online resources, tutorials, and third-party tools available for Git.
Flexibility: Git provides numerous ways to manipulate the version history and offers several strategies for merging and rebasing. This flexibility allows teams to tailor their workflows to their specific needs.
GitHub and GitLab: Platforms like GitHub and GitLab provide hosting for Git repositories and have become central to many development workflows. They provide additional features such as pull requests, issue tracking, code reviews, and continuous integration/delivery services.
Performance: Git performs better than Mercurial in certain areas due to its implementation and architecture. For instance, it has been reported to be faster when it comes to committing changes, diffing files, and more.
Staging Area: Git’s staging area allows you to stage partial commits, which means you can make a lot of changes and then commit them in logical chunks. This is a feature not present in Mercurial and can lead to cleaner, more organized commits.
Granular Control: Git gives users more control over the internals of the system. This can be beneficial in complex scenarios or when things go wrong.
That said, Git's flexibility and power also come with complexity, and it has a steeper learning curve compared to Mercurial. Some operations in Git can have destructive effects if not used correctly, but its "reflog" command provides a safety net, allowing users to recover almost anything.
An old video, low quality, but with fantastic content, of Linus Torvalds about GIT. Fun fact: he says that CVS is ugly and stupid.
I did not mention the old Microsoft solution for SVM and I won’t nominate it, but it was as bad as CVS and it forced me to use the old Visual Studio with the Windows operating system. I could not run scripts to lint the code since the software had an exclusive lock on the file system, that is criminal more than stupid!
That’s all folks! Thank you for reading.