Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-12138

serveradapter is git forcing without asking when error occurs in normal git commit

XMLWordPrintable

    • Hide

      1) EXEC: create myapp in tools with openshift in ~/git/myapp

      2) EXEC: take the git url and clone the app into a separate directory (to simulate other changes)
      mkdir temp (different directory than the git-repo created by our tooling!!)
      cd temp
      git clone ssh:<specifichost>/myapp.git/
      cd myapp
      3) EXEC: edit README or some other existing file
      4) EXEC: git commit -m "external change" README
      5) EXEC: git push

      <ton of output>

      6) ASSERT: (verifying that now pushing from the repo created by our tooling is now failing because of "non-fastforward"):
      cd ~/git/myapp
      echo "-------------" > README (or change README manually with vim
      git push will now fail with something like:

      ax@slowbeard: $ git push ~/git/appmy
      To ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/
      ! [rejected] master -> master (non-fast-forward)
      error: failed to push some refs to 'ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/'
      To prevent you from losing history, non-fast-forward updates were rejected
      Merge the remote changes (e.g. 'git pull') before pushing again. See the
      'Note about fast-forwards' section of 'git push --help' for details.

      7) EXEC: in Eclipse, open README, edit it, and choose Publish from the context-menu of the server adapter.

      Result:
      Thus when trying to publish from tools it should not let you push and it should ask you before pushing with force.

      You can verify it did not push force by using

      git pull
      git log README

      and check that "external change" is still present.

      Show
      1) EXEC: create myapp in tools with openshift in ~/git/myapp 2) EXEC: take the git url and clone the app into a separate directory (to simulate other changes) mkdir temp (different directory than the git-repo created by our tooling!!) cd temp git clone ssh:<specifichost>/myapp.git/ cd myapp 3) EXEC: edit README or some other existing file 4) EXEC: git commit -m "external change" README 5) EXEC: git push <ton of output> 6) ASSERT: (verifying that now pushing from the repo created by our tooling is now failing because of "non-fastforward"): cd ~/git/myapp echo "-------------" > README (or change README manually with vim git push will now fail with something like: ax@slowbeard: $ git push ~/git/appmy To ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/ ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. 7) EXEC: in Eclipse, open README, edit it, and choose Publish from the context-menu of the server adapter. Result: Thus when trying to publish from tools it should not let you push and it should ask you before pushing with force. You can verify it did not push force by using git pull git log README and check that "external change" is still present.
    • Hide
      If someone changed your OpenShift repo your clone will get out of date. Pushing to it would fail, since what you're trying to push to OpenShift is outdated. You'd have to get those changes and merge them in before you can push your changes. You can override the remote changes by forcing your push. The OpenShift adapter now allows you to override remote changes. It will inform you that your clone is out of date and the regular push failed. It will then let you choose to push force or not to push at all.
      Show
      If someone changed your OpenShift repo your clone will get out of date. Pushing to it would fail, since what you're trying to push to OpenShift is outdated. You'd have to get those changes and merge them in before you can push your changes. You can override the remote changes by forcing your push. The OpenShift adapter now allows you to override remote changes. It will inform you that your clone is out of date and the regular push failed. It will then let you choose to push force or not to push at all.
    • Not Required

      Was noticed through reading the code that if another error than "up to date" occurs jbosstools is forcing a push witohut asking the user.

      This must be fixed since otherwise you are nuking users history!

        1. check-for-null-pushresults.patch
          2 kB
        2. JBIDE-12138.patch
          3 kB
        3. JBIDE-12138improved.txt
          7 kB
        4. jgit-error.png
          jgit-error.png
          22 kB
        5. jgit-error.png
          jgit-error.png
          590 kB
        6. want-to-push-force-question.png
          want-to-push-force-question.png
          28 kB

              manderse@redhat.com Max Andersen
              manderse@redhat.com Max Andersen
              Isaac Rooskov Isaac Rooskov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: