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

pre-receive hook is not tolerant for an initial commit when branch is not even there #3089

Open
yarikoptic opened this issue Jun 25, 2024 · 0 comments

Comments

@yarikoptic
Copy link
Contributor

To troubleshoot

  • fetching and pushing through git  #3087
    I setup new bare repo (just git init --bare; git annex init so it did get only git-annex branch) and symlinked the pre-receive hook from openneuro. Then I tried to push from a clone of minimal repo from openneuro
yoh@typhon:/tmp/ds005256$ git push -u tmp-bare main
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 32 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 874 bytes | 874.00 KiB/s, done.
Total 8 (delta 1), reused 0 (delta 0), pack-reused 0
remote: fatal: Invalid revision range 0000000000000000000000000000000000000000..390e235f34bb2774270841e2e80fcf2e913bf979
remote: fatal: path '.bidsignore' does not exist in '390e235f34bb2774270841e2e80fcf2e913bf979'
remote: hooks/pre-receive: line 134: /srv/node_modules/.bin/bids-validator: No such file or directory
remote: 
remote: -------------------------------------------------------------------------
remote: Your push was rejected because it failed validation.
remote: Please test with bids-validator locally to resolve any errors before pushing.
remote: -------------------------------------------------------------------------
To ../ds005256-bare
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to '../ds005256-bare'

so it was not kosher that bids-validator was not available ... I created a shim within PATH and tuned up the pre-receive to not rely on hardcoded path. Now push "kinda worked" as it gave fatal error but proceeded "normally"

yoh@typhon:/tmp/ds005256$ git push -u tmp-bare main
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 32 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 874 bytes | 874.00 KiB/s, done.
Total 8 (delta 1), reused 0 (delta 0), pack-reused 0
remote: fatal: Invalid revision range 0000000000000000000000000000000000000000..390e235f34bb2774270841e2e80fcf2e913bf979
remote: fatal: path '.bidsignore' does not exist in '390e235f34bb2774270841e2e80fcf2e913bf979'
remote: This dataset failed a quick validation, please verify it is a BIDS dataset at the root of the git repository
To ../ds005256-bare
 * [new branch]      main -> main
branch 'main' set up to track 'tmp-bare/main'.

yoh@typhon:/tmp/ds005256$ git push -u tmp-bare main
branch 'main' set up to track 'tmp-bare/main'.
Everything up-to-date

not sure if those "fatal" and validation errors matter.

FWIW -- then I tried to push updated version with bids filename errors addressed -- went fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant