So I have a few private git repositories that are different language implementations (Python, Java, etc.) of an algorithm. Each implementation is functionally identical, performing the same steps and giving the same output. Currently, these are separate repos, but I was wondering if I shouldn’t unify them into one repo, with directories indicating the language, like:
master
- java
- python
- ruby
I could use a git-repo combine command to preserve the history, so that’s not an issue. I was just curious as to the best practice regarding this.
I had this same question with Mercurial, and an algorithm (COBS) that I wanted to implement in C and Python.
Eventually I decided to split it into separate repositories (even though the Python implementation included a C extension that had similar code to the plain C implementation). My reasoning came down to:
git describeis a nice feature to identify a version based on the latest annotated tag. With just one implementation in the repository,git describeusage is simple. But if different implementations with separate version numbers are in the one repository, thengit describeusage becomes more complicated, needing use of the--matchoption to limit to tags with a given prefix. e.g.git describe --match "python*"