Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349760 - Add an option to populate commit message with default git message
Summary: Add an option to populate commit message with default git message
Status: CLOSED INVALID
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-18 17:28 EDT by yacoob CLA
Modified: 2013-09-29 14:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yacoob CLA 2011-06-18 17:28:59 EDT
I've created a small git hook that adds extra information to commit message before it's presented to the user. 

https://github.com/yacoob/git-last-fm

This information is introduced as a comment line, to avoid forcing a comment if users doesn't add anything. If this extra information would be added as a normal line, git would detect it as user commit, and always commit files, despite user's intent.

Now, if I use this hook with EGit, from Eclipse, the comment line gets stripped by EGit, and doesn't show up in the commit dialog. Easiest way to make that work, would be to add an option to EGit to preserve the comment lines from git itself. 

If you don't like that idea; can you tell me whether there's anything that EGit sets in the environment, that my hook can check for, to discover it's being run by Eclipse? If there's anything like that (environment variable?) I can use it to detect EGit and ditch the comment sign at the beginning of the line.
Comment 1 Robin Rosenberg CLA 2013-01-03 19:39:52 EST
I don't understand. EGit currently does not support hooks, so how can it misinterpret the output of a hook?