#135 Better clog content
Closed: Fixed 7 years ago Opened 7 years ago by cqi.

clog command outputs the top changelog got from SPEC into file clog as following, for example,

add missing nocheck argument to Commands.compile (cqi)

- add stage config files and rhpkg-stage binary (araszka)
- Properly detect and tag RHS/RHGS branches. (jarrpa)
- Fix publican-build command (lsedlar)

However, according to the description

This will create a file named "clog" that contains the latest rpm changelog entry. The leading "- " text will be stripped.

The output should be

add missing nocheck argument to Commands.compile (cqi)
add stage config files and rhpkg-stage binary (araszka)
Properly detect and tag RHS/RHGS branches. (jarrpa)
Fix publican-build command (lsedlar)

Meanwhile, current output is also shared with commit --clog, that is the output is used as commit message. This seems a conflict and probably a bug making people confused.

Fixing this issue by correcting the output is straightforward, but need packagers' attention.


By the way there was a discussion related to changelogs on fedora-devel@ list recently:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/L5P6BWXKGMZBRFTRKBVVNS5DFL4OJC6R/

It seems from it that not a lot of people use this functionality.

One reason why the first line may be separated like that is so that it is a correct git commit message. Otherwise people would have to add the summary line manually. It would actually make sense if the original %changelog entry was like this:

- New upstream release 1.XY
- add missing nocheck argument to Commands.compile (cqi)
- add stage config files and rhpkg-stage binary (araszka)
- Properly detect and tag RHS/RHGS branches. (jarrpa)
- Fix publican-build command (lsedlar)

The commit message would then look reasonable.

Yup, but it restricts a packager to update changelog with New upstream release 1.XY first, meanwhile it may not be to make a new release each time when update SPEC, commit, and push.

With the fix, use case of commit --clog would change to

fedpkg commit -m "commit message summary" --clog

Where, -m specifies commit message summary, and --clog generates the message body. For example,

commit message summary

add missing nocheck argument to Commands.compile (cqi)
add stage config files and rhpkg-stage binary (araszka)
Properly detect and tag RHS/RHGS branches. (jarrpa)
Fix publican-build command (lsedlar)

Yup, that looks much better. Currently when using both -m and --clog, -m wins. If the clog output goes as the message body, maybe preserving the dashes would be nice so that it still looks like a list. I'm not sure if the description is meant to strip it from all the lines or just from the start of the file.

I found an example commit with the confusing message format.

If the clog output goes as the message body, maybe preserving the dashes would be nice so that it still looks like a list.

I just thought this point. Could it introduce another conflict, that is clog without --raw does not output dashes, and commit --clog does. Or, we can just define that commit --clog is same as clog --raw. I prefer latter one. :)

Fortunately, commit command has --raw option to generate a raw clog file already. So, user is able to commit like this

fedpkg commit -m "commit message summary" --raw

Once I use -m, the clog is not used anymore. I'm not sure if it's worth supporting all combinations of -m, --clog and --raw. The tools should ideally just do the right thing.

yeah, combining -m, --clog and --raw is really not a good way. It seems there is a blocker here. Anyway, we should provide good user experience to developers. How about simplify the options just like above mentioned

fedpkg commit -m "commit message summary" --with-changelog

This mean constructing commit message, e.g.

commit message summary

- New upstream release 1.XY
- add missing nocheck argument to Commands.compile (cqi)
- add stage config files and rhpkg-stage binary (araszka)
- Properly detect and tag RHS/RHGS branches. (jarrpa)
- Fix publican-build command (lsedlar)

This does not break the usage of --clog and --raw. Both of them work as before, except that user should modify commit message manually to add a summary line.

BTW, --clog and --raw might be removed in the future, if they are not useful at all in practice.

I agree. Your proposal looks like a good way to fix it.

@cqi changed the status to Closed

7 years ago

Login to comment on this ticket.

Metadata