Bug 582046 - GIT HOOKS PRE-COMMIT
Summary: GIT HOOKS PRE-COMMIT
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-08 02:42 EDT by sandeep goud CLA
Modified: 2023-06-09 15:38 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sandeep goud CLA 2023-06-08 02:42:24 EDT
I am unable to run the git pre-commit from egit (git)staging.kindly let we know what are the steps need to configure.
Comment 1 Matthias Sohn CLA 2023-06-09 15:38:22 EDT
If a pre-commit hook script is installed in the repository's .git/hooks directory it should be executed when a new commit is created.

But FS#runHookIfPresent [1] is only implemented for Posix [2] and Cygwin [3] but not for Windows [4] that's why hooks aren't run on Windows.

Contributions are welcome :-)

[1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java#1902 
[2] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java#269
[3] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java#139
[4] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java#36