Change By: Andre Dietisheim (13/Jun/12 10:50 AM)
Description: 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!

Steps to reproduce:

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.

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.
Steps to Reproduce: 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.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira