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.
Encrypt the sensitive data (purpose of this reply) If you want to store your config files containing sensitive information (like passwords) in a public location then it needs to be encrypted. The files could be decrypted when recovered from the repository, or even used straight from their encrypted form.
Core languages supported by GitHub features Core languages for GitHub features include C, C++, C#, Go, Java, JavaScript, PHP, Python, Ruby, Scala, and TypeScript.
Git was designed as a set of programs written in C and several shell scripts that provide wrappers around those programs. Although most of those scripts have since been rewritten in C for speed and portability, the design remains, and it is easy to chain the components together.
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 describe
is a nice feature to identify a version based on the latest annotated tag. With just one implementation in the repository, git describe
usage is simple. But if different implementations with separate version numbers are in the one repository, then git describe
usage becomes more complicated, needing use of the --match
option to limit to tags with a given prefix. e.g. git describe --match "python*"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With