coreos / rpm-ostree

⚛📦 Hybrid image/package system with atomic upgrades and package layering
https://coreos.github.io/rpm-ostree
Other
871 stars 195 forks source link

commit message support #162

Open cgwalters opened 9 years ago

cgwalters commented 9 years ago

OSTree has them, we should support people writing them for a few reasons.

One use case I see is it's very common to maintain metadata in a git repository, and it'd be nice to have that git repo URL + commit in the message.

mbarnes commented 9 years ago

Also https://github.com/projectatomic/rpm-ostree-toolbox/issues/35

cgwalters commented 7 years ago

There was a recent thread on this on ostree-list.

Related to the git repo/URL, we did land https://github.com/projectatomic/rpm-ostree/pull/676 - though we haven't talked about showing that in the UI in any way.

It does seem clear we should at least have the equivalent of the new ostree commit -F.

cgwalters commented 7 years ago

In the short term, if anyone wants to use commit messages right now, you can hack it like this, by having rpm-ostree write the commit, then overwrite it but use the contents:

rpm-ostree compose --repo=repo tree <treefile>
ostree --repo=repo commit -s <subject> -F <commit body file> --tree=ref=exampleos/42/x86_64/demo --parent exampleos/42/x86_64/demo^

This general principle applies broadly - you can use rpm-ostree just to generate content, and then ostree tooling to manipulate/edit/promote it after.

Concrete cmdline I just tested:

# echo 'Commit body here!' > body.txt
# ostree --repo=repo commit -b fedora/rawhide/x86_64/atomic-host -s 'My awesome Fedora Atomic Host build!' -F body.txt --tree=ref=fedora/rawhide/x86_64/atomic-host --parent $(ostree --repo=repo rev-parse fedora/rawhide/x86_64/atomic-host^)
jlebon commented 7 years ago

You can make the "rpm-ostree just generates content" even more explicit by using --write-commitid-to (which also will avoid needing --parent). E.g.:

rpm-ostree compose --repo=repo tree --write-commitid-to=csum <treefile>
ostree --repo=repo commit -b my/actual/branch -F body.txt -s "summary!" --tree=ref=$(cat csum)