Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348135

Summary: [server] Fetch & Merge leaves behind empty directories
Product: [ECD] Orion Reporter: Boris Bokowski <bokowski>
Component: GitAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Szymon.Brandys
Version: unspecified   
Target Milestone: 0.3 M1   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on: 349848    
Bug Blocks:    
Attachments:
Description Flags
screen shot showing the path and the extra directories none

Description Boris Bokowski CLA 2011-06-02 16:02:22 EDT
I did a fetch and merge for org.eclipse.orion.client on org.eclipse.orion as well as for my local clone using the command line.

On Orion, I ended up with a bunch of empty directories that I do not see on my local file system. Is JGit leaving behind empty directories?
Comment 1 Boris Bokowski CLA 2011-06-02 16:03:11 EDT
Created attachment 197268 [details]
screen shot showing the path and the extra directories
Comment 2 John Arthorne CLA 2011-06-02 16:11:39 EDT
Yep, I hadn't noticed but I am seeing this too. Git doesn't seem to handle empty directories very well... I just tried creating an empty directory and command line git didn't consider that a change.
Comment 3 Boris Bokowski CLA 2011-06-07 16:00:43 EDT
Do we know what's going on here? Is JGit to blame? We should try our best to fix this for 0.2.
Comment 4 Tomasz Zarna CLA 2011-06-09 11:27:34 EDT
(In reply to comment #0)
> I did a fetch and merge for org.eclipse.orion.client on org.eclipse.orion as
> well as for my local clone using the command line.

What kind of change were you merging? I put up a quick unit test in JGit and there was no sign of a folder after merging in a commit that removed it on a different branch.

> On Orion, I ended up with a bunch of empty directories that I do not see on my
> local file system.

Are you saying that the result in Orion/JGit was different then using the command line?

(In reply to comment #2)
> I just tried creating an empty directory and command line git didn't consider that a change.

Right, git doesn't track directories.
Comment 5 Tomasz Zarna CLA 2011-06-09 11:33:43 EDT
(In reply to comment #4)
> I put up a quick unit test in JGit and there was no sign of a folder after merging 
> in a commit that removed it on a different branch.

Moreover, when I merged in a change that removed the only file in a folder, the folder was gone as well.

I'm trying to figure out what happened in comment 0.
Comment 6 Tomasz Zarna CLA 2011-06-20 07:46:08 EDT
(In reply to comment #4)
> (In reply to comment #0)
> > I did a fetch and merge for org.eclipse.orion.client on org.eclipse.orion as
> > well as for my local clone using the command line.
> 
> What kind of change were you merging?

Let my answer my own question, I believe it was http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=7d1ab0496245ee5a207827dc7314b250f9a955f8.
Comment 7 Malgorzata Janczarska CLA 2011-06-20 09:48:51 EDT
Boris, did you have the project from Orion imported to your Eclipse workspace? In opposite to the one you fetched via console?
I also noticed that the old folders were left behind in my workspace, so I tried to reproduce the same scenario again. From other clone I pushed some commits with deletes and renames and every time doing fetch and merge deleted the folders. So I'm starting to think that there might have been some operations done by my Eclipse (with egit and webtools) that made the folders stay, for instance keeping some temporary files that were removed after git operation was finished.
Comment 8 Boris Bokowski CLA 2011-06-20 11:06:03 EDT
(In reply to comment #7)
> Boris, did you have the project from Orion imported to your Eclipse workspace?
> In opposite to the one you fetched via console?

No, like I said in comment 0 the problem happened on orion.eclipse.org, which has no Eclipse workspace.
Comment 9 Tomasz Zarna CLA 2011-06-20 12:23:32 EDT
It's a bug in JGit, see the blocking bug or go straight to http://egit.eclipse.org/r/3756 where a failing test and a fix proposal have been submitted.
Comment 10 Boris Bokowski CLA 2011-06-20 13:23:20 EDT
          What    |Removed                     |Added
----------------------------------------------------------------------------
          Priority|P2                          |P3
          Severity|major                       |normal

How is this not a major loss of function?
Comment 11 Tomasz Zarna CLA 2011-06-22 04:13:58 EDT
(In reply to comment #10)
> How is this not a major loss of function?

If we consider "merge" as a function it's definitely "not lost". It works fine, except for those leftovers, which are harmless and happen rarely. To be clear, it is a bug, no question about it (see comment 9).
Comment 12 Tomasz Zarna CLA 2011-07-18 12:16:44 EDT
This has been fixed with bug 349848 but added a test verifying the fix here: http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=4823dd9af54cfa6cad35be94609dab9ece72b632