Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/
Date: Mon, 12 Oct 2015 03:36:12
Message-Id: pan$e8fc1$1360333a$4edeba7b$3ccaf796@cox.net
In Reply to: [gentoo-dev] Re: [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/ by "Michał Górny"
1 Michał Górny posted on Sun, 11 Oct 2015 15:02:43 +0200 as excerpted:
2
3 > Furthermore, *please* don't mix old version removals with other changes.
4 > This makes it unnecessarily hard to revert breaking changes. Let's
5 > suppose you accidentally removed a version that had reverse
6 > dependencies. If you did it in a separate commit, we could quickly
7 > revert that commit and save users from seeing the breakage, and we could
8 > do the removal properly afterwards. When changes are mixed like this,
9 > you have to do partial reverts and partial re-commits, and things get
10 > unnecessarily hard.
11
12 Yes, please. Advanced users doing direct git syncs appreciate it too.
13 =:^)
14
15 The git experts drill this and drill this, as handled correctly, it's a
16 major advantage git has over more traditional VCS tools, but it's oh so
17 easy to not "get it", for those used to working with those more
18 traditional but less flexible tools. One single logical change per
19 commit. If you want to bunch up, bunch up the commits and push them all
20 at once, but the commits really do need to be one logical change per
21 commit. It makes bisect-debugging, reverting, and cherry-picking, all
22 three, /so/ much simpler. =:^)
23
24 Adding new python compatibility is one logical change. Removing old
25 ebuilds is another. In fact, ideally each removal would be a separate
26 commit.
27
28 It is, however, worth repeating that in git, commits are entirely
29 separate from pushes and are very (as in, extremely!) cheap, while
30 pushes, particularly if properly repoman-checked, are obviously much more
31 expensive. It's thus very possible to do all the above in a single
32 /push/ even with each logical change in a separate /commit/. Simply make
33 each logical change a commit of its own without a push, until finished
34 with what you wanted to do. Then do the push of all the commits at
35 once. In fact, with git it's entirely possible to do separate commits to
36 several unrelated things (in gentoo context, probably packages), then
37 push them all at once, without screwing things up, because again, commits
38 and pushes are entirely separate things, and just because all the changes/
39 commits happen to arrive at the same time with a single push, doesn't
40 necessarily have anything at all to do with whether they're related,
41 because the logical unit is the individual commit, not the push that
42 lands all those individual commits upstream.
43
44 --
45 Duncan - List replies preferred. No HTML msgs.
46 "Every nonfree program has a lord, a master --
47 and if you use the program, he is your master." Richard Stallman

Replies