Skip to content

Commit

Permalink
commit: compute commit title for commit related files only
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
arthurzam committed Mar 5, 2023
1 parent ff2c851 commit 41b8134
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pkgdev/scripts/pkgdev_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def parse_known_args(self, args=None, namespace=None):
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, []


Expand Down Expand Up @@ -575,6 +578,7 @@ def _generate_mapping(self):
"--cached",
"-z",
"HEAD",
*self._options.git_args_paths,
stdout=subprocess.PIPE,
)

Expand Down

0 comments on commit 41b8134

Please sign in to comment.