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

Re: [PATCH 1/3] parse-opt: migrate fmt-merge-msg.

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 2, 2008, 11:51 UTC
Message-ID
<20081002115118.GC17334@artemis.corp>
In-Reply-To
<20081001145606.GX21310@spearce.org>
On Wed, Oct 01, 2008 at 02:56:06PM +0000, Shawn O. Pearce wrote:
Show 26 quoted lines
> Pierre Habouzit <madcoder@debian.org> wrote:
> > @@ -347,38 +349,32 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
> >  
> >  int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
> >  {
> > +	const char *inpath = NULL;
> > +	struct option options[] = {
> > +		OPT_BOOLEAN(0, "log",     &merge_summary, "populate log with the shortlog"),
> > +		OPT_BOOLEAN(0, "summary", &merge_summary, "alias for --log"),
> > +		OPT_STRING('F', "file",   &inpath, "file", "file to read from"),
> > +		OPT_END()
> 
> 
> > +	argc = parse_options(argc, argv, options, fmt_merge_msg_usage, 0);
> > +	if (argc > 0)
> > +		usage_with_options(fmt_merge_msg_usage, options);
> > +
> > +	if (!inpath || strcmp(inpath, "-"))
> > +		in = stdin;
> > +	else {
> > +		fclose(in);
> > +		in = fopen(argv[2], "r");
> > +		if (!in)
> > +			die("cannot open %s", argv[2]);
> 
> Really argv[2]?  Shouldn't that be inpath?
oh crap you're right. I'll submit and updated series soon... *sigh*
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Shawn O. PearceNext: Pierre Habouzit
Message 15 of 19 in “small warm-up: easy parse-opt migrations.”
  1. Pierre HabouzitSep 28, 2008
  2. parse-opt: migrate fmt-merge-msg.Pierre Habouzit, Sep 28, 2008
  3. parse-opt: migrate git-merge-base.Pierre Habouzit, Sep 28, 2008
  4. parse-opt: migrate builtin-merge-file.Pierre Habouzit, Sep 28, 2008
  5. Shawn O. PearceSep 29, 2008
  6. Pierre HabouzitSep 30, 2008
  7. Shawn O. PearceSep 30, 2008
  8. Pierre HabouzitSep 30, 2008
  9. Shawn O. PearceSep 30, 2008
  10. 1/3 parse-opt: migrate fmt-merge-msg.Pierre Habouzit, Oct 1, 2008
  11. 2/3 parse-opt: migrate git-merge-base.Pierre Habouzit, Oct 1, 2008
  12. 3/3 parse-opt: migrate builtin-merge-file.Pierre Habouzit, Oct 1, 2008
  13. Shawn O. PearceOct 1, 2008
  14. Shawn O. PearceOct 1, 2008
  15. Pierre HabouzitOct 2, 2008
  16. parse-opt: migrate fmt-merge-msg.Pierre Habouzit, Oct 2, 2008
  17. parse-opt: migrate git-merge-base.Pierre Habouzit, Oct 2, 2008
  18. parse-opt: migrate builtin-merge-file.Pierre Habouzit, Oct 2, 2008
  19. Sverre RabbelierSep 28, 2008

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.