The git-2 eclass doesn't properly handle a nonbare repo and an origin that does significant rebases. The git-2_update_repo function calls EGIT_UPDATE_CMD - for a nonbare repo, EGIT_UPDATE_CMD="git pull -f -u ${EGIT_OPTIONS}" - git pull -f -u doesn't handle very well the case where the remote has been rebased with commits that conflict with commits currently checked out in the nonbare repo. Reproducible: Always Steps to Reproduce: 1. Create a git repo with some commits 2. Set up an ebuild to use git-2 to clone it in nonbare mode 3. Get through git-2_src_unpack once 4. Rebase the git repo with commits that will conflict with the previous checkout 5. Run git-2_src_unpack again Actual Results: Something along the lines of: Already on 'master' Your branch and 'origin/master' have diverged, and have 22 and 32 different commits each, respectively. (use "git pull" to merge the remote branch into yours) * egit_up: git pull -f -u warning: inexact rename detection was skipped due to too many files. warning: you may want to set your merge.renamelimit variable to at least 7423 and retry the command. * ERROR: foo-bar/my-ebuild-9999 failed (unpack phase): * git-2_update_repo: can't update from git://my-project Expected Results: git-2 should have an option to fetch and checkout, rather than pulling
Created attachment 409794 [details, diff] Patch to add an EGIT_FORCE_FETCH_UPDATE variable Adds an EGIT_FORCE_FETCH_UPDATE variable to git-2.eclass, which, when set, forces git-2 to use git fetch for git-2_update_repo
Would it be better to verify this also affects git-r3.eclass and upgrade offending ebuilds? Just asking as I'm curious.
This eclass is deprecated. I don't think we'd be adding more code for the non-bare mode since it's gone in git-r3.
Should this bug be closed and a tracker created to migrate ebuilds to git-r3.eclass? Is the non-bare mode still a requirement for certain ebuilds? Again, just asking to keep this moving towards resolution.
I have a personal use case where I need a non-bare repository (need to be able to, in the ebuild, merge topic branches from a second repository on to the checkout from the EGIT-managed repository)
git-2.eclass is long gone.