Author Topic: GitBlocks Plugin  (Read 66243 times)

Offline tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
GitBlocks Plugin
« on: March 20, 2015, 02:33:27 pm »
 Hey, folks!
I'm currently working on a new git plugin for Code::Blocks!  :)
The only git plugin I found was cbvcs, but it's outdated and lacks some features, so I started my own! ;)

GitBlocks is an easy-to-use and small git plugin for Code::Blocks.
 
So far it features:
 - Creating a new git working repository
 - Cloning an existing repository
 - Deleting the working directory's .git folder
 - Commiting individual files
 - Commiting the whole project
 - Pushing to origin (login & password already supported)
 - Pulling from origin (login & password already supported)
 - Fetching from origin (login & password already supported)
 - Removing files
 - Adding a new branch
 - Switching between branches
 - Showing a diff (working directory <> index  only at the moment)
 - Showing a commit log
 - Showing git's status

Still to do:
 - Branching
 - Moving files
 - Adding keyboard shortcuts
 - Managing Tags
 - Documenting the code ...

GitHub repository: https://github.com/tomolt/GitBlocks

NOTE: GitBlocks SHOULD work on Windows, but I'm currently not able to test it!

Changelog:

Version 0.7.4:
 - Cloning an existing repository asks now for opening a *.cbp / *.workspace file in it
 - You can now clone password-protected repositories
 - Some internal changes (like ExecuteInTerminal(...) etc.)
 - Fixed some stuff again ...

Version 0.7.3:
 - Added removing files
 - Fixed some potential bugs ...

Version 0.7.0:
 - Added 'Add new branch'
 - Added 'Switch to branch'
 - 'Push to origin' pushes now HEAD instead of master
 - Removed config (was pretty useless)
 - Structurized to code a bit more

Version 0.6.4:
 - Switched to autotools as default build system
 - Fixed the UI layout

Version 0.4.3:
...

Feel free to tell me about your opinions and suggestions below! :D
« Last Edit: May 27, 2015, 12:14:36 pm by tomolt »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GitBlocks Plugin
« Reply #1 on: March 20, 2015, 03:21:21 pm »
Hello, tomolt, I see this is your first post in our forum, welcome!
You did a good job!!! Keep going, and ask questions about C::B here if you need some help.  ;)

Quote
- Better build system (maybe CMake)
The current method we use is to supply two cbp files, one for Windows and the other one for Linux.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
Re: GitBlocks Plugin
« Reply #2 on: March 20, 2015, 04:16:03 pm »
Quote
Hello, tomolt, I see this is your first post in our forum, welcome!
You did a good job!!! Keep going, and ask questions about C::B here if you need some help. 
Thanks, ollydbg, but I'm not exactly new to C::B, only the forum (I'm using C::B for about one year now!). ;)
Quote
The current method we use is to supply two cbp files, one for Windows and the other one for Linux.
I wasn't exactly sure how to set the build system up anyways, CMake was just the first good system that came into my mind. :)
« Last Edit: March 20, 2015, 04:17:45 pm by tomolt »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GitBlocks Plugin
« Reply #3 on: March 20, 2015, 04:25:21 pm »
For non-integrated in the tree plugins I use autotools and codeblocks projects.
You can see an example here  https://github.com/obfuscated/cb_gdbmi
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
Re: GitBlocks Plugin
« Reply #4 on: March 20, 2015, 04:38:32 pm »
I'm not too keen on autotools, so I will probably go with codeblocks projects!  :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: GitBlocks Plugin
« Reply #5 on: March 20, 2015, 07:14:26 pm »
Patch need to compile project using Windows 7 32 bit and wxWidgets 2.8.12.

FYI: Code::Blocks's Windows version of wxWidgets has 2.6 compatible mode turned off.

Code
 src/CloneDialog.cpp     | 2 +-
 src/CommitAllDialog.cpp | 2 +-
 src/CommitDialog.cpp    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/CloneDialog.cpp b/src/CloneDialog.cpp
index 3404cf8..afcd2a1 100644
--- a/src/CloneDialog.cpp
+++ b/src/CloneDialog.cpp
@@ -1,6 +1,6 @@
 #include "CloneDialog.h"
 
-CloneDialog::CloneDialog(wxWindow *parent) : wxDialog(parent, ID_CLOD, _T("Clone repository"))
+CloneDialog::CloneDialog(wxWindow *parent) : wxDialog(parent, ID_CLOD, wxString(_T("Clone repository")))
 {
  wxBoxSizer *clodSizer = new wxBoxSizer(wxVERTICAL);
  SetSizer(clodSizer);
diff --git a/src/CommitAllDialog.cpp b/src/CommitAllDialog.cpp
index 12f02c5..7c5556e 100644
--- a/src/CommitAllDialog.cpp
+++ b/src/CommitAllDialog.cpp
@@ -1,6 +1,6 @@
 #include "CommitAllDialog.h"
 
-CommitAllDialog::CommitAllDialog(wxWindow *parent) : wxDialog(parent, ID_COAD, _T("Commit all"))
+CommitAllDialog::CommitAllDialog(wxWindow *parent) : wxDialog(parent, ID_COAD, wxString(_T("Commit all")))
 {
  wxBoxSizer *coadSizer = new wxBoxSizer(wxVERTICAL);
  SetSizer(coadSizer);
diff --git a/src/CommitDialog.cpp b/src/CommitDialog.cpp
index fbcb888..e42d2d6 100644
--- a/src/CommitDialog.cpp
+++ b/src/CommitDialog.cpp
@@ -4,7 +4,7 @@
 #include <cbproject.h>
 #include <projectfile.h>
 
-CommitDialog::CommitDialog(wxWindow *parent) : wxDialog(parent, ID_COMD, _T("Commit"))
+CommitDialog::CommitDialog(wxWindow *parent) : wxDialog(parent, ID_COMD, wxString(_T("Commit")))
 {
  ProjectManager *ProjMan = Manager::Get()->GetProjectManager();
  filenames.push_back(ProjMan->GetActiveProject()->GetFilename());

Updated the attached CB project for windows 7.

Tim S.
 

[attachment deleted by admin]
« Last Edit: March 22, 2015, 04:25:21 pm by stahta01 »
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 tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
Re: GitBlocks Plugin
« Reply #6 on: March 20, 2015, 07:49:09 pm »
Thanks, man! :D
I'm trying to get this in the repo as fast as I can!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GitBlocks Plugin
« Reply #7 on: March 20, 2015, 08:27:28 pm »
I'm not too keen on autotools, so I will probably go with codeblocks projects!  :)
As far as I'm concerned this is the only build system that plays well with distro packages, and that is why I'm using it.
Also I'm using it in a modern and minimal way (only two files related to autotools in the whole repo).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
Re: GitBlocks Plugin
« Reply #8 on: March 21, 2015, 12:05:14 pm »
I'm not too keen on autotools, so I will probably go with codeblocks projects!  :)
As far as I'm concerned this is the only build system that plays well with distro packages, and that is why I'm using it.
Also I'm using it in a modern and minimal way (only two files related to autotools in the whole repo).
What we need is an automatable console-only program that builds C::B projects! Something like "codeblocks-build GitBlocks.cbp -tdefault"! :)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GitBlocks Plugin
« Reply #9 on: March 21, 2015, 12:23:17 pm »
It won't help much with the integration with linux distros.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: GitBlocks Plugin
« Reply #10 on: March 21, 2015, 02:28:47 pm »
this could be a candidate for a contrib plugin in our repo in the end, but then it has to be build also with autotools, like all our other plugins. So I would suggest to try to play the game of the contrib plugins.

Keep up the good work.

Offline tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
Re: GitBlocks Plugin
« Reply #11 on: March 21, 2015, 05:31:40 pm »
It won't help much with the integration with linux distros.
I meant prebuild packages. Of course it won't work for source distribution.
Quote
this could be a candidate for a contrib plugin in our repo in the end, but then it has to be build also with autotools, like all our other plugins. So I would suggest to try to play the game of the contrib plugins.
Okay, I'll try to switch to autotools in the near future, but I first have to learn it.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: GitBlocks Plugin
« Reply #12 on: April 22, 2015, 08:53:51 pm »
Any news here? Is it dead already? ;-)

There are a number of crash bugs, btw... how do you prefer bug-reports?
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 tomolt

  • Multiple posting newcomer
  • *
  • Posts: 12
  • Professional system breaker
Re: GitBlocks Plugin
« Reply #13 on: April 29, 2015, 06:41:34 pm »
It definitely isn't dead! I just had to work on other stuff recently. For the bug reports, I think I'll just use GitHub tickets.

Offline decaf999

  • Single posting newcomer
  • *
  • Posts: 3
Re: GitBlocks Plugin
« Reply #14 on: May 15, 2015, 04:35:15 pm »
Hi,

This is first post in this board, please let me know if post is not appropriate here.

I am trying to use this plugin on Windows.  First I see .cbp for windows build was provided by stahta01 on March 20th in this thread, whcih is not yet available on repo as of this writing, and that attachment appeared to be deleted by admin from that post.  Does anybody still have that attachment?  Or better yet, will it be available to the repo anytime soon?

Also anybody using this plugin on Windows, I am interested in knowing which git back-end actually tested with this plugin .  I will have to research a bit to find a few good git back-end programs for windows and try them out, but it would be helpful to know what has been tested and working, if any.

Regards