git: changelog day by day

后端 未结 5 750
无人及你
无人及你 2020-12-23 22:23

How to generate changelog of commits groupped by date, in format:

[date today]
- commit message1
- commit message2
- commit message3
...
[date day+3]
- commi         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 22:35

    That would require most certainly some kind of script.
    A bit like this commandline-fu

    for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
    

    (not exactly what you are after but can gives you an idea nonetheless)

    I know about GitStats which has also data organized by date (but not the commit messages)


    Note: the git branch part of this command is ill-fitted for scripting, as Jakub Narębski comments.
    git for-each-ref or git show-ref are natural candidate for scripting commands, being plumbing commands.

提交回复
热议问题