Observed behavior: rpmautospec convert . creates an empty commit even if target repository is already using rpmautospec.
rpmautospec convert .
Expected behavior: No commit if no changes are made. (Or even no commit ever — committing on behalf of user is strange in my opinion, but that is not the topic of this issue.)
To reproduce:
git log
Because I did not expect this behavior, I accidentally pushed such empty commit together with some other work: rubygem-sync 98f94fdfb.
Hmm, I don't see this here:
$ ~/python/rpmautospec/run-rpmautospec.py convert . Traceback (most recent call last): File "/home/zbyszek/python/rpmautospec/run-rpmautospec.py", line 6, in <module> main() File "/home/zbyszek/python/rpmautospec/rpmautospec/cli.py", line 103, in main sys.exit(subcmd_module.main(args)) File "/home/zbyszek/python/rpmautospec/rpmautospec/subcommands/convert.py", line 226, in main pkg = PkgConverter(Path(args.spec_or_path)) File "/home/zbyszek/python/rpmautospec/rpmautospec/subcommands/convert.py", line 69, in __init__ raise RuntimeError("Changelog file 'changelog' is already in the repository") RuntimeError: Changelog file 'changelog' is already in the repository
and with #266
$ ~/python/rpmautospec/run-rpmautospec.py convert Changelog file 'changelog' is already in the repository
Right, this does not happen for every repository that uses rpmautospec. Actually, only repositories that use the rpmautospec macros in the specfile, but do not have the changelog file, are affected (i.e. repositories that have been on rpmautospec right from the start).
changelog
The rubygem-sync repo that I link to is an example.
rubygem-sync
Commit c702b792 fixes this issue