Prepare spaghetti according to package directions.
While spaghetti is cooking, heat oil in a large heavy skillet over medium heat.
Add garlic and saute just until it begins to turn color.
Add onion and continue to saute until limp.
Add chopped tomatoes and continue to saute until limp and juices are rendered.
Add sardines, breaking it up into pieces as you stir.
Season with fish sauce or salt and red pepper flakes (if using) to taste.
Add tomato sauce and cook over high heat for two minutes.
Lower heat and add lime or lemon juice and sugar (if using) to taste.
Remove from heat and taste again, adjusting seasonings and adding Tabasco or other hot sauce if desired.
Toss with the spaghetti as soon as it's done. Serve hot.