Skip to content

Commit 41b8134

Browse files
committed
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: #122 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent ff2c851 commit 41b8134

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pkgdev/scripts/pkgdev_commit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def parse_known_args(self, args=None, namespace=None):
4848
if namespace.edit:
4949
args.append("--edit")
5050
namespace.commit_args = args
51+
namespace.git_args_paths = list(
52+
filter(os.path.exists, (s for s in args if not s.startswith("-")))
53+
)
5154
return namespace, []
5255

5356

@@ -575,6 +578,7 @@ def _generate_mapping(self):
575578
"--cached",
576579
"-z",
577580
"HEAD",
581+
*self._options.git_args_paths,
578582
stdout=subprocess.PIPE,
579583
)
580584

0 commit comments

Comments
 (0)