Opened 4 years ago

Last modified 18 months ago

#2750 new enhancement

Git: fetch all branches before switching to the given revision, if branch=None

Reported by: dustin Owned by:
Priority: major Milestone: 0.9.+
Version: 0.8.8 Keywords: git
Cc:

Description

See https://github.com/buildbot/buildbot/pull/1074

branch=None is a bit of a degenerate case, referring vacuously to the "default branch", which in Git really means master. However, it's also the default, and there's no reason to make that default fail in the interest of an optimization (not fetching every commit).

Change History (7)

comment:1 Changed 4 years ago by dustin

  • Milestone changed from 0.8.+ to 0.9.+

Ticket retargeted after milestone closed

comment:2 Changed 4 years ago by sa2ajj

Maybe the meaning of branch=None should be reconsidered:

  • if revision is not specified -> default branch
  • if a revision is specified -> fetch that particular revision and set it as the one to work on
Last edited 4 years ago by sa2ajj (previous) (diff)

comment:3 Changed 4 years ago by dustin

Maybe I misunderstand, but you can't instruct git to fetch a specific revision from a remote repository -- only to fetch some named revision (and its parents).

comment:4 Changed 4 years ago by sa2ajj

Maybe, I misremembered something.

I'll investigate and update the ticket.

Last edited 4 years ago by sa2ajj (previous) (diff)

comment:5 Changed 4 years ago by sa2ajj

It looks like

git fetch <remote> <SHA-1>:FETCH_HEAD

works just fine.

$ git --version
git version 2.1.0

comment:6 Changed 4 years ago by dustin

Hah, well, I stand corrected!

Note: See TracTickets for help on using tickets.