guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git-annex: problematic shebangs in .git/hooks/pre-commit?


From: Kyle Meyer
Subject: Re: git-annex: problematic shebangs in .git/hooks/pre-commit?
Date: Thu, 23 Aug 2018 13:05:09 -0400

Timothy Sample <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]