Skip to main content



      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 09:55 Go to next message
Eclipse UserFriend
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 03:09 Go to previous messageGo to next message
Eclipse UserFriend
This is the JDT forum (for questions about the Java tools). It's better to ask on the EGit forum.
Re: Blocking Git commit when special tag found in code [message #1750857 is a reply to message #1750688] Fri, 30 December 2016 03:36 Go to previous messageGo to next message
Eclipse UserFriend
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 16:48 Go to previous messageGo to next message
Eclipse UserFriend
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 01:35 Go to previous messageGo to next message
Eclipse UserFriend
@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 03:50 Go to previous message
Eclipse UserFriend
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 Jun 17 23:23:20 EDT 2025

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

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

Back to the top