You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a bug or more a feature request.
We use Eclipse with work-trees. This is not fully supported yet but works when you create the worktrees on the command line. Checkout branch A into one worktree and checkout branch B into another one.
Now you can open branch A in one Eclipse workspace and branch B in another. Committing pulling and pushing all works. But we have an issue with commit hooks.
We have activated a commit message hook. This works on the first worktree A but not on B.
The command line parameter $1 which should point to the file with the commit message is "empty".
When committing on branch A the file is passed to the hook as .git/COMMIT_EDITMSG that works fine.
But on B it does not work. Most likely because then the file will be written to .git\worktrees\branch-B\COMMIT_EDITMSG and the code that invokes the commit hook does not look there? Just guessing for now but this is what I think is going wrong and why the parameter is empty.
How to reproduce:
With git command line tools
On a repo checkout branch A into a folder
Checkout another branch B into another folder as separate work-tree
Activate commit hook support: may need some additional setup on Windows with Cygwin
With Eclipse
Create workspace A and import projects
Create another workspace B and import projects
Do a change in workspace 1 and commit it in Eclipse
Check the printed message and it will be .git/COMMIT_EDITMSG
Create a simple commit hook in .git/hooks/commit-msg to print $1
Do a change in workspace B and commit it in Eclipse
Check the printed message and it will be empty
Actual behavior
commit-msg commit hook is not invoked correctly when work-trees are involved. The parameter to pass the COMMIT_EDITMSG file is empty.
Expected behavior
The commit-msg script should be invoked with parameter 1 pointing to the correct COMMIT_EDITMSG file in the work-trees folder.
Relevant log output
Other information
No response
The text was updated successfully, but these errors were encountered:
Version
7.0.0.202409031743-r
Operating System
Windows
Bug description
Not sure if this is a bug or more a feature request.
We use Eclipse with work-trees. This is not fully supported yet but works when you create the worktrees on the command line. Checkout branch A into one worktree and checkout branch B into another one.
Now you can open branch A in one Eclipse workspace and branch B in another. Committing pulling and pushing all works. But we have an issue with commit hooks.
We have activated a commit message hook. This works on the first worktree A but not on B.
The command line parameter $1 which should point to the file with the commit message is "empty".
When committing on branch A the file is passed to the hook as .git/COMMIT_EDITMSG that works fine.
But on B it does not work. Most likely because then the file will be written to .git\worktrees\branch-B\COMMIT_EDITMSG and the code that invokes the commit hook does not look there? Just guessing for now but this is what I think is going wrong and why the parameter is empty.
How to reproduce:
With git command line tools
With Eclipse
Create workspace A and import projects
Create another workspace B and import projects
Do a change in workspace 1 and commit it in Eclipse
Check the printed message and it will be .git/COMMIT_EDITMSG
Create a simple commit hook in .git/hooks/commit-msg to print $1
Do a change in workspace B and commit it in Eclipse
Check the printed message and it will be empty
Actual behavior
commit-msg commit hook is not invoked correctly when work-trees are involved. The parameter to pass the COMMIT_EDITMSG file is empty.
Expected behavior
The commit-msg script should be invoked with parameter 1 pointing to the correct COMMIT_EDITMSG file in the work-trees folder.
Relevant log output
Other information
No response
The text was updated successfully, but these errors were encountered: