Unverified Commit dedf21dc authored by Austin Horstman's avatar Austin Horstman
Browse files

nixpkgs-plugin-update: include GitHub URL in add commits



When adding new plugins, include the GitHub repository URL in the commit
body. This provides immediate context about the source repository without
needing to look up the plugin definition.

Signed-off-by: default avatarAustin Horstman <khaneliman12@gmail.com>
parent d9ee6730
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -640,12 +640,21 @@ class Editor:
            autocommit = not args.no_commit
            if autocommit:
                assert editor.nixpkgs_repo is not None
                commit(
                    editor.nixpkgs_repo,
                    "{drv_name}: init at {version}".format(

                commit_message = "{drv_name}: init at {version}".format(
                    drv_name=editor.get_drv_name(plugin.normalized_name),
                    version=plugin.version,
                    ),
                )

                if isinstance(pdesc.repo, RepoGitHub):
                    github_url = (
                        f"https://github.com/{pdesc.repo.owner}/{pdesc.repo.repo}"
                    )
                    commit_message += f"\n\n{github_url}"

                commit(
                    editor.nixpkgs_repo,
                    commit_message,
                    [args.outfile, args.input_file],
                )