diff --git a/src/west/app/project.py b/src/west/app/project.py index c6c59794..f3caf66c 100644 --- a/src/west/app/project.py +++ b/src/west/app/project.py @@ -788,7 +788,7 @@ def do_add_parser(self, parser_adder): parser.add_argument('-a', '--all', action='store_true', help='include output for inactive projects') parser.add_argument('-m', '--manifest', action='store_true', - help='show changes relative to the manifest revision') + help='show changes relative to "manifest-rev"') return parser def do_run(self, args, user_args): @@ -800,9 +800,16 @@ def do_run(self, args, user_args): # which it won't do ordinarily since stdout is not a terminal. color = ['--color=always'] if self.color_ui else [] for project in self._cloned_projects(args, only_active=not args.all): + diff_commit = ( + ['manifest-rev'] # see #719 and #747 + # Special-case the manifest repository while it's + # still showing up in the 'projects' list. Yet + # more evidence we should tackle #327. + if args.manifest and not isinstance(project, ManifestProject) + else [] + ) # Use paths that are relative to the base directory to make it # easier to see where the changes are - diff_commit = [project.revision] if args.manifest else [] cp = project.git(['diff', f'--src-prefix={project.path}/', f'--dst-prefix={project.path}/', '--exit-code'] + color + diff_commit, diff --git a/tests/test_project.py b/tests/test_project.py index eb7e168e..6c324b63 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -350,6 +350,7 @@ def test_diff(west_init_tmpdir): cmd('update net-tools') cmd('diff') cmd('diff --stat') + cmd('diff --manifest') cmd('update Kconfiglib')