Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] egencache --update-changelogs: fix timestamp assumptions (bug 579292)
Date: Sat, 09 Apr 2016 07:51:50
Message-Id: 5708B48D.9020908@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] egencache --update-changelogs: fix timestamp assumptions (bug 579292) by Brian Dolbec
1 On 04/08/2016 06:12 PM, Brian Dolbec wrote:
2 > On Fri, 8 Apr 2016 00:29:40 -0700
3 > Zac Medico <zmedico@g.o> wrote:
4 >
5 >> On 04/07/2016 11:51 PM, Brian Dolbec wrote:
6 >>> the above looks good, but what about:
7 >>>
8 >>>
9 >>> [19:01] <dwfreed|phone> just use --first-parent
10 >>> [19:01] <dwfreed|phone> also take into account merge commits
11 >>> [19:03] <dwfreed|phone> git really complicates ChangeLog generation
12 >>> in general [19:03] <dwfreed|phone> because your ChangeLog should
13 >>> reflect when these commits became part of master, but you still
14 >>> need to perserve their messages [19:04] * zmedico is skeptical
15 >>> about the linearizability of the timestamps [19:04] <dwfreed|phone>
16 >>> if you don't look at merge commits for your timestamps of changes,
17 >>> correct, it is not linear [19:05] <dwfreed|phone> but if you take a
18 >>> set of commits and determine when they became part of master, it is
19 >>> linear [19:05] <dol-sen> so: git log --first-parent --format=%ct
20 >>> -1 . [19:05] <dol-sen> to get the last timestamp of changes to htat
21 >>> pkg [19:06] <dol-sen> then use that timestamp [19:06] <dol-sen>
22 >>> lmod = self.grab(['git', self._work_tree, 'log', '--format=%ct',
23 >>> '-1', '.']) [19:06] <dol-sen> that is the current code [19:06]
24 >>> <dwfreed|phone> git log -m --first-parent --format=%ct -1 . [19:06]
25 >>> <dol-sen> so just add the --first-parent option? [19:07]
26 >>> <dwfreed|phone> you want -m toolmod = self.grab(['git',
27 >>> self._work_tree, 'log', '--format=%ct', '-1', '.'])
28 >>>
29 >>> [19:06] <dwfreed|phone> git log -m --first-parent --format=%ct -1 .
30 >>> [19:06] <dol-sen> so just add the --first-parent option?
31 >>> [19:07] <dwfreed|phone> you want -m too
32 >>>
33 >>>
34 >>> Don't we need to add the -m --first-parent ???
35 >>>
36 >>
37 >> I don't know enough about how those options matter for git log
38 >> behavior, but I trust that dwfreed has good reasons to recommend
39 >> them. Maybe we should add them in a separate patch, possibly with
40 >> some explanation about how they are useful in this context.
41 >
42 > They really matter when the tree gets crappy/stale merge commits from
43 > pull requests which play with the way the tree is considered. In this
44 > particular case, it will ignore the branch history and only consider the
45 > merge commit that connects it to master. Which is when we want to make
46 > the changelog entry, not when the (possibly stale) user commit was made.
47
48 Bug filed:
49
50 https://bugs.gentoo.org/show_bug.cgi?id=579402
51 --
52 Thanks,
53 Zac