Skip to content

Instantly share code, notes, and snippets.

@jeremydw
Forked from kwk/.gitconfig
Created June 9, 2018 06:16

Revisions

  1. @kwk kwk revised this gist Jul 7, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    [alias]
    # List your commits by quarters of the current year in reverse order (short version)
    # List your commits by quarters of a year in reverse order (short version)
    q1 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"January $year\" --until \"March $year\" --oneline --reverse $@; }; f"
    q2 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"April $year\" --until \"June $year\" --oneline --reverse $@; }; f"
    q3 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"July $year\" --until \"September $year\" --oneline --reverse $@; }; f"
    q4 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"October $year\" --until \"December $year\" --oneline --reverse $@; }; f"
    # List your commits by quarters of the current year in reverse order (long version)
    # List your commits by quarters of a year in reverse order (long version)
    quarter1 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"January $year\" --until \"March $year\" --reverse $@; }; f"
    quarter2 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"April $year\" --until \"June $year\" --reverse $@; }; f"
    quarter3 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"July $year\" --until \"September $year\" --reverse $@; }; f"
  2. @kwk kwk revised this gist Jul 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ Add this snippet to your global `~/.gitconfig` file to simply query commits per
    * `q2|quarter2` April to June
    * `q3|quarter3` July to September
    * `q4|quarter4` October to December
    * in reverse order
    * in chronological order
    * with one line per commit (use `git quarter1 2012` for the full message)
    * all additional parameters after the year will be passed to the `git log` command that is used to implement this macro
    * for example, `git q2 2010 --patch` lists all diffs for each commit.
  3. @kwk kwk revised this gist Jul 7, 2014. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,11 @@ Add this snippet to your global `~/.gitconfig` file to simply query commits per

    `git (q1|q2|q3|q4|quarter1|quarter2|quarter3|quarter4) (2012|2013|2014...any year)`
    * will list all of your commits (based on your user name)
    * that you've made from January to March in the year 2012
    * that you've made from
    * `q1|quarter1` January to March
    * `q2|quarter2` April to June
    * `q3|quarter3` July to September
    * `q4|quarter4` October to December
    * in reverse order
    * with one line per commit (use `git quarter1 2012` for the full message)
    * all additional parameters after the year will be passed to the `git log` command that is used to implement this macro
  4. @kwk kwk created this gist Jul 7, 2014.
    11 changes: 11 additions & 0 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    [alias]
    # List your commits by quarters of the current year in reverse order (short version)
    q1 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"January $year\" --until \"March $year\" --oneline --reverse $@; }; f"
    q2 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"April $year\" --until \"June $year\" --oneline --reverse $@; }; f"
    q3 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"July $year\" --until \"September $year\" --oneline --reverse $@; }; f"
    q4 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"October $year\" --until \"December $year\" --oneline --reverse $@; }; f"
    # List your commits by quarters of the current year in reverse order (long version)
    quarter1 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"January $year\" --until \"March $year\" --reverse $@; }; f"
    quarter2 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"April $year\" --until \"June $year\" --reverse $@; }; f"
    quarter3 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"July $year\" --until \"September $year\" --reverse $@; }; f"
    quarter4 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"October $year\" --until \"December $year\" --reverse $@; }; f"
    13 changes: 13 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # README

    Add this snippet to your global `~/.gitconfig` file to simply query commits per quarter of a year.

    ## Usage

    `git (q1|q2|q3|q4|quarter1|quarter2|quarter3|quarter4) (2012|2013|2014...any year)`
    * will list all of your commits (based on your user name)
    * that you've made from January to March in the year 2012
    * in reverse order
    * with one line per commit (use `git quarter1 2012` for the full message)
    * all additional parameters after the year will be passed to the `git log` command that is used to implement this macro
    * for example, `git q2 2010 --patch` lists all diffs for each commit.