Show HN: Vdm, a sane alternative to e.g. Git submodules
vdm is a versioned-dependency manager that simplifies external dependency management across programming languages. It requires Git, supports YAML/JSON spec files, and offers future enhancements for synchronization and remote types.
Read original article`vdm` is a general-purpose versioned-dependency manager designed as a user-friendly alternative to Git Submodules. It is language-agnostic and facilitates the management of external dependencies that lack native specification methods in programming languages. Common use cases for `vdm` include accessing shared CI repositories for scripts, testing backend applications with frontend code from different repositories, and importing `.proto` files for protocol buffers.
To get started with `vdm`, users can install it from its GitHub Releases page or via the Go toolchain using the command `go install github.com/opensourcecorp/vdm@<version>`. Users need to create a `vdm` specification file in YAML or JSON format to define their external dependencies. An example spec file includes entries for both Git and file types, specifying remote sources and local paths. After setting up the spec file, users can run `vdm sync` to retrieve the specified dependencies.
`vdm` is a statically-linked binary that requires Git to be installed for managing Git remote types. Future enhancements for `vdm` include improvements to the synchronization mechanism, options to retain the `.git` directory during cloning, and support for additional remote types beyond Git and file. For further details, users can refer to the `vdm` GitHub repository.
Related
Show HN: WhoDB – Streamlined, Lightweight Database Management with a Sleek UI/UX
WhoDB is a database management tool on GitHub, developed in GoLang for speed. It includes interactive graphs for database schema visualization. Find more details on the WhoDB GitHub Repository.
Reproducibility in Disguise
Reproducibility in software development is supported by tools like Bazel, addressing lifecycle challenges. Vendor dependencies for reproducibility face complexity, leading to proposed solutions like vendoring all dependencies for control.
Jujutsu: A Next Generation Replacement for Git
Jujutsu, an experimental version control system by Martin von Zweigbergk, offers Git compatibility, simplified commits, effective conflict handling, and features like automatic rebasing. Despite being in active development with some limitations, it shows promise for revolutionizing version control.
Show HN: Open-source CLI coding framework using Claude
The GitHub repository for "Dravid (DRD) - AI-Powered CLI Coding Framework" streamlines coding with AI. It aids in project setup, code generation, and file management. The README covers features, installation, usage, and support.
Git-credential-manager: Secure, cross-platform Git credential storage
Git Credential Manager is a secure helper for Git on Windows, macOS, and Linux. It ensures consistent authentication, including multi-factor authentication, for platforms like Azure DevOps, Bitbucket, GitHub, and GitLab. Supports secure storage, multi-factor authentication, and more. Compatible with HTTP(S) remotes. Visit the GitHub repository for details.
- Several users suggest alternatives to vdm, such as "pasta," "git-subrepo," and "git-aggregator," highlighting their own experiences and features.
- There is a common critique of Git submodules, with users discussing their complexities and suggesting that vdm may address some of these pain points.
- Some commenters express skepticism about the use of YAML for configuration, citing issues with diffing and merging.
- Users emphasize the importance of traceability and ease of use in dependency management, raising concerns about the balance between the two.
- Overall, there is a shared interest in finding efficient and user-friendly solutions for managing external dependencies across projects.
If you're looking for alternatives, here's something we've built (hope I'm not hijacking this): https://github.com/audiotool/pasta
It's called "pasta" for copy pasta. It was built with exactly the same motivation aa yours, also has a yaml config file, and is also implemented in go, kinda interesting. If yours takes off and we can drop ours, that'd be awesome!
For some feedback in features we have which we thinkg we'd be missing:
- we have the ability to copy individual files and specific subdirectories of other repos, not the entire repos
- mechanics to "clear" the target directory, in case a file gets deleted upstream, to keep the directories in sync
- we've modelled it with a plugin API, so you can implement new "copiers" for bitbucket, google drive, subversion, ...
- the github plugin we have uses the Github API for better performance, and you can add auth by setting an env var GITHUB_TOKEN
We also create a "result" file of every copy, noting the exact commit that was copied, which might or might not be a useful... Were thinking of posting it here at some point but never got around to it. Again, if yours takes off, that'd be the best option :)
We're using it mostly to copy .proto definitions from one repo to another.
In that respect, it resembles git-subtree with --squash, but differs from git-submodule or regular git-subtree.
https://github.com/fviard/svn_xternals
Despite the README saying that it is a work in progress, the tool is functional for a few years already. Also, again despite the name, it works with GIT.
The idea is to be able to use the concept of "externals" from SVN transparently with svn or GIT. It does something similar to what Google "gclient" was doing but in a more efficient way (ie a lot faster and consuming a lot less resources).
To use it, you just need to create a file ("externals.conf" in your project for example), in a format like that:
externals.conf
git@github.com:user/myproject_core.git myproject/core
git@github.com:user/myproject_plugins_onething.git myproject/plugins/onething
git@github.com:anotheruser/another_thing.git@mybranch myproject/plugins/another_thing
git@github.com:corpuser/random_library.git@release-tag-123 myproject/vendor/random_library
Then, you can simply run:
python3 externalsup.pyAnd it will take care to do automatically the git clone, or pull, or "switch" if you change a branch/tag indicator in the externals file.
Like that, you can easily commit a externals.conf file in a root project folder, and individually manage the version of sub-components that can be hosted anywhere.
The "externals.conf" file is a plain text file so easily to read and diff to compare different versions of your project.
> This git command clones an external git repo into a subdirectory of your repo. Later on, upstream changes can be pulled in, and local changes can be pushed back. Simple.
https://github.com/ingydotnet/git-subrepo
After trying many similar solutions, it gets the closest to what I want to achieve, which is nested Git repositories. A project with subprojects, each of which can be an independent Git repo with its own history to push/pull, while the project itself has the entire codebase and history.
It's written in Bash, so fairly portable.
---
Edit: After skimming through the project vdm, I see the problems it aims to solve are different from what git-subrepo does. The latter is more about monorepos. Ah well, that's what I get for commenting before reading the post.
vdm does look useful for managing a project with external dependencies, which are Git repos owned by others or oneself. Maybe like a language-agnostic package manager.
I poured my heart and soul into it[2] but it wasn't very popular. I guess there's not much need for a dependency manager that's not tailored to the needs of a particular community, like a platform or language.
What collaborative tool would you recommend using with vdm? AOSP has gerrit which is sort of specifically designed for this multi-remote meta setup. GitHub/GitLab don’t play nice with this type of environment.
In addition, other tools can also do this to varying degrees of success, like Bazel and cmake.
To solve it we use git-aggregator (I am not the autor) (language agnostic too). It seem to have the same features as VDM + some extra one (possiblity to have a frozen file, possibly to apply patch/pr...)
This allows you to treat common code in a repo as just a normal part of the repo. However, the common code is also in a repo of its own. This tool then allows you to push / merge your changes back to the common repo.
Check the git page for a list of the benefits.
If I could have submodules that operated that way I think submodules would be a lot more straightforward to newcomers.
box = !cd ${GIT_PREFIX:-.} && git config --get remote.origin.url > .gitboxinfo && git rev-parse --abbrev-ref HEAD >> .gitboxinfo && git rev-parse HEAD >> .gitboxinfo && mv .git .gitbox && git add -f .gitboxinfo && true
unbox = !cd ${GIT_PREFIX:-.} && mv .gitbox .git && true
Then I add the .gitbox folder to gitignore. Whenever I need to interact with the "submodule" repo I unbox, otherwise I leave it boxed and as far as everyone else in the project is concerned, the dependency was just copied n pasted in the project.If you ever need to regenerate the gitbox folder from scratch you can take a peek at the gitboxinfo file and git clone and reset the dependency repo in a temp folder, then move the git folder next to the gitboxinfo file.
Plus unlike submodules with this you can have local changes to the submodule files without having to fork the submodule itself.
1: A setup.py that installs dependencies like this:
pip install git+https://github.com/dependency/repo
2: Git submodules?
Regarding the name, I’m French, and VDM basically means FML in French.
Personally I don't see the difference between this and submodules. Repo stores the information in xml files, vdm stores it in yaml files and git submodules in the git database. I don't really care.
The real headache for me is the trouble of traceability vs ease of use. You need to specify your dependencies with a sha1 to have traceable SLSA compliant builds, but that also means that you'll need to update all superrepos once a submodule is updated. Gerrit has support for this, but it's not atomic, and what about CI? What about CI that fails?
Related
Show HN: WhoDB – Streamlined, Lightweight Database Management with a Sleek UI/UX
WhoDB is a database management tool on GitHub, developed in GoLang for speed. It includes interactive graphs for database schema visualization. Find more details on the WhoDB GitHub Repository.
Reproducibility in Disguise
Reproducibility in software development is supported by tools like Bazel, addressing lifecycle challenges. Vendor dependencies for reproducibility face complexity, leading to proposed solutions like vendoring all dependencies for control.
Jujutsu: A Next Generation Replacement for Git
Jujutsu, an experimental version control system by Martin von Zweigbergk, offers Git compatibility, simplified commits, effective conflict handling, and features like automatic rebasing. Despite being in active development with some limitations, it shows promise for revolutionizing version control.
Show HN: Open-source CLI coding framework using Claude
The GitHub repository for "Dravid (DRD) - AI-Powered CLI Coding Framework" streamlines coding with AI. It aids in project setup, code generation, and file management. The README covers features, installation, usage, and support.
Git-credential-manager: Secure, cross-platform Git credential storage
Git Credential Manager is a secure helper for Git on Windows, macOS, and Linux. It ensures consistent authentication, including multi-factor authentication, for platforms like Azure DevOps, Bitbucket, GitHub, and GitLab. Supports secure storage, multi-factor authentication, and more. Compatible with HTTP(S) remotes. Visit the GitHub repository for details.