#git bot interface
Functions
Here are your choices so far:
Introduction
The following features are available on IRC:
- Triggers: inline commands in the form of !foo
(list) spit out a previously defined text for
foo. It will be addressed to whoever you addressed with the line that
you used the trigger in. It can be used anywhere in the middle of a line,
though it should not run into other words.
- Edit: If you are logged into NickServ, you
can use ".trigger_edit <trigger> <new expansion>" to
change the value of a trigger (no "!" there).
- Add new: Only available to selected people; same
syntax as for editing. If you have been hanging out in #git for quite
some time and haven't been selected yet, go shout at jast to make it
happen.
- Aliases: to make one trigger an alias for
another, set its contents to "@!othertrigger".
- Matching: if a request for !foo doesn't find an
expansion named "foo", it will search for other names that
contain "foo", and will spit out the shortest match instead.
- Private delivery: append "@p" to a trigger to
have the response delivered to the person you are addressing, in a
NOTICE.
- Manpages: Say something like "man git-commit" to show a
link to one of git's manpages. Addressing works the same as for triggers.
- FAQs: Say something like "faq non-bare" to link to an FAQ
from the git wiki. Valid keywords are the anchors used on the wiki page.
Addressing works the same as for triggers.
- Draw graphs: the ".graph" and ".digraph" commands are
interfaces to Instagraph (the syntax is
explained there).
The main use case is visualizing scenarios people might come across in
everyday Git. For this we also have a small custom graphing language with the
.gitgraph command.
- Linking to things in the Git repo:
git::master
(list of commits in branch)
git::master^{commit}
or git::master^c
(commit
view)
We try to auto-detect whether to show a list of commits or a single commit:
if the argument looks like a commit ID, we show a single commit, otherwise
it's the list. If a branch name was mistakenly detected as a commit ID, you
can use something like git::beef^{log}
or
git::beef^l
to force the list.
git::master:Documentation/
(tree view, trailing slash)
git::master:builtin/commit.c
(blob view)
- Linking to things in other repos:
git[github
jast/gitinfo] master:gitinfo.pl
etc. Other supported hosting sites are
bitbucket, gitlab, repo[.or.cz] and notabug.
- Random stuff: use the ".random" command to get a random
line of wisdom (well, a random line of text, at any rate) contributed by a
user.
- Add: you can contribute lines if you are
logged in. Simply use the command ".random add Your line
here".
- Delete: the bot appends a line's ID when
outputting the line. You can use the command ".random delete 5" to
delete the line with ID 5. Note that only a select few can delete
lines.
- Git version: #git has the most recent version of git in
the topic. If you notice that it is out of date, use ".version" to
automatically find the most recent version and update the topic. It may take
up to 15 minutes after a release until it detects the new version.
- Knowledge base: Use ".info query" to query a
general knowledge base that will try to match the query against many things,
including: Wikipedia, github, Sourceforge, calculator, Merriam-Webster,
TheFreeDictionary. Powered by DuckDuckGo's
ZeroClick Info API.
- Web search: Use ".search query" to get up to
three web search results. Powered by DuckDuckGo.
- Web login: use the ".weblogin" command to get a link for
activating extra features on the web page, such as editing and reverting
trigger texts.
Commands and triggers can be used both in-channel and privately (by using
/msg). By default, private messages will be responded to via NOTICE to you
personally... but if you do something like "/msg gitinfo someuser: !foo
to:#git", the response will be addressed to someuser in #git. The channel must
be specified because gitinfo hangs out (or supports hanging out) in multiple
channels.
Source code
- Bot (requires Perl,
common::sense, DBD::SQLite, File::Slurp, JSON, POE::Component::IRC and
friends)
- web interface (requires
PHP 5.x)
Both projects are published under the GPL v3. When contributing, please
sign off (using git commit -s) your commits to confirm:
- you have permission to license your changes under the GPL v3, and
- you do license your changes under the GPL v3.
Commits that are not signed off will not be accepted.