why no process info when cloning

Jason A. Donenfeld Jason at zx2c4.com
Tue Feb 23 16:00:59 CET 2016


I would, instead, suggest this elegant hack:

zx2c4 at thinkpad ~ $ cat a.c
int main(int argc, char *argv[])
{
        printf("git's main\n");
}
zx2c4 at thinkpad ~ $ cat b.c
#define main git_http_backend_main
#include "a.c"
#undef main

int main(int argc, char *argv[])
{
        printf("cgit's main\n");
        git_http_backend_main(argc, argv);
}
zx2c4 at thinkpad ~ $ ./a.out
cgit's main
git's main


This way, in fact, we don't even need to use the main function, if it
turns out we could benefit from accessing various static functions.


More information about the CGit mailing list