Patchwork [PATCHv3,2/3] buildhistory: record all builds

login
register
mail settings
Submitter Koen Kooi
Date March 22, 2012, 3:25 p.m.
Message ID <1332429941-19621-2-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/24161/
State Accepted
Commit 2e40558cc33c5c566a9a742c32eda3ea017f8607
Headers show

Comments

Koen Kooi - March 22, 2012, 3:25 p.m.
When nothing has changed an empty commit prefixed with "No changes" will get generated

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/classes/buildhistory.bbclass |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Paul Eggleton - March 23, 2012, 2:33 p.m.
On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
> When nothing has changed an empty commit prefixed with "No changes" will get
> generated

So I guess what's missing from this commit message is an explanation of why 
you want this.

Cheers,
Paul
Koen Kooi - March 23, 2012, 2:46 p.m.
Op 23 mrt. 2012, om 15:33 heeft Paul Eggleton het volgende geschreven:

> On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
>> When nothing has changed an empty commit prefixed with "No changes" will get
>> generated
> 
> So I guess what's missing from this commit message is an explanation of why 
> you want this.

Drat, I had assumed the commit title would be enough for that :)
Paul Eggleton - March 23, 2012, 3:24 p.m.
On Friday 23 March 2012 15:46:23 Koen Kooi wrote:
> Op 23 mrt. 2012, om 15:33 heeft Paul Eggleton het volgende geschreven:
> > On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
> >> When nothing has changed an empty commit prefixed with "No changes" will
> >> get generated
> > 
> > So I guess what's missing from this commit message is an explanation of
> > why
> > you want this.
> 
> Drat, I had assumed the commit title would be enough for that :)

My personal opinion (probably backed up by the commit policy, I haven't 
refreshed my memory on it recently) is that commit messages should explain the 
reasoning behind a change and not just be a restatement of the change in 
human-readable form - although that is often useful in addition.

Cheers,
Paul
Koen Kooi - March 23, 2012, 3:48 p.m.
Op 23 mrt. 2012, om 16:24 heeft Paul Eggleton het volgende geschreven:

> On Friday 23 March 2012 15:46:23 Koen Kooi wrote:
>> Op 23 mrt. 2012, om 15:33 heeft Paul Eggleton het volgende geschreven:
>>> On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
>>>> When nothing has changed an empty commit prefixed with "No changes" will
>>>> get generated
>>> 
>>> So I guess what's missing from this commit message is an explanation of
>>> why
>>> you want this.
>> 
>> Drat, I had assumed the commit title would be enough for that :)
> 
> My personal opinion (probably backed up by the commit policy, I haven't 
> refreshed my memory on it recently) is that commit messages should explain the 
> reasoning behind a change and not just be a restatement of the change in 
> human-readable form - although that is often useful in addition.

I get that, but I'm having trouble coming up with something that isn't already covered but the "record all builds" statement :(

regards,

Koen
Paul Eggleton - March 23, 2012, 3:53 p.m.
On Friday 23 March 2012 16:48:35 Koen Kooi wrote:
> I get that, but I'm having trouble coming up with something that isn't
> already covered but the "record all builds" statement :(

I know what you mean, but I think that just stating its "so that the commit 
log of the buildhistory repo provides a complete log of all builds performed, 
not just those that resulted in changes" would be sufficient.

Cheers,
Paul
Koen Kooi - March 23, 2012, 4:24 p.m.
Op 23 mrt. 2012, om 16:53 heeft Paul Eggleton het volgende geschreven:

> On Friday 23 March 2012 16:48:35 Koen Kooi wrote:
>> I get that, but I'm having trouble coming up with something that isn't
>> already covered but the "record all builds" statement :(
> 
> I know what you mean, but I think that just stating its "so that the commit 
> log of the buildhistory repo provides a complete log of all builds performed, 
> not just those that resulted in changes" would be sufficient.

Added that, thanks!

I'll respin 3/3 with Chris' feedback as well.

regards,

Koen

Patch

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 764e1e8..2305b50 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -408,6 +408,8 @@  buildhistory_commit() {
 			if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
 				git push -q ${BUILDHISTORY_PUSH_REPO}
 			fi
+		else
+			git commit ${BUILDHISTORY_DIR}/ --allow-empty -m "No changes: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
 		fi) || true
 }