Giants rookie Chris Shaw hit a two-run single in the eighth inning and San Francisco rallied to beat San Diego 5-4 on Tuesday night