Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
b380cf4
First Commit with structure
The-Leyn Jun 12, 2025
3c8c15e
feat(cat-file): support -t and -p options
MrDevaa Jun 13, 2025
973a1cc
feat: Adding the scratch_git folder and setting up the alias 'pit' to…
The-Leyn Jun 13, 2025
8d92e9b
feat(cat-file): support -t and -p options
MrDevaa Jun 13, 2025
4bf4e0c
Merge branch 'deva' of https://github.com/Woodiss/hetic_git into deva
MrDevaa Jun 13, 2025
7bfe4ee
chore(sync): update branch with latest changes from main
MrDevaa Jun 13, 2025
5243b1b
feat(commit): implement commit creation using git commit-tree
MrDevaa Jun 14, 2025
27050dc
feat: add init command
Woodiss Jun 16, 2025
36784a0
feat: Adding the test for the command hash-object and including pytes…
The-Leyn Jun 19, 2025
d55c2ab
test(cat-file): add unit test for cat-file functionality
MrDevaa Jun 19, 2025
78f4c8f
Merge pull request #23 from Woodiss/ad
The-Leyn Jun 19, 2025
f6281fd
feat(rm): remove file and test
Amaury057 Jun 19, 2025
cccc55c
fix: add file param init cmd & feat: pytest for init cmd
Woodiss Jun 20, 2025
af67c7b
Merge remote-tracking branch 'origin/main' into woodis
Woodiss Jun 20, 2025
8323a75
feat: Adding the command ls-files and its test
The-Leyn Jun 22, 2025
aa12944
refactor(write-tree): update logic and adjust cat-file test and add.p…
MrDevaa Jun 23, 2025
bd5beba
fix app useless
Woodiss Jun 23, 2025
da16006
Merge pull request #26 from Woodiss/woodis
The-Leyn Jun 23, 2025
2520cac
feat: Adding the command show-ref without its test
The-Leyn Jun 23, 2025
3fb4c0a
Merge branch 'main' into ad
The-Leyn Jun 23, 2025
4a24a8d
Merge pull request #27 from Woodiss/ad
The-Leyn Jun 23, 2025
47ed771
update: adding init command in main.py
The-Leyn Jun 23, 2025
093a6f4
Merge branch 'ad'
The-Leyn Jun 23, 2025
304d5fe
Merge branch 'ad' into adDev
The-Leyn Jun 23, 2025
b2da71f
feat(pit-add): add method handling and support for 'pit add .' command
MrDevaa Jun 24, 2025
0bba795
Merge branch 'main' into willex
The-Leyn Jun 24, 2025
2224f5f
Merge pull request #25 from Woodiss/willex
The-Leyn Jun 24, 2025
c41ce16
Merge branch 'main' into deva
The-Leyn Jun 24, 2025
07b39bf
Merge pull request #24 from Woodiss/deva
The-Leyn Jun 24, 2025
78ecd44
feat: Refactoring the show-ref command and adding its tests
The-Leyn Jun 25, 2025
4b60fad
init cmd rev-parse
Woodiss Jun 25, 2025
0d0b7c4
fix:test file folder
Woodiss Jun 25, 2025
21d072d
Merge branch 'main' into adDev
The-Leyn Jun 26, 2025
69221e0
Merge branch 'main' of https://github.com/Woodiss/hetic_git into feat…
Woodiss Jun 26, 2025
e83f2ba
fix: merging main and fixing test_cat_file.py
The-Leyn Jun 26, 2025
189597e
refactor: Extract the logic to read an object in utils.py
The-Leyn Jun 26, 2025
0ea4047
feat: implémenter la commande commit-tree
christopherDEPASQUAL Jun 26, 2025
8fcb35f
feat: Adding unit test for ls-tree (may need to be redone)
The-Leyn Jun 26, 2025
44a02f7
Merge pull request #28 from Woodiss/ad
The-Leyn Jun 26, 2025
753f26c
refactor: Creating the utils/ folder
The-Leyn Jun 29, 2025
681b699
refactor: extrating the logic of hash-object to the utils/ folder
The-Leyn Jun 29, 2025
8a2a89c
refactor: Changing the output of the ls-tree command to match git and…
The-Leyn Jun 29, 2025
361c4d1
refactor: extracting the index logic from the 'add' and 'rm' commands…
The-Leyn Jun 29, 2025
fd5a72b
refactor: adding the --help to the show-ref command and changing the …
The-Leyn Jun 29, 2025
12c66ee
feat: add rev-parse cmd & test
Woodiss Jun 30, 2025
cc0e42f
merge feat/rev-parse & main
Woodiss Jun 30, 2025
e1ec5ea
feat: create workflows
Woodiss Jun 30, 2025
b0904f8
fix: add identity for pytest
Woodiss Jun 30, 2025
9c490a7
fix: update cache pip step with correctly install
Woodiss Jun 30, 2025
1c4525a
feat
MrDevaa Jun 30, 2025
6569e92
Merge pull request #30 from Woodiss/ad
The-Leyn Jun 30, 2025
73be618
Merge branch 'main' into feat/rev-parse
The-Leyn Jun 30, 2025
bbe4d1d
Merge pull request #31 from Woodiss/feat/rev-parse
The-Leyn Jun 30, 2025
a0fb868
Merge pull request #32 from Woodiss/feat/workflow
The-Leyn Jun 30, 2025
08dcef3
Merge branches 'main' and 'deva' of https://github.com/Woodiss/hetic_…
MrDevaa Jun 30, 2025
e56edc2
feat adapted Cat-file to main logics
MrDevaa Jun 30, 2025
4466eab
Merge branch 'main' of https://github.com/Woodiss/hetic_git into devadev
MrDevaa Jun 30, 2025
d3013ff
feat adapted Cat-file to main logics
MrDevaa Jun 30, 2025
c2c7945
fix: logique commit_tree et son test
christopherDEPASQUAL Jul 1, 2025
de39e8b
Suppression de hetic_git dans le nom des imports
christopherDEPASQUAL Jul 1, 2025
441c0e8
feat: add new OS test workflow
Woodiss Jul 2, 2025
f4296d4
Fix : correction de l'erreur dans les tests
christopherDEPASQUAL Jul 2, 2025
83b73d0
fix: show_ref.py now compatible with windows os (after test)
Woodiss Jul 2, 2025
eefc332
Merge pull request #34 from Woodiss/feat/workflow
The-Leyn Jul 2, 2025
9c25b23
Merge remote-tracking branch 'origin' into dp/feature/commit-tree
christopherDEPASQUAL Jul 3, 2025
054c23f
feat(status): creation de pit status
Amaury057 Jul 7, 2025
7d89f73
Fix : Utilisation de `object.py` dans les scripts
christopherDEPASQUAL Jul 7, 2025
ba26a7e
pytest
Amaury057 Jul 7, 2025
77fb777
Merge pull request #33 from Woodiss/deva
The-Leyn Jul 7, 2025
46d7b6f
Merge pull request #35 from Woodiss/dp/feature/commit-tree
The-Leyn Jul 7, 2025
f7bae85
merge conflict
Amaury057 Jul 7, 2025
9d109f7
Merge pull request #36 from Woodiss/willex
The-Leyn Jul 7, 2025
6ae1623
Merge branch 'main' of https://github.com/Woodiss/hetic_git into devadev
MrDevaa Jul 7, 2025
370edce
feat: Adding the log command, not tracking every commit
The-Leyn Jul 21, 2025
5d82ca7
seperate logic .gitignore on status.py moved to utils & added on add.py
MrDevaa Jul 21, 2025
7502b8b
feat: Adding the test of the log command
The-Leyn Jul 22, 2025
d261cce
first commti after refactored
Amaury057 Jul 22, 2025
1067a55
refactor: command pit log and its test
The-Leyn Jul 22, 2025
ce3d19d
Merge pull request #40 from Woodiss/ad
The-Leyn Jul 22, 2025
5b8dfbd
feat: add a new command reset with hard and soft
Jul 22, 2025
0623f97
fix: reset hard work with edit or deleted file
Woodiss Jul 23, 2025
0779c01
deleted temp folder
Woodiss Jul 23, 2025
3983745
add reset mixed
Woodiss Jul 23, 2025
295b634
Merge pull request #38 from Woodiss/devadev
The-Leyn Jul 23, 2025
46defc6
Delete .vscode directory
The-Leyn Jul 23, 2025
ebbe030
Merge branch 'main' into feat/reset
The-Leyn Jul 23, 2025
f5c93e5
Merge pull request #42 from Woodiss/feat/reset
The-Leyn Jul 23, 2025
d5b7d37
pull
Amaury057 Jul 23, 2025
631a596
status def
Amaury057 Jul 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tests Python

on:
push:
branches: ["**"]

jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
# 1) Récupération du code
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "[email protected]"

# 2) Installation de Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11.0"

# 3) Mettre en cache le dossier pip (accélère les exécutions)
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml', 'setup.cfg', 'setup.py') }}
restore-keys: |
${{ runner.os }}-pip-

# 4) Installer les dépendances
- name: Install dependencies
run: pip install -e .

# 5) Lancer les tests
- name: Run pytest
run: pytest
196 changes: 196 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
#poetry.toml

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Cursor
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
# refer to https://docs.cursor.com/context/ignore-files
.cursorignore
.cursorindexingignore
.DS_Store
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ You will implement a subset of Git commands, both low-level (plumbing) and user-

## 🛠 Plumbing Commands

### `git hash-object <file>`
### `git hash-object [-w] <file>`

- **Creates a blob** object from file content and writes its SHA-1 to stdout.
- ❌ Reject directories or missing files.

### `git cat-file -t|-p <oid>`

- `-t`: Print object type.
- `-p`: Pretty-print blob/tree/commit content.
- ❌ Reject invalid OIDs or missing options.

### `git write-tree`

- Create a tree object from the staging area.
- Writes SHA-1 of the tree to stdout.

### `git commit-tree <tree_sha> -m "msg" [-p <parent>]`

- Creates a commit object pointing to a tree (and parent commit if any) and writes its oid to stdout
- Requires `-m` message.
- ❌ No annotated tags.
Expand All @@ -33,55 +37,68 @@ You will implement a subset of Git commands, both low-level (plumbing) and user-
## 🧑‍💻 Porcelain Commands

### `git init [<dir>]`

- Initializes a Git repository in the given directory.
- Create .git/objects, .git/refs/heads, HEAD, and minimal config

### `git add <file>…`

- Adds files to the staging area (not directories).
- ❌ No `-p`, no wildcards.

### `git rm <file>…`

- Removes a file from working directory and index.

### `git commit -m "msg"`

- Runs `write-tree`, creates a commit with HEAD as parent.
- ❌ No editor or message prompt.

### `git status`

- Shows staged and unstaged changes.

### `git checkout [-b] <branch|sha>`

- Switch to existing commit or branch.
- `-b <branch>` creates a new branch.
- Change HEAD, update working dir, check for conflicts

### `git reset [--soft|--mixed|--hard] <sha>`

- `--soft`: move HEAD
- `--mixed`: + reset index
- `--hard`: + reset working directory
- ❌ No file-specific reset.

### `git log`

- Print commit history from HEAD (one-line summary ok).

### `git ls-files`

- List all files in the index.

### `git ls-tree <tree_sha>`

- List contents of a tree object.

### `git rev-parse <ref>`

- Convert ref/branch/HEAD into SHA-1.
- ❌ No complex selectors

### `git show-ref`

- List all refs and their hashes.

---

## 🧠 Advanced Feature: Merge Support

### `git merge <branch|sha>`

- Perform 3-way merge and create a merge commit with 2 parents.
- On conflict: insert `<<<<<<<`, `=======`, `>>>>>>>` markers into file(s).
- ❌ No rebase, squash, or fast-forward-only merges.
Expand Down
Empty file added git_scratch/__init__.py
Empty file.
Empty file.
Loading