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

Re: [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.

From
Junio C Hamano <gitster@pobox.com>
Date
May 30, 2008, 20:27 UTC
Message-ID
<7viqwvk04y.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com>
Simon Hausmann <simon@lst.de> writes:
Show 13 quoted lines
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 5331b45..e42ead0 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -214,6 +214,11 @@ core.ignoreStat::
>  	See linkgit:git-update-index[1].
>  	False by default.
>  
> +core.showUntrackedFiles::
> +	A boolean to enable/disable displaying untracked files in the output
> +	of linkgit:git-status[1] and linkgit:git-commit[1].
> +	Defaults to true.
> +

This does not belong to the 'core.*', which is about the low-level plumbing. It perhaps could live in 'status.*' section, but I think you can do better than introducing this as a boolean.

Show 22 quoted lines
> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> index c3c9f5b..a3174e4 100644
> --- a/Documentation/git-commit.txt
> +++ b/Documentation/git-commit.txt
> @@ -150,12 +150,17 @@ but can be used to amend a merge commit.
>  	the last commit without committing changes that have
>  	already been staged.
>  
> +-U|--untracked::
> +	Show untracked files, in the "Untracked files:" section of commit
> +	message template.
> +	This option overrides the core.showUntrackedFiles
> +	configuration option, and is normally not needed.
> +
>  -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
> +	directories.  Without this option only its name and
>  	a trailing slash are displayed for each untracked
> -	directory.
> +	directory. This option implies --untracked.

I wonder if we really need a new option that is half independent to an existing one.

Step back a bit and think.  You have three choice:
 (1) Do not show untracked files at all; or
 (2) Show untracked but summarize untracked directories; or
 (3) Show all untracked files.

We have had (2) and (3) so far, and you are adding (1) as a new feature. How about allowing -u on the command line to take an optional parameter to say what kind the user wants? I.e.

        -u=none		shows nothing (i.e. (1))
        -u=normal	shows summarized report (i.e. (2))
	-u=all		shows all untracked files (i.e. (3))

And (3) can also be spelled as "-u without parameter"; absense of -u anywhere defaults to (2). That would be the first patch.

Then, in the second patch, you can add support to 'status.showuntracked'; you pretend that it is set to 'normal' if it is not defined in the configuration file.

Hmm?
Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 10 of 11 in “Ensure that commit/status don't stat all files when core.ignoreStat = true”
  1. Ensure that commit/status don't stat all files when core.ignoreStat = trueMarius Storm-Olsen, May 27, 2008
  2. Junio C HamanoMay 27, 2008
  3. Marius Storm-OlsenMay 27, 2008
  4. 1/3 Clearify the documentation for core.ignoreStatMarius Storm-Olsen, May 30, 2008
  5. 2/3 Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.Simon Hausmann, May 30, 2008
  6. 3/3 Add shortcut in refresh_cache_ent() for marked entries.Marius Storm-Olsen, May 30, 2008
  7. Marius Storm-OlsenMay 30, 2008
  8. Marius Storm-OlsenMay 30, 2008
  9. Marius Storm-OlsenMay 30, 2008
  10. Junio C HamanoMay 30, 2008
  11. Marius Storm-OlsenMay 31, 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.