Skip to content

GitHooks does not handle running in submodules #603

@umlaeute

Description

@umlaeute

I'm trying to use Servus in a project of mine.
Since it is not packaged for my distribution, i included Servus via a git submodule.
Servus in turn includes this repository (via git submodule, but I think that doesn't matter here).

Now trying to build the submoduled Servus fails happily with:

CMake Error: Could not open file for write in copy operation .../Servus/.git/hooks/pre-commit.tmp
CMake Error: : System Error: Not a directory
CMake Error at CMake/common/GitHooks.cmake:18 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMake/common/Common.cmake:152 (include)
  CMakeLists.txt:35 (include)

And yes, .../Servus/.git is not a directory, but a file (that contains a reference to the parent repository).
afaik, this is how git submodules work.

Since the GitHooks snippet already ignores the case where .git is missing altogether, it probably should do something sensible if it is not a directory as well...

This has also been reported in in Servus as HBPVIS/Servus#108

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions