SAN FRANCISCO -- Maybe the opponents' uniform jogged some memories for Randy Johnson, who pitched most of his best games for Arizona over the years.
He suggested it's just competitive nature.
Johnson took a no-hitter into the seventh inning against his former team, and the San Francisco Giants held on to beat the Diamondbacks 2-0 on Sunday.
"Sometimes you have to put blinders on when it comes to certain teams," Johnson said. "I just wanted to pitch well. It's nice to go out there and feel like I'm contributing after the last two starts."
Johnson, who allowed one hit in seven innings, was perfect through four. He faced the minimum through six and stranded Augie Ojeda at third base after the shortstop doubled to open the seventh.
"The leadoff double changes the complexion of the game," Johnson said. "They had the heart of their order coming up and you have to make your pitches. We got a run and I felt I could make it stand up."
The 45-year-old Johnson (1-2) got his 296th win in his first start against the Diamondbacks, with whom he spent eight seasons. Bob Howry pitched the eighth and Brian Wilson got the last three outs for his second save.
"It was beautiful," Wilson said. "It was a nice day and Randy was out there dominating. He proved he can still do it.
"You watch him working the hitters, working the count and you realize not all of us can go out there and do that."
Arizona right-hander Max Scherzer (0-1), who was born the summer Johnson finished his sophomore season at Southern California, allowed three hits in five innings. He walked four and struck out six.
"We haven't swung the bat well to this point and that's why we have the record that we have," Diamondbacks manager Bob Melvin said. "We've had some real good pitching performances and when you don't swing the bat, you put a lot of pressure on your pitching staff to have to be perfect."
Johnson walked Tony Clark to open the fifth and Chris Young bounced into a fielder's choice. Johnson picked off Young for the second out and got Justin Upton on a fly out to center fielder Aaron Rowand.
"I had a better slider and better location," Johnson said. "That makes all the difference. There were also some defensive plays that were good for us."
"That was incredible," Giants manager Bruce Bochy said. "Here he is, 45 years old, and pitches a game like that. I thought he had a shot at it. He was really zoned in."
Both teams struggled to score runs during the series, totaling six in the 53 innings as the pitchers combined for a 2.04 ERA.
"He pitched great -- obviously he was fired up," Diamondbacks outfielder Eric Byrnes said. "His velocity was up and he didn't miss too many locations. He put the ball where he wanted to and when he's like that he's pretty tough to hit. We had to come out here and swing the bats better than we did."
Winn and Rowand walked around a single by Bengie Molina to load the bases with no outs in the fourth. Pablo Sandoval, who had three hits in the game, struck out ahead of Ishikawa's sacrifice fly. Renteria singled to reload the bases but Johnson struck out to end the inning.
Molina, Rowand and Sandoval opened the eighth with consecutive singles and scored when pinch hitter Rich Aurilia grounded into a double play.
Johnson was the third pitcher in the Bay Area to take a no-hitter into the seventh inning in the past eight days. Athletics RHP Trevor Cahill did it against the Mariners last Sunday and Red Sox RHP Tim Wakefield went seven no-hit innings against the A's on Wednesday. ... Bochy tinkered with his lineup again, moving Fred Lewis into the leadoff spot, Winn to No. 3 and Sandoval to No. 6, all for the first time this season. ... The Giants have won their first two home series. ... The Diamondbacks are hitting .211 (15-71) with runners in scoring position, last in the NL.