Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Blocking Git commit when special tag found in code(How do I block or warn on Git commit when there are special TODO tags indicating temporary code?)
Blocking Git commit when special tag found in code [message #1750688] Sun, 25 December 2016 14:55 Go to next message
Joshua Fox is currently offline Joshua FoxFriend
Messages: 4
Registered: December 2016
Junior Member
Sometimes I insert logging or instrumentation into the code -- sometimes even artificially throwing exceptions to make sure my code can handle them. This should not go to the shared repository.

Can Eclipse warn or prevent Git commits if there are special tags in the code?

These would not necessarily be TODO tags, but rather something like DEVONLY.

Intellij supports this.

How can this be done in Eclipse?
Re: Blocking Git commit when special tag found in code [message #1750853 is a reply to message #1750688] Fri, 30 December 2016 08:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33227
Registered: July 2009
Senior Member
This is the JDT forum (for questions about the Java tools). It's better to ask on the EGit forum.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Blocking Git commit when special tag found in code [message #1750857 is a reply to message #1750688] Fri, 30 December 2016 08:36 Go to previous messageGo to next message
Joshua Fox is currently offline Joshua FoxFriend
Messages: 4
Registered: December 2016
Junior Member
Done. Feel free to delete the present ticket, or let me know how.
Re: Blocking Git commit when special tag found in code [message #1750899 is a reply to message #1750857] Sat, 31 December 2016 21:48 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
We might just add the hint that JDT allows users to define arbitrary "task tags", so it's definitely possible to let the compiler create markers for tags like DEVONLY.

If this were to be interfaced with EGit, assigning highest priority to DEVONLY would enable EGit to accept commits mentioning TODO (medium priority), but not DEVONLY - but I don't know about the EGit side of this...

Stephan

Re: Blocking Git commit when special tag found in code [message #1750904 is a reply to message #1750899] Sun, 01 January 2017 06:35 Go to previous messageGo to next message
Joshua Fox is currently offline Joshua FoxFriend
Messages: 4
Registered: December 2016
Junior Member
@Stephan, thank you. About this -- EGit to accept commits mentioning TODO (medium priority), but not DEVONLY -- Can you send some docs about how EGit/git accept/reject based on priority?

About this -- compiler create markers for tags like DEVONLY. -- sure, Eclipse/JDT, though not the compiler, can designate DEVONLY as a type of to-do marker, but how does that help us towards the goal?
Re: Blocking Git commit when special tag found in code [message #1750909 is a reply to message #1750904] Sun, 01 January 2017 08:50 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
On the JDT side it is indeed the compiler that detects the configured task tags (and it's the Compiler category where you find the property page for configuring this).

I just mentioned the priorities to indicate that it would be possible for other plug-ins to distinguish between tags that are tolerated and those that are treated specially.

I also mentioned that I don't know about any such functionality in EGit specifically, so I recommend you take my hints into the EGit forum, and then perhaps to an RFE in bugzilla.
Previous Topic:Can't view variables when debugging
Next Topic:Keyboard Input and Live Text Animation Help
Goto Forum:
  


Current Time: Tue Oct 15 00:18:17 GMT 2024

Powered by FUDForum. Page generated in 0.04699 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top