https://github.com/benwiederhake/git_quine
A program that recreates its own repository
https://github.com/benwiederhake/git_quine
git quine
Last synced: about 1 month ago
JSON representation
A program that recreates its own repository
- Host: GitHub
- URL: https://github.com/benwiederhake/git_quine
- Owner: BenWiederhake
- License: mit
- Created: 2019-07-15T13:57:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T16:28:15.000Z (almost 3 years ago)
- Last Synced: 2025-02-10T20:56:51.829Z (8 months ago)
- Topics: git, quine
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git_quine
A program that recreates its own repository. Why? Because fun!
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)## Install
How do you mean? It's a quine. It produces itself as output.
There is nothing to install.## Motivation
> Bäärenkatapulte!
## Usage
Just run it! It should produce exactly the same commits on every platform.
```
$ ls -a
.git .gitignore git_quine.py LICENSE README.md
$ ./git_quine.py
Git repository created in git_quine/
$ ls git_quine/
.git .gitignore git_quine.py LICENSE README.md
$ diff -su <(git rev-parse HEAD) <(git -C git_quine/ rev-parse HEAD)
Files /dev/fd/63 and /dev/fd/62 are identical
```### Stand-alone
To prove that it doesn't just copy the files, I encourage you to take `git_quine.py`,
move it somewhere else, delete the repository, and run the quine.
You will see that it reproduces the entire repository *without* access to anything else.### Feature support
This quine supports arbitrary commit messages and times, added files, and changes to files.
Naturally, it can't reproduce *all* features of git. Most importantly,
this quine currently only understands history as a single branch, consisting only of single-parent commits.
Also, this quine is its own author *and* committer, because that simplifies things.Diffs are stored inefficiently.
If you take a deep dive into how this quine works, you will see that these missing features can be easily added.
## Contribute
Feel free to dive in! [Open an issue](https://github.com/BenWiederhake/git_quine/issues/new) or submit PRs.