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

Re: [PATCH 1/2] Add -e/--exclude to git-clean.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2010, 20:27 UTC
Message-ID
<7vr5ixlx0k.fsf@alter.siamese.dyndns.org>
In-Reply-To
<8f454efeb3aa4acd0e0c420b197d0269dc53db34.1279654370.git.jaredhance@gmail.com>
Jared Hance <jaredhance@gmail.com> writes:
Show 6 quoted lines
> With the -e/--exclude option for git-clean, a user can specify files
> that they haven't yet told git about, but either need for a short amount
> of time or plan to tell git about them later. This allows one to still
> use git-clean while these files are around without losing data.
>
> Signed-off-by: Jared Hance <jaredhance@gmail.com>
Thanks.
> +static int exclude_cb(const struct option *opt, const char *arg, int unset)
> +{
> +	struct string_list *exclude_list = (struct string_list *)opt->value;
Unnecessary cast, as opt->value is of type (void *).
Show 5 quoted lines
> @@ -36,6 +44,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  	struct dir_struct dir;
>  	static const char **pathspec;
>  	struct strbuf buf = STRBUF_INIT;
> +	struct string_list exclude_list = { NULL, 0, 0, 0 };

Mental note to myself. We should convert this to use STRING_LIST_INIT after the next release when Thiago's patch graduates to 'master'.

Previous: Jared HanceNext: Jared Hance
Message 3 of 7 in “Add -e/--exclude to git-clean.”
  1. 0/2 Add -e/--exclude to git-clean.Jared Hance, Jul 20, 2010
  2. 1/2 Add -e/--exclude to git-clean.Jared Hance, Jul 20, 2010
  3. Junio C HamanoJul 20, 2010
  4. 2/2 Add test for git clean -e.Jared Hance, Jul 20, 2010
  5. Junio C HamanoJul 20, 2010
  6. Jared HanceJul 20, 2010
  7. Jared HanceJul 20, 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.