01VCS / git-meta

Wanna git preserve your file dates? git-meta stores all files' metadata into .gitmeta! On every commit!
12 stars 3 forks source link

locks up forever on init.sh on RHEL linux releases / wrong instructions / bad location / bad name #11

Open gitcnd opened 9 months ago

gitcnd commented 9 months ago

my "ps" says it's locked up at "cat".

dodgy bash script probably?

Also - instructions seem wrong?

Copy git-meta.sh and init.sh into your repo

seems like a less-than-ideal idea to stick the script in the repo itself? Shouldn't this be in /usr/local/bin/ ?

/usr/bin is the wrong place to put local scripts

init.sh is a bad name. should be git-meta-init.sh or something more sensible.

this is not portable (centos/redhat/etc): sudo apt install

it's also a bad idea to install stuff without asking or checking if it's already there anyhow. Don't do that - just tell people it's a dependency, and stop if it's missing.

gitcnd commented 9 months ago

This is your mistake:-

cat > .git/hooks/pre-commit <<EOF

(missing backslash) should be

cat > .git/hooks/pre-commit <<\EOF

gitcnd commented 9 months ago

has this in your installer

sudo cp -f git-meta /usr/bin/

but has this in your hooks:

bash .git/hooks/git-meta --store

... those are not the same place...

gitcnd commented 9 months ago

also does not have any restore hooks

danimesq commented 9 months ago

Hello @gitcnd 👋

Here myself facing the same issue of the init hanging; but still hadn't time to fix this and, plus, the issues you've just reported.

Thank you for taking your time to try this script and find my mistakes on it; hopefully I'll fix these right this year. But feel free to submit a PR in the meantime; that would be quite appreciated, and I hope you've fixed these issues on your side and. now enjoying this tool working and preserving your files' metadata.

Please note I've recently introduced breaking changes (presenting the .gitmeta-cid file), starting from the commit https://github.com/01VCS/git-meta/commit/fc4e66241a0bb6de4777f34133168789df36b188 (with the help of CursorGPT, as my time nows' quite limited compared to 2021 and StackOverflow can become a hell). The idea for these recent changes is to make a workaround to scale Git's MD-1 hashes into a safer (and nicer) one. Once it gets sorted out and fully working, the next step is a experimental feature for signing commits with a cryptocurrency key (in this case Ethereum) instead of GPG/PGP, for the punker ones. But both should be opt-in, as working on a repo will take longer in checksums better than MD-1.

BTW, the endgame for git-meta is being able to apply the repo's .git-meta metadata at checkout!

gitcnd commented 9 months ago

I re-wrote the entire thing: it's here, tested, working nicely

https://github.com/gitcnd/git-meta

I also added a feature I like:

https://www.instructables.com/How-to-Use-git-on-Your-Own-Machines-to-Manage-Web-/