Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None of the commands work #1572

Closed
muja opened this issue Sep 2, 2024 · 6 comments
Closed

None of the commands work #1572

muja opened this issue Sep 2, 2024 · 6 comments
Labels
acknowledged an issue is accepted as shortcoming to be fixed

Comments

@muja
Copy link

muja commented Sep 2, 2024

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
@Byron
Copy link
Member

Byron commented Sep 2, 2024

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
Copy link
Author

muja commented Sep 2, 2024

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
Copy link
Member

Byron commented Sep 2, 2024

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 Byron added acknowledged an issue is accepted as shortcoming to be fixed and removed feedback requested labels Sep 2, 2024
Byron added a commit that referenced this issue Sep 2, 2024
Otherwise, the `GIX_VERSION` environment variable is not available at build time,
which can lead to runtime errors.
@Byron
Copy link
Member

Byron commented Sep 2, 2024

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>.

@Byron Byron closed this as completed Sep 2, 2024
@muja
Copy link
Author

muja commented Sep 2, 2024

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
Copy link
Member

Byron commented Sep 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants