diff options
author | Naveen Nathan <naveen@lastninja.net> | 2019-11-07 11:23:57 +1100 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2020-02-17 17:16:28 -0500 |
commit | 297b428c8c92dca2c62d57dd41ad085aa94c4aa4 (patch) | |
tree | 37f99ed74be2ffdfeb35e096ac063a0bc813e7e4 /src/app.rs | |
parent | 804b43ecd8bd37fde4fc81f49d1f9bb659aeac1c (diff) |
cli: add --no-ignore-exclude flag
This commit adds a new --no-ignore-exclude flag that permits disabling
the use of .git/info/exclude filtering. Local exclusions are manual
configurations to a repository and are not shared, so it is sometimes
useful to disable to get a consistent view of a repository.
This also adds a new section to the man page that describes automatic
filtering.
Closes #1420
Diffstat (limited to 'src/app.rs')
-rw-r--r-- | src/app.rs | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -595,6 +595,7 @@ pub fn all_args_and_flags() -> Vec<RGArg> { flag_no_config(&mut args); flag_no_ignore(&mut args); flag_no_ignore_dot(&mut args); + flag_no_ignore_exclude(&mut args); flag_no_ignore_global(&mut args); flag_no_ignore_messages(&mut args); flag_no_ignore_parent(&mut args); @@ -1769,6 +1770,26 @@ This flag can be disabled with the --ignore-dot flag. args.push(arg); } +fn flag_no_ignore_exclude(args: &mut Vec<RGArg>) { + const SHORT: &str = "Don't respect local exclusion files."; + const LONG: &str = long!("\ +Don't respect ignore files that are manually configured for the repository +such as git's '.git/info/exclude'. + +This flag can be disabled with the --ignore-exclude flag. +"); + let arg = RGArg::switch("no-ignore-exclude") + .help(SHORT).long_help(LONG) + .overrides("ignore-exclude"); + args.push(arg); + + let arg = RGArg::switch("ignore-exclude") + .hidden() + .overrides("no-ignore-exclude"); + args.push(arg); +} + + fn flag_no_ignore_global(args: &mut Vec<RGArg>) { const SHORT: &str = "Don't respect global ignore files."; const LONG: &str = long!("\ |