[Mesa-dev] [PATCH v3] Rename the _mesa_lookup_enum_by_nr() function Renamed function _mesa_lookup_prim_by_nr() to _mesa_prim_string() _mesa_lookup_enum_by_nr() to _mesa_enum_string() _mesa_lookup_enum_by_name() to _mesa_enum_value() Changes were made, because nobody liked the way these functions are called.

Kenneth Graunke kenneth at whitecape.org
Wed Jun 5 14:24:11 PDT 2013

This patch is really doing three related, but independent things:
1. Renaming _mesa_lookup_prim_by_nr() to _mesa_prim_string()
2. Renaming _mesa_lookup_enum_by_nr() to _mesa_enum_string()
3. Renaming _mesa_lookup_enum_by_name() to _mesa_enum_value()

Generally, a patch should only do one thing at a time.  This has a 
number of benefits:
- Patches are smaller and easier for people to review.
- If a reviewer doesn't like the way you did something (for example, 
prefers a different name), you can redo and resubmit that one part 
instead of the whole thing.  This is less work for you and also easier 
on reviewers.
- If something breaks, people tracking it down via 'git bisect' will 
find a small, specific change that caused the problem rather than a 
large change that does many things.
- Small patches are easier to revert, if there is something broken.

I realize this is a bit pedantic for this particular patch, but I'd 
still prefer to see it as three separate patches:

mesa: Rename _mesa_lookup_prim_by_nr() to _mesa_prim_string().
mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_string().
mesa: Rename _mesa_lookup_enum_by_name() to _mesa_enum_value().

You'll also notice that our commit titles start with a prefix for the 
particular area of code they touch.  For example, src/glsl starts with 
"glsl: ", src/drivers/dri/i965 starts with "i965: ", and src/mesa/main 
(or generally anything not fitting a specific category) starts with 
"mesa: ".  If you're not sure what prefix to use, run 'git log' on a 
file to see what other people have done.


More information about the mesa-dev mailing list