>>863
江川『英文法解説』より引用

不定詞の名詞用法 (2) 補語として

動詞(is/was)の前にdo/didがきて、不定詞以下がその内容を説明する場合には to がよく省略される。

All I *did* was (to) give her a hint. (私は彼女にヒントを与えただけです)
When I was thrown into the water, the best I could *do* was (to) keep myself afloat.
(私は水中に投げ出されると、浮いているのが精一杯でした)

[解説]
(2) to の省略は is/was の前に do/did がくることが条件で、他の語がくる場合は省略が起こらない (Quirk, ComGEL, §15.15)。
All I wanted was to help him.
All I wanted to do was (to) help him.

pp.315-316