Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/topheman/basic-git-rust
Basic implementation of git, to get better at rust 🦀
https://github.com/topheman/basic-git-rust
Last synced: about 2 months ago
JSON representation
Basic implementation of git, to get better at rust 🦀
- Host: GitHub
- URL: https://github.com/topheman/basic-git-rust
- Owner: topheman
- Created: 2024-02-03T16:27:24.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-19T20:52:41.000Z (11 months ago)
- Last Synced: 2024-04-08T00:39:38.288Z (9 months ago)
- Language: Rust
- Homepage:
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# basic-git-rust
This is a very basic and partial rust implementation of git.
The goal of this project is to get better at rust programming, not to make a full featured git implementation.
I've already done a few rust projects (with WebAssembly or bevy), however, I wanted something that needs to deal directly with:
- I/O
- parsing
- handling bytes
- parallelismThis is a work in progress, we'll see where it goes.
## Setup
Add the following alias to your `.zshrc` / `.bashrc`, it will:
- lets you use the `basic-rust-git` implementation from anywhere by using the alias `mygit`
- it runs```sh
alias mygit=/path/to/your/repo/mygit.sh
```## Utilities
If you cloned the repository from github, the git objects (commits, tree, ...) will be packed into `.git/objects/pack` and not present in `.git/objects` as individual objects.
Run the following to unpack the objects:
```sh
./unpack.sh
```## Features
The features won't be implemented in full.
For the moment, the commands don't handle packed objects, so you may need to run `./unpack.sh` on the repo if you just cloned it if you want to run commands against it.
### mygit cat-file
[git cat-file - doc reference](https://git-scm.com/docs/git-cat-file)
```sh
mygit cat-file -p 342293066bfc04c621eb7cbe4d5fc3a272ff0b05
```## Genesis of the project
It started with the ["Build Your Own Git" Challenge](https://codecrafters.io/challenges/git) from code codecrafters.io, after the first two steps, it requires a 40$/months membership - it's a little too much for the usage I would have had.