Question

I have set up subclipse for SVN on eclipse. Sometimes, we forget to remove console.logs() in the JavaScript source files and these are causing some errors on IE

So I was thinking if there could be an alert message that can be shown if subclipse detects any console.logs() during SVN Commit or it would be better if it could completely erase those console.logs() all together!(I Know I'm Asking For More Here!).

Thanks in advance guys.

Was it helpful?

Solution

Your best option is to perform a check at the server via a pre-commit hook script. Inspect the content coming in; if any JS file contains uncommented console.logs() statements (or any instances of console.logs(), period), reject the commit & inform the user why.

You may have to maintain a working copy on the server to apply the diffs to, to perform this check properly.

If you try to do any checking at the client end, you will have to configure each client separately and trust that users only use the client that you've configured. Assuming you have any SVN clients that offer this functionality (I'm only aware of TortoiseSVN allowing for anything remotely like this).

Your Subversion client and server should never automatically "purge" lines as you suggest in that last paragraph. You'll inevitably lose content you don't want to lose, and break your builds.

OTHER TIPS

You can use svn:ignore to ignore the JavaScript or Logs directory. Here is an article from IBM for how to use Subversion with Eclipse. You can go see the "Ignoring files" section. http://www.ibm.com/developerworks/opensource/library/os-ecl-subversion/

If your project generates files, or otherwise includes files that you don't want to check in to the Subversion repository, you can tell Subclipse to ignore them. Right-click the file or directory you want to exclude from version control, then choose Team > Add to svn:ignore to display the Add to svn:ignore dialog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top