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