Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 383425 - Continuation of Bug 351458 - easy way to get commit from GitHub
Summary: Continuation of Bug 351458 - easy way to get commit from GitHub
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: 0.5   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 1.0 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: gsoc2012
Keywords:
Depends on:
Blocks: 385833
  Show dependency tree
 
Reported: 2012-06-25 07:44 EDT by Edyta Przymus CLA
Modified: 2012-07-24 06:10 EDT (History)
2 users (show)

See Also:


Attachments
Transparent background (13.72 KB, image/png)
2012-07-02 08:31 EDT, Szymon Brandys CLA
no flags Details
Remove empty space (9.08 KB, image/png)
2012-07-02 08:51 EDT, Szymon Brandys CLA
no flags Details
Two popups (35.92 KB, image/png)
2012-07-10 11:56 EDT, Szymon Brandys CLA
no flags Details
Initial state of Pull Request Page (159.58 KB, image/png)
2012-07-15 17:00 EDT, Edyta Przymus CLA
no flags Details
Wrong section name (7.60 KB, image/png)
2012-07-17 08:29 EDT, Szymon Brandys CLA
no flags Details
Comments for layout (25.49 KB, image/png)
2012-07-17 08:43 EDT, Szymon Brandys CLA
no flags Details
New layout (175.86 KB, image/png)
2012-07-17 13:00 EDT, Edyta Przymus CLA
no flags Details
Improved padding/margin (177.30 KB, image/png)
2012-07-19 05:08 EDT, Edyta Przymus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edyta Przymus CLA 2012-06-25 07:44:19 EDT
Build Identifier: 

There should be a convienient way to find a commit by providing repository URL and the commit number. In case repository is already cloned to workspace, Orion should find the commit by its number. In the opposite case, the repository should be cloned and after this action, the commit should be found.

Reproducible: Always
Comment 2 Szymon Brandys CLA 2012-06-26 07:38:27 EDT
Comments:
I used this url http://localhost:8080/git/git-repository.html#,getGitCommit=git://github.com/edytaprzymus/orion.client/commit/9bf2fecaf1d834285096337a8c49a60ab801669b. Note that git://github.com/edytaprzymus/orion.client is already used as a second remote for one of my repos in Orion.

1. Instead of asking me to fetch the remote, I'm asked to create a new clone.
2. When I agree to clone the repo, the suggested repo url is git://github.com/edytaprzymus/orion.client/commit/9bf2fecaf1d834285096337a8c49a60ab801669b. When I just click Ok, it fails. I need to remove /commit/9bf2fecaf1d834285096337a8c49a60ab801669b first.
3. When cloning is done, my page url is changed, so now it looks like this: http://localhost:8080/git/git-repository.html#,getGitCommit=git://github.com/edytaprzymus/orion.client/commit/9bf2fecaf1d834285096337a8c49a60ab801669b,openGitCommit=undefined and 'Commit name:' prompt shows 'undefined' instead of the commit name.

Am I doing something wrong?
Comment 3 Szymon Brandys CLA 2012-06-26 07:42:53 EDT
Some UI comments:
1. 'Get Git Commit' dialog should rather say:
"You are trying to open commit [commit sha1] from [remote url]. The remote is not on your repositories list. \n
Do you want to clone it?"
2. I would change the title to "Open Commit".
Comment 4 Szymon Brandys CLA 2012-06-26 08:46:46 EDT
According to Edyta I should have used this link http://localhost:8080/git/git-repository.html#,getGitCommit=git://github.com/edytaprzymus/orion.client_9bf2fecaf1d834285096337a8c49a60ab801669b
and it works ok if the remote does not exist on the repo list. But I see problems if the remote exists.

Comments for the case when remote url does not exist
1) Once cloning is done, we should immediately see the 'Find Commit' dialog. I guess we need an argument in the url saying that we want to see the dialog instead of the slideout.
We can raise a separate bug for that.

Comments for the case when remote url exists
1) I still would like to be able to create a new clone. So the dialog should ask if I want to fetch the existing remote or create a new clone anyway.
2) Moreover if the commit is already fetched, I do not know whether I should fetch or not.

So maybe the dialog should look like this

Commit <sha1> from <remote url>
<commit details like on Find Commit>
found on:

Open from repo1 link <--- this link takes to the commit page
Open from repo2 link

<remote url> is also used by the following repos:
repo3 [Fetch] <--- when fetch is done, the section above is updated
repo4 [Fetch]
repo5 [Fetch]

Create new clone using <remote url> [Clone]

Any other thoughts?
Comment 5 Edyta Przymus CLA 2012-06-26 14:32:10 EDT
https://github.com/edytaprzymus/orion.client/commit/f4e6374f8bf6464a0d36afcf854d4ad1546c3cbe

This is just a dirty version of improved workflow for existing remote. Please treat it like a half-mockup, and test it just to estimate if the general design is what we want.

I am keeping improving it, so probably tomorrow it would be more complete (function to create new clone for existing remote is still missing for example), but my intention in posting this commit was to show the progress of my project, which would allow Szymon  to comment my work even at this stage.
Comment 6 Edyta Przymus CLA 2012-06-28 02:13:14 EDT
https://github.com/edytaprzymus/orion.client/commit/32bb5c154182f31315fec00f0591f43610d961c2

Improved version of previous solution.
Comment 8 Szymon Brandys CLA 2012-07-02 08:31:13 EDT
Created attachment 218148 [details]
Transparent background

Moreover 'Clone' should be an action next to "create new clone using git://github.com/edytaprzymus/orion.client"
Comment 9 Szymon Brandys CLA 2012-07-02 08:49:33 EDT
More comments:
- When I click 'Fetch' on the 'Get Git Commit' dialog and fetch is done, I would not expect whole page to be reloaded
- I would put 'Force Fetch' next to 'Fetch on the dialog
- I would investigate how to show 'Open Commit' dialog immediately after fetch, clone etc. Now, we show the slideout first and one has to click 'More'
Comment 10 Szymon Brandys CLA 2012-07-02 08:51:17 EDT
Created attachment 218152 [details]
Remove empty space

Not sure why we have the space here, but not for:
git://github.com/edytaprzymus/orion.client is also used by the following repos:
org.eclipse.orion.client [Fetch]
Comment 11 Edyta Przymus CLA 2012-07-02 16:18:08 EDT
https://github.com/edytaprzymus/orion.client/commit/8e97dfb281a4c94d9ef2a63a0c8a91d336eb6d32

In this commit I managed to introduce almost all Szymon's comments, the only one that is left is:

"- I would investigate how to show 'Open Commit' dialog immediately after fetch,
clone etc. Now, we show the slideout first and one has to click 'More'"

I have already idea about it, I want to discuss it tomorrow.
Comment 12 Edyta Przymus CLA 2012-07-05 15:27:25 EDT
https://github.com/edytaprzymus/orion.client/commit/8d8d5b84d519ab63537f94d1a9cf2898c791f059

Hopefully this is the proper version - more robust, better-looking and with nice interface to OpenCommitCommand.

The only issue - it works only on the old-style repos page. I will try to convert it for latest version ASAP.
Comment 13 Edyta Przymus CLA 2012-07-08 13:52:19 EDT
https://github.com/edytaprzymus/orion.client/commit/6fef3aa1aca7aaf5998e31189f7d7116ea5aec01

Solution from last comment adapted for the new repositories page.
Comment 14 Szymon Brandys CLA 2012-07-09 06:34:05 EDT
The latest patch does not work for me. When I click More on the slideout, the dialog is not shown.
Comment 15 Edyta Przymus CLA 2012-07-09 09:43:21 EDT
https://github.com/edytaprzymus/orion.client/commit/878683ed01abd3c35dcab65c24380ba5ddb91cdd

Slideout eliminated and it works fine now
Comment 16 Edyta Przymus CLA 2012-07-10 08:36:14 EDT
I wrote all this code and have the rights to contribute it to Eclipse under the
eclipse.org web site terms of use.
Comment 17 Szymon Brandys CLA 2012-07-10 11:56:17 EDT
Created attachment 218513 [details]
Two popups

I used this link 8http://localhost:8080/git/git-repository.html#,getGitCommit=git://github.com/edytaprzymus/orion.client_878683ed01abd3c35dcab65c24380ba5ddb91cdd
I was asked to clone the repo, since the remote did not exist in my workspace. I agreed and when cloning was done two popups appeared. See the screenshot.
They both show all the details I need i.e. which repos have the commit and what are commit details, but I would expect just one dialog.
Comment 18 Szymon Brandys CLA 2012-07-11 11:35:02 EDT
I started the new pullRequest page in 23c69cdbf2328bc13b19f995d459c7881cdf7ed5. See branch bug383425 on git.eclipse.org.
Comment 19 Edyta Przymus CLA 2012-07-11 15:33:32 EDT
Szymon, 
are you sure you pushed this commit? I see branch bug383425 on orion.server on eclipse.org, but there is no commit with such a sha. On orion.client I cannot see branch named bug383425.
Comment 20 Szymon Brandys CLA 2012-07-12 04:42:45 EDT
My fault. I created branch on a wrong repo. I'll push the branch today.
Comment 21 Szymon Brandys CLA 2012-07-12 06:02:41 EDT
(In reply to comment #20)
> My fault. I created branch on a wrong repo. I'll push the branch today.
Done. Look for pullRequest.css .js and .html files.
Comment 22 Edyta Przymus CLA 2012-07-15 16:59:09 EDT
This is initial version of page with Pull Request features:
https://github.com/edytaprzymus/orion.client/commit/075b514b57ebd2a97a0c956086d51a0f61eda9c9

I also attached an attachment illustrating its features: it has three sections, one for creating new repository, one with links to desired commit which is found in workspace, and one for fetching from repositories that have the remote.

Please take a look on this and tell me if I go in good direction.
Comment 23 Edyta Przymus CLA 2012-07-15 17:00:05 EDT
Created attachment 218734 [details]
Initial state of Pull Request Page
Comment 24 Szymon Brandys CLA 2012-07-16 06:14:08 EDT
Couple comments
- breadcrumb, e.g. Pull Request for 6dfe7ab70eed62590bf4a7b6966c8170e1d302fe on git://github.com/szbra/test2.git
- if section is empty, we should either hide it or change its name 
e.g. if there is no commit to open the section should say "No Commit to Open" maybe
- "Open Commit" link could show commit details when hover on it
- you could show more details about repos e.g. their locations and repo names could be links to repository page
- use pref service to remember the section state ie closed vs open
- we need to fix the page layout. But since we have ongoing discussion about pages layout, let's skip this point for now.
Comment 25 Edyta Przymus CLA 2012-07-16 16:35:04 EDT
https://github.com/edytaprzymus/orion.client/commit/1991013016e02963121d6c50c69f0c79d41515f6

Comments implemented. The only problem I encountered is that response of getGitClone doesn't contain the field "Content.Path", so showing the location of repository is not implemented.

I am open to any comments about layout.
Comment 26 Szymon Brandys CLA 2012-07-17 08:29:25 EDT
Created attachment 218799 [details]
Wrong section name

I ended up having a commit to open and 'Commit not found' header
Comment 27 Szymon Brandys CLA 2012-07-17 08:31:28 EDT
(In reply to comment #25)
> https://github.com/edytaprzymus/orion.client/commit/1991013016e02963121d6c50c69f0c79d41515f6
> 
> Comments implemented. The only problem I encountered is that response of
> getGitClone doesn't contain the field "Content.Path", so showing the location of
> repository is not implemented.

See the repositories page how to handle it.
Comment 28 Szymon Brandys CLA 2012-07-17 08:43:22 EDT
Created attachment 218800 [details]
Comments for layout

For the layout I would suggest to follow the layout we have on the git repository page. It means:
- lines between rows, use the right css style
- actions should be aligned to the right
I would apply that for 'Commit' and 'Fetch from repository...' sections.

In 'Create new repository' let's try this:
[Clone Repository] using git://github.com/edytaprzymus/orion.client.git
Comment 29 Edyta Przymus CLA 2012-07-17 12:59:55 EDT
https://github.com/edytaprzymus/orion.client/commit/f4014f368d03173030716e125bd147261d2a2eda

The commit with problems and layout fixed. I also attached a screenshot. I just want to show, that I changed the place where popup with details of commit is shown - the reason is, that when the link "Open Commit" is on the right, the popup is visible only partially.
Comment 30 Edyta Przymus CLA 2012-07-17 13:00:20 EDT
Created attachment 218828 [details]
New layout
Comment 31 Szymon Brandys CLA 2012-07-18 05:03:15 EDT
(In reply to comment #30)
> Created attachment 218828 [details]
> New layout

Popup with commit details should be shown when you hover on the commit link, not the repo link. Use the same padding/margin for items as we use on the repo page. See how .sectionTableItem from section.css i used on git.repository.html. Otherwise it looks good.
Comment 32 Edyta Przymus CLA 2012-07-19 05:07:43 EDT
https://github.com/edytaprzymus/orion.server/commit/0f55dd9bae19ba8340d32457fb9e852a114847ee
Here are you're remarks implemented. I also attached layout sample as an image.
Comment 33 Edyta Przymus CLA 2012-07-19 05:08:52 EDT
Created attachment 218908 [details]
Improved padding/margin
Comment 34 Szymon Brandys CLA 2012-07-19 06:04:23 EDT
(In reply to comment #33)
> Created attachment 218908 [details]
> Improved padding/margin

Looks good. Please prepare a commit to review and I'll take a look on Friday.
Comment 35 Edyta Przymus CLA 2012-07-19 17:15:12 EDT
https://github.com/edytaprzymus/orion.client/commit/aeb2c099a33aa2833dbc236df2205f377841305b

This is the commit for review
Comment 36 Edyta Przymus CLA 2012-07-22 14:51:14 EDT
https://github.com/edytaprzymus/orion.client/commit/d621e63edf0c6e11dc7b6284b537da730d9e9dfe
I fixed problems with sections' titles. It should be fine now. 
I also created initial version of greasmonkey script for Bugzilla, which creates links for the page created in this bug automatically from links to commits on github. Do we already have a bug for this issue, or should I create it? I want to show you this code next time you'll review my work.
Comment 37 Edyta Przymus CLA 2012-07-23 06:03:31 EDT
https://github.com/edytaprzymus/orion.client/commit/64eebd9e1dc5c362217ab7ca3fc4da21c4a9490e
Szymon's kind remarks implemented. I hope everything is ok right now.
Comment 39 Szymon Brandys CLA 2012-07-24 06:07:15 EDT
Merged to master. Let's open new bugs for remaining issues.