[jbosstools-issues] [JBoss JIRA] (JBIDE-13175) Openshift server adapter: on first push it says that it has no local changes. Even though local clone has 1 commit more than remote

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Mon Jan 28 04:05:47 EST 2013


    [ https://issues.jboss.org/browse/JBIDE-13175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750482#comment-12750482 ] 

Andre Dietisheim edited comment on JBIDE-13175 at 1/28/13 4:05 AM:
-------------------------------------------------------------------

after reading a lot of code and a lot of git manuals and even testing a lot, I'm completely sure that there's no way to do a diff btw. an local and a remote without fetching the remote first. 

To prove it, do the following:

* git clone an openshift repo to your local machine. You'll get a local branch with 2 branches:

{code}
[adietish at adietish-thinkpad aa]$ git branch -a
* master
  remotes/origin/master
{code}

* You'll be able to do a diff btw. those 2:

{code}
[adietish at adietish-thinkpad aa]$ git diff --shortstat master origin/master
 1 files changed, 0 insertions(+), 4 deletions(-)
{code}

* Now add the origin as *openshift* to your repo:

{code}
[adietish at adietish-thinkpad aa]$ git remote -v
origin	ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git/ (fetch)
origin	ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git/ (push)
[adietish at adietish-thinkpad aa]$ git remote add openshift ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git/
{code}

* and try to diff, it wont work:

{code}
[adietish at adietish-thinkpad aa]$ git diff --shortstat master openshift/master
fatal: ambiguous argument 'openshift/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
{code}

* you have to first fetch (and get another remote tracking branch) so that the diff works:

{code}
[adietish at adietish-thinkpad aa]$ git fetch openshift
>From ssh://aa-myops.rhcloud.com/~/git/aa
 * [new branch]      master     -> openshift/master
[adietish at adietish-thinkpad aa]$ git branch -a
* master
  remotes/openshift/master
  remotes/origin/master
[adietish at adietish-thinkpad aa]$ git diff master --shortstat openshift/master
 1 files changed, 0 insertions(+), 4 deletions(-)
{code}

                
      was (Author: adietish):
    after reading a lot of code and a lot of git manuals and even testing a lot, I'm completely sure that there's no way to do a diff btw. an local and a remote without fetching the remote first. 

To prove it, do the following:

* git clone an openshift repo to your local machine. You'll get a local branch with 2 branches:

{code}
[adietish at adietish-thinkpad aa]$ git branch -a
* master
  remotes/origin/master
{code}

* You'll be able to do a diff btw. those 2:

{code}
[adietish at adietish-thinkpad aa]$ git diff --shortstat master origin/master
 1 files changed, 0 insertions(+), 4 deletions(-)
{code}

* Now add the origin as *openshift* to your repo:

{code}
[adietish at adietish-thinkpad aa]$ git remote -v
origin	ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git/ (fetch)
origin	ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git/ (push)
[adietish at adietish-thinkpad aa]$ git remote add openshift ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git/
{code}

* and try to diff, it wont work:

{code}
[adietish at adietish-thinkpad aa]$ git diff --shortstat master openshift/master
fatal: ambiguous argument 'openshift': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
{code}

* you have to first fetch (and get another remote tracking branch) so that the diff works:

{code}
[adietish at adietish-thinkpad aa]$ git fetch openshift
>From ssh://aa-myops.rhcloud.com/~/git/aa
 * [new branch]      master     -> openshift/master
[adietish at adietish-thinkpad aa]$ git branch -a
* master
  remotes/openshift/master
  remotes/origin/master
[adietish at adietish-thinkpad aa]$ git diff master --shortstat openshift/master
 1 files changed, 0 insertions(+), 4 deletions(-)
{code}

                  
> Openshift server adapter: on first push it says that it has no local changes. Even though local clone has 1 commit more than remote
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-13175
>                 URL: https://issues.jboss.org/browse/JBIDE-13175
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: openshift
>    Affects Versions: 4.0.0.Beta2
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 4.1.0.Alpha1
>
>         Attachments: 1-local-change.png, no-local-changes.png, no_changes_yes.png
>
>
> # EXEC: launch *OpenShift Application* wizard and create a new application / import existing one
> # ASSERT: you get the OpenShift application imported to your workspace
> # EXEC: in *Servers* view, select the adapter for your OpenShift application and pick *Publish* from its context menu
> Result:
> The adapter tells you that there are no local changes. If you look at your local project you'll see in the git-decoration that the local git repo is ahead of 1 commit of the remote, so there is a local commit that could be pushed/published.
> !no-local-changes.png!
> Expected result:
> The adapter should tell you that there are local changes and ask you if you want to publish them.

--
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


More information about the jbosstools-issues mailing list