29

A company asked me to program a GIT wrapper for them.

The people there have absolute no versioning systems experience, but it will be incorporated in their daily routine eventually (through my program).

I'm planning on using VC++ to create a tiny windows applet that will help ppl in this process. Any thoughts on that?

What about a Deamon process checking if people want to commit/push their files?

Draconar
  • 1,147
  • 1
  • 17
  • 36
  • 9
    what would the purpose of the wrapper be that git and the *other* git tools out there cannot handle? – Fredrik Pihl Sep 30 '11 at 21:57
  • 3
    Assuming you do need the wrapper system, you could just call git directly from your program using the appropriate arguments. – mwd Sep 30 '11 at 21:59

4 Answers4

34

For almost (but not all!) use cases, libgit2 is the easiest way to interact with Git repositories via code.

Ana Betts
  • 73,868
  • 16
  • 141
  • 209
  • This looks good… I did wonder when I looked at libgit2 if there was a C++ binding that didn't require Qt… It looks like there's none advertised on the provided site. I note the OP wanted VC++: Looks like someone else had a problem with VS2010 C++ but it was resolved in this SO post: http://stackoverflow.com/questions/14860814/qt-creator-unresolved-external-symbol – rholmes Jan 27 '14 at 00:57
14

Git already has two layers: The plumbing (which you may be interested in) on top of which is built the primary porcelain which provides the user interface. If you want to implement something like git-commit but with slightly different semantics all of the underlying programs like git-write-tree and git-rev-parse are there for you to build on.

See also What does the term "porcelain" mean in Git?

Community
  • 1
  • 1
Ben Jackson
  • 90,079
  • 9
  • 98
  • 150
  • Git's very flexible - porcelain is great. If you're not wedded to a GUI you might try a simple scripting approach via a favorite language (Ruby, Python, Perl, or bash-like shell even). I've seen those used to good effect with DVCS systems, but it may be tough on people who don't embrace the command line. Adding aliased commands in Git itself can also go a very long way, but you need to be able to distribute them out to your user base (not too hard, lots of options) – rholmes Jan 27 '14 at 01:00
4

There's already TortoiseGit, among other "friendly" interfaces. Don't re-invent the wheel, start by researching what's already available.

MrTux
  • 32,350
  • 30
  • 109
  • 146
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • And of course, it's open source, so even if it's not what you want, it's probably a lot closer than nothing. – Cascabel Oct 01 '11 at 04:43
  • 1
    He's asking for wrapping git features, not an interface. For instance, if you would want to implement collaborating features in a piece of software, you would need a library. I know of Grit in Ruby but afaik there ain't such a thing for C/C++. – Michael Oct 16 '13 at 10:37
  • 3
    @user626921: His question specifically states that his goal is to provide his users with an interface. His current plan is to write one, but I'm suggesting a lower-cost approach is to customize one that already exists. – Ben Voigt Oct 16 '13 at 14:18
1

In order to easier the search for documentation hereafter the link to the official. It's about the plumbing and porcelain: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain

Jean-Marc
  • 740
  • 8
  • 9