#264 Convert creates a commit even if repo is already using rpmautospec
Closed: Fixed by nphilipp. Opened by oturpe.

Observed behavior:
rpmautospec convert . creates an empty commit even if target repository is already using rpmautospec.

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:

  1. Run rpmautospec convert . in any repository that already uses rpmautospec.
    (Or run the comman twice in a repository that does not.)
  2. Observe from git log that empty commit was added.
    ```

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).

The rubygem-sync repo that I link to is an example.

268 should fix this.

Commit c702b792 fixes this issue

Metadata
Related Pull Requests