Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341953 - [server] Git status response should give back the stageAll and commitAll URI
Summary: [server] Git status response should give back the stageAll and commitAll URI
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-05 14:36 EDT by libing wang CLA
Modified: 2011-09-01 11:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description libing wang CLA 2011-04-05 14:36:38 EDT
Currently , all the properties I can get from git status request is based on a single file , e.g. as below
  "Modified": [
    {
      "Git": {
        "CommitLocation": "http://localhost:8080/git/commit/HEAD/file/K/bundles/org.eclipse.orion.client.core/static/compare.html",
        "DiffLocation": "http://localhost:8080/git/diff/Default/file/K/bundles/org.eclipse.orion.client.core/static/compare.html",
        "IndexLocation": "http://localhost:8080/git/index/file/K/bundles/org.eclipse.orion.client.core/static/compare.html"
      },
      "Location": "http://localhost:8080/file/K/bundles/org.eclipse.orion.client.core/static/compare.html",
      "Name": "bundles/org.eclipse.orion.client.core/static/compare.html",
      "Path": "bundles/org.eclipse.orion.client.core/static/compare.html"
    },

I am using Git.DiffLocation on a single file to do the compare and Git.IndexLocation to do stage , which is good.

But as "Stage All" , "Unstage All" and "Commit/Amend All" are based on the directory where the git-status.html is called in , I had to craft them by using the hash value of the git-status.html.

In M7 , we should return these information in the response , these information should be global instead of being based n a single file.
Comment 1 Tomasz Zarna CLA 2011-04-06 05:01:26 EDT
Would format like this work for you?

{ "CommitAll": "http://localhost:8080/git/commit/file/K/", "StageAll": "http://localhost:8080/git/index/file/K/", "Modified" : [...], "Added" : [...], ... }
Comment 2 libing wang CLA 2011-04-06 10:02:32 EDT
(In reply to comment #1)
> Would format like this work for you?
> 
> { "CommitAll": "http://localhost:8080/git/commit/file/K/", "StageAll":
> "http://localhost:8080/git/index/file/K/", "Modified" : [...], "Added" : [...],
> ... }

Yes.The format is good.
Btw , just recalled one more thing , will we support single file unstage in M7?
Comment 3 libing wang CLA 2011-04-06 10:04:37 EDT
Maybe we should use "CommitAllLocation" and "StageAllLocation" just ot make the naming convention consistent.
Comment 4 Tomasz Zarna CLA 2011-04-06 14:45:26 EDT
(In reply to comment #2)
> Btw , just recalled one more thing , will we support single file unstage in M7?

It's being tracked by bug 338202, which is currently blocked by bug 338701 in JGit.

(In reply to comment #3)
> [...] use "CommitAllLocation" and "StageAllLocation"

Fine with me.
Comment 5 Tomasz Zarna CLA 2011-04-12 09:34:30 EDT
Done[1], "CommitLocation" and "IndexLocation" from git status response, which are at the same level as "Added", "Changed" and others can be used to stage and commit all files in a clone. An example of a response with new keys can be found here: http://wiki.eclipse.org/Orion/Server_API/Git_API#Getting_status_for_a_git_project. Libing, I hope you don't mind this little change I made in the final implementation.

[1] http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=c69083bcd790fbbab97334f3096434223ed635cd