[
https://issues.jboss.org/browse/JBIDE-13175?page=com.atlassian.jira.plugi...
]
Andre Dietisheim edited comment on JBIDE-13175 at 1/28/13 8:47 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@adietish-thinkpad aa]$ git branch -a
* master
remotes/origin/master
{code}
* You'll be able to do a diff btw. those 2:
{code}
[adietish@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@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@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@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@adietish-thinkpad aa]$ git fetch openshift
* [new branch]
master -> openshift/master
[adietish@adietish-thinkpad aa]$ git branch -a
* master
remotes/openshift/master
remotes/origin/master
[adietish@adietish-thinkpad aa]$ git diff master --shortstat openshift/master
1 files changed, 0 insertions(+), 4 deletions(-)
{code}
It's important to note that the remote tracking branch (and thus the diff) will only
get created if the remote is added with a fetch-spec
{code}
[remote "openshift"]
url = ssh://31d6dc5619f24750b09941de420c133e@aa-myops.rhcloud.com/~/git/aa.git
fetch = +refs/heads/*:refs/remotes/openshift/*.
{code}
If the remote is added without a fetch-spec, then fetching does not help. The fetch will
not create the remote tracking branch and thus the diff wont work.
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@adietish-thinkpad aa]$ git branch -a
* master
remotes/origin/master
{code}
* You'll be able to do a diff btw. those 2:
{code}
[adietish@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@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@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@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@adietish-thinkpad aa]$ git fetch openshift
* [new branch]
master -> openshift/master
[adietish@adietish-thinkpad aa]$ git branch -a
* master
remotes/openshift/master
remotes/origin/master
[adietish@adietish-thinkpad aa]$ git diff master --shortstat openshift/master
1 files changed, 0 insertions(+), 4 deletions(-)
{code}
It's important to note that the remote tracking branch (and thus the diff) will only
get created if the remote is added with a fetch-spec
{code}
fetch = +refs/heads/*:refs/remotes/openshift/*.
{fetch}
If the remote is added without a fetch-spec, then fetching does not help. The fetch will
not create the remote tracking branch and thus the diff wont work.
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