Roughly chop the onions, I like halve rings. Heat some oil in a deep saucepan and sauté the onions for 3-4 minutes.
Take any green of the tomatoes if they have it, and toss them in the pan. Stir and leave on medium heat for about 5 minutes. Don't stir too often! You want the tomatoes to brown.
Chop or press the garlic and add it to the pan. Bake for about 1-2 minutes.
Add the orzo and stock. Press any tomatoes that haven't 'popped' yet. Turn down the heat and let it softly boil for 8 minutes. Stir occasionally so it doesn't stick to the bottom of the pan.
Add the spinach to the pan in batches and stir it in. Then add the pesto and black pepper to your taste. Serve with pine nuts.