News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

GitBlocks Plugin

Started by tomolt, March 20, 2015, 02:33:27 PM

Previous topic - Next topic

tomolt

 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

ollydbg

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.

tomolt

#2
QuoteHello, 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!). ;)
QuoteThe 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. :)

oBFusCATed

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!]

tomolt

I'm not too keen on autotools, so I will probably go with codeblocks projects!  :)

stahta01

#5
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.


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]
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

tomolt

Thanks, man! :D
I'm trying to get this in the repo as fast as I can!

oBFusCATed

Quote from: tomolt on March 20, 2015, 04:38:32 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!]

tomolt

Quote from: oBFusCATed on March 20, 2015, 08:27:28 PM
Quote from: tomolt on March 20, 2015, 04:38:32 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"! :)

oBFusCATed

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!]

killerbot

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.

tomolt

Quote from: oBFusCATed on March 21, 2015, 12:23:17 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.
Quotethis 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.

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

tomolt

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.

decaf999

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