Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-10055

metatools: make merge-kits work with git amended fixups branches

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None
    • Hide
      1. On a out of date local clone of your kit-fixups repo, create a local branch
      2. Make a random commit
      3. git push origin BRANCH_NAME to create the remote branch
      4. Run merge-kits against that fork's new remote branch
      5. Go back to your out-of-date kit-fixups local clone and checkout the master branch
      6. Run a git pull --rebase
      7. git checkout the local branch from earlier
      8 Run git rebase master on that branch
      9. Run git push --force origin BRANCH_NAME
      10. Re-run merge-kits and your should see the error
      Show
      1. On a out of date local clone of your kit-fixups repo, create a local branch 2. Make a random commit 3. git push origin BRANCH_NAME to create the remote branch 4. Run merge-kits against that fork's new remote branch 5. Go back to your out-of-date kit-fixups local clone and checkout the master branch 6. Run a git pull --rebase 7. git checkout the local branch from earlier 8 Run git rebase master on that branch 9. Run git push --force origin BRANCH_NAME 10. Re-run merge-kits and your should see the error
    • git pull --ff-only is not rebasing when pulling the amended remote branch
    • Workaround: remove repo_tmp/source-trees/kit-fixups

      When running the merge-kits command as part of funtoo-metatools (version used: master branch commit b41602d) on a forked kit-fixups remote repository branch that has recently been git amended to using a git force push, merge-kits fails to run again.

      This is a request to add git pull support for amended remote branches when using merge-kits on forked kit-fixups remote branches.

      This was discovered during the development of the next-gen ruby-kit changes.

      Full funtoo-metatools merge-kits Python traceback:

      ./bin/merge-kits next --fixups_url https://code.funtoo.org/bitbucket/scm/~siris/kit-fixups.git --fixups_branch "FL-9695/rubies-next-gen-v1"
      [INFO 02:14:17] Cleaning tree /home/ss/repo_tmp/source-trees/kit-fixups
      Traceback (most recent call last):
        File "/home/ss/Repos/funtoo-metatools/./bin/merge-kits", line 92, in <module>
          hub.LOOP.run_until_complete(main_thread(args))
        File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
          return future.result()
        File "/home/ss/Repos/funtoo-metatools/./bin/merge-kits", line 46, in main_thread
          await model.initialize(
        File "/usr/lib/python3.9/site-packages/metatools/config/merge.py", line 100, in initialize
          self.kit_fixups.initialize()
        File "/usr/lib/python3.9/site-packages/metatools/tree.py", line 143, in initialize
          self._initialize_tree()
        File "/usr/lib/python3.9/site-packages/metatools/tree.py", line 405, in _initialize_tree
          self.gitCheckout(self.branch, from_init=True)
        File "/usr/lib/python3.9/site-packages/metatools/tree.py", line 504, in gitCheckout
          self.do_pull()
        File "/usr/lib/python3.9/site-packages/metatools/tree.py", line 419, in do_pull
          self.run_shell("(cd %s && git pull --ff-only)" % self.root)
        File "/usr/lib/python3.9/site-packages/metatools/tree.py", line 71, in run_shell
          return run_shell(cmd_list, abort_on_failure=abort_on_failure, chdir=chdir, logger=self.log)
        File "/usr/lib/python3.9/site-packages/metatools/tree.py", line 34, in run_shell
          raise ShellError(f"Aborted due to failed command. Error executing '{cmd_str}':\n{output}\n")
      metatools.tree.ShellError: Aborted due to failed command. Error executing '(cd /home/ss/repo_tmp/source-trees/kit-fixups && git pull --ff-only)':
      From https://code.funtoo.org/bitbucket/scm/~siris/kit-fixups
       + a4c042cf5...3a69a1886 FL-9695/rubies-next-gen-v1 -> origin/FL-9695/rubies-next-gen-v1  (forced update)
       * [new branch]          FL-10052/packer-autogen -> origin/FL-10052/packer-autogen
       * [new branch]          FL-9943/firefox-101.0.1 -> origin/FL-9943/firefox-101.0.1
         41ffbcfb6..d3d7867bf  master                  -> origin/master
      fatal: Not possible to fast-forward, aborting.

            Unassigned Unassigned
            siris siris
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: