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

Re: start of git2 (based on libgit2)

From
Jeff King <peff@peff.net>
Date
Mar 26, 2011, 13:29 UTC
Message-ID
<20110326132915.GA2859@sigill.intra.peff.net>
In-Reply-To
<4D8D2B31.4040908@lyx.org>
On Sat, Mar 26, 2011 at 12:54:25AM +0100, Vincent van Ravesteijn wrote:
Show 11 quoted lines
> http://librelist.com/browser/libgit2/
> >According to Jeff King[2], I should start with plumbing commands. I
> >agree.  However, how deep?  I.e. do I have to make sure all git rev-list
> >possible arguments are implemented?
> 
> I guess a lot can be copied from Git itself. Actually
> builtin/rev-list.c consists mostly of command line arguments parsing
> methods, and outputting functions. The key is to parse what you want
> to know and ask libgit2 to provide the info. If libgit2 has
> implemented the basic functionality that is needed, the rest would be
> relatively simple.

I wouldn't worry about having _every_ argument. Some arguments are much less frequently used than others. For example, start with basic stuff, like including and excluding commits (e.g., "branch1 ^branch2"), --max-count, --{min,max}-age, --grep, and others. Do common things like path limiting. And then once all that is done and tested, start worrying about things like --cherry-pick (or maybe not, and focus on the basics of other simple commands).

Show 5 quoted lines
> >Are we aiming for a distributed 100s of executables architecture
> >(current git), or single huge binary? I would go for single executable
> >for to higher portability. Is that ok?
> 
> AFAICS, current git is a single binary on Windows already.

Even on Linux, most of the commands are just hardlinks to the git executable. Most commands are built-in these days. A few are still external but written in C (sometimes because we want to keep them small and external, like git-daemon and git-shell). But there are still some commands written in other languages, like pull, stash, and add--interactive.

Check out the BUILTIN_OBJS, PROGRAM_OBJS, and SCRIPT_* variables in the Makefile.

So yeah, for basic commands, one monolithic binary is probably fine.
-Peff
Previous: Motiejus JakštysNext: Junio C Hamano
Message 4 of 7 in “start of git2 (based on libgit2)”
  1. Motiejus JakštysMar 25, 2011
  2. Vincent van RavesteijnMar 25, 2011
  3. Motiejus JakštysMar 26, 2011
  4. Jeff KingMar 26, 2011
  5. Junio C HamanoMar 27, 2011
  6. Vincent van RavesteijnMar 27, 2011
  7. Sam VilainMar 26, 2011

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.