GitoxideLabs/gitoxide

None of the commands work

Closed this issue · 6 comments

muja commented

Current behavior 😯

  • cargo install gitoxide didn't work immediately because it requires cmake, even with default features disabled
  • gix commit-graph list yields the error\

    Error: a commitgraph is required, but none was found

    Caused by:
    0: Could not open commit-graph file at './.git/objects/info/commit-graphs/commit-graph-chain'
    1: No such file or directory (os error 2)

  • So maybe I need to run gix corpus run first? Oh, that fails as well:

    Error: GIX_VERSION must be set in build-script

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

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

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?

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.

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

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

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.