From a1493ab9346d4533912ba537bff1fdadf293aa3a Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 29 Mar 2022 10:34:14 -0400 Subject: [PATCH] Add whitespace ignore to diff --- CHANGELOG.md | 6 ++++++ mepo.d/cmdline/parser.py | 4 ++++ mepo.d/repository/git.py | 2 ++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9b3b20..6de60a68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +## [1.42.0] - 2022-03-29 + +### Added + +- Added `-b/--ignore-space-change` option to `mepo diff` + ## [1.41.0] - 2022-03-25 ### Changed diff --git a/mepo.d/cmdline/parser.py b/mepo.d/cmdline/parser.py index 84007c22..1541b9aa 100644 --- a/mepo.d/cmdline/parser.py +++ b/mepo.d/cmdline/parser.py @@ -150,6 +150,10 @@ def __diff(self): '--staged', action = 'store_true', help = 'Show diff of staged changes') + diff.add_argument( + '-b','--ignore-space-change', + action = 'store_true', + help = 'Ignore changes in amount of whitespace') diff.add_argument( 'comp_name', metavar = 'comp-name', diff --git a/mepo.d/repository/git.py b/mepo.d/repository/git.py index fd1b2fd9..4c61063f 100644 --- a/mepo.d/repository/git.py +++ b/mepo.d/repository/git.py @@ -128,6 +128,8 @@ def run_diff(self, args=None): cmd += ' --name-status' if args.staged: cmd += ' --staged' + if args.ignore_space_change: + cmd += ' --ignore-space-change' output = shellcmd.run(shlex.split(cmd),output=True) return output.rstrip()