top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Using GIT as library from an own C program

+2 votes

Is it possible to use a git library in a C Program?
Does someone know, if it is possible to include GIT source as part of my program?

posted Feb 14, 2014 by Sonu Jindal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

There is a project called libgit (maybe libgit2?).
However, it is not part of Git, it is totally independent (from developments view).

answer Feb 15, 2014 by Dewang Chaudhary
Similar Questions
+1 vote

I want to build my own library in C, can someone help me with this?

+1 vote

I'd like to rewrite the repack shell script in C. So I tried the naive approach reading the man page and
the script itself and write C program by matching each block/line of the script with a function in C

Now I stumble upon other git commands (git pack-objects). What's the best way to approach such a plumbing command?

I don't think just calling cmd_pack_objects(argc, **argv) would be the right thing to do, as we're not using all the command line parameters, so some of the logic in cmd_pack_object could be skipped.
Another approach would be to use some of the functions as used by cmd_pack_objects, but these mostly reside in builtin/pack_objects.c. They'd need to be moved up to pack.h/pack.c.

So my question is, how you'd generally approach rewriting a shell script in C.

0 votes

When I update my branch from master it pulls down several files, including some sass files. When I compile, however, gulp alerts me that I am missing .scss files.

I tested this by creating a new fresh branch and running gulp sass. This time there were no errors and I saw the missing .scss had been brought in.

Would anyone know why, on update, I am only getting some of the files from master?

0 votes

I want to work on a visualization program for git. I was hoping there was a library that would allow me to monitor a git repo for changes. Consider it like inotify, but for a git repository (in fact, I think it would probably have inotify under the hood).

This hypothetical library would trigger an event any time the repository was modified, i.e. any time the graph that represents history was changed.

Is there such a library? If not, is there a better way to monitor the repository so that I wouldn't need to write it myself? Would anyone else be interested if I wrote it myself?