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

Re: [PATCH 4/5] log: parse detached options like git log --grep foo

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 29, 2010, 22:25 UTC
Message-ID
<20100729222436.GA1824@burratino>
In-Reply-To
<1280391629-30017-5-git-send-email-Matthieu.Moy@imag.fr>
Hi,
Glance over this again:
Show 11 quoted lines
> +++ b/revision.c
> @@ -1382,12 +1400,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
>  		revs->grep_filter.fixed = 1;
>  	} else if (!strcmp(arg, "--all-match")) {
>  		revs->grep_filter.all_match = 1;
> -	} else if (!prefixcmp(arg, "--encoding=")) {
> -		arg += 11;
> +	} else if ((argcount = diff_long_opt("encoding", argv, &optarg))) {
>  		if (strcmp(arg, "none"))
> -			git_log_output_encoding = xstrdup(arg);
> +			git_log_output_encoding = xstrdup(optarg);

I think arg should be optarg in the string comparison, too. Sorry I didn’t notice last time.

I wonder why t3900 and t8005 do not catch this.
>  		else
>  			git_log_output_encoding = "";

Curious, Jonathan

Previous: Matthieu MoyNext: Matthieu Moy
Message 6 of 25 in “log and diff: accept detached forms (--option value)”
  1. 0/5 log and diff: accept detached forms (--option value)Matthieu Moy, Jul 29, 2010
  2. 1/5 diff: parse detached options like -S fooMatthieu Moy, Jul 29, 2010
  3. 2/5 diff: split off a function for --stat-* option parsingMatthieu Moy, Jul 29, 2010
  4. 3/5 diff: parse detached options --stat-width n, --stat-name-width nMatthieu Moy, Jul 29, 2010
  5. 4/5 log: parse detached options like git log --grep fooMatthieu Moy, Jul 29, 2010
  6. Jonathan NiederJul 29, 2010
  7. Matthieu MoyJul 30, 2010
  8. 1/5 diff: parse detached options like -S fooMatthieu Moy, Jul 30, 2010
  9. Junio C HamanoAug 2, 2010
  10. Matthieu MoyAug 2, 2010
  11. Jonathan NiederAug 2, 2010
  12. 2/5 diff: split off a function for --stat-* option parsingMatthieu Moy, Jul 30, 2010
  13. 3/5 diff: parse detached options --stat-width n, --stat-name-width nMatthieu Moy, Jul 30, 2010
  14. Junio C HamanoAug 2, 2010
  15. Matthieu MoyAug 2, 2010
  16. 4/5 log: parse detached options like git log --grep fooMatthieu Moy, Jul 30, 2010
  17. Junio C HamanoAug 2, 2010
  18. Matthieu MoyAug 2, 2010
  19. Junio C HamanoAug 2, 2010
  20. Matthieu MoyAug 3, 2010
  21. Junio C HamanoAug 3, 2010
  22. Matthieu MoyAug 3, 2010
  23. Miles BaderAug 4, 2010
  24. 5/5 log: parse detached option for --globMatthieu Moy, Jul 30, 2010
  25. 5/5 log: parse detached option for --globMatthieu Moy, Jul 29, 2010

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.