'Attempt to create a commit from the index and commit message.'

def commit(self):

    if (not bool(self.summary.value())):
        error_msg = N_(u'Please    supply    a    commit    message.\n\nA    good    commit    message    has    the    following    format:\n\n-    First    line:    Describe    in    one    sentence    what    you    did.\n-    Second    line:    Blank\n-    Remaining    lines:    Describe    why    this    change    is    good.\n')
        Interaction.log(error_msg)
        Interaction.information(N_(u'Missing    Commit    Message'), error_msg)
        return
    msg = self.commit_message(raw=False)
    if (not (self.model.staged or self.model.is_merging)):
        error_msg = N_(u'No    changes    to    commit.\n\nYou    must    stage    at    least    1    file    before    you    can    commit.')
        if self.model.modified:
            informative_text = N_(u'Would    you    like    to    stage    and    commit    all    modified    files?')
            if (not qtutils.confirm(N_(u'Stage    and    commit?'), error_msg, informative_text, N_(u'Stage    and    Commit'), default=True, icon=icons.save())):
                return
        else:
            Interaction.information(N_(u'Nothing    to    commit'), error_msg)
            return
        cmds.do(cmds.StageModified)
    amend = self.amend_action.isChecked()
    if (amend and self.model.is_commit_published() and (not qtutils.confirm(N_(u'Rewrite    Published    Commit?'), N_(u"This    commit    has    already    been    published.\nThis    operation    will    rewrite    published    history.\nYou    probably    don't    want    to    do    this."), N_(u'Amend    the    published    commit?'), N_(u'Amend    Commit'), default=False, icon=icons.save()))):
        return
    no_verify = self.bypass_commit_hooks_action.isChecked()
    sign = self.sign_action.isChecked()
    (status, out, err) = cmds.do(cmds.Commit, amend, msg, sign, no_verify=no_verify)
    self.bypass_commit_hooks_action.setChecked(False)
    if (status != 0):
        Interaction.critical(N_(u'Commit    failed'), (N_(u'"git    commit"    returned    exit    code    %s') % (status,)), (out + err))
