desktop / desktop/desktop

Hook with shebang line fails to execute on Windows only through GitHub desktop

Open
#21,360 1 comment 0 reactions 0 assignees View on GitHub
bug priority-3
Dominant language
TypeScript
Stars
21.8k
Forks
10.5k
Avg merge
1d 15h
Merged PRs (30d)
25

Description

### The problem

I have the Flutter repository set up locally, which when configured for engine development has some git hooks. When I try to change branch from GitHub desktop it always fails with this error:

Image

Changing branch from the command line works fine.

The hook is here:

https://github.com/flutter/flutter/blob/master/engine/src/flutter/tools/githooks/post-checkout

The only reference to `vpython3` is the shebang line here:

```
#!/usr/bin/env vpython3
```

When I checkout from the Windows PowerShell terminal, everything is fine and the hook runs. I know it's running, because the hook is just to print a warning, and the warning is printed:

Image

But presumably GH Desktop is invoking them (or git) in a different way.

I found https://github.com/desktop/desktop/issues/18739 which might be related, but it has been closed as fixed a long time ago, and I'm on the latest version.

### Release version

3.5.4

### Operating system

Windows 11 x86

### Steps to reproduce the behavior

1. Be on Windows
2. Clone https://github.com/flutter/flutter
3. Set up the engine development as per https://github.com/flutter/flutter/blob/main/docs/engine/contributing/Setting-up-the-Engine-development-environment.md
It's possible you can just directly enable the hooks in `.git\config` instead?
```ini
[core]
hooksPath = D:\\Dev\\Google\\Flutter\\Flutter main\\engine\\src\\flutter\\tools\\githooks
```
4. Try to change branches in GitHub Desktop

### Log files

[2025-12-11.desktop.production.log](https://github.com/user-attachments/files/24101290/2025-12-11.desktop.production.log)

### Screenshots

Image

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked engine/src/flutter/tools/githooks/post-checkout hook and the attached 2025-12-11.desktop.production.log. Reproduce a branch change on Windows through GitHub Desktop and compare it with the PowerShell checkout, then trace the Git hook invocation path. Done means the hook executes successfully through GitHub Desktop without breaking branch changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, git, typescript
Domain
desktop, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.