All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ls-files: avoid the verb "deprecate" for individual options
@ 2024-01-24 21:10 Junio C Hamano
  2024-01-25 18:06 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2024-01-24 21:10 UTC (permalink / raw)
  To: git
  Cc: Elijah Newren, Jeff King, Raúl Núñez de Arenas Coronado

When e750951e (ls-files: guide folks to --exclude-standard over
other --exclude* options, 2023-01-13) updated the documentation to
give greater visibility to the `--exclude-standard` option, it marked
the `--exclude-per-directory` option as "deprecated".

While it is technically correct that being deprecated does not
necessarily mean it is planned to be removed later, it seems to
cause confusion to readers, especially when we merely mean

    The option Y can be used to achieve the same thing as the option
    X much simpler. To those of you who aren't familiar with either
    X or Y, we would recommend to use Y when appropriate.

This is especially true for `--exclude-standard` vs the combination
of more granular `--exclude-from` and `--exclude-per-directory`
options.  It is true that one common combination of the granular
options can be obtained by just giving the former, but that does not
necessarily mean a more granular control is not necessary.

State the reason why we recommend readers `--exclude-standard` in
the description of `--exclude-per-directory`, instead of saying that
the option is deprecated.  Also, spell out the recipe to emulate
what `--exclude-standard` does, so that the users can give it minute
tweaks (like "do the same as Git Porcelain, except I do not want to
read the global exclusion file from core.excludes").

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * With the grammofix by Peff squashed in and with minor tweaks to
   the proposed log message.

 Documentation/git-ls-files.txt | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index f65a8cd91d..9447f2d8f4 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -119,8 +119,10 @@ OPTIONS
 
 --exclude-per-directory=<file>::
 	Read additional exclude patterns that apply only to the
-	directory and its subdirectories in <file>.  Deprecated; use
-	--exclude-standard instead.
+	directory and its subdirectories in <file>.  If you are
+	trying to emulate the way Porcelain commands work, using
+	the `--exclude-standard` instead is easier and more
+	thorough.
 
 --exclude-standard::
 	Add the standard Git exclusions: .git/info/exclude, .gitignore
@@ -298,9 +300,8 @@ traversing the directory tree and finding files to show when the
 flags --others or --ignored are specified.  linkgit:gitignore[5]
 specifies the format of exclude patterns.
 
-Generally, you should just use --exclude-standard, but for historical
-reasons the exclude patterns can be specified from the following
-places, in order:
+These exclude patterns can be specified from the following places,
+in order:
 
   1. The command-line flag --exclude=<pattern> specifies a
      single pattern.  Patterns are ordered in the same order
@@ -322,6 +323,18 @@ top of the directory tree.  A pattern read from a file specified
 by --exclude-per-directory is relative to the directory that the
 pattern file appears in.
 
+Generally, you should be able to use `--exclude-standard` when you
+want the exclude rules applied the same way as what Porcelain
+commands do.  To emulate what `--exclude-standard` specifies, you
+can give `--exclude-per-directory=.gitignore`, and then specify:
+
+  1. The file specified by the `core.excludesfile` configuration
+     variable, if exists, or the `$XDG_CONFIG_HOME/git/ignore` file.
+
+  2. The `$GIT_DIR/info/exclude` file.
+
+via the `--exclude-from=` option.
+
 SEE ALSO
 --------
 linkgit:git-read-tree[1], linkgit:gitignore[5]
-- 
2.43.0-386-ge02ecfcc53


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ls-files: avoid the verb "deprecate" for individual options
  2024-01-24 21:10 [PATCH] ls-files: avoid the verb "deprecate" for individual options Junio C Hamano
@ 2024-01-25 18:06 ` Jeff King
  2024-01-25 18:55   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2024-01-25 18:06 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Elijah Newren, Raúl Núñez de Arenas Coronado

On Wed, Jan 24, 2024 at 01:10:31PM -0800, Junio C Hamano wrote:

>  --exclude-per-directory=<file>::
>  	Read additional exclude patterns that apply only to the
> -	directory and its subdirectories in <file>.  Deprecated; use
> -	--exclude-standard instead.
> +	directory and its subdirectories in <file>.  If you are
> +	trying to emulate the way Porcelain commands work, using
> +	the `--exclude-standard` instead is easier and more
> +	thorough.

Sorry I missed this gramm-o before, but should be "the --exclude-standard
option" or just "--exclude-standard".

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ls-files: avoid the verb "deprecate" for individual options
  2024-01-25 18:06 ` Jeff King
@ 2024-01-25 18:55   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2024-01-25 18:55 UTC (permalink / raw)
  To: Jeff King
  Cc: git, Elijah Newren, Raúl Núñez de Arenas Coronado

Jeff King <peff@peff.net> writes:

> On Wed, Jan 24, 2024 at 01:10:31PM -0800, Junio C Hamano wrote:
>
>>  --exclude-per-directory=<file>::
>>  	Read additional exclude patterns that apply only to the
>> -	directory and its subdirectories in <file>.  Deprecated; use
>> -	--exclude-standard instead.
>> +	directory and its subdirectories in <file>.  If you are
>> +	trying to emulate the way Porcelain commands work, using
>> +	the `--exclude-standard` instead is easier and more
>> +	thorough.
>
> Sorry I missed this gramm-o before, but should be "the --exclude-standard
> option" or just "--exclude-standard".

Oops, certainly.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-25 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24 21:10 [PATCH] ls-files: avoid the verb "deprecate" for individual options Junio C Hamano
2024-01-25 18:06 ` Jeff King
2024-01-25 18:55   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.