Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub desktop freezes on commit when there is a pre-commit hook #11997

Open
Marius-Juston opened this issue Apr 14, 2021 · 2 comments
Open

GitHub desktop freezes on commit when there is a pre-commit hook #11997

Marius-Juston opened this issue Apr 14, 2021 · 2 comments
Labels
investigation-needed Likely bugs, but haven't been reliably reproduced by a reviewer

Comments

@Marius-Juston
Copy link

Describe the bug

I added a very simple git hook that would run before every commit:

#!/bin/bash

echo "Pulling ..."
git pull

This hook is located in the .git/hooks/ folder and named pre-commit as an executable. Though when I try to commit in GitHub desktop the program freezes and does not commit.

The GitHub desktop GUI is opened using my Windows environment and I added the folder location using the \\wsl$\Ubuntu-20.04\home\... path. I am also in my GitHub enterprise account.

Version & OS

GitHub Desktop version: Version 2.7.2
Windows 10: 10.0.19042 Build 19042

The repository is located in a WSL2 environment in Ubuntu 20.04.2 LTS.

Steps to reproduce the behavior

  1. In a WSL environment create a git repository.
  2. Create a pre-commit file that run git pull
  3. In your Windows environment open GitHub desktop
  4. Select Add local repository
  5. Navigate to the WSL location of the folder (\\wsl$\Ubuntu-20.04\home\... )
  6. Commit

Expected behavior

GitHub desktop should, when I press commit just run the pre-commit script and then just commit like it normally does.

Actual behavior

GitHub desktop just freezes and has the commit sign just keep on turning.

Screenshots

image

image

Logs

2021-04-14T02:00:28.725Z - info: [ui] [AppStore] loading 9 repositories from store
2021-04-14T02:00:28.727Z - info: [ui] [AppStore] found account: Marius-Juston (Marius Juston)
2021-04-14T02:00:28.727Z - info: [ui] [AppStore] found account: mjuston2 (Juston, Marius F)
2021-04-14T02:00:30.875Z - info: [ui] launching: 2.7.2 (Windows 10.0.19042)
2021-04-14T02:00:30.876Z - info: [ui] execPath: 'C:\Users\mariu\AppData\Local\GitHubDesktop\app-2.7.2\GitHubDesktop.exe'
2021-04-14T02:00:30.892Z - info: [ui] Executing getRemotes: git remote -v (took 2.144s)
2021-04-14T02:00:30.893Z - info: [ui] Executing getRemotes: git remote -v (took 1.554s)
2021-04-14T02:00:30.928Z - info: [ui] Executing getStatus: git --no-optional-locks status --untracked-files=all --branch --porcelain=2 -z (took 1.981s)
2021-04-14T02:00:31.047Z - info: [ui] Executing getStatus: git --no-optional-locks status --untracked-files=all --branch --porcelain=2 -z (took 1.517s)
2021-04-14T02:00:31.904Z - info: [ui] Executing installGlobalLFSFilter: git lfs install --skip-repo (took 1.731s)
2021-04-14T02:00:32.080Z - info: [ui] Stats reported.
2021-04-14T02:00:32.476Z - info: [ui] Executing getCommits: git log 37852f6e0eb36f0f73da29d5bc55f1488253935a --date=raw --max-count=1 -z --format=%H%x00%h%x00%s%x00%b%x00%an <%ae> %ad%x00%cn <%ce> %cd%x00%P%x00%(trailers:unfold,only)%x00%D --no-show-signature --no-color -- (took 1.322s)
2021-04-14T02:00:34.298Z - info: [ui] Executing getBranches: git for-each-ref --format=%00%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(symref)%00 refs/heads refs/remotes (took 1.710s)
2021-04-14T02:00:34.303Z - info: [ui] Executing getBranches: git for-each-ref --format=%00%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(symref)%00 refs/heads refs/remotes (took 1.187s)
2021-04-14T02:00:36.733Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 -- (took 4.120s)
2021-04-14T02:00:36.733Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 -- (took 3.488s)
2021-04-14T02:00:40.491Z - info: [ui] Executing getCommits: git log HEAD --date=raw --max-count=100 -z --format=%H%x00%h%x00%s%x00%b%x00%an <%ae> %ad%x00%cn <%ce> %cd%x00%P%x00%(trailers:unfold,only)%x00%D --no-show-signature --no-color -- (took 1.746s)
2021-04-14T02:00:45.398Z - info: [ui] Executing getCommits: git log HEAD --date=raw --max-count=100 -z --format=%H%x00%h%x00%s%x00%b%x00%an <%ae> %ad%x00%cn <%ce> %cd%x00%P%x00%(trailers:unfold,only)%x00%D --no-show-signature --no-color -- (took 1.199s)
2021-04-14T02:00:48.291Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: mjuston2-linj2-bingyan2-austinl8 - mjuston2 (has token)
2021-04-14T02:00:50.958Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 2.610s)
2021-04-14T02:00:58.490Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: mjuston2 - mjuston2 (has token)
2021-04-14T02:01:04.453Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 5.957s)
2021-04-14T02:06:50.130Z - info: [ui] [RepositoryIndicatorUpdater]: Refreshing sidebar indicators for 8 repositories took 12.5s of which 340.9s paused, total 353.4s
2021-04-14T02:19:00.617Z - info: [ui] [RepositoryIndicatorUpdater]: Refreshing sidebar indicators for 8 repositories took 4.0s of which 0.0s paused, total 4.0s
@steveward
Copy link
Member

Thanks for the report @Marius-Juston. Have you tested out this pre-commit hook using Git from the command line to see if it works there?

Also, are you using HTTPS or SSH authentication with this repository in WSL?

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Apr 14, 2021
@Marius-Juston
Copy link
Author

I have tested out the pre-commit hook using Git from the command line and it was working.
I believe that I was using HTTPS authentication.

@no-response no-response bot removed the more-info-needed The submitter needs to provide more information about the issue label Apr 14, 2021
@steveward steveward added the investigation-needed Likely bugs, but haven't been reliably reproduced by a reviewer label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation-needed Likely bugs, but haven't been reliably reproduced by a reviewer
Projects
None yet
Development

No branches or pull requests

2 participants