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
The moment Larry Walker got the call he was in the Hall of Fame
Larry Walker is joined by his family as he gets the call that he's been inducted in the Baseball Hall of Fame.
Marcell Ozuna gets one-year deal from Braves worth $18 million
Outfielder Marcell Ozuna, who hit 29 home runs for the Cardinals last season, will play for the Atlanta Braves in 2020 on a one-year contract worth $18 million.
Kurkjian: Walker's induction to HOF shouldn't have taken this long
Tim Kurkjian reacts to Larry Walker's induction into the Baseball Hall of Fame, which took 10 years.
Kurkjian: Jeter is a top-four shortstop of all time
Tim Kurkjian breaks down Derek Jeter's Hall of Fame career and hopes people don't speculate about the one person who didn't vote for him.
Derek Jeter, Larry Walker elected to Baseball Hall of Fame
Shortstop Derek Jeter and outfielder Larry Walker were elected to the Baseball Hall of Fame on Tuesday. They'll be inducted into the Hall in Cooperstown, New York, in July.
Resolution urges MLB to strip Astros, Red Sox of World Series titles, award them to Dodgers
A resolution urging Major League Baseball to strip the Houston Astros and Boston Red Sox of recent World Series titles and award them to the Los Angeles Dodgers has been unanimously approved by the L.A. City Council.