wayland-info: unbreak build on FreeBSD
Merge request reports
Activity
- Resolved by Jan Beich
- Resolved by Jan Beich
Also, the commit message would need to be more explicit, instead of the bare compiler error.
I reckon http://who-t.blogspot.com/2009/12/on-commit-messages.html is a good start.
the commit message would need to be more explicit, instead of the bare compiler error.
But compiler error is more explicit than human interpretation.
Why is it necessary? See the compiler error.
How does it address the issue? Read the short diff or the summary.
What effects does the patch have? Nop elsewhere (Linux). musl hasprogram_invocation_short_name
just like glibc.I hope you don't mind me dissecting into this.
For example, I would have formatted the commit message as something like this:
build: use getprogname() on BSDs and Solaris The libc on BSD and Solaris do not implement program_invocation_short_name, leading to this error: ../wayland-info/wayland-info.c:258:28: error: use of undeclared identifier 'program_invocation_short_name' fprintf(stderr, "[%s] ", program_invocation_short_name); ^ Use getprogname() always if it is found, redefining program_invocation_short_name.
It's kind of obvious, yes, but it does discriminate from e.g. not using the right
#include
s by saying the variable does not exist at all.Actually, the commit title is a little misleading: you're not testing for BSD and Solaris, you're testing for the existence of
getprogname()
. So the title should be:build: redefine program_invocation_short_name if getprogname() exists
or something in that direction. In that case it is even more important to mention the relevant OSs and the particular OS where you got the error in the commit message, so that readers know why this change was made (as opposed to thinking "I never got that error, why is this patch there?"). This is quite important if someone has a system that has bothgetprogname()
andprogram_invocation_short_name
in which case the#define
inconfig.h
might cause compiler errors in system headers.build: use getprogname() on BSDs and Solaris The libc on BSD and Solaris do not implement program_invocation_short_name, leading to this error:
Too verbose: paraphrasing summary line and error message. One-liner here is enough but I admit mine wasn't very good.
you're not testing for BSD and Solaris, you're testing for the existence of
getprogname()
.The reader is supposed to connect the dots between the error message and BSD + Solaris. Every word in the commit message is should carry additional meaning.
build: redefine program_invocation_short_name if getprogname() exists
Poor example: the diff is neither large nor complex enough to require translating.
it is even more important to mention the relevant OSs
Already mentioned. Reminds me, this is a good example for inline comments.
and the particular OS where you got the error in the commit message
Look at my email address in the commit message. ;)
Agreed, me too.
FWIW, speaking for myself, I contribute to quite a lot of different projects, with different code base, and having a nice and readable git commit log is not just for being pedantic or to look fancy, it is a real plus for anybody who needs to contribute to the project, either now or in a few years time when nobody remembers what this was all about.
Edited by Olivier Fourdan
- Resolved by Olivier Fourdan
- Resolved by Jan Beich
added 6 commits
-
819236c9...4d68681d - 4 commits from branch
wayland:main
- 4035a330 - wayland-info: hardcode program name in fail_on_null
- 82f63675 - wayland-info: disable Linux-only clocks on non-Linux
-
819236c9...4d68681d - 4 commits from branch
added 1 commit
- 191e3674 - wayland-info: disable Linux-only clocks if not available
FWIW, an old version of this MR is already used by OpenBSD, not just DragonFly and FreeBSD.
@jbeich, can you add S-o-b tags to your commit messages?