APIs for automatic patch generation
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
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
Heya,
Quoted 2 lines · Markus Elfring
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
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 1 line
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
Heya,
Quoted 1 line · Markus Elfring
I do not need the whole functionality of these commands for my library.
My answer still holds.
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 2 lines
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