The difference between indirect and direct relative clause is a key difficulty in Irish, and you never study it long enough. Here is how it works in traditional language.
The main difference between direct and indirect clauses is, that in a direct clause, the element relativized is either the subject or the object of the relative clause, and it is not written out in the relative clause. Like this:
Sin é an fear a chonaic mé. That is the man who saw me/whom I saw.
Sin é an fear a chonaic ag obair mé. That is the man who saw me working.
Sin é an fear a chonaic mé ag obair. That is the man whom I saw working.
Sin é an fear a chonaic sé. That is the man whom he saw.
Sin é an fear a chonaic é. That is the man who saw him/it.
Sin é an rud a thuig sé. That is the thing that he understood.
An fear atá ag obair anseo, is é mo mhac é. The man who is working here is my son. (More literally, “the man who is working here, he is my son”.)
The particle that signifies direct relative clause is a, and it always lenites, if this is applicable. It does not lenite the impersonal forms of regular verbs in past tense:
an mac a saolaíodh dóibh the son who was born to them
or those irregular verbs which are similar to regular ones in not leniting the impersonal form in past tense:
an bronntanas a tugadh dó the present that was given to him
But note that chonacthas is always lenited whether there is a direct relative particle before it or not. The past tense forms of faigh!/fáil, both personal and impersonal, resist lenition: an t-airgead a fuair mé uait the money I got from you, an pota óir a fuarthas ag deireadh an bhogha báistí the pot of gold that was found at the end of the rainbow.
As you see above, the verb tá has the direct relative form atá – such forms as athá are dialectal (Munster), because the a- is historically speaking part of the stem. For a similar reason, the verb abair!/rá does not usually lenite the d- in direct relative: a deir, a deireadh, a déarfadh, a dúirt. It is not unheard of to write these relative forms as one word, i.e. adeir, adeireadh and so on, but it is not the present standard.
The d’ used before vowel and fh- is usually kept after the direct relative a, and it is not lenited (in the written language, that is – the spoken language is a more complicated story). This d’ can be dropped at least in conditional mood before fh- + consonant, i.e. a fhliuchfadh is as correct as a d’fhliuchfadh, but I have learned to keep the d’ and usually do so, so I am not very sure where it can be dropped.
The addition of a broad -s to present and future forms in relative clauses is not part of the standard, but it is the rule in the most widely spoken dialects, and I use it in my Irish, because it is my opinion that it is a good way to keep direct and indirect relative distinct. Thus, I write:
An fear a thagas ag glanadh an urláir gach uile lá, is iarchaptaen mara é a chuaigh ar an drabhlás.
The man who comes to clean the floor every day, he is a former sea captain who went/has gone to the dogs.
An fear a thiocfas ag glanadh an urláir amárach, is iarchaptaen mara é a chuaigh ar an drabhlás.
The man who will come to clean the floor tomorrow, he is (etc.).
In the standard language they prefer a thagann, a thiocfaidh. Note that this form can also keep the -nn before the -s in the present tense: a thaganns. However, it is my opinion that this latter form is less established in literary Irish.
Such present forms of strong verbs as chí/tchí/tí ‘sees’, gheibh ‘gets’, ‘finds’, deir ‘says’, thig ‘comes’ do not usually take the -ann, and nor do they need the relative -as, even in dialects and styles where it is otherwise preferred. However, I don’t think such forms as a (t)chíos, a gheibheas, a deireas, a thigeas are wrong either.
Note that tchí/chí/tí and gheibh are not part of the standard language, which prefers respectively feiceann and faigheann. Thig is accepted by the standardizers in the phrase thig leis [rud a dhéanamh] = is féidir leis [rud a dhéanamh] ‘he can [do something]’, and sometimes those who don’t know that it is basically the same as tagann perceive it as a distinct verb and try to introduce other finite forms of the same “verb”.
The habitual present of the verb “to be”, bíonn, is typically treated as a regular habitual present. Thus, its direct relative form is a bhíonn in the standard language and a bhíos, a bhíonns in those dialects which take the relative -s. However, in Ulster the delenited forms a bíos and a bí also exist. This is as far as I know due to some ancient irregularity.
If the verb has a personal ending, the -s forms are of course not used: seo é an seomra a ghlanaim gach uile lá this is the room I clean every day. However, I don’t think it is wrong at all to use pronoun and -s form: seo é an seomra a ghlanas mé gach uile lá.
It is a well-known problem that the direct relative clause can be ambiguous. Sin é an t-oifigeach a mharaigh an gnáthshaighdiúir can mean “that is the officer who killed the common soldier” or “that is the officer whom the common soldier killed”. Scroll down for how the ambiguity can be avoided.
The direct relative clause is also used in emphasis:
Airsean a rinne mé trácht ‘It’s of him I made mention’
Ar an traein a tháinig mé ‘It’s by train I came’
Leis an gcailín a labhair mé ‘It’s with the girl I spoke’
The indirect relative clause is used when the relativized element is written out inside the relative sentence. Most often this means that the element relativized is a prepositional phrase in the relative clause, but it can also be something that is referred to by a possessive pronoun:
Seo é an fear a ndearna mé trácht air. This is the man I made mention of.
An duine a nglanaim a sheomra gach uile lá, níl a fhios agam a dhath ina thaobh. The person whose room I clean every day, I don’t know anything about him or her. (In English “him or her”, or maybe “them”, but in Irish we use the masculine gender, because the noun duine is masculine.)
An duine ar cheannaigh mé an rothar uaidh, chuaigh sé ar imirce go dtí an Astráil. The person from whom I bought the bike emigrated to Australia.
An t-arrachtach ar dhírigh an captaen a gha-ghunna air, is é peata an Tliongánaigh úd thall é. The monster at which the captain aimed his raygun is the pet of that Klingon over there. (The noun Tliongánach for Klingon is purportedly based directly on the Klingon language, so I’ll use it. Earlier, I preferred Cliongónach, but as Tliongánach is so much more authentic, I guess Irish-speaking Trekkies should prefer it. Qapla’!)
The preposition can be put before the indirect relative clause, but this is a somewhat posh or literary usage not all are aware of:
Seo an fear ar a ndearna mé trácht. This is the man of whom I made mention. (In fact, you do sometimes see this done wrongly, like this: Seo an fear ar a rinne mé trácht. I tend to think that this is a pure Anglicism rather than a rethinking of the old structure. I.e., the old one being entirely forgotten by or unknown to the speaker, the new one is introduced under the influence of literary English. Of these two I recommend the older form though, because it is an established literary form; but being stylistically marked, it is less acceptable than Seo an fear a ndearna mé trácht air.)
Tháinig an fear ar labhair mé leis = Tháinig an fear lenar labhair mé The man to whom I spoke came.
D’imigh an fear a bhfuair mé an peann ar iasacht uaidh = D’imigh an fear óna bhfuair mé an peann ar iasacht The man from whom I borrowed the pen went away/left.
An t-arrachtach ar dhírigh an captaen a gha-ghunna air, is é peata an Tliongánaigh úd thall é = An t-arrachtach ar ar dhírigh an captaen a gha-ghunna, is é peata an Tliongánaigh úd thall é.
As you see, the indirect relative a eclipses, i.e. behaves like the go (“that”) particle. In the past tense of the regular verbs, we use ar, which lenites and which behaves like gur. Thus:
Seo é an fear ar thrácht mé air. This is the man I mentioned (note that in Irish trácht!/trácht ‘to mention’ takes the ar preposition).
Note that the inflected preposition agrees in person with the element relativized:
Mise a ndearna sé trácht orm, ní maith liom a iompraíocht ar aon nós. Me, whom he mentioned, I don’t like his behavior at all. (Yes, the example is somewhat contrived, but I vouch for its grammaticality. The English translation is intentionally clumsy, meant to keep close to the original.)
Mise an duine a ndearna sé trácht air – I am the person he mentioned, because here the element relativized is not mise immediately, but rather an duine.
Indirect relative clauses are also used after such nouns as áit “place” or dóigh “way, manner, method”, although no preposition is written out: an áit ar chaith mé laethanta m’óige the place where I spent the days of my youth, an dóigh ar chríochnaigh sé an obair the way he finished the work. The underlying structure here is *an áit inar chaith mé laethanta m’óige/*an áit ar chaith mé laethanta m’óige inti; *an dóigh ar ar chríochnaigh sé an obair/*an dóigh ar chríochaigh mé an obair uirthi – note that we say san áit, ar an dóigh; but the underlying structure is no longer used. You do see direct relative clause used here sometimes, but it should be avoided as substandard language. The direct/indirect relative clause distinction might be disappearing in spoken Irish, but what I am concerned about is established literary language (whichever dialect).
After nouns meaning “way” in the sense of a concrete way or road, you have a direct relative clause: an bealach a tháinig sé the way he came. Here bealach is treated as a kind of object or accusative, although the verb tar!/tag-/t(h)ioc-/tháinig/teacht does not take a real object.
After units of time you can have either: an lá a bhí mé ansin = an lá a raibh mé ansin the day I was there. (Of course if the verb is a transitive one and the unit of time is obviously its object, then use only the direct relative clause: an lá a chaith mé ansin the day I spent there.) Actually, I would see those units of time as “extra objects” and prefer an lá a bhí mé ansin, an bhliain a bhí mé ansin, an mhí a bhí mé ansin, but some people insist an indirect relative clause should be used here.
I’d like to point out however that the conjunction nuair ‘when’ is always followed by a direct relative clause, and nuair comes from an uair ‘the hour, the time, the occasion (when)’, so it occurs to me that putting the direct relative after units of time is a usage that has been around for a while and should be accepted.
Finally, there is the “all-inclusive relative clause”. This can be an indirect or a direct one, but it uses the a + eclipsis (or with the regular past tense, ar + aspiration), which then has the meaning “all available ones”:
Tháinig a raibh ann All who were there came.
Labhair mé lena raibh sásta freagra a thabhairt I spoke to all who were willing to answer.
Labhair mé lenar casadh orm I spoke to all whom I met.
Direct and indirect relative clauses look the same when negated. Compare:
Sin é an fear a chonaic mé. That is the man whom I saw.
Sin é an fear nach bhfaca mé. That is the man whom I didn’t saw.
Sin é an fear ar chuala mé trácht air. That is the man whom I heard mention of.
Sin é an fear nár chuala mé trácht air. That is the man whom I didn’t hear mention of.
Labhair mé lena raibh sásta freagra a thabhairt. I spoke to all who were willing to answer.
Labhair mé le nach raibh sásta freagra a thabhairt. I spoke to all who weren’t willing to answer.
If you want to avoid the ambiguity in direct relative clauses, you are allowed to write out the subject or the object and make the relative clause indirect. Like this:
Sin é an t-oifigeach a mharaigh an gnáthshaighdiúir. That is the officer who killed the common soldier/whom the common soldier killed (the original direct relative clause).
Sin é an t-oifigeach ar mharaigh an gnáthshaighdiúir é. That is the officer whom the common soldier killed. (This is the more common variant.)
Sin é an t-oifigeach ar mharaigh sé an gnáthshaighdiúir. That is the officer who killed the common soldier. (This is less common of the two, because for the direct relative clause, this is the default interpretation.)
This possibility is overlooked by practically every learners’ grammar, and when I suggest it, there is always someone who suggests it is wrong. Indeed, you need to sift through literally thousands of pages of native literature and folklore to see this often enough to be sure of it. However, it is common enough to be acceptable, and it is used in every dialect zone, both Connacht, Ulster and Munster.