Note that there are some explanatory texts on larger screens.

plurals
  1. POGIT - Determining # lines of code written per hour (committed & uncommitted)
    primarykey
    data
    text
    <p>I want to graph the # of new lines of code written each hour over the course of the day.</p> <p>I'm aware of git diff, git log and they are very powerful for determining total # of lines committed to a branch. The --since="7am" option is really great as well.</p> <p>Some of the git commands I'm utilizing are:</p> <p><strong>Total # of lines</strong> </p> <pre><code>git log --numstat --pretty="%H" master | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}' </code></pre> <p><strong># lines additional in devel branch compared to master</strong></p> <pre><code>git log --numstat --pretty="%H" master..devel | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}' </code></pre> <p><strong># lines since a time of day</strong></p> <pre><code>git log --since="7am" --format=format: --numstat | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("%d, -%d\n", plus, minus)}' </code></pre> <p><strong># lines currently uncommitted</strong></p> <pre><code>git diff --stat | tail -1 | awk '{print $4}' </code></pre> <p>I've been struggling though with coming up with a way to track the # of new lines written in the past hour including uncommitted changes, across all branches in the current repo.</p> <p>This may be more of a math problem.</p> <h1>The Question:</h1> <ul> <li>How can I determine the exact amount of lines written in the past hour across all branches, including uncommitted changes.</li> </ul> <h1>Gotchas/Scenarios:</h1> <ul> <li>+200 uncommitted at 7pm is 200 new lines written. +250 uncommitted at 8pm is only 50 new lines written the past hour.</li> <li>+200 uncommitted at 7pm is 200 new lines written. At 8pm we commit 100 of the lines and then write 50 more new lines. Now +150 show as uncommitted, but we would need to determine that only 50 new lines were written in the past hour. Reconciling committed and uncommitted stats.</li> <li>+200 uncommitted at 7pm. At 7:30pm we write 500 additional new lines and commit them. At 8pm we write 100 more new lines thus showing +300 as uncommitted. We should end up with 600 new lines written in the last hour.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload