List for cgit developers and users
 help / color / mirror / Atom feed
From: Jason at zx2c4.com (Jason A. Donenfeld)
Subject: why no process info when cloning
Date: Tue, 23 Feb 2016 16:00:59 +0100	[thread overview]
Message-ID: <CAHmME9rKyPe_km2dL=gW1cM606UU+1UjV8MLW5y6pL+fLiJg=w@mail.gmail.com> (raw)
In-Reply-To: <20160223144245.GM1766@serenity.lan>

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.


      reply	other threads:[~2016-02-23 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  7:28 zhang.lei.fly
2016-02-23  9:45 ` john
2016-02-23 14:38   ` Jason
2016-02-23 14:42     ` john
2016-02-23 15:00       ` Jason [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHmME9rKyPe_km2dL=gW1cM606UU+1UjV8MLW5y6pL+fLiJg=w@mail.gmail.com' \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).