GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Windows] Hooks for submodules that are configured outside the submodule repository lead to error in PurePath.relative_to · Issue #1999 · gitpython-developers/GitPython

[Windows] Hooks for submodules that are configured outside the submodule repository lead to error in PurePath.relative_to #1999

New issue
Copy link
New issue
Copy link
Closed as not planned
Bug
Closed as not planned
[Windows] Hooks for submodules that are configured outside the submodule repository lead to error in PurePath.relative_to#1999
Bug
Copy link
Labels
acknowledgedhelp wanted

Description

@visq
visq
opened on Jan 21, 2025
Issue body actions

Issue: Repo.Index.commit fails during execution of post-commit hook
Root Cause: The .git config does not reside inside the submodule repository in the problematic setup.

    Repo/SubmoduleA$ cat .git
    gitdir: ../.git/modules/SubmoduleA

However, this is expected by the commit hook on windows:

    if sys.platform == "win32" and not _has_file_extension(hp):
        # Windows only uses extensions to determine how to open files
        # (doesn't understand shebangs). Try using bash to run the hook.
        relative_hp = Path(hp).relative_to(index.repo.working_dir).as_posix()
        cmd = ["bash.exe", relative_hp]

Reproduce: Track files with git-lfs and have the hooks outside the repository directory

Fix:

    if sys.platform == "win32" and not _has_file_extension(hp):
        # Windows only uses extensions to determine how to open files
        # (doesn't understand shebangs). Try using bash to run the hook.
        relative_hp = Path(hp).relative_to(index.repo.working_dir, walk_up=True).as_posix()
        cmd = ["bash.exe", relative_hp]

Activity

  1. Byron
    added
    acknowledged
    help wanted
    on Jan 22, 2025
  2. Byron
    added the
    Bug
    issue type on Jul 20, 2026
  3. Byron
    closed this as not plannedon Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedhelp wanted

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.