SAN FRANCISCO -- Still on a pitch count following a shoulder injury that sidelined him for the final 2 1/2 months last season, Jeff Samardzija knew he had no shot of going the distance against Colorado.
Kevin Pillar made sure Samardzija at least got a win, something that had eluded him for nearly a year.
Samardzija and two relievers combined on a three-hitter, Pillar homered and the San Francisco Giants squeezed past the slumping Rockies 1-0 on Thursday night.
"Today was a good day," Samardzija said. "That's the way it's going to go here for a while until we get that arm strength where we want it. It's constant work, but when you get nights like that tonight, it gives you a little more energy to keep doing what you're doing, keep going."
Samardzija (1-0) went seven innings and outpitched Rockies starter Jon Gray to win in a matchup of sputtering offenses. Colorado has lost six straight and 10 of 11.
The Rockies were shut out for the second time this season and have not held a lead since Chris Iannetta's 11th-inning homer on April 3 at Tampa Bay.
"He had a good mix going tonight, good command of all of them," Giants manager Bruce Bochy said about Samardzija. "He was on top of his game. This has to do a lot for his confidence."
Samardzija allowed only one runner past first base and retired 10 of his final 11 batters. The right-hander won for the first time since April 20, 2018, when he pitched five scoreless innings to beat the Los Angeles Angels in his first start of the season.
"Last year was not a great year for me but I learned a lot," Samardzija said. "It's definitely been a little bit of an evolution for me and a process, and we're kind of seeing where we're at."
Gray (0-3) was almost as sharp but tied a National League record by allowing a home run in his 15th consecutive start. That was the only blemish on an otherwise crisp night for Gray, who gave up five hits and three walks with six strikeouts.
"In any well-pitched game the margin is really thin," Rockies manager Bud Black said. "Samardzija pitched great and Jon pitched great. It comes down to a pitch or two."
Gray pitched in and out of trouble most of the night until Pillar's home run leading off the seventh. Acquired from Toronto last week, Pillar has 10 RBI over his last four games.
"I wanted to get strike one on Pillar but I left the pitch up too much," Gray said. "It was a good slider but I just put it in the wrong place and he put a good swing on it."
Mark Leiter (1996) and Ramon Ortiz (2005) also allowed home runs in 15 straight starts. The major league record is 20 set by Hall of Famer Bert Blyleven (1986-87).
As manager of the Rockies and San Diego Padres, Black has spent the better part of his career matching up against Bochy. Bochy has announced his plans to retire at season's end, and Black is sad to see him go. "There's no better in-game strategist than Bruce," Black said before the game. "I'm going to miss him. He's a throwback. He's got a great baseball mind."
San Francisco second baseman Joe Panik made a diving stop on Charlie Blackmon's sharp liner leading off the ninth. That matched the defensive gem made in the second inning by Colorado left fielder Raimel Tapia, who made a diving grab to rob Pablo Sandoval of a hit.
Rockies: 1B Daniel Murphy saw a hand specialist in Arizona, but the Rockies had yet to receive results. Murphy is out with a broken left index finger. ... OF David Dahl (left side core injury) ran and played long toss in Arizona, although Black said the team plans to take a cautious approach with Dahl's rehab.
Giants: 3B Evan Longoria was rested. Sandoval started and went 0 for 4.
More AP MLB:https://apnews.com/tag/MLB andhttps://twitter.com/AP-Sports
Shin-Soo Choo is lending aid to minor leaguers
Joon Lee reacts to Rangers outfielder Shin-Soo Choo donating $1,000 each to about 190 players in Texas' minor league system.
Shin-Soo Choo donating funds to Rangers minor leaguers
Veteran Shin-Soo Choo is giving $1,000 each to 191 players in the Rangers' farm system.
Can Major League Baseball be played in December?
Jeff Passan, Mark Teixeria and Eduardo Perez break down the possibility of the MLB postseason going into December.
Ted Williams smashes walk-off homer in 1941 All-Star Game
On July 8, 1941, Ted Williams hit a towering blast for a walk-off home run in the All-Star Game.
DirecTV to carry Dodgers games on SportsNet LA
DirecTV has reached a deal to carry the Los Angeles Dodgers' network, SportsNet LA.
MLB cancels Cubs-Cardinals London series in June
MLB has canceled the London series between the Cubs and Cardinals due to the coronavirus pandemic.