1 |
Michał Górny posted on Tue, 25 Jul 2017 10:05:06 +0200 as excerpted: |
2 |
|
3 |
> ===Splitting commits=== |
4 |
> Git commits are lightweight, and the developers are encouraged to split |
5 |
> their commits to improve readability and the ability of reverting |
6 |
> specific sub-changes. When choosing how to split the commits, the |
7 |
> developers should consider the following three rules: |
8 |
> # Use atomic commits — one commit per logical change. |
9 |
> # Split commits at logical unit (package, eclass, profile…) boundaries. |
10 |
> # Avoid creating commits that are 'broken' — e.g. are incomplete, have |
11 |
> uninstallable packages. |
12 |
|
13 |
(Without commenting on the technical specifics, particularly in the |
14 |
examples, only nitpicking grammar here...) |
15 |
|
16 |
Two instances of "the developers": Should be "the developer" (singular), |
17 |
or "developers" (plural, no "the"), your choice. Note that in the first |
18 |
usage, if the singular "the developer" is chosen, the following "are" and |
19 |
"their" will need changed to singular as well. |
20 |
|
21 |
(Of course then there's the question of his/her or a controversial usage |
22 |
of singular "their" to remain gender neutral, so plural "developers" may |
23 |
be best there, nicely avoiding the secondary controversy. FWIW, the |
24 |
appropriateness of singular they/their to avoid gender specificity is a |
25 |
current topic of debate in linguistic circles, but is "languagelog approved" |
26 |
at least, citing usage by respected authors going back over a century, and |
27 |
seems to be on the way toward wider acceptance. YMMV, but it's easy enough |
28 |
to avoid the entire question here, with consistent plural usage.) |
29 |
|
30 |
> It is technically impossible to always respect all of the three rules, |
31 |
|
32 |
s/all of the three rules,/all three rules/ |
33 |
(Note omission of the comma too.) |
34 |
|
35 |
> so developers have to balance between them at their own discretion. Side |
36 |
> changes that are implied by other change (e.g. revbump due to some |
37 |
> change) should be included in the first commit requiring them. Commits |
38 |
> should be ordered to avoid breakage, and follow logical ordering |
39 |
> whenever possible. |
40 |
> |
41 |
> Examples: |
42 |
> * When doing a version bump, it is usually not reasonable to split every |
43 |
> necessary logical change into separate commit since the interim commits |
44 |
|
45 |
s/into separate commit/into separate commits/ |
46 |
|
47 |
... but that's still slightly uncomfortable due to ambiguous plurality |
48 |
agreement. Maybe... |
49 |
|
50 |
"into its own commit" |
51 |
|
52 |
> would correspond to a broken package. However, if the package has a live |
53 |
> ebuild, it ''might'' be reasonable to perform split logical changes on |
54 |
> the live ebuild, then create a release as another logical step. |
55 |
> * When doing one or more changes that require a revision bump, bump the |
56 |
> revision in the commit including the first change. Split the changes |
57 |
> into multiple logical commits without further revision bumps — since |
58 |
> they are going to be pushed in a single push, the user will not be |
59 |
> exposed to interim state. |
60 |
> * When adding a new version of a package that should be masked, you can |
61 |
> include the {{Path|package.mask}} edit in the commit adding it. |
62 |
> Alternatively, you can add the mask in a split commit ''preceding'' the |
63 |
> bump. |
64 |
> * When doing a minor change to a large number of packages, it is |
65 |
> reasonable to do so in a single commit. However, when doing a major |
66 |
> change (e.g. a version bump), it is better to split commits on package |
67 |
> boundaries. |
68 |
|
69 |
-- |
70 |
Duncan - List replies preferred. No HTML msgs. |
71 |
"Every nonfree program has a lord, a master -- |
72 |
and if you use the program, he is your master." Richard Stallman |