def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
app = inliner.document.settings.env.app<EOL>try:<EOL><INDENT>base = app.config.github_project_url<EOL>if not base:<EOL><INDENT>raise AttributeError<EOL><DEDENT>if not base.endswith('<STR_LIT:/>'):<EOL><INDENT>base += '<STR_LIT:/>'<EOL><DEDENT><DEDENT>except AttributeError as err:<EOL><INDENT>raise ValueError('<STR_LIT>' % str(err))<EOL><DEDENT>ref = base + text<EOL>node = nodes.reference(rawtext, text[:<NUM_LIT:6>], refuri=ref, **options)<EOL>return [node], []<EOL>
Link to a GitHub commit.

    Returns 2 part tuple containing list of nodes to insert into the
    document and a list of system messages.  Both are allowed to be
    empty.

    :param name: The role name used in the document.
    :param rawtext: The entire markup snippet, with role.
    :param text: The text marked with the role.
    :param lineno: The line number where rawtext appears in the input.
    :param inliner: The inliner instance that called us.
    :param options: Directive options for customization.
    :param content: The directive content for customization.