GitoxideLabs / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.91k stars 303 forks source link

None of the commands work #1572

Closed muja closed 1 month ago

muja commented 1 month ago

Current behavior 😯

Expected behavior 🤔

I was trying to find out in how far gix supports replacement objects. I am none the wiser, it is not clear how to display a commit log to find out for example and the documentation is not really helpful (README mentions gix-traverse but gix traverse is not a commend for example?)

Git behavior

git log shows a commit log including the replaced objects

Steps to reproduce 🕹

cd $(mktemp -d)
git init .
git commit --allow-empty -m 'test commit'
git replace --edit HEAD # e.g. change 'test'  to 'best'

sudo apt install cmake
# install gitoxide
cargo install gitoxide
gix commit-graph list
# etc
Byron commented 1 month ago

Thanks for reporting - I think, like you already pointed out, gitoxide is shoddy software that is best left alone.

I'd be interested to learn how it's possible to build gix without invoking the build-script, which would always set GIX_VERSION.

muja commented 1 month ago

I'm not sure, I haven't done anything special. I installed using rust 1.74.1 on Ubuntu 22.04 inside a VM. Do you need any more info?

Byron commented 1 month ago

Thanks so much - cargo install gitoxide really does the trick and I can reproduce the issue. I really didn't think it was even possible, but here we are.

Byron commented 1 month ago

Thanks again - the build-script wasn't part of the package, which made this case very possible. This will be fixed with the next release, which is why I'd pre-emptively close this issue.

Object-replacements are fully supported by the way, and you would be able to test that with gix rev list or gix rev query <spec>.

muja commented 1 month ago

Thanks. Good to know, the git-cliff maintainers are evaluating gitoxide over at orhun/git-cliff#826 because of this (among others).

However, gix rev list doesn't really show anything or at least doesn't prove that replacements are supported:

image

Byron commented 1 month ago

gix rev query -c <replaced-commit-hash> should do the trick. If it is supported, it shows the original object, if it is supported, it shows the replacement.. Similar tests can be conducted with gix rev list and replaced commits that would alter the commit graph.