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

Re: [RFC/PATCH] Add --exclude-dir option to git grep

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2010, 05:51 UTC
Message-ID
<7vsk0ynzfl.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4C9D596C.4060906@ripton.net>
David Ripton <dripton@ripton.net> writes:
Show 12 quoted lines
>>> +static int exclude_dir_callback(const struct option *opt, const char *arg,
>>> +				int unset)
>>> +{
>>> +	struct string_list *exclude_dir_list = opt->value;
>>> +	char *s1 = (char *)arg;
>>
>> What is this cast for?
>
> It avoids:
>
> "builtin/grep.c:893: warning: initialization discards qualifiers from
> pointer target type"
And the reason why s1 cannot be of type "const char *" is...?
Previous: David RiptonNext: David Ripton
Message 4 of 7 in “Add --exclude-dir option to git grep”
  1. Add --exclude-dir option to git grepDavid Ripton, Sep 24, 2010
  2. Junio C HamanoSep 24, 2010
  3. David RiptonSep 25, 2010
  4. Junio C HamanoSep 25, 2010
  5. David RiptonSep 25, 2010
  6. David RiptonSep 25, 2010
  7. Junio C HamanoSep 27, 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.