How does repentance fit into the doctrine of sola fide ("by faith alone")? Sola fide (Latin for "by faith alone") is a defining doctrine of Protestantism. Wikipedia defines it as follows:


  The doctrine of sola fide asserts God's pardon for guilty sinners is granted to and received through faith alone, excluding all "works". All mankind, it is asserted, is fallen and sinful, under the curse of God, and incapable of saving itself from God's wrath and curse. But God, on the basis of the life, death, and resurrection of his Son, Jesus Christ alone (solus Christus), grants sinners judicial pardon, or justification, which is received solely through faith.


How does repentance fit into this doctrine? Is it possible to be unrepentant of sin (whether for some sins or all sins that one has committed) and yet still receive pardon for those sins? Is repentance considered a "work" in that it is ultimately unnecessary for justification?
There are two primary ways that sola fide theologians deal with this issue, and there is ongoing debate between them over it (cf. Lordship salvation controversy).  I'll first address the historical view (sometimes called &quot;Lordship salvation&quot;) and the more recent view, called &quot;free grace theology.&quot;
Lordship salvation
The name commonly applied to this view emphasizes that following Christ is not merely a matter of intellectual belief, but also accepting him as Lord and therefore turning away from the sin nature.  Thus its adherents see repentance and faith as inherently connected; as Wayne Grudem says, they are &quot;two different sides of the same coin&quot; (ST, 714) Louis Berkhof writes:

True repentance never exists except in conjunction with faith, while, on the other hand, wherever there is true faith, there is also real repentance. The two are but different aspects of the same turning, — a turning away from sin in the direction of God. (ST, 4.7.D.3)

Thus the two cannot be separated.  Where they are distinguished (as in Calvin, Institutes, 3.3.1; see curiousdannii's answer), the one necessarily follows the other, and thus in all cases faith is the only basis for the justification of the sinner.
Berkhof and Grudem are both Reformed theologians, as is John MacArthur, the author of the book The Gospel According to Jesus, which extensively defends this view.  But their analysis is shared by other Protestant traditions.  For example, Arminian John Miley writes:

While faith is the one and only condition of justification, yet a true repentance is always presupposed, because only in such a mental state can the proper faith be exercised. An impenitent soul cannot properly trust in Christ for the forgiveness of sin. (Systematic Theology, II, 323)

Lutheran John Mueller, summarizing Francis Pieper's work, uses the word contrition instead, but sees the two as synonyms in this sense:

The two essential elements in conversion are contrition and faith [...] Contrition belongs to conversion only for the reason that faith cannot find entrance into the proud and secure heart; it is &quot;the indispensable preparation for conversion.&quot; (Christian Dogmatics, 338)

Repentance here is not assumed to be perfect or complete repentance, but rather a general turning away from sin.  Continued growth in faith and repentance is an important aspect of the Christian's sanctification, but a failure to perfectly repent of every sin does not lead to a loss of salvation.
Free grace theology
This view's name reflects its adherents' belief that repentance is a &quot;work&quot; that is not required for salvation – thus grace is more &quot;free&quot; than in a scheme were repentance and faith are aspects of conversion.  According to this view, intellectual faith alone, without any turning from sin, is sufficient for salvation.
In recent times the view is most commonly associated with evangelicals influenced by dispensationalism; Wayne Grudem identifies Lewis Sperry Chafer as its originator.  In Major Bible Themes, Chafer writes:

The Scriptures are violated and the whole doctrine of grace confused when salvation is made to depend on anything other than believing. The divine message is not &quot;believe and pray,&quot; &quot;believe and confess sin,&quot; &quot;believe and confess Christ,&quot; &quot;believe and be baptized,&quot; &quot;believe and repent,&quot; or &quot;believe and make restitution.&quot; (Chapter 28)

Bob Wilkin, founder of the Grace Evangelical Society, expounds:

There is no commitment, no decision of the will, no turning from sins, and no works that are part of faith in Christ. If you are convinced or persuaded that what He promised is true, then you believe in Him. Faith is passive. It is simply taking Jesus at His word.
Thus turning from sins, commitment, obedience, and perseverance are not faith and thus aren’t conditions of eternal life. Those are all types of works. Works have their proper place in the Christian life, but only after you have believed in Jesus. (source; emphasis in original)

Thus for the free grace theologian, repentance is distinct from faith and therefore comes after (and not necessarily immediately after) conversion and justification.
Summary
Thus we see two views in the sola fide camp with respect to this question.  Both agree that perfect repentance is not a requirement for salvation, but the majority view holds that in conversion faith and repentance are inseparable, though only faith is the basis of justification.  The &quot;free grace&quot; view holds that faith and repentance are distinct, with the latter being a work that is done after justification is accomplished.