-
Notifications
You must be signed in to change notification settings - Fork 2
Commit Questions
- Last commit on a repository
- Last commits on a repository
- User's last commit on a repository
- Time of user's last commit on a repository
- Time of last commit on a repository
- Number of total commits on a repository
- Number of commits by user on a repository
- User's last commits
- Last person to commit on a repository
Intent Name: 'lastCommitOnRepo'
Entities involved: 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var commits = await github.Repository.Commit.Get(repoOwner, repoName, "master");
gitbotResponse = ($"The last commit was at {commits.Commit.Committer.Date.TimeOfDay} on {commits.Commit.Committer.Date.Day}/{commits.Commit.Committer.Date.Month}/{commits.Commit.Committer.Date.Year} by {commits.Commit.Author.Name}: \"{commits.Commit.Message}\"");
Unique Utterances
- What is the last commit on
<repo>? - the last commit
<repo> - The last commit on
<repo>is what - Show me the last commit on
<repo> - Tell me the last commit on
<repo> - Get the last commit on
<repo>for me - Display the last commit on
<repo> - Commit on
<repo>the last time - Give me
<repo>'s last commit - Find the last commit on
<repo>
Intent Name: 'lastNCommits'
Entities involved: 'number', 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var commits = await github.Repository.Commit.GetAll(repoOwner, repoName);
var noOfCommits = commits.Count;
var previousCommits = "";
var previousCommiter = "";
for (int index = 0; index < number; index++){
previousCommits = commits.ElementAt(index).Commit.Message;
previousCommiter = commits.ElementAt(i).Commit.Author.Name;
gitbotResponse += ($"\nCommit #{noOfCommits - i} was by {previousCommiter}. \"{previousCommits}\" \n");
}
Unique Utterances
- What are the last
<number>commits on<repo>? - Give me the last
<number>commits on<repo> - What are the
<number>most recent commits on<repo>? -
<number>latest commits on<repo> -
<number>last commits on<repo> - The last
<number>commits on<repo> -
<repo>'s last<number>commits - Show me the last
<number>commits on<repo> - Shoe me the
<number>most recent commits on<repo> - Tell me the last
<number>commits on<repo> - Get the last
<number>commits on<repo>for me - Display the last
<number>commits on<repo> -
<repo>'s last<number>commits are what - Tell me
<repos>'s last<number>commits - Find
<repos>'s last<number>commits for me
Intent Name: 'lastCommitByUserOnRepo'
Entities involved: 'user', 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
if (repoOwner == null) { gitbotResponse = ($"I think you mean \"{intent}\" but I didn't see a repoOwner."); break; }
try
{
var commits = await github.Repository.Commit.GetAll(repoOwner, repoName);
int i = 0;
while (!String.Equals(commits.ElementAt(i).Author.Login, user, StringComparison.Ordinal) && i < commits.Count)
{
i++;
}
if (i != 0)
gitbotResponse = ($"The last commit by {user} was \"{commits.ElementAt(i).Commit.Message}\".");
else
gitbotResponse = ($"{user} has no commits on {repoOwner}/{repoName}.");
}
catch
{
gitbotResponse = ("The user or repository entered is not valid.");
}
Unique Utterances
- What was
<user>’s last commit on<repo>? - The last commit on
<repo>by<user> -
<user>'s last commit on<repo>is what - Show me
<user>'s last commit on<repo> - Tell me the last commit of
<repo>on<user> - Get the last commit on
<repo>by<user>for me - Display
<user>'s last commit on<repo> -
<user>'s last commit on<repo>the last time - Give me
<repo>'s last commit which created by<user> - What was the last commit on
<repo>made by<user>?
Intent Name: 'timeOfUsersLastCommitOnRepo'
Entities involved: 'user', 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
if (repoOwner == null) { gitbotResponse = ($"I think you mean \"{intent}\" but I didn't see a repoOwner."); break; }
try
{
var commits = await github.Repository.Commit.GetAll(repoOwner, repoName);
int i = 0;
var u = await github.User.Get(user);
var name = u.Name;
while (!String.Equals(commits.ElementAt(i).Commit.Author.Name, name, StringComparison.Ordinal))
i++;
if (i != 0)
gitbotResponse = ($"The last commit time by {user} was at {commits.ElementAt(i).Commit.Committer.Date.TimeOfDay} on {commits.ElementAt(i).Commit.Committer.Date.Day}/{commits.ElementAt(i).Commit.Committer.Date.Month}/{commits.ElementAt(i).Commit.Committer.Date.Year}.");
else
gitbotResponse = ($"The user has no commits on the repo");
}
catch
{
gitbotResponse = ("Invalid user or repo entered.");
}
Unique Utterances
- When was
<user>’s last commit on<repo>? - The last commit of
<user>on<repo>is when - Show me the time of
<user>’s last commit on<repo> - Tell me when did
<user>commit the last time on<repo> - when did
<user>’s commit to<repo>the last time? - Find the time of
<user>’s last commit on<repo>for me -
<user>’s last commit on<repo>is when - Get me the time of
<user>’s last commit on<repo> - Tell me
<user>'s last commit on<repo>is at what time
Intent Name: 'timeOfLastCommit'
Entities involved: 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var commits = await github.Repository.Commit.Get(repoOwner, repoName, "master");
gitbotResponse = ($"The last commit on {repoOwner}/{repoName}/master was made at {commits.Commit.Committer.Date.TimeOfDay} on {commits.Commit.Committer.Date.Day}/{commits.Commit.Committer.Date.Month}/{commits.Commit.Committer.Date.Year}.");
Unique Utterances
- Tell me the time of the most recent commit on
<repo> - Tell me the time of the latest commit on
<repo> - Tell me the time of the last commit on
<repo> - Tell me when the last commit on
<repo>was - Most recent commit time on
<repo> - What time was the most recent commit on
<repo>? - What time was the last commit on
<repo>? - What time was the latest commit on
<repo>? - Get me the time of the most recent commit on
<repo> - Get me the time of the last commit on
<repo> - Time of latest commit on
<repo>? - Time of last commit on
<repo> - Latest commit time on
<repo> - Last commit time on
<repo> - When was the last commit on
<repo>?
Intent Name: 'totalCommitsOnRepo'
Entities involved: 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var commits = await github.Repository.Commit.GetAll(repoOwner, repoName);
gitbotResponse = ($"There has been {commits.Count} commits on {repoOwner}/{repoName}.");
Unique Utterances
- Total commits on
<repo> - Total number of commits on
<repo> - How many commits are on
<repo>? - How many commits on
<repo>? - How many total commits on
<repo>?
Intent Name: 'numberOfCommitsByUserOnRepo'
Entities involved: 'user', 'repoName', 'repoOwner'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var total = "";
gitbotResponse = ($"{user} has made {total} commits on {repoOwner}/{repoName}.");
Unique Utterances
- How many commits has
<user>made on<repo>? -
<user>made how many commits on<repo> - The number of commits
<user>made on<repo> - Show me the number of
<user>'s commits on<repo> - Tell me the quantity of
<user>'s commits on<repo> - Get the number of
<user>'s commits on<repo>for me - Display the number of
<user>'s commits on<repo> -
<user>'s committed on<repo>how many times - Tell me
<user>'s has how many commits on<repo> - Find
<user>'s number of commits on<repo>
Intent Name: 'lastNumberOfCommitsByUser'
Entities involved: 'user', 'number'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var commits = "";
gitbotResponse = ($"Here are the last {number} commits by {user} on {repoOwner}/{repoName}:{commits}.");
Unique Utterances
- What is
<user>'s last<x>commits? - The last
<x>commits of<user> -
<user>'s last<x>commits - Show me the last
<x>commits by<user> - Tell me the last
<x>commits of<user> - Get the last
<x>commits of<user>for me - Display the last
<x>commits by<user> -
<user>'s last<x>commits are what? - Tell me
<user>'s last<x>commits - Find
<user>'s last<x>commits for me
Intent Name: 'lastPersonToCommit'
Entities involved: 'repoOwner', 'repoName'
GitHub Code:
var github = new GitHubClient(new ProductHeaderValue("GitBot"));
var commits = await github.Repository.Commit.Get(repoOwner, repoName, "master");
gitbotResponse = ($"The last person to commit on {repoOwner}/{repoName} was {commits.Commit.Committer.Name}");
Unique Utterances
- What is the last person to commit of
<repo>? - The last person to commit
<repo> - Who made the last commit of
<repo> - Show me the person committed to
<repo>last time - Tell me who committed to
<repo>last time - Get the last person that committed to
<repo>for me - Display the last person committed to
<repo> - Who commited to
<repo>last - Tell me the owner of the
<repo>'s last commit - Find the last person who committed to
<repo>
If you want to get in touch with us about GitBot, you can send an email to nating@tcd.ie