What should be the right tense in this sentence?

I read this sentence in a book recently:

What I should have done is given him the...

(Emphasis mine) I'm not a linguist but I thought it should be:

What I should have done is give him the...

Can anyone tell me which is right and why? Thank you.

Edit:
Going by what most people have said, if the first is grammatically correct (which I do not argue), the explanation I can think of is this: from the first part of the sentence (the subject) What I should have done, there is a present perfect tense (i.e. have done). This influences the second part of the sentence (the predicate, I think that's what it is called as I'm not an English student) and makes it a present perfect tense, too (given, in this case).
Going by this reasoning, as I asked in a comment, this example should be grammatically correct:

What I did was gave him...

I'm sorry if it seems I'm pushing this too far. I'm quite particular about trivial matters.


Both sentences are grammatically correct and mean just about the same to my ear.

As Peter Shor accurately pointed out, the first one is an example of an elliptical construction and, as such, should be interpreted as follows:

What I should have done is [I should have] given him...

Consider other similar constructions:

What we have done is [we have] given the military judge the tools he or she will need to render justice.

All you have done is [you have] given me an argument to justify on anything I might wish to spendmy time on.

As for your second sentence, what I should have done is to could be an acceptable, grammatically correct alternative to it, but it's somewhat less idiomatic than the construction without to.

In addition to that, the to in there is unnecessary and doesn't add anything to the overall meaning of the sentence.

Here's a link to Google Ngram that supports my assumption.


What I should have done is given him the...

I think the sentence above usually appears in informal situations including oral communication.

Recently I also read a sentence like the question above.

I look up the book PRACTICAL ENGLISH USAGE/Swan


281. infinitives (3):without to

5. after do

All I did was (to) give him a little push.


It could be helpful for those having similiar questions.