Skip to content

Commit 0009542

Browse files
committed
ls-files: avoid the verb "deprecate" for individual options
When e750951 (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 <[email protected]>
1 parent 564d025 commit 0009542

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

Documentation/git-ls-files.txt

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ OPTIONS
119119

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

125127
--exclude-standard::
126128
Add the standard Git exclusions: .git/info/exclude, .gitignore
@@ -298,9 +300,8 @@ traversing the directory tree and finding files to show when the
298300
flags --others or --ignored are specified. linkgit:gitignore[5]
299301
specifies the format of exclude patterns.
300302

301-
Generally, you should just use --exclude-standard, but for historical
302-
reasons the exclude patterns can be specified from the following
303-
places, in order:
303+
These exclude patterns can be specified from the following places,
304+
in order:
304305

305306
1. The command-line flag --exclude=<pattern> specifies a
306307
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
322323
by --exclude-per-directory is relative to the directory that the
323324
pattern file appears in.
324325

326+
Generally, you should be able to use `--exclude-standard` when you
327+
want the exclude rules applied the same way as what Porcelain
328+
commands do. To emulate what `--exclude-standard` specifies, you
329+
can give `--exclude-per-directory=.gitignore`, and then specify:
330+
331+
1. The file specified by the `core.excludesfile` configuration
332+
variable, if exists, or the `$XDG_CONFIG_HOME/git/ignore` file.
333+
334+
2. The `$GIT_DIR/info/exclude` file.
335+
336+
via the `--exclude-from=` option.
337+
325338
SEE ALSO
326339
--------
327340
linkgit:git-read-tree[1], linkgit:gitignore[5]

0 commit comments

Comments
 (0)