Author Topic: Announcing cbvcs  (Read 19294 times)

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Announcing cbvcs
« on: February 08, 2011, 03:50:09 am »
Hi all,

Just wanted to let you know about a version control plugin that I'm working on. At the moment it only supports git 1.7 (needs to be installed) but the grand plan is to support other 'back-ends' as well.

It's not yet feature complete, but feel free to have a play with it and come up with suggestions/ patches whatever.

Missing features:
1. Can't rename files
2. Can't revert changes
3. No Branching or tags yet
4. Can't initialise (start tracking) a project
5. And other things I can't think of at the moment :-)

Available features:
1. Add files
2. Remove files
3. Commit changes (on a single file, folder or whole project)

I've only worked on a Linux box (lucid) with 10.05 so YMMV with the Windows version.

It's available in source form at http://code.google.com/p/cbvcs/

Have fun!
D

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Announcing cbvcs
« Reply #1 on: February 22, 2011, 03:10:21 am »
 Hi there,

I had a play with this on Windows. It fails to compile for lack of "vcstrackermap.h". It's included in two places and you use a VcsTrackerMap object which appears to require it. It's included in the project but showing as missing. I checked your google repo. but the file isn't there, either.

Thanks.

« Last Edit: February 22, 2011, 03:19:29 am by Cryogen »

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Announcing cbvcs
« Reply #2 on: February 22, 2011, 10:45:52 am »
Hi Thanks for trying it out.

I've added the missing files.

D

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Announcing cbvcs
« Reply #3 on: February 26, 2011, 03:11:59 am »
 
 Hi dushara,

Thanks for that. It now compiles and runs smoothly. I couldn't find a stand-alone git exe for Windows and don't have ready access to a git repo. so I can't comment on the git functionality but I can say that it compiles and runs correctly, it appears in Help/Plugins and the Plugin manager and the git commands appear in the project menu. I've added a Windows project file and made some changes to bring it into line with the usual way of doing things, so your unix project is now the "-unix" version. I have used the normal paths in the Windows project so it creates its output files in the standard places. Check the project properties and build post-compile options. The same thing should be done for the unix verson but, since my VMs have been trashed and I haven't restore them yet, I haven't done that to avoid creating problems for you. I also added a pre-compiled header for Windows builds. These are some of the things that usually need to be done before a plug-in is added to the contrib collection.

Attached are the changed and new files. You might like to add some details to manifest.xml at the appropriate time.

Thanks for your efforts. Keep it up.

Cryo.
« Last Edit: February 26, 2011, 03:14:08 am by Cryogen »

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Announcing cbvcs
« Reply #4 on: February 26, 2011, 01:21:23 pm »
Hi Cryogen,

I'll integrate your changes soon. When I looked at the rename feature, I realised that I need to rework the design a bit. Now I've also started adding unit tests to make sure the changes I make aren't going to introduce any bugs. So anyway the long and short of it is, it will take me a bit of time to get the next version pushed through to the project page.

BTW have you seen msys (git http://code.google.com/p/msysgit/)?

Dushara

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9701
Re: Announcing cbvcs
« Reply #5 on: February 28, 2011, 06:54:39 am »
I'll integrate your changes soon. [...]
I had a look myself meanwhile. One thing I noticed is that it'll popup an error message every time you start C::B if git was not found (a git command fails to execute). Please don't do this. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Announcing cbvcs
« Reply #6 on: February 28, 2011, 07:11:57 am »
I had a look myself meanwhile. One thing I noticed is that it'll popup an error message every time you start C::B if git was not found (a git command fails to execute). Please don't do this. :-)

Hi Thanks for trying it out.

Yes that would be annoying. I'm yet to detect for the presence of git and well not do anything afterwards.

This is still in very early development...

Offline erotavlas

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Announcing cbvcs
« Reply #7 on: March 02, 2011, 09:47:57 am »
Hi,

I'm searching a plug-in to add the compatibility to manage a svn system inside code::block. What can you say about it?

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Announcing cbvcs
« Reply #8 on: March 02, 2011, 11:09:52 am »
Hi,

I'm searching a plug-in to add the compatibility to manage a svn system inside code::block. What can you say about it?

Well the grand plan is to make the plug-in more general but that's not going to be anytime soon. I've seen someone has a plug-in called SVNInside. Maybe that'll cover your needs.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Announcing cbvcs
« Reply #9 on: March 03, 2011, 03:30:12 am »
BTW have you seen msys (git http://code.google.com/p/msysgit/)?


Not sure if I saw that one or not. If the need arises I'll have a closer look. Thanks.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7700
    • My Best Post
Re: Announcing cbvcs
« Reply #10 on: March 04, 2011, 04:50:04 pm »
Patch to add ability to Compile for Windows in same project file.
Based on project of another poster to this thread. I think it was Cryogen project file.

Tim S.

Code
Index: cbvcs.cbp
===================================================================
--- cbvcs.cbp (revision 6)
+++ cbvcs.cbp (working copy)
@@ -6,7 +6,8 @@
  <Option pch_mode="2" />
  <Option compiler="gcc" />
  <Build>
- <Target title="default">
+ <Target title="Linux">
+ <Option platforms="Unix;Mac;" />
  <Option output="cbvcs" prefix_auto="1" extension_auto="1" />
  <Option type="3" />
  <Option compiler="gcc" />
@@ -25,7 +26,62 @@
  <Add after="zip -j9 cbvcs.cbplugin cbvcs.so cbvcs.zip" />
  </ExtraCommands>
  </Target>
+ <Target title="Win32">
+ <Option platforms="Windows;" />
+ <Option output="..\..\..\devel\share\CodeBlocks\plugins\cbvcs" prefix_auto="1" extension_auto="1" />
+ <Option object_output="..\..\..\.objs\plugins\contrib\cbvcs" />
+ <Option type="3" />
+ <Option compiler="gcc" />
+ <Option parameters="--debug-log --multiple-instance --no-check-associations -ns -nd" />
+ <Option host_application="..\..\..\devel\codeblocks.exe" />
+ <Compiler>
+ <Add option="-g" />
+ <Add option="-pipe" />
+ <Add option="-mthreads" />
+ <Add option="-fmessage-length=0" />
+ <Add option="-fexceptions" />
+ <Add option="-Winvalid-pch" />
+ <Add option='-include &quot;pch.h&quot;' />
+ <Add option="-DBUILDING_PLUGIN" />
+ <Add option="-DHAVE_W32API_H" />
+ <Add option="-D__WXMSW__" />
+ <Add option="-DWXUSINGDLL" />
+ <Add option="-DcbDEBUG" />
+ <Add option="-DCB_PRECOMP" />
+ <Add option="-DWX_PRECOMP" />
+ <Add option="-DwxUSE_UNICODE" />
+ <Add directory="..\..\..\include" />
+ <Add directory="..\..\..\sdk\wxscintilla\include" />
+ <Add directory="$(#wx.include)" />
+ <Add directory="$(#wx.lib)" />
+ <Add directory="$(#wx.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)" />
+ </Compiler>
+ <ResourceCompiler>
+ <Add directory="$(#wx.include)" />
+ </ResourceCompiler>
+ <Linker>
+ <Add option="-Wl,--enable-auto-import" />
+ <Add option="-mthreads" />
+ <Add library="codeblocks" />
+ <Add library="wxmsw$(WX_VERSION)$(WX_SUFFIX)" />
+ <Add directory="..\..\..\devel" />
+ <Add directory="$(#wx.lib)" />
+ <Add directory="$(#wx.lib)\gcc_dll$(WX_CFG)" />
+ </Linker>
+ <ExtraCommands>
+ <Add after="zip -j9 ..\..\..\devel\share\codeblocks\cbvcs.zip manifest.xml" />
+ <Mode after="always" />
+ </ExtraCommands>
+ <Environment>
+ <Variable name="WX_SUFFIX" value="u" />
+ <Variable name="WX_VERSION" value="28" />
+ <Variable name="WX_CFG" value="" />
+ </Environment>
+ </Target>
  </Build>
+ <VirtualTargets>
+ <Add alias="All" targets="Linux;Win32;" />
+ </VirtualTargets>
  <Unit filename="CommitMsgDialog.cpp" />
  <Unit filename="CommitMsgDialog.h" />
  <Unit filename="IVersionControlSystem.cpp" />
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Announcing cbvcs
« Reply #11 on: March 05, 2011, 01:32:29 pm »
Quote
Patch to add ability to Compile for Windows in same project file.
Based on project of another poster to this thread. I think it was Cryogen project file.

Hi thanks for the patch.

I've merged it to the trunk along with a major refactoring of the code. There are some unit tests with a coverage util (lcov).

Now I can start looking at renaming files. Need some suggestions on this one. The issue is renaming a file requires the file to be renamed in the project as well. Which means the project needs to be saved to capture the name change. 2 problems come to mind:

  • The user may not want the project to be saved (can't think why but there may be because of other changes to the project as well)
  • Renaming (on disk) and saving the project is a 2 step process which if interrupted can leave the project file and working directory out of sync. Ok granted the project tree will indicate missing files, but is this good enough?

Any thoughts?

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: Announcing cbvcs
« Reply #12 on: March 08, 2011, 04:22:53 pm »
I tested cbvcs and came across one bug: right-clicking on "workspace", while the workspace is empty, in the project explorer causes a crash.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Announcing cbvcs
« Reply #13 on: March 09, 2011, 12:57:02 am »
Quote
Patch to add ability to Compile for Windows in same project file.
Based on project of another poster to this thread. I think it was Cryogen project file.

Hi thanks for the patch.

This is not the standard way that contrib projects are organised, or I'd have done it that way. It also generates warnings for the project that doesn't apply to the system in use, which are undesirable. I'd suggest not doing this.

I've merged it to the trunk along with a major refactoring of the code. There are some unit tests with a coverage util (lcov).

Now I can start looking at renaming files. Need some suggestions on this one. The issue is renaming a file requires the file to be renamed in the project as well. Which means the project needs to be saved to capture the name change. 2 problems come to mind:

  • The user may not want the project to be saved (can't think why but there may be because of other changes to the project as well)
  • Renaming (on disk) and saving the project is a 2 step process which if interrupted can leave the project file and working directory out of sync. Ok granted the project tree will indicate missing files, but is this good enough?

Any thoughts?

That's true of most operations if they're interrupted. Certainly worth consideration but I can't immediately think of a way to do any better.

Cheers.

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Announcing cbvcs
« Reply #14 on: March 11, 2011, 10:31:06 am »
Quote
Patch to add ability to Compile for Windows in same project file.
Based on project of another poster to this thread. I think it was Cryogen project file.

Hi thanks for the patch.

This is not the standard way that contrib projects are organised, or I'd have done it that way. It also generates warnings for the project that doesn't apply to the system in use, which are undesirable. I'd suggest not doing this.


Fair enough. But I think I'll go with it for now. That way I need to manage only one project when adding/renaming source files etc. I'll keep it as the master and generate individual projects (the way you did) off it.