Hi Kyle, Kyle Meyer <k...@kyleam.com> writes:
> Timothy Sample <samp...@ngyro.com> writes: > > [...] > >>> I'm wondering whether the shebang patching in .git/hooks/pre-commit >>> will >>> cause a problem. Using the patched shellPath_portable, 'git annex >>> init' >>> generates a hook like this: >>> >>> % cat .git/hooks/pre-commit >>> #!/gnu/store/rbrandv7anzjxqkr40d7fkanzssslk4b-bash-minimal-4.4.19/bin/sh >>> # automatically configured by git-annex >>> git annex pre-commit . >>> >>> But won't this break if that particular bash-mininimal is garbage >>> collected? >> >> My understanding is that since git-annex contains a reference to >> bash-minimal, the garbage collector will leave it alone. Indeed, >> running “guix gc --references /gnu/store/…-git-annex-20180626” shows >> that Guix knows that git-annex needs bash-minimal. As long as >> git-annex >> is available (a prerequisite to the pre-commit hook working) >> bash-minimal will be available. > > Hmm, I'm not convinced that *that* bash-minimal will be available. > > Perhaps I'm just missing something, but to spell out my concern a > little > more: I have /gnu/store/A/git-annex and /gnu/store/X/bash-minimal. I > set up a repo with 'git annex init', and > /gnu/store/X/bash-minimal/bin/sh is used in the shebang. > > Some time later I am using /gnu/store/B/git-annex, which references > /gnu/store/Y/bash-minimal. That repo's hook still uses the > X/bash-minimal/bin/sh. But if /gnu/store/X/bash-minimal is no longer > referenced by any package, it could be garbage collected, leading to > the > hook failing. Ah yes! That could be a problem indeed. Good catch. Following the example of autoconf, it seems it should just be left alone. I will fix it shortly. (Right now git-annex doesn’t even build, so I will fix that first!) Thanks! -- Tim