Author Topic: Git Plugin  (Read 13650 times)

Offline polymath

  • Single posting newcomer
  • *
  • Posts: 6
Git Plugin
« on: August 24, 2010, 07:43:32 pm »
I was thinking about making a Git plugin for C::B, but i have a few questions first:

1.  Is there another plugin that already serves this purpose?  I searched the wiki but couldn't find any.
2.  In what way should I interact with git.  I see a two options: a) through the command line with wxProces- advantage is that i could check at runtime if git is installed (git --version), but it would be less efficient; b) through the Git API, which would be faster, but would crash if the library wasn't present on the system.  I *could* distribute the plugin with the library, or statically link if necessary, but this doesn't seem like a great solution.
3.  Should the plugin require the user to add files to the vcs manually or should it automatically add/remove files as they are added to/removed from the project?

If someone could answer these questions, i could get to work.  Just want to know if there is an established policy or something for these questions.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Git Plugin
« Reply #1 on: August 24, 2010, 10:20:15 pm »

 Hi,

I have only briefly used Git so can't speak about items 1 or 3 but re: 2 it should be easy enough to do a check for the existence of the library at start and advise the user if it's missing, I would have thought.

Ciao.

Offline billyonthemountain

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Git Plugin
« Reply #2 on: August 29, 2010, 11:36:20 pm »
1) haven't heard about such a plug-in before... but would be a nice idea.   :D
2) I'm no expert but I'd say b), as cryogen mentioned you should be able to check for the dll's presence somehow.
3) This is probably something that could be an option, enabled by default.
You could have the plug-in either automatically add the files based on file extensions and leave the user the possibility to add/delete some specific files, or keep it completely manual.

On a side note, it could be a good idea to think about a general framework for integration of various VCS, very much like the compiler framework; the user could then choose to associate a project with a VCS of his choice...
(ASM, C/C++)||(VISION&AI)||(EMBEDDED SYSTEMS)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Git Plugin
« Reply #3 on: August 30, 2010, 08:18:59 am »
1.  Is there another plugin that already serves this purpose?  I searched the wiki but couldn't find any.
Not to my knowledge.

2.  In what way should I interact with git.
Use the command line tools I'd say. In fact, try to be as generic as possible. e.g. make the application and it's parameters you use an option. I could think of a version control plugin using command line tools that allows by loading a pre-set to handle not just GIT, but also SVN for example. This would be a great milestone.

3.  Should the plugin require the user to add files to the vcs manually
Manually, please. Always this should be under the user's control. Everything done "automagically" will surely be annoying in 90% of the cases... ;-)
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 seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Git Plugin
« Reply #4 on: August 30, 2010, 09:43:29 pm »
I was thinking about making a Git plugin for C::B, but i have a few questions first:

1.  Is there another plugin that already serves this purpose?  I searched the wiki but couldn't find any.
2.  In what way should I interact with git.  I see a two options: a) through the command line with wxProces- advantage is that i could check at runtime if git is installed (git --version), but it would be less efficient; b) through the Git API, which would be faster, but would crash if the library wasn't present on the system.  I *could* distribute the plugin with the library, or statically link if necessary, but this doesn't seem like a great solution.
3.  Should the plugin require the user to add files to the vcs manually or should it automatically add/remove files as they are added to/removed from the project?

If someone could answer these questions, i could get to work.  Just want to know if there is an established policy or something for these questions.

Hi,

I do not know if you are aware, but someone has already done a SVN plugin in the past (SVNInside).
It is still possible to compile it against the latest nightly. I have uploaded the project here:
http://www.MegaShare.com/2499155

It can be a good starting point.

Sebastien

PS: I would like to give due credit to the author of this plugin. However I do not know who made it. If you search the forum with "SVNInside", you will surely find it.

Offline polymath

  • Single posting newcomer
  • *
  • Posts: 6
Re: Git Plugin
« Reply #5 on: August 31, 2010, 11:28:18 pm »
Alright.  I think I'll run everything through the wxProcess() API, as this is the easiest (yes, I'm lazy.  I'm also human :P).  Perhaps i could have commands in a config file something like the following?
Code
add_file: git add $1
remove_file: git rm $FORCE $1
pull_remote: git pull $1
push_remote: git push $1
\etc
Now, managing manually is good (and easy), but *if* one wanted to make an automagic option, I guess i would use the cbEVT_PROJECT_FILE_* events to do adds and rms.  More challenging would be managing file adds and removes on the remote side.  I haven't found much documentation on plugin-initiated events (like how a plugin would add files to the project), so if anyone has good SDK documentation that i'm missing, please point me in that direction.  If automagic is disabled, perhaps the plugin could open a dialog saying that the new files have been downloaded and asking if the user wants to add them to the project?  Just throwing ideas out there.

I will check out the SVN plugin.  Yes, i do agree that it would be nice to have a generic VCS framework, however the differences between centralized and decentralized VCSs is big enough (IMHO) that for anything non-trivial we would either need to come up with an elaborate scripting language to do this, or two separate frameworks with several common components.  I don't know, i have ZERO experience with SVN, CVS and the like and the workflow with these systems.

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Git Plugin
« Reply #6 on: November 15, 2010, 09:39:31 am »
Hi how's the plug-in coming along?

I posted a question along similar lines (in the wrong forum I see) http://forums.codeblocks.org/index.php/topic,13683.0.html.


Offline bluephoenix

  • Single posting newcomer
  • *
  • Posts: 2
Re: Git Plugin
« Reply #7 on: January 15, 2011, 09:42:18 am »
2) I think you should use the API,offers more flexibility.It should be up to the user to check if git is installed.
3) Maybe you can add an option to do it automaticaly or ask every time.
I am really looking forward to this plugin!