threads / discuss / 22742

APIs for automatic patch generation

Subject: APIs for automatic patch generation

## tl;dr

6 messages between Feb 20, 2010 and Dec 13, 2010.

replies: 5people: 2as markdown or json

Markus Elfring· Feb 20, 2010, 19:40 UTC · lore
Hello,

I would like to generate patches in the Git format for some other software automatically. Which application programming interfaces do you recommend for this purpose if I am going to integrate this into a small C++ class library? http://www.kernel.org/pub/software/scm/git/docs/v1.7.0/technical/api-index.html http://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools

Specific use cases:
- Which functions or commands should I call to retrieve the required
informations for a line like "index 8d16832..358c98b 100644"?
- Can any functions help to construct proper range specifications for
difference hunks?

Regards, Markus

Markus Elfring· Feb 23, 2010, 17:04 UTC · re: Markus Elfring · lore

Re: APIs for automatic patch generation

Hello,

The commands "git diff" and "git format-patch" contain functionality that I would like to reuse for my little application in a C++ class library.

Which functions exist in a C API that can provide the following data?
- a line like "index 8d16832..358c98b 100644"
- range specifications for difference hunks
- mail construction

Regards, Markus

Sverre Rabbelier· Feb 23, 2010, 17:07 UTC · re: Markus Elfring · lore

Re: APIs for automatic patch generation

Heya,
On Tue, Feb 23, 2010 at 18:04, Markus Elfring <Markus.Elfring@web.de> wrote:
> The commands "git diff" and "git format-patch" contain functionality that I
> would like to reuse for my little application in a C++ class library.
Until libgit2 is done, just shell out and call 'git format-patch'.
[0] http://git.wiki.kernel.org/index.php/SoC2010Ideas#libgit2
-- 
Cheers,

Sverre Rabbelier
Markus Elfring· Feb 23, 2010, 17:23 UTC · re: Sverre Rabbelier · lore

Re: APIs for automatic patch generation

> Until libgit2 is done, just shell out and call 'git format-patch'.
Thanks for the link.

I do not need the whole functionality of these commands for my library. I am looking if the mentioned data items can also be really retrieved by command line parameters.

Regards, Markus

Sverre Rabbelier· Feb 23, 2010, 18:07 UTC · re: Markus Elfring · lore

Re: APIs for automatic patch generation

Heya,
On Tue, Feb 23, 2010 at 18:23, Markus Elfring <Markus.Elfring@web.de> wrote:
> I do not need the whole functionality of these commands for my library.
My answer still holds.
-- 
Cheers,

Sverre Rabbelier
Markus Elfring· Dec 13, 2010, 16:00 UTC · re: Markus Elfring · lore

Re: APIs for automatic patch generation

> The commands "git diff" and "git format-patch" contain functionality that I
> would like to reuse for my little application in a C++ class library.
Which functions exist in the recently published C API 
(http://libgit2.github.com/) that can provide the following data?
* a line like "index 8d16832..358c98b 100644"
* range specifications for difference hunks
* mail construction

Regards, Markus

← back to recent threads