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

Re: [PATCH 1/3] Add an optional <mode> argument to commit/status -u|--untracked-files option

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 7, 2008, 01:55 UTC
Message-ID
<7v4p86qa93.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<5f0ab026ce200e501be81a3b5082e482e1580e42.1212670149.git.marius@trolltech.com>
Marius Storm-Olsen <marius@trolltech.com> writes:
Show 10 quoted lines
> diff --git a/builtin-commit.c b/builtin-commit.c
> index b294c1f..1f4986b 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -102,7 +103,7 @@ static struct option builtin_commit_options[] = {
>  	OPT_BOOLEAN('o', "only", &only, "commit only specified files"),
>  	OPT_BOOLEAN('n', "no-verify", &no_verify, "bypass pre-commit hook"),
>  	OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"),
> -	OPT_BOOLEAN('u', "untracked-files", &untracked_files, "show all untracked files"),
> +	{ OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, "mode", "show untracked files, optional modes: all, normal. (Default: all)", PARSE_OPT_OPTARG, NULL, (int)"all" },
Hmm.

$ make builtin-commit.c:106: error: initializer element is not constant builtin-commit.c:106: error: (near initialization for 'builtin_commit_options[18].defval') make: *** [builtin-commit.o] Error 1

I also have to wonder what the funny cast of (int)"all"  is doing.
Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 4 of 7 in “Add an optional <mode> argument to commit/status -u|--untracked-files option”
  1. 1/3 Add an optional <mode> argument to commit/status -u|--untracked-files optionMarius Storm-Olsen, Jun 5, 2008
  2. 2/3 Add argument 'no' commit/status option -u|--untracked-filesMarius Storm-Olsen, Jun 5, 2008
  3. 3/3 Add configuration option for default untracked files modeMarius Storm-Olsen, Jun 5, 2008
  4. Junio C HamanoJun 7, 2008
  5. Marius Storm-OlsenJun 9, 2008
  6. 1/3 Add an optional <mode> argument to commit/status -u|--untracked-files optionMarius Storm-Olsen, Jun 5, 2008
  7. Junio C HamanoJun 10, 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.