Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaced git-standup with gitlog #18

Merged
merged 26 commits into from
May 14, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e159030
replaced git-standup with gitlog
mojoaxel Apr 18, 2017
a2f3250
removed git-standup dependencie
mojoaxel Apr 19, 2017
83da292
added myself as contributor ;-)
mojoaxel Apr 19, 2017
8cff4ac
reverted: added myself as contributor ;-)
mojoaxel Apr 19, 2017
ed9f20e
also get gitlogs also from subdirs up to a given depth
mojoaxel Apr 19, 2017
36cb216
Merge branch 'master' into gitlog
mojoaxel Apr 20, 2017
2146858
updated README
mojoaxel Apr 20, 2017
cf3ecc8
updated subdirs release
mojoaxel Apr 21, 2017
f38f9fd
added error handling
mojoaxel Apr 21, 2017
d349d8d
Merge remote-tracking branch 'upstream/master' into gitlog
mojoaxel Apr 21, 2017
752a227
Merge branch 'master' into gitlog
mojoaxel Apr 26, 2017
29a7b70
Merge branch 'gitlog' of github.com:mojoaxel/tiny-care-terminal into …
mojoaxel Apr 26, 2017
878fea1
seperated gitbot into own module;
mojoaxel Apr 26, 2017
b30df8b
Merge branch 'master' into gitlog
mojoaxel Apr 26, 2017
df56ba5
fixed emty commit list
mojoaxel Apr 26, 2017
6922c43
@notwaldorf review comments
mojoaxel Apr 26, 2017
3eebc08
Merge branch 'master' into gitlog
mojoaxel Apr 27, 2017
4bc9a05
added repo name to commit history
mojoaxel Apr 27, 2017
1aed41b
do not hide commits while reloading
mojoaxel Apr 27, 2017
3f3886d
make it possible to switch between git-standup and gitlog
mojoaxel Apr 27, 2017
294657b
filter pure administrative commits
mojoaxel Apr 27, 2017
4cf5e21
readded git-stanup as peerDependency
mojoaxel May 7, 2017
86caaa0
use existing git-standup implementation
mojoaxel May 7, 2017
7d6ed23
Merge branch 'master' into gitlog
mojoaxel May 7, 2017
f945c1e
Merge branch 'master' into gitlog
mojoaxel May 12, 2017
e1ded0d
Merge branch 'gitlog' of github.com:mojoaxel/tiny-care-terminal into …
mojoaxel May 12, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions care.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ var contrib = require('blessed-contrib');
var chalk = require('chalk');
var parrotSay = require('parrotsay-api');
var weather = require('weather-js');
var gitUsername = require('git-user-name')();
var gitlog = require('gitlog');
var async = require("async");

var screen = blessed.screen(
{fullUnicode: true, // emoji or bust
Expand Down Expand Up @@ -102,23 +105,38 @@ function doTheCodes() {
var todayCommits = 0;
var weekCommits = 0;

var today = spawn('sh ' + __dirname + '/standup-helper.sh', [config.repos], {shell:true});
todayBox.content = '';
today.stdout.on('data', data => {
getGitCommits(config.repos, 1, data => {
todayCommits = getCommits(`${data}`, todayBox);
updateCommitsGraph(todayCommits, weekCommits);
screen.render();
});

var week = spawn('sh ' + __dirname + '/standup-helper.sh', ['-d 7', config.repos], {shell:true});
weekBox.content = '';
week.stdout.on('data', data => {
getGitCommits(config.repos, 7, data => {
weekCommits = getCommits(`${data}`, weekBox);
updateCommitsGraph(todayCommits, weekCommits);
screen.render();
});
}

function getGitCommits(repos, days, callback) {
var cmts = [];
async.each(repos, (repo, done) => {
gitlog({
repo: repo,
since: `${days} days ago`,
fields: ['abbrevHash', 'subject', 'authorDateRel', 'authorName'],
author: gitUsername
}, (err, logs) => {
logs.forEach(c => {
cmts.push(`${c.abbrevHash} - ${c.subject} (${c.authorDateRel}) <${c.authorName}>`);
});
done();
});
}, err => {
callback(cmts.join('\n'));
});
}

function makeBox(label) {
return {
label: label,
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config.apiKeys = config.apiKeys === 'true' ? true : false;

// Directories in which to run git-standup on for a list of your recent commits.
config.repos = process.env.TTC_REPOS || '~/Code';
config.repos = config.repos.split(',').join(' ');
config.repos = config.repos.split(',');

// Where to check the weather for. This can be a zip code or a location name
// So both 90210 and "San Francisco, CA" should be ok.
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "A terminal that tries to take care of you 💖",
"main": "care.js",
"author": "Monica Dinculescu <[email protected]>",
"contributors": [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been doing this for anyone else who has been sending PRs, so I'm inclined to just have the GitHub contributors reflect this. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all! Let's keep the package.json slim 😉

"Alexander Wunschik <[email protected]> (http://wunschik.it)"
],
"license": "MIT",
"bin": {
"tiny-care-terminal": "care.js"
Expand All @@ -13,7 +16,8 @@
"blessed": "^0.1.81",
"blessed-contrib": "^4.7.5",
"chalk": "^1.1.3",
"git-standup": "^2.1.8",
"git-user-name": "^1.2.0",
"gitlog": "^2.4.0",
"parrotsay-api": "^0.1.1",
"scraperjs": "^1.2.0",
"twit": "^2.2.5",
Expand Down
36 changes: 0 additions & 36 deletions standup-helper.sh

This file was deleted.