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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marius Storm-Olsen <marius@xxxxxxxxxxxxx> writes:

> 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.

> @@ -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?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux