`core.hooksPath` not respected for custom Git hooks (e.g. .githooks folder)
Version
0.14.16
Operating System
macOS
Distribution Method
dmg (Mac OS - Apple Silicon)
Describe the issue
Originally discussed in this comment — opening a new issue as suggested in the reply.
Hi all,
First of all, thanks for the amazing work on GitButler — it’s truly changed the way I work with Git, giving me much more flexibility and control.
One thing I’m struggling with is getting Git hooks to run properly. I always enable the “Run commit hooks” toggle in my project settings, since I always rely on hooks in my workflow.
I usually store my hook scripts in a .githooks folder and set it with:
git config core.hooksPath .githooks
However, the hooks are never executed (yes, they are set as executables: chmod +x .githooks/*). I also tried using the default git/hooks directory, but unfortunately, the result is the same — they still don’t run. Specifically, I’m trying to use pre-commit and pre-push hooks.
I’m not sure if I’m doing something wrong or if there’s a limitation I’m missing. I’d really love to get this working, as commit hooks are a critical part of my development flow.
Any help or insights would be greatly appreciated — and again, thanks for all your great work on GitButler!
How to reproduce (Optional)
No response
Expected behavior (Optional)
When I enable the “Run commit hooks” toggle and set core.hooksPath to a custom directory (e.g., .githooks), GitButler should run the hook scripts (e.g., pre-commit, pre-push) located in that directory — just like standard Git behavior when run via CLI.
Relevant log output (Optional)
Thanks a lot for reporting!
Essentially, GitButler hands of pre-commit hooks to git2_hooks as indicated here in git2_hooks::hooks_pre_commit():
https://github.com/gitbutlerapp/gitbutler/blob/4ce41cb660699b3464113d1742f08145777a7eea/crates/gitbutler-repo/src/hooks.rs#L59-L85
However, the pre-push is expected to be run by Git as GitButler uses the binary to push, and that also doesn't seem to happen.
Thus I'd think that there is something about the configuration that, when run through GitButler, doesn't get applied.
Can it be that environment variables are used to configure crucial parts of Git somehow?
Thanks for your response.
Here is a the content of ".githooks/pre-commit" and ".githooks/pre-push". Yes, it is the same.
BTW none of them are executed.
#!/bin/sh
set -e # Exit immediately if any command exits with a non-zero status
echo ""
echo '* Verify dependencies'
go mod verify
echo ""
echo '* Run: go-modernize'
modernize -test ./...
echo ""
echo '* Run: golangci'
golangci-lint run ./...
echo ""
echo '* Run: all tests and generate coverage report'
go test ./... -covermode=atomic
I do not see anything special here
Thanks
I don't think the content of the hooks has anything to do with it, my inquiry was about some difference in the environment that makes Git when launched from GitButler not see the pre-push hook, for instance, which otherwise is seen by Git when executed from the terminal.
Thus, even if one would think that the git2_hooks crate for some reason doesn't see the pre-commit hook, we would still expect that git when launched by GitButler when pushing picks up all hooks. But that also doesn't seem to happen.
In your opinion what kind of checks should I do on my environment/configuration to allow a better diagnosis of the issue?
for information purposes only, when I added the local repository on GitButler, I selected the git executable present in the system.
both git cli and github desktop work fine and execute hooks. I would have expected them to work with GitButler out of the box too.
Thanks
Thanks for checking with me, and sorry for the ambiguity.
I'd want to focus on the pre-push hook as it should be expected when GitButler performs a push through the Git CLI. This, however, doesn't happen for unknown reason.
As GitButler comes up with environment variables for GUI applications, these will be lacking what the users usually sees when going through the terminal.
Could you check what GIT_ prefixed environment variables are available when typing env in the terminal? Maybe there are other variables as well that stick out to you.
Once that is sorted, that will certainly explain why pre-commit hooks aren't executed either.
Thanks again.
Thanks for the follow-up!
I ran:
env
env | grep -i '^GIT_'
typeset -xp | grep '^GIT_'
printenv | grep '^GIT_'
but there was no output in any of these cases—no environment variables starting with GIT_.
Based on your comment, I expected there might be at least some GIT_ variables set.
For context, I’m running this in the terminal on macOS Sequoia 15.4, using zsh inside both iTerm2 and Ghostty
Let me know if there’s a better way to capture the environment that Git sees when it runs hooks. I’m happy to try anything you suggest!
Thank you!
It seems there is nothing special.
What happens when running the application directly from the terminal where git push definitely runs the pre-push hook? /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri should do the trick.
~~We'd expect that GitButler when launched from the terminal will execute the pre-push hooks just like git push in the terminal does.~~ Scratch that, it seems --no-verify is passed when pushing, and hooks will not be run.
https://github.com/gitbutlerapp/gitbutler/blob/47b86e156741307df4c69de6404167998b2091d6/crates/gitbutler-git/src/repository.rs#L355
@Caleb-T-Owens may have more context on the reasoning, and can maybe help to make *push related hooks possible again.
However, we'd also expect that creating a commit will now run pre-commit hooks - now the app as exactly the same environment as Git would have when run in the terminal, and git2_hooks would emulate that behaviour.
Thanks again for your help!
/Applications/GitButler.app/Contents/MacOS/gitbutler-tauri any args to be passed?
by running /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri nothing happen
It should open the GitButler application and a lot of lines would show in the terminal. However, nothing happens if the application is already open.
/Applications/GitButler.app/Contents/MacOS/gitbutler-tauri
2025-04-14T15:30:31.462633Z INFO crates/gitbutler-tauri/src/main.rs:64: system git executable for fetch/push: "git"
2025-04-14T15:30:31.462702Z INFO crates/gitbutler-tauri/src/main.rs:104: starting app version=0.14.18 name=GitButler
2025-04-14T15:30:31.642421Z INFO get_app_settings: crates/gitbutler-tauri/src/settings.rs:49: close time.busy=792ns time.idle=18.5µs
2025-04-14T15:30:31.653722Z INFO get_app_settings: crates/gitbutler-tauri/src/settings.rs:49: close time.busy=1.21µs time.idle=11.4µs
2025-04-14T15:30:31.688942Z INFO get_user: crates/gitbutler-tauri/src/users.rs:10: close time.busy=31.5ms time.idle=16.8µs
2025-04-14T15:30:31.756444Z INFO list_projects: crates/gitbutler-tauri/src/projects.rs:51: close time.busy=1.04ms time.idle=12.1µs
2025-04-14T15:30:31.777948Z INFO get_project: crates/gitbutler-tauri/src/projects.rs:37: close time.busy=1.40ms time.idle=13.0µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 no_validation=None
2025-04-14T15:30:31.783573Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=55.1µs time.idle=9.04µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T15:30:31.786950Z INFO git_head: crates/gitbutler-tauri/src/commands.rs:68: close time.busy=245µs time.idle=13.6µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:31.787357Z INFO git_remote_branches: crates/gitbutler-tauri/src/commands.rs:10: close time.busy=1.62ms time.idle=10.3µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:31.787891Z INFO get_base_branch_data:get_base_branch_data: crates/gitbutler-branch-actions/src/base.rs:49: close time.busy=1.61ms time.idle=10.3µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:31.787917Z INFO get_base_branch_data: crates/gitbutler-tauri/src/virtual_branches.rs:154: close time.busy=1.79ms time.idle=7.79µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:31.788799Z INFO operating_mode: crates/gitbutler-tauri/src/modes.rs:20: close time.busy=148µs time.idle=6.92µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:31.805861Z INFO list_projects: crates/gitbutler-tauri/src/projects.rs:51: close time.busy=37.0µs time.idle=10.7µs
2025-04-14T15:30:31.809612Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=72.9µs time.idle=10.9µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T15:30:31.819385Z INFO list_branches: crates/gitbutler-tauri/src/virtual_branches.rs:493: close time.busy=1.28ms time.idle=10.4µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 filter=None
2025-04-14T15:30:31.856578Z INFO get_branch_listing_details: crates/gitbutler-tauri/src/virtual_branches.rs:507: close time.busy=3.45ms time.idle=17.1µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 branch_names=["i-branch-1"]
2025-04-14T15:30:31.859373Z INFO get_branch_listing_details: crates/gitbutler-tauri/src/virtual_branches.rs:507: close time.busy=6.37ms time.idle=15.5µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 branch_names=["Lane"]
2025-04-14T15:30:31.870971Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=87.0µs time.idle=11.4µs key="user.name"
2025-04-14T15:30:31.871018Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=72.1µs time.idle=11.5µs key="user.name"
2025-04-14T15:30:31.877404Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=79.4µs time.idle=13.3µs key="user.email"
2025-04-14T15:30:31.887059Z INFO list_projects: crates/gitbutler-tauri/src/projects.rs:51: close time.busy=40.0µs time.idle=13.5µs
2025-04-14T15:30:31.887102Z INFO list_projects: crates/gitbutler-tauri/src/projects.rs:51: close time.busy=23.0µs time.idle=5.17µs
2025-04-14T15:30:31.908940Z INFO list_virtual_branches: crates/gitbutler-tauri/src/virtual_branches.rs:54: close time.busy=40.7ms time.idle=10.4µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:31.912388Z INFO list_branches: crates/gitbutler-tauri/src/virtual_branches.rs:493: close time.busy=698µs time.idle=9.96µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 filter=None
2025-04-14T15:30:31.933398Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=80.6µs time.idle=13.3µs key="gitbutler.aiModelProvider"
2025-04-14T15:30:31.936092Z INFO stack_details: crates/gitbutler-tauri/src/workspace.rs:32: close time.busy=2.25ms time.idle=5.75µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 stack_id=70bd30a8-2f74-4e23-98fd-c8a93c5aa21d
2025-04-14T15:30:31.950247Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=2.37ms time.idle=15.5µs handle="aiOpenAIKey"
2025-04-14T15:30:31.958042Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=47.7µs time.idle=12.9µs handle="aiAnthropicKey"
2025-04-14T15:30:31.958860Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=94.6µs time.idle=9.92µs key="gitbutler.aiOllamaEndpoint"
2025-04-14T15:30:31.959554Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=47.2µs time.idle=5.54µs key="gitbutler.aiOllamaModelName"
2025-04-14T15:30:31.960031Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=35.2µs time.idle=4.62µs key="gitbutler.aiModelProvider"
2025-04-14T15:30:31.960533Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=50.4µs time.idle=7.00µs key="gitbutler.aiOpenAIKeyOption"
2025-04-14T15:30:31.960954Z INFO git_get_global_config: crates/gitbutler-tauri/src/commands.rs:97: close time.busy=34.5µs time.idle=5.12µs key="gitbutler.aiAnthropicKeyOption"
2025-04-14 17:30:31.977 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000257b9e0> - changing property shadowOffset in transform-only layer, will have no effect
2025-04-14 17:30:31.977 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000257b9e0> - changing property shadowColor in transform-only layer, will have no effect
2025-04-14 17:30:31.977 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000257b9e0> - changing property shadowRadius in transform-only layer, will have no effect
2025-04-14 17:30:31.980 gitbutler-tauri[75116:326680] <CATransformLayer: 0x600002573d20> - changing property shadowOffset in transform-only layer, will have no effect
2025-04-14 17:30:31.980 gitbutler-tauri[75116:326680] <CATransformLayer: 0x600002573d20> - changing property shadowColor in transform-only layer, will have no effect
2025-04-14 17:30:31.980 gitbutler-tauri[75116:326680] <CATransformLayer: 0x600002573d20> - changing property shadowRadius in transform-only layer, will have no effect
2025-04-14T15:30:32.307980Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=59.0µs time.idle=11.5µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T15:30:32.308303Z INFO get_base_branch_data:get_base_branch_data: crates/gitbutler-branch-actions/src/base.rs:49: close time.busy=914µs time.idle=8.79µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:32.308325Z INFO get_base_branch_data: crates/gitbutler-tauri/src/virtual_branches.rs:154: close time.busy=1.16ms time.idle=11.0µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:32.317489Z INFO fetch_from_remotes:get_base_branch_data: crates/gitbutler-branch-actions/src/base.rs:49: close time.busy=1.22ms time.idle=19.6µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 action=Some("auto")
2025-04-14T15:30:32.317540Z INFO fetch_from_remotes: crates/gitbutler-tauri/src/virtual_branches.rs:551: close time.busy=530ms time.idle=9.42µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 action=Some("auto")
2025-04-14T15:30:32.320040Z INFO get_base_branch_data:get_base_branch_data: crates/gitbutler-branch-actions/src/base.rs:49: close time.busy=761µs time.idle=10.2µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:32.320063Z INFO get_base_branch_data: crates/gitbutler-tauri/src/virtual_branches.rs:154: close time.busy=941µs time.idle=10.2µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:32.320711Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=51.8µs time.idle=13.5µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T15:30:32.323021Z INFO stack_details: crates/gitbutler-tauri/src/workspace.rs:32: close time.busy=3.78ms time.idle=9.33µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 stack_id=70bd30a8-2f74-4e23-98fd-c8a93c5aa21d
2025-04-14T15:30:32.332148Z INFO handle:calculate_virtual_branches: crates/gitbutler-watcher/src/handler.rs:105: close time.busy=14.0ms time.idle=16.8µs event=VirtualBranch(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
2025-04-14T15:30:32.332214Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=14.4ms time.idle=11.0µs event=VirtualBranch(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
2025-04-14T15:30:32.337271Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=48.1µs time.idle=10.8µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14 17:30:32.578 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000255d420> - changing property shadowOffset in transform-only layer, will have no effect
2025-04-14 17:30:32.578 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000255d420> - changing property shadowColor in transform-only layer, will have no effect
2025-04-14 17:30:32.578 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000255d420> - changing property shadowRadius in transform-only layer, will have no effect
2025-04-14T15:30:32.848412Z INFO list_branches: crates/gitbutler-tauri/src/virtual_branches.rs:493: close time.busy=5.79ms time.idle=55.8µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 filter=None
2025-04-14T15:30:33.058971Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=65.1µs time.idle=37.9µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=75 fs_events=75 ignored=0 ignored=0 git_noop=17 git_noop=17 git=1 git=1 project=0 project=0 git_dedup=1 git_dedup=1
2025-04-14T15:30:33.059570Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=526µs time.idle=12.7µs event=GitFileChange(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29, FETCH_HEAD)
2025-04-14T15:30:33.567437Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=241µs time.idle=42.8µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T15:30:33.574533Z INFO get_base_branch_data:get_base_branch_data: crates/gitbutler-branch-actions/src/base.rs:49: close time.busy=8.25ms time.idle=55.8µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:33.574621Z INFO get_base_branch_data: crates/gitbutler-tauri/src/virtual_branches.rs:154: close time.busy=10.1ms time.idle=40.5µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:33.587803Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=78.8µs time.idle=18.6µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T15:30:34.097621Z INFO list_branches: crates/gitbutler-tauri/src/virtual_branches.rs:493: close time.busy=5.13ms time.idle=59.2µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 filter=None
2025-04-14T15:30:35.768098Z INFO message_hook: crates/gitbutler-tauri/src/repo.rs:128: close time.busy=51.7ms time.idle=30.2µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 refactor(testutils): enhance CaptureStdout to capture stderr and handle errors
2025-04-14T15:30:36.373179Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=45.0µs time.idle=61.5µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=2 fs_events=2 ignored=0 ignored=0 git_noop=1 git_noop=1 git=0 git=0 project=0 project=0
2025-04-14T15:30:49.826369Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=20.9µs time.idle=24.8µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=9 fs_events=9 ignored=0 ignored=0 git_noop=1 git_noop=1 git=1 git=1 project=0 project=0 git_dedup=1 git_dedup=1
2025-04-14T15:30:49.826648Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=211µs time.idle=7.21µs event=GitFileChange(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29, index)
2025-04-14T15:30:50.843845Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=6.75µs time.idle=16.8µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=1 fs_events=1 ignored=0 ignored=0 git_noop=0 git_noop=0 git=0 git=0 project=0 project=0
2025-04-14T15:30:59.479371Z INFO pre_commit_hook: crates/gitbutler-tauri/src/repo.rs:103: close time.busy=10.5s time.idle=30.6µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "internal/testutils/testutils.go", hunks: [Hunk { hash: Some(6b2c5f68f8bf0160c4f954e4b62a4227), start: 54, end: 97, hunk_header: None }] }] }
2025-04-14T15:30:59.514810Z INFO commit_virtual_branch: crates/gitbutler-tauri/src/virtual_branches.rs:35: close time.busy=33.8ms time.idle=15.7µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 stack_id=70bd30a8-2f74-4e23-98fd-c8a93c5aa21d refactor(testutils): enhance CaptureStdout to capture stderr and handle errors ownership=Some(BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "internal/testutils/testutils.go", hunks: [Hunk { hash: Some(6b2c5f68f8bf0160c4f954e4b62a4227), start: 54, end: 97, hunk_header: None }] }] })
2025-04-14T15:30:59.516645Z INFO post_commit_hook: crates/gitbutler-tauri/src/repo.rs:116: close time.busy=131µs time.idle=9.88µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T15:30:59.519941Z INFO stack_details: crates/gitbutler-tauri/src/workspace.rs:32: close time.busy=3.96ms time.idle=15.0µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 stack_id=70bd30a8-2f74-4e23-98fd-c8a93c5aa21d
2025-04-14T15:30:59.530052Z INFO handle:calculate_virtual_branches: crates/gitbutler-watcher/src/handler.rs:105: close time.busy=14.8ms time.idle=20.3µs event=VirtualBranch(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
2025-04-14T15:30:59.530127Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=15.1ms time.idle=10.8µs event=VirtualBranch(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
2025-04-14 17:30:59.561 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000257c100> - changing property shadowOffset in transform-only layer, will have no effect
2025-04-14 17:30:59.561 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000257c100> - changing property shadowColor in transform-only layer, will have no effect
2025-04-14 17:30:59.561 gitbutler-tauri[75116:326680] <CATransformLayer: 0x60000257c100> - changing property shadowRadius in transform-only layer, will have no effect
2025-04-14T15:31:00.224572Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=218µs time.idle=87.8µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=180 fs_events=180 ignored=0 ignored=0 git_noop=73 git_noop=73 git=2 git=2 project=0 project=0 git_dedup=2 git_dedup=2
2025-04-14T15:31:00.226282Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=1.53ms time.idle=42.2µs event=GitFileChange(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29, index, logs/HEAD)
2025-04-14T15:31:00.226396Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=1.33ms time.idle=21.0µs event=GitButlerOplogChange(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
the pre_commit_hook executes properly and I see the toast notification on the UI too.
The real question is...why it never happened before
Great, thanks~~this means that somehow the environment in the user's terminal is responsible for making it work, maybe even the current working directory, somehow. Maybe this you can also try out by running GitButler from the terminal, but from another directory~~. The git-hooks directory is .githooks, which Git interprets as relative to the working tree (I think).
And… I think the solution here is to update to the next release of git2-hooks which will contain this PR - a fix for the issue we see here.
With the pre-push hook we will stay tuned for a reply to the question asked earlier.
this is the portion when push
2025-04-14T20:17:59.463444Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=29.8µs time.idle=35.4µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=6 fs_events=6 ignored=0 ignored=0 git_noop=0 git_noop=0 git=1 git=1 project=0 project=0 git_dedup=1 git_dedup=1
2025-04-14T20:17:59.463861Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=306µs time.idle=12.5µs event=GitFileChange(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29, FETCH_HEAD)
2025-04-14T20:17:59.927869Z INFO push_stack: crates/gitbutler-tauri/src/stack.rs:113: close time.busy=1.72s time.idle=52.6µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 stack_id=70bd30a8-2f74-4e23-98fd-c8a93c5aa21d with_force=false
2025-04-14T20:17:59.936969Z INFO stack_details: crates/gitbutler-tauri/src/workspace.rs:32: close time.busy=6.25ms time.idle=21.8µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 stack_id=70bd30a8-2f74-4e23-98fd-c8a93c5aa21d
2025-04-14T20:17:59.952466Z INFO handle:calculate_virtual_branches: crates/gitbutler-watcher/src/handler.rs:105: close time.busy=23.6ms time.idle=20.9µs event=VirtualBranch(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
2025-04-14T20:17:59.952572Z INFO handle: crates/gitbutler-watcher/src/handler.rs:55: close time.busy=24.2ms time.idle=13.8µs event=VirtualBranch(16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29)
2025-04-14T20:17:59.967045Z INFO get_base_branch_data:get_base_branch_data: crates/gitbutler-branch-actions/src/base.rs:49: close time.busy=1.03ms time.idle=7.71µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T20:17:59.967081Z INFO get_base_branch_data: crates/gitbutler-tauri/src/virtual_branches.rs:154: close time.busy=1.33ms time.idle=10.7µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29
2025-04-14T20:17:59.975517Z INFO secret_get_global: crates/gitbutler-tauri/src/secret.rs:9: close time.busy=2.56ms time.idle=18.9µs handle="git-lab-token:16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29"
2025-04-14T20:18:00.479028Z INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates/gitbutler-watcher/src/file_monitor.rs:119: close time.busy=37.2µs time.idle=38.7µs id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 window="main" project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 fs_events=16 fs_events=16 ignored=0 ignored=0 git_noop=12 git_noop=12 git=0 git=0 project=0 project=0
2025-04-14T20:18:00.482701Z INFO list_branches: crates/gitbutler-tauri/src/virtual_branches.rs:493: close time.busy=4.48ms time.idle=42.8µs project_id=16d4fd4d-0e95-4722-9e85-f8c9d1a6fa29 filter=None
no reference to pre-push hook
Thanks, what I meant is that @Caleb-T-Owens should have context about why GitButler explicitly disables hooks when pushing, and what we could do to make these possible again.
I figured! I just wanted to share that part of the logs for completeness, in case it’s helpful.