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

Re: [PATCH] Make builtin-tag.c use parse_options.

From
Kristian Høgsberg <krh@redhat.com>
Date
Nov 12, 2007, 19:48 UTC
Message-ID
<1194896926.2869.15.camel@hinata.boston.redhat.com>
In-Reply-To
<1b46aba20711120509l104792ebo4ea9a51c710510f3@mail.gmail.com>
On Mon, 2007-11-12 at 14:09 +0100, Carlos Rica wrote:
> 2007/11/10, Junio C Hamano <gitster@pobox.com>:
> > Carlos Rica <jasampler@gmail.com> writes:
...
Show 6 quoted lines
> Then, Kristian, what are you willing to do in such case?
> It seems easier for me to concatenate of -m and -F options, even when
> both types are given. I don't know why "people" want multiple -m options,
> but I think that mixing -m and -F options could be interesting for them too.
> If someone know if this have been discussed and decided already,
> please give me the link.

I should be pretty easy to just append the contents of multiple fies, even inter-mingled with -m options. We just do a callback like Johannes just did for -m in builtin-commit.c for -F and append to the same strbuf. strbuf_read() already appends, so the callback could look something like:

static int opt_parse_F(const struct option *opt, const char *arg, int
unset)
{
        struct strbuf *buf = opt->value;
	if (!strcmp(arg, "-")) {
                if (isatty(0))
                        fprintf(stderr, "(reading log message from
standard input)\n");
                if (strbuf_read(&sb, 0, 0) < 0)
                        die("could not read log from standard input");
	} else {
                if (strbuf_read_file(&sb, logfile, 0) < 0)
                        die("could not read log file '%s': %s",
                            logfile, strerror(errno));
	}
}

Shouldn't be too hard :) Kristian

Previous: Pierre Habouzit
Message 11 of 11 in “Make builtin-tag.c use parse_options.”
  1. Make builtin-tag.c use parse_options.Carlos Rica, Nov 9, 2007
  2. Jakub NarebskiNov 9, 2007
  3. Johannes SchindelinNov 9, 2007
  4. Junio C HamanoNov 10, 2007
  5. Junio C HamanoNov 10, 2007
  6. Junio C HamanoNov 10, 2007
  7. Carlos RicaNov 10, 2007
  8. Pierre HabouzitNov 10, 2007
  9. Carlos RicaNov 12, 2007
  10. Pierre HabouzitNov 12, 2007
  11. Kristian HøgsbergNov 12, 2007

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.