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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2008, 20:02 UTC
Message-ID
<7vod6i1e3p.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<c9062d05cabcbd45657e89b03eac9715a46f8b79.1212498900.git.marius@trolltech.com>
Marius Storm-Olsen <marius@trolltech.com> writes:
Show 8 quoted lines
> Determining untracked files can be a very slow operation on large trees.
> This commit adds a <mode> argument, which allows you to avoid showing the
> untracked files in a repository. Possible options are:
>     none   - Show no untracked files
>     normal - Show untracked files and directories
>     all    - Show all untracked files
>
> If the optional argument is not specified, the option defaults to 'all'.

You got me worried. You are defaulting the parameter of "-u" to 'all', not making the command default (in the absense of -u anything) to "-u all", which was what I misunderstood on my first reading. "the optional parameter defaults to 'all'" is what you meant...

enum {NONE,NORMAL,ALL}_UNTRACKED are named (1) too generic, in a sense that it is not clear _what_ is done to the class of untracked worktree entities, and/or (2) opposite from other enums where common prefix is followed by differing part.

Perhaps renaming them to SHOW_{NONE,NORMAL,ALL}_UNTRACKED would make it easier to read.

It would have been nicer if this patch was further split into two; the first one to introduce NORMAL and ALL without changing any behaviour, then the second one to add NONE to introduce a new behaviour, with tests so that other people will not break this new feature in their later changes.

Show 19 quoted lines
> @@ -150,12 +150,15 @@ but can be used to amend a merge commit.
>  	the last commit without committing changes that have
>  	already been staged.
>  
> --u|--untracked-files::
> -	Show all untracked files, also those in uninteresting
> -	directories, in the "Untracked files:" section of commit
> -	message template.  Without this option only its name and
> -	a trailing slash are displayed for each untracked
> -	directory.
> +-u[<mode>]|--untracked-files[=<mode>]::
> +	Show all untracked files.
> +	The mode parameter is optional, and is used to specify
> +	the handling of untracked files. The possible options are:
> +		none   - Show no untracked files
> +		normal - Shows untracked files and directories
> +		all    - Also shows individual files in untracked directories.
> +	If the mode parameter is not specified, the defaults is
> +	'all'.
Does this mark-up actually work?
Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 3 of 11 in “Add an optional <mode> argument to commit/status -u|--untracked-files option”
  1. Add an optional <mode> argument to commit/status -u|--untracked-files optionMarius Storm-Olsen, Jun 3, 2008
  2. Add configuration option for default untracked files modeMarius Storm-Olsen, Jun 3, 2008
  3. Junio C HamanoJun 3, 2008
  4. Marius Storm-OlsenJun 3, 2008
  5. Jeff KingJun 3, 2008
  6. Marius Storm-OlsenJun 3, 2008
  7. しらいしななこJun 3, 2008
  8. Jeff KingJun 3, 2008
  9. Alex RiesenJun 6, 2008
  10. Marius Storm-OlsenJun 6, 2008
  11. Jeff KingJun 3, 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.