An open API service indexing awesome lists of open source software.

https://github.com/omerba31/git_filesystem

A hybrid Git-like file system project using C++ for backend logic and Python for the command-line interface โ€” supports operations like staging, commits, object handling, and more.
https://github.com/omerba31/git_filesystem

cli cpp docker git makefile python

Last synced: 3 months ago
JSON representation

A hybrid Git-like file system project using C++ for backend logic and Python for the command-line interface โ€” supports operations like staging, commits, object handling, and more.

Awesome Lists containing this project

README

          

# Git FileSystem

A hybrid Git-like file system project that combines the performance of C++ with the flexibility of a Python command-line interface. It mimics essential Git operations such as creating objects, managing trees, and committing changes โ€” all within a custom file system environment.

---

## ๐Ÿง  Project Structure

- **C++ Core (`libcaf/src/`)**: Implements the core logic for managing blobs, trees, commits, object I/O, and hashing.
- **Python CLI (`caf/`)**: Provides a user-friendly interface for interacting with the file system via commands.
- **Binding Layer**: Exposes C++ functionality to Python (via bindings in `bind.cpp` and setup config).

---

## ๐Ÿš€ Features

- Create and manage Git-like objects (blobs, trees, commits)
- Navigate a custom file system hierarchy
- Interact through Python-based CLI
- Modular, extensible, and performance-focused

---

## ๐Ÿ› ๏ธ Installation

### Prerequisites

- Python 3.8+
- A C++ compiler (`g++` or `clang`)
- `pip` and `virtualenv` (optional but recommended)

### Clone the repository

```bash
git clone https://github.com/Omerba31/git_fileSystem.git
cd git_fileSystem
```

### Build and install the C++ extension

```bash
cd libcaf
pip install .
```

> This will compile the C++ source in `libcaf/src/` and make it available to the Python interface.

### Run the CLI

```bash
cd ../caf
python -m caf
```

---

## ๐Ÿงช Running Tests

```bash
cd tests
pytest
```

---

## ๐Ÿ“ Directory Overview

```
git_fileSystem/
โ”œโ”€โ”€ caf/ # Python CLI interface
โ”œโ”€โ”€ libcaf/ # C++ backend and binding setup
โ”‚ โ”œโ”€โ”€ src/ # Core C++ logic (Blob, Tree, Commit, etc.)
โ”‚ โ””โ”€โ”€ setup.py # Build configuration for Python bindings
โ”œโ”€โ”€ tests/ # Unit tests
โ”œโ”€โ”€ Makefile # Optional build automation
โ””โ”€โ”€ Dockerfile # Containerization setup
```

---

## ๐Ÿงฉ Example Commands

From the CLI:

```bash
> init
Initialized empty Git-like repository.

> add file.txt
Staged 'file.txt'

> commit -m "Initial commit"
[commit] Created with message: Initial commit

> ls
.blob
.tree
```

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License**. See `LICENSE` for details.

---

## ๐Ÿค Contributions

Feel free to open issues, suggest features, or submit pull requests!