Bug 347194 - [client] git-status is showing staged files (that aren't changed) which I never staged
Summary: [client] git-status is showing staged files (that aren't changed) which I nev...
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Git (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 0.2   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 347384 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-25 13:09 EDT by Susan McCourt CLA
Modified: 2011-10-21 11:37 EDT (History)
6 users (show)

See Also:


Attachments
screenshot (217.69 KB, image/png)
2011-05-25 13:09 EDT, Susan McCourt CLA
no flags Details
screenshot taken on localhost (26.57 KB, patch)
2011-05-27 09:47 EDT, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2011-05-25 13:09:25 EDT
Created attachment 196579 [details]
screenshot

Running orion.eclipse.org (20110524).
Tried with both inner and outer git-status page.

Yesterday I was self-hosting on orion.eclipse.org, committing changes, etc.  Everything worked smoothly.

This morning I fetched/merged (it seemed successful) and then proceeded to make a change.  When I went to git-status to stage and commit the change, I was surprised to see a bunch of files in my staged list.  They are mostly css files, some others.  There are no actual changes in the files themselves.  These files don't mean anything to me (I wasn't working with them.)  The unstaged change is the change I was working on, so that is expected.
Comment 1 Susan McCourt CLA 2011-05-25 13:25:17 EDT
Transferring bug to Tomasz.
My username is sfranklin (same password we were all give initially).

I apologize in advance if it turns out this bug has already been fixed.  Now that we are self-hosting on orion.eclipse.org, it means that I'm running server code that is aging during the week.  Since the problem involves my particular git repo on the server, I can't simply go to the localhost and figure out if the problem has been fixed.
Comment 2 Boris Bokowski CLA 2011-05-25 13:50:12 EDT
(In reply to comment #1)
> I apologize in advance if it turns out this bug has already been fixed.  Now
> that we are self-hosting on orion.eclipse.org, it means that I'm running server
> code that is aging during the week.

I am wondering if we are going to need an easier and quicker way of upgrading the server in cases that affect self-hosting. Could we use p2 for this?
Comment 3 libing wang CLA 2011-05-25 13:51:04 EDT
I am having the same issue as Susan does.
Comment 4 Susan McCourt CLA 2011-05-25 14:02:12 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > I apologize in advance if it turns out this bug has already been fixed.  Now
> > that we are self-hosting on orion.eclipse.org, it means that I'm running server
> > code that is aging during the week.
> 
> I am wondering if we are going to need an easier and quicker way of upgrading
> the server in cases that affect self-hosting. Could we use p2 for this?

I talked to John on IRC about doing more frequent I-builds.  He said it's trivial to install a new server so I don't think we have to build a p2 upgrade strategy, it's more just deciding when the builds happen, who tags, when orion.eclipse.org goes down for the upgrade.  Sounds like a good discussion for tomorrow's meeting.
Comment 5 Tomasz Zarna CLA 2011-05-26 04:18:42 EDT
(In reply to comment #1)
> Since the problem involves my particular
> git repo on the server, I can't simply go to the localhost and figure out if the
> problem has been fixed.

I will try to export the project to a SFTP server and then run it on localhost.

(In reply to comment #4)
> it's more just deciding when the builds happen, who tags, when
> orion.eclipse.org goes down for the upgrade.

I would automatically promote an I-build with "all-tests passed" status. Or even better, a clean N-build could be tagged first and then promoted.
Comment 6 Tomasz Zarna CLA 2011-05-26 04:37:22 EDT
(In reply to comment #5)
> I will try to export the project to a SFTP server and then run it on localhost.

According to bug 343307 this won't work, .git folder, which holds crucial data to figure out what's happening, is skipped during export.

Is there any change you know if those css files part of the fetch result you did before you went to git-status page?
Comment 7 libing wang CLA 2011-05-26 09:05:53 EDT
(In reply to comment #6)
 
> Is there any change you know if those css files part of the fetch result you
> did before you went to git-status page?
I had exactly the same issue.After merge I got whole bunch of CSS file staged.
I went through all the commits I merged and found a lot of files are merged into.
Seems all the staged css files are coming from the merge but wonder why only CSS are staged.
Comment 8 Susan McCourt CLA 2011-05-26 11:53:17 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > I will try to export the project to a SFTP server and then run it on localhost.
> 
> According to bug 343307 this won't work, .git folder, which holds crucial data
> to figure out what's happening, is skipped during export.
> 
> Is there any change you know if those css files part of the fetch result you
> did before you went to git-status page?

The files were not anything I had been touching. I don't think Simon has touched the css files since the original moving around.  Simon?  

In the screenshot, the other files that showed up were the files under the /sites directory.  Not sure why those in particular.
Comment 9 Susan McCourt CLA 2011-05-26 11:55:02 EDT
random guess here, could this have anything to do with bug 347314?
Comment 10 Boris Bokowski CLA 2011-05-26 19:40:29 EDT
Note that the "download as a zip" action will include the .git folder in the resulting zip file. This is useful for recovering from weird states by first downloading everything and then using the command line Git client.
Comment 11 Tomasz Zarna CLA 2011-05-27 09:11:12 EDT
(In reply to comment #10)
> Note that the "download as a zip" action will include the .git folder in the
> resulting zip file.

Thanks for the tip, I was looking for that action in the context menu. Missed the down arrow next to it.

After downloading Susan's project here is "git status" output from msysgit:
$ git status -s
 M bundles/org.eclipse.orion.client.core/static/edit/setup.js

What is strange, no sign of CSS files here. I'm investigating...
Comment 12 Tomasz Zarna CLA 2011-05-27 09:47:41 EDT
Created attachment 196755 [details]
screenshot taken on localhost

The project seems to be in good health when imported into Orion hosted locally.
Comment 13 Tomasz Zarna CLA 2011-05-27 10:26:35 EDT
I've also got an exported project from Libing. His case did look similar at first but msysgit returned a different result:

$ git status -s
MM bundles/org.eclipse.orion.client.core/static/compare/compare.css
MM bundles/org.eclipse.orion.client.core/static/edit/edit.css
MM bundles/org.eclipse.orion.client.core/static/index.css
MM bundles/org.eclipse.orion.client.core/static/navigate/table.css
MM bundles/org.eclipse.orion.client.core/static/navigate/tree.css
MM bundles/org.eclipse.orion.client.core/static/plugin/install.css
MM bundles/org.eclipse.orion.client.core/static/plugin/list.css
MM bundles/org.eclipse.orion.client.core/static/search/search.css
MM bundles/org.eclipse.orion.client.core/static/sites/site.css
MM bundles/org.eclipse.orion.client.core/static/sites/siteService.js
MM bundles/org.eclipse.orion.client.core/static/sites/siteTree.js
MM bundles/org.eclipse.orion.client.core/static/sites/siteUtils.js
MM bundles/org.eclipse.orion.client.core/static/sites/sites.css
MM bundles/org.eclipse.orion.client.core/static/test/unittest.css
MM bundles/org.eclipse.orion.client.git/static/git-clone.css
MM bundles/org.eclipse.orion.client.git/static/git-status.css
 M bundles/org.eclipse.orion.client.git/static/js/git-status/git-status-table.js
MM bundles/org.eclipse.orion.client.users.ui/static/profile/manage-users.css
MM bundles/org.eclipse.orion.client.users.ui/static/profile/user-profile.css

which is the same list Git Status page showed on Orion@localhost (good). What was strange was diff result:

diff --git a/bundles/org.eclipse.orion.client.core/static/compare/compare.css b/bundles/bundles/org.eclipse.orion.client.core/static/compare/compare.css old mode 100755 new mode 100644
...

Not sure what caused this.
Comment 14 Tomasz Zarna CLA 2011-05-27 10:55:08 EDT
(In reply to comment #13)
> diff --git a/bundles/org.eclipse.orion.client.core/static/compare/compare.css
> b/bundles/bundles/org.eclipse.orion.client.core/static/compare/compare.css old
> mode 100755 new mode 100644
> ...

I think I've found the culprit: Git stores the entire file permission mask, but during a checkout it gets messed up.
http://superuser.com/questions/204757/git-chmod-problem-checkout-screws-exec-bit

A solution is always the same: "git config core.filemode false". I'm checking if JGit respects that setting, we already know it doesn't support all config options (bug 301775).
Comment 15 Tomasz Zarna CLA 2011-05-27 11:03:12 EDT
(In reply to comment #14)
> A solution is always the same: "git config core.filemode false". I'm checking if
> JGit respects that setting

Luckily for us it does, so a solution for Libining's case would be setting that option to "false" for each clone (created) in Orion.
Comment 16 Tomasz Zarna CLA 2011-05-27 11:20:42 EDT
Setting added in http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=8f66d33069e05fe91014550ba5b71c0cd301060e. As for Susan's case I assume it's a matter of upgrading to a newer version of Orion (see comment 12). If not, feel free to reopen the bug.
Comment 17 Boris Bokowski CLA 2011-05-27 15:34:16 EDT
So this seems to have been triggered by a bunch of css files that have their execute bit set in the Git repository. It would be good to investigate if Orion/JGit can cause this to happen, or if it is something that came in through the command line client:

bokowski$ find . -type f -perm -100 -print
./org.eclipse.orion.client.core/static/compare/compare.css
./org.eclipse.orion.client.core/static/edit/edit.css
./org.eclipse.orion.client.core/static/index.css
./org.eclipse.orion.client.core/static/navigate/table.css
./org.eclipse.orion.client.core/static/navigate/tree.css
./org.eclipse.orion.client.core/static/plugin/install.css
./org.eclipse.orion.client.core/static/plugin/list.css
./org.eclipse.orion.client.core/static/search/search.css
./org.eclipse.orion.client.core/static/sites/site.css
./org.eclipse.orion.client.core/static/sites/site.js
./org.eclipse.orion.client.core/static/sites/sites.css
./org.eclipse.orion.client.core/static/sites/sites.js
./org.eclipse.orion.client.core/static/sites/siteService.js
./org.eclipse.orion.client.core/static/sites/siteTree.js
./org.eclipse.orion.client.core/static/sites/siteUtils.js
./org.eclipse.orion.client.core/static/test/unittest.css
./org.eclipse.orion.client.git/static/git-clone.css
./org.eclipse.orion.client.git/static/git-status.css
./org.eclipse.orion.client.users.ui/static/profile/manage-users.css
./org.eclipse.orion.client.users.ui/static/profile/user-profile.css

These files should not have the execute bit set. I'll commit a fix for that.
Comment 18 Boris Bokowski CLA 2011-05-27 15:39:29 EDT
Hmm, looks like somebody else fixed the problem already.

However, there are a bunch of new files now that have the execute bit set. Simon, can you please check your local Git configuration?


bokowski$ find . -type f -perm -100 -print
./org.eclipse.orion.client.core/static/dojox/embed/Flash.js
./org.eclipse.orion.client.core/static/dojox/embed/flashVars.js
./org.eclipse.orion.client.core/static/dojox/form/FileUploader.js
./org.eclipse.orion.client.core/static/dojox/html/styles.js
./org.eclipse.orion.client.core/static/dojox/layout/ToggleSplitter.js
./org.eclipse.orion.client.core/static/dojox/lib/main.js
./org.eclipse.orion.client.core/static/js-tests/requirejs-pluginRegistry/test.html
./org.eclipse.orion.client.core/static/js-tests/requirejs-pluginRegistry/testcase.js
./org.eclipse.orion.client.core/static/js-tests/requirejs-pluginRegistry/testPlugin.html
./org.eclipse.orion.client.core/static/js-tests/requirejs-preferences/test.html
./org.eclipse.orion.client.core/static/js-tests/requirejs-preferences/testcase.js
./org.eclipse.orion.client.core/static/js-tests/requirejs-preferences/testPlugin.html
./org.eclipse.orion.client.core/static/js-tests/requirejs-serviceRegistry/test.html
./org.eclipse.orion.client.core/static/js-tests/requirejs-serviceRegistry/testcase.js
./org.eclipse.orion.client.core/static/orion/assert.js
./org.eclipse.orion.client.core/static/orion/plugin.js
./org.eclipse.orion.client.core/static/orion/preferences.js
./org.eclipse.orion.client.core/static/orion/service.js
./org.eclipse.orion.client.core/static/orion/test.js
./org.eclipse.orion.client.core/static/requirejs/i18n.js
./org.eclipse.orion.client.core/static/requirejs/order.js
./org.eclipse.orion.client.core/static/requirejs/require.js
./org.eclipse.orion.client.core/static/requirejs/text.js

Also, how come we now have dojox files in org.eclipse.orion.client.core?
Comment 19 Boris Bokowski CLA 2011-05-27 15:41:20 EDT
I've fixed the permissions of the new files from the previous comment.
Comment 20 Simon Kaegi CLA 2011-05-27 15:49:38 EDT
Sorry and thanks Boris -- I've now set...
git config core.filemode false
Comment 21 Simon Kaegi CLA 2011-05-27 15:52:33 EDT
(In reply to comment #20)
> Sorry and thanks Boris -- I've now set...
> git config core.filemode false

Incidentally my earlier problems with seeing a bunch of unchanged files in the Orion Git Status page are now gone so file permissions was likely the culprit.
Comment 22 Susan McCourt CLA 2011-10-21 11:37:36 EDT
*** Bug 347384 has been marked as a duplicate of this bug. ***