Skip to content

Conversation

@ssssam
Copy link
Contributor

@ssssam ssssam commented Sep 14, 2015

The output of git log is not exactly in chronological order. The
default sort option (--date-order) is described in the man page as
follows:

Show no parents before all of its children are shown, but otherwise
show commits in the commit timestamp order.

The uniq program will only remove duplicate lines if they follow each
other. In order for this to work correctly, we need to ensure that the
list of dates is exactly in chronological order. There doesn't seem to
be a git log option to achieve this, but we can use the sort
program. I used reverse sort (sort -r) since the output will be roughly
reverse-sorted already.

It's also worth noting that the default --date-order option sorts by
commit date, but git-summary uses author date (%ai). Passing
--author-date-order doesn't fix this issue, though, so I didn't change
that.

At the time of writing, this change reduces the number of 'active days'
for git-extras.git from 367 to 331.

The output of `git log` is not exactly in chronological order. The
default sort option (--date-order) is described in the man page as
follows:

    Show no parents before all of its children are shown, but otherwise
    show commits in the commit timestamp order.

The `uniq` program will only remove duplicate lines if they follow each
other. In order for this to work correctly, we need to ensure that the
list of dates is exactly in chronological order. There doesn't seem to
be a `git log` option to achieve this, but we can use the `sort`
program. I used reverse sort (`sort -r`) since the output will be roughly
reverse-sorted already.

It's also worth noting that the default --date-order option sorts by
commit date, but git-summary uses *author* date (%ai). Passing
--author-date-order doesn't fix this issue, though, so I didn't change
that.

At the time of writing, this change reduces the number of 'active days'
for git-extras.git from 367 to 331.
@nicolaiskogheim
Copy link
Collaborator

Can't believe I missed this! Good catch!

@hemanth
Copy link
Collaborator

hemanth commented Sep 22, 2015

👍

hemanth added a commit that referenced this pull request Sep 22, 2015
effort, summary: Correctly estimate the number of active days
@hemanth hemanth merged commit f8b8113 into tj:master Sep 22, 2015
@ssssam ssssam deleted the fix-active-days branch September 23, 2015 14:50
@qw3rtman qw3rtman mentioned this pull request Dec 27, 2015
tardypad pushed a commit to tardypad/git-extras that referenced this pull request Jul 13, 2016
effort, summary: Correctly estimate the number of active days
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants