From 41b813487245d68407640a36ece5d2320e6c1af9 Mon Sep 17 00:00:00 2001 From: Arthur Zamarin Date: Sun, 5 Mar 2023 21:52:58 +0200 Subject: commit: compute commit title for commit related files only In cases were multiples files are staged for commit across packages, but we run `pkgdev commit .` in one of them, it was adding and committing only the current package, but computing the message based on both of them. Resolves: https://github.com/pkgcore/pkgdev/issues/122 Signed-off-by: Arthur Zamarin --- src/pkgdev/scripts/pkgdev_commit.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pkgdev/scripts/pkgdev_commit.py b/src/pkgdev/scripts/pkgdev_commit.py index c85c7b1..98cbb78 100644 --- a/src/pkgdev/scripts/pkgdev_commit.py +++ b/src/pkgdev/scripts/pkgdev_commit.py @@ -48,6 +48,9 @@ class ArgumentParser(cli.ArgumentParser): if namespace.edit: args.append("--edit") namespace.commit_args = args + namespace.git_args_paths = list( + filter(os.path.exists, (s for s in args if not s.startswith("-"))) + ) return namespace, [] @@ -575,6 +578,7 @@ class GitChanges(UserDict): "--cached", "-z", "HEAD", + *self._options.git_args_paths, stdout=subprocess.PIPE, ) -- cgit v1.2.3-65-gdbad