* Regarding GIT API
@ 2011-02-15 11:08 Abhinav Goyal
2011-02-15 11:21 ` Erik Faye-Lund
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Abhinav Goyal @ 2011-02-15 11:08 UTC (permalink / raw)
To: git
hello All,
I searched a lot but all in vain to find GIT API from which I can call
git commands from my C++ Application. I tried my hands on libgit2 but found that
it deals with very low level git functionality .I just need the git command
support for my C++ application. I have my own reason for not using command
prompt system call. Please help me if you have any idea regarding API that I can
use.
thanks and regrads
Abhinav Goyal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Regarding GIT API
2011-02-15 11:08 Regarding GIT API Abhinav Goyal
@ 2011-02-15 11:21 ` Erik Faye-Lund
2011-02-15 11:22 ` Marc Weber
2011-02-15 11:49 ` Dmitry Potapov
2 siblings, 0 replies; 6+ messages in thread
From: Erik Faye-Lund @ 2011-02-15 11:21 UTC (permalink / raw)
To: Abhinav Goyal; +Cc: git
On Tue, Feb 15, 2011 at 12:08 PM, Abhinav Goyal <honeykool23@gmail.com> wrote:
> hello All,
>
> I searched a lot but all in vain to find GIT API from which I can call
> git commands from my C++ Application. I tried my hands on libgit2 but found that
> it deals with very low level git functionality .I just need the git command
> support for my C++ application. I have my own reason for not using command
> prompt system call. Please help me if you have any idea regarding API that I can
> use.
>
Git's API is constructed through calling the plumbing commands, not by
calling C/C++ functions. If you want an example of how to do that, you
could look at the git-cheetah source code:
http://repo.or.cz/w/git-cheetah.git
LibGit2 is the most complete alternative for C/C++ to my knowledge.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Regarding GIT API
2011-02-15 11:08 Regarding GIT API Abhinav Goyal
2011-02-15 11:21 ` Erik Faye-Lund
@ 2011-02-15 11:22 ` Marc Weber
2011-02-15 11:49 ` Dmitry Potapov
2 siblings, 0 replies; 6+ messages in thread
From: Marc Weber @ 2011-02-15 11:22 UTC (permalink / raw)
To: git
Excerpts from Abhinav Goyal's message of Tue Feb 15 12:08:14 +0100 2011:
> prompt system call. Please help me if you have any idea regarding API that I can
> use.
I've no clue but I'd look into qgit or the like which I'd expect to do
what you want if such an API exists.
Marc Weber
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Regarding GIT API
2011-02-15 11:08 Regarding GIT API Abhinav Goyal
2011-02-15 11:21 ` Erik Faye-Lund
2011-02-15 11:22 ` Marc Weber
@ 2011-02-15 11:49 ` Dmitry Potapov
2011-02-15 12:40 ` Michael J Gruber
2 siblings, 1 reply; 6+ messages in thread
From: Dmitry Potapov @ 2011-02-15 11:49 UTC (permalink / raw)
To: Abhinav Goyal; +Cc: git
On Tue, Feb 15, 2011 at 11:08:14AM +0000, Abhinav Goyal wrote:
> I just need the git command
> support for my C++ application. I have my own reason for not using command
> prompt system call.
If you need full git functionality, currently the only proper way is to
use git porcelain command, i.e. run commands using system() and parse
their output. Git porcelain commands are designed to be used in this way,
so their output is easy to parse. Also, their output should not change
between different versions, in contrast to front-end git commands, which
provide more human oriented output.
NOTE: There are libraries for some other languages such as Java and Ruby
(jGit and Grit correspondingly), but they contain re-implementation of
most git functionality. No one has bothered to write anything like that
in C. So, libgit2 provides only low-level and very limited functionality.
More information about git interfaces to different languages, you can
find here:
https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#Interfaces_to_other_programming_languages
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Regarding GIT API
2011-02-15 11:49 ` Dmitry Potapov
@ 2011-02-15 12:40 ` Michael J Gruber
2011-02-15 17:09 ` Dmitry Potapov
0 siblings, 1 reply; 6+ messages in thread
From: Michael J Gruber @ 2011-02-15 12:40 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: Abhinav Goyal, git
Dmitry Potapov venit, vidit, dixit 15.02.2011 12:49:
> On Tue, Feb 15, 2011 at 11:08:14AM +0000, Abhinav Goyal wrote:
>> I just need the git command
>> support for my C++ application. I have my own reason for not using command
>> prompt system call.
>
> If you need full git functionality, currently the only proper way is to
> use git porcelain command, i.e. run commands using system() and parse
> their output. Git porcelain commands are designed to be used in this way,
> so their output is easy to parse. Also, their output should not change
> between different versions, in contrast to front-end git commands, which
> provide more human oriented output.
You mean "plumbing" for the commands with robust interface.
The front-end commands are "porcelain": they may break when used for
heavy (scripting) work...
>
> NOTE: There are libraries for some other languages such as Java and Ruby
> (jGit and Grit correspondingly), but they contain re-implementation of
> most git functionality. No one has bothered to write anything like that
> in C. So, libgit2 provides only low-level and very limited functionality.
>
> More information about git interfaces to different languages, you can
> find here:
>
> https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#Interfaces_to_other_programming_languages
>
>
> Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Regarding GIT API
2011-02-15 12:40 ` Michael J Gruber
@ 2011-02-15 17:09 ` Dmitry Potapov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Potapov @ 2011-02-15 17:09 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Abhinav Goyal, git
On Tue, Feb 15, 2011 at 3:40 PM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
>
> You mean "plumbing" for the commands with robust interface.
>
> The front-end commands are "porcelain": they may break when used for
> heavy (scripting) work...
Thank you for correction...
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-02-15 17:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 11:08 Regarding GIT API Abhinav Goyal
2011-02-15 11:21 ` Erik Faye-Lund
2011-02-15 11:22 ` Marc Weber
2011-02-15 11:49 ` Dmitry Potapov
2011-02-15 12:40 ` Michael J Gruber
2011-02-15 17:09 ` Dmitry Potapov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).