pkgcore / pkgcheck

pkgcore-based QA utility for ebuild repos
https://pkgcore.github.io/pkgcheck
BSD 3-Clause "New" or "Revised" License
34 stars 29 forks source link

suggest `git remote set-head` when not set for remote #608

Closed arthurzam closed 9 months ago

arthurzam commented 11 months ago
<+Flow> arthurzam: re https://github.com/pkgcore/pkgdev/issues/107, maybe pkgdev(/pkgcore?) could detect the cases where set remote head is not set and warn (or even try to fix it by running "git remote set-head origin -a")
<+Flow> I am still not sure how this happens, but it seems I am not the only one who ran into this
<@arthurzam> Flow: do you think something like: upon failure in normal happy path, try to run `git rev-parse ${REMOTE_NAME}`, and if it fails, suggest running `git remote set-head ${REMOTE_NAME}`
<@arthurzam> sounds fine?
<+Flow> sounds git, err good
<+Flow> arthurzam: but I think you really want to also use -a with set-head
<@arthurzam> Flow: yeah, agreed
<+Flow> and, fwiw, I think there are multiple call sites where pkgcore/pkgdev assumes that origin is a valid reference to origin/HEAD
<+Flow> so that's probably something to factor out in an extra method?
<@arthurzam> Flow: I think I'll try to do it more generic (I remember less the git code in the stack)
<+Flow> whatever floats your goat :)