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

Re: [PATCH 1/2] make show-index a builtin

From
Jeff King <peff@peff.net>
Date
May 28, 2018, 17:57 UTC
Message-ID
<20180528175754.GA20636@sigill.intra.peff.net>
In-Reply-To
<xmqqlgc3iyom.fsf@gitster-ct.c.googlers.com>
On Tue, May 29, 2018 at 12:31:53AM +0900, Junio C Hamano wrote:
Show 17 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > diff --git a/show-index.c b/builtin/show-index.c
> > similarity index 96%
> > rename from show-index.c
> > rename to builtin/show-index.c
> > index 1ead41e211..65fa86dd08 100644
> > --- a/show-index.c
> > +++ b/builtin/show-index.c
> > @@ -4,7 +4,7 @@
> 
> I squashed
> 
> #include "builtin.h"
> 
> near the beginning of this file to squelch -DDEVELOPER extra
> warnings.  Otherwise looks obviously good.

Thanks. I'm still using my custom build options, and obviously I need to add -Wmissing-prototypes.

Show 13 quoted lines
> > diff --git a/git.c b/git.c
> > index 5771d62a32..c91e144d9a 100644
> > --- a/git.c
> > +++ b/git.c
> > @@ -470,6 +470,7 @@ static struct cmd_struct commands[] = {
> >  	{ "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
> >  	{ "show", cmd_show, RUN_SETUP },
> >  	{ "show-branch", cmd_show_branch, RUN_SETUP },
> > +	{ "show-index", cmd_show_index },
> 
> Hmph, this does not need SETUP?  Ah, of course, because its
> subcommand body used to do everything itself, and this patch just
> turns cmd_main() to cmd_show_index().

It is not even that it does the setup itself. It does not need the setup at all, because it is purely a mechanical parsing of the stdin stream to text output. No repo required, and it does not know or care if the matching packfile even exists.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 4 of 5 in “minor show-index modernizations”
  1. 0/2 minor show-index modernizationsJeff King, May 28, 2018
  2. 1/2 make show-index a builtinJeff King, May 28, 2018
  3. Junio C HamanoMay 28, 2018
  4. Jeff KingMay 28, 2018
  5. 2/2 show-index: update documentation for index v2Jeff King, May 28, 2018

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.