git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] do not add common-main to lib

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 15, 2016, 12:20 UTC
Message-ID
<alpine.DEB.2.20.1608151418150.4924@virtualbox>
In-Reply-To
<20160815075207.31280-1-list@eworm.de>
Hi Christian,
On Mon, 15 Aug 2016, Christian Hesse wrote:
Show 10 quoted lines
> From: Christian Hesse <mail@eworm.de>
> 
> Commit 08aade70 (mingw: declare main()'s argv as const) changed
> declaration of main function. This breaks linking external projects
> (e.g. cgit) to libgit.a with:
> 
> error: Multiple definition of `main'
> 
> So do not add common-main to lib and let projects have their own
> main function.
I am opposed to this change.

For one, libgit.a is *not* a library with an API, for a good reason: nothing in Git's development guarantees any kind of stable API. For that reason, libgit.a is not installed, either, and neither are any headers.

And even more importantly: *iff* you *insist* on using libgit.a in your project *despite* having been told not to, it is your responsibility to stay up-to-date with the requirements of it.

One such requirement is that you now implement cmd_main() instead of main().

So if you want to continue to have an out-of-tree project that links against the (private) libgit.a, it is your out-of-tree project that needs changing, not libgit.a.

Ciao, Johannes

Previous: Christian HesseNext: Christian Hesse
Message 4 of 5 in “do not add common-main to lib”
  1. 1/1 do not add common-main to libChristian Hesse, Aug 15, 2016
  2. Jeff KingAug 15, 2016
  3. Christian HesseAug 15, 2016
  4. Johannes SchindelinAug 15, 2016
  5. Christian HesseAug 15, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.