In 1978, the 49ers traded their 1979 first-rounder for O.J. Simpson. They had a season so bad that they were in line for the #1 pick, but it went to Buffalo instead (they used it on LB Tom Cousineau, who went to Canada).
If SF doesn't make that trade, they may have taken Phil Simms #1 overall. Walsh had him as the best QB in that draft. Then, after the Bills probably take LB Tom Cousineau fifth overall (they had the first and fifth picks that year), and the Colts take LB Barry Krauss sixth overall, the Giants are picking at seven.
I don't see them drafting Montana there. It was way too early for him. They had several needs on offense, and I can see WR Jerry Butler, Ottis Anderson, and Kellen Winslow in contention for that pick. In my opinion, they take RB O.J. Anderson (RB was a more prime position then).
After that, they would probably be in the market for a QB. At the start of the second round, Montana, Steve Dils, Chuck Fusina, and Rick Leach were among the best available (none went in Round 2, and Montana was the only one to go in Round 3 in OTL). The Giants had a second-rounder, but no third rounder (went to MIA for Larry Csonka).
In OTL, Walsh called the other teams to gauge their interest in Joe. Some said that they may consider him in Round 5 or 6, and some said that he should go to Canada. If the Giants don't take him in Round 2 (my guess is that they probably don't. Not many teams were willing to take Joe in Round 2. The Giants still probably draft WR Earnest Gray), he ends up dropping to Round 4.
I could see the Bills (pick 87) and Giants (pick 90) having interest in a QB (the Bills took QB Dan Manucci in Round 5). If the Bills take Montana, he is probably the one that comes in during the 1980 AFC Divisional playoff game when Joe Ferguson hurt his ankle. What if Ferguson can't go for the rest of the playoffs, and Montana takes the Bills to a SB title? Ferguson may get his job back in 81, but I can't see him being there too much longer. Montana could have been having success in Buffalo instead of SF.
If the Giants take him, they probably end up starting Pisarcik and Randy Dean most of the year, and then Joe probably takes over in 1980. With O.J. Anderson to handle the ground game, and young (and up and coming) WR's Johnny Perkins and Earnest Gray to throw to, Montana could have done a nice job, provided he could have stayed healthy (the Giants didn't have a great O-line. Simms missed practically two seasons due to injury and the strike in 1982 and 83).