Skip to content
This repository was archived by the owner on Jul 18, 2022. It is now read-only.
This repository was archived by the owner on Jul 18, 2022. It is now read-only.

Commits should be sorted by author's date and author's date should be used for copyright years #31

@fbiville

Description

@fbiville

Currently, headache implicitly relies on git log default order, i.e. by descending commit dates.

I think we should rely on the reverse chronological order of author dates instead (i.e. git log --author-date-order --reverse).

As an example, let's consider an empty repo where two commits are created:

test-repo git:(master) export GIT_AUTHOR_DATE="Sat May 19 01:01:01 2007 -0700" \
    && echo 'hello' > hello.txt \
    && git add hello.txt \
    && git commit -m 'Hello, is it me you are looking for?'
[master (root-commit) a5ec09c] Hello, is it me you are looking for?
 1 file changed, 1 insertion(+)
 create mode 100644 hello.txttest-repo git:(master) export GIT_AUTHOR_DATE="Sat May 19 01:01:01 2003 -0700" \
    && echo 'Good bye' > goodbye.txt \
    && git add goodbye.txt \
    && git commit -m 'You say goodbye but I say hello'
[master a16415b] You say goodbye but I say hello
 1 file changed, 1 insertion(+)
 create mode 100644 goodbye.txttest-repo git:(master) unset GIT_AUTHOR_DATE

By default, the order is: a16415b then a5ec09c (i.e. commits sorted by descending commit date):

test-repo git:(master) git log --format='%h %ad %cd %s' | cat
a16415b Mon May 19 01:01:01 2003 -0700 Fri Dec 28 18:41:55 2018 +0100 You say goodbye but I say hello
a5ec09c Sat May 19 01:01:01 2007 -0700 Fri Dec 28 18:41:48 2018 +0100 Hello, is it me you are looking for?

What we want instead is the last commit in terms of author date ordering (when the contents was created matters [author date], not when it was merged [commit date] in my opinion), i.e.:

test-repo git:(master) git log --format='%h %ad %cd %s' --author-date-order --reverse | cat
a5ec09c Sat May 19 01:01:01 2007 -0700 Fri Dec 28 18:41:48 2018 +0100 Hello, is it me you are looking for?
a16415b Mon May 19 01:01:01 2003 -0700 Fri Dec 28 18:41:55 2018 +0100 You say goodbye but I say hello

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions