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

Bug 317882

Summary: Corrupted file in 0.8.4 tarball
Product: [Technology] EGit Reporter: Severin Gehwolf <sgehwolf>
Component: CoreAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: caniszczyk, christian.halstrick, niels, sgehwolf, sop
Version: unspecified   
Target Milestone: 0.11-M1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Bad BranchSelectionDialog.java
none
Fixed BranchSelectionDialog.java none

Description Severin Gehwolf CLA 2010-06-24 17:05:10 EDT
I'm currently packaging egit 0.8.4 (Fedora rawhide) and got the tarball via http://egit.eclipse.org/w/?p=egit.git;a=snapshot;h=6b528445c3e543688b990e0a631c5f0238b02741;sf=tbz2

It seems that the first few bits of egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java are corrupted. When trying to build egit 0.8.4 it failed, due to compilation errors. 

  [javac] 183. ERROR in /path/to/BranchSelectionDialog.java (at line 1)
    [javac] 	???/*******************************************************************************
    [javac] 	^^^
    [javac] Syntax error on tokens, delete these tokens
    [javac] ----------


I was unable to solve the problem via a patch (patch fails to apply for reasons I'm not aware of). So I've created a new file, replacing the first line. Something along those lines:

NR=$(expr `wc -l egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java` - 1)
tail -n$NR egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java > part2.java
echo "/*******************************************************************************" > part1.java
cat part1.java part2.java > egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java

And it built fine. Then, I tried checking out sources from command line using the git client:

git clone git://egit.eclipse.org/egit.git egit
cd egit
git checkout 6b528445c3e543688b990e0a631c5f0238b02741
cd ..
tar -cjf egit_test.tar.bz2 egit

just to make sure that it isn't a problem of how tarballs are created when using the above URL. It seems the file in the repository is corrupted (although I'm not entirely convinced).

Thoughts?

Also, I have been working on a current snapshot first. I.e. upcoming 0.9.0. In that snapshot, de067ee2b18bb50d412eb6c111c42770733b3c18 or http://egit.eclipse.org/w/?p=egit.git;a=snapshot;h=de067ee2b18bb50d412eb6c111c42770733b3c18;sf=tbz2 there seem to be two corrupted files:

egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java

and

egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java
Comment 1 Chris Aniszczyk CLA 2010-06-24 20:27:18 EDT
Hrmm, will investigate.
Comment 2 Severin Gehwolf CLA 2010-08-26 12:13:48 EDT
The same thing is happening for snapshots of master (i.e. upcoming 0.9.0). It's happening for org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java and org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java.

Here is what I'm doing to make it compile:

NR=$((`wc -l egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java | \
     cut -d' ' -f1` - 1))
tail -n$NR egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java > part2.java
echo "/*******************************************************************************" > part1.java
cat part1.java part2.java > egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
NR=$((`wc -l egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java | \
	     cut -d' ' -f1` - 1))
	tail -n$NR egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java > part2.java
	echo "/*******************************************************************************" > part1.java
	cat part1.java part2.java > egit/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java

Could this be a gitweb problem?
Comment 3 Shawn Pearce CLA 2010-08-27 12:13:05 EDT
Seems to me that yes, its a gitweb issue.

Can you try the zip download instead of the tar?
Comment 4 Severin Gehwolf CLA 2010-08-30 14:38:43 EDT
(In reply to comment #3)
> Can you try the zip download instead of the tar?

The same problem is happening when I choose the zip format.
Comment 5 Christian Halstrick CLA 2011-01-12 04:37:53 EST
This seems to be a gitweb problem. Can you open a bug against gitweb.
Comment 6 Severin Gehwolf CLA 2011-01-12 09:45:58 EST
Anybody an idea where the Git bug tracker is homed? I can't find it :(
Comment 7 Shawn Pearce CLA 2011-01-12 09:56:56 EST
(In reply to comment #6)
> Anybody an idea where the Git bug tracker is homed? I can't find it :(

There isn't one.  You need to post a bug report to the Git mailing list, at git at vger.kernel.org.  The list is open posting, so you don't need to join to post a bug report.
Comment 8 Severin Gehwolf CLA 2011-01-12 10:03:41 EST
(In reply to comment #7)
> (In reply to comment #6)
> > Anybody an idea where the Git bug tracker is homed? I can't find it :(
> 
> There isn't one.  You need to post a bug report to the Git mailing list, at git
> at vger.kernel.org.  The list is open posting, so you don't need to join to
> post a bug report.

Alright then. Thanks Shawn.
Comment 9 Severin Gehwolf CLA 2011-01-15 10:27:42 EST
(In reply to comment #5)
> This seems to be a gitweb problem. Can you open a bug against gitweb.

Ok, so I've checked with the Git folks and they didn't seem to think this is a Git/gitweb problem. They suggested that the respective files are broken in the repository.

I don't know how they (org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java and org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java) got into this state, but this seems to be the case. What's more, Eclipse and its compiler seems to be more lenient towards files with a few broken bytes. javac not so much :)

Here's what I'd suggest:
1.) Open BranchSelectionDialog.java and GitCloneWizard.java with a hex editor (I've used and editor called "bless" on Fedora)
2.) Delete the first 3 bytes (EF BB BF), those are the problematic 3 bytes. To be clear, bless shows me ". . ." in the ASCII view before the slash of the javadoc opening token "/".
3.) Save the files and push them into the repos.

After that, I'd be good with closing this bug. For reference, I'll attached a good and a bad version of BranchSelectionDialog.java.

Thanks!
Comment 10 Severin Gehwolf CLA 2011-01-15 10:31:36 EST
Created attachment 186873 [details]
Bad BranchSelectionDialog.java
Comment 11 Severin Gehwolf CLA 2011-01-15 10:33:23 EST
Created attachment 186874 [details]
Fixed BranchSelectionDialog.java
Comment 12 Severin Gehwolf CLA 2011-01-15 10:42:36 EST
Git mailing list thread is here: http://thread.gmane.org/gmane.comp.version-control.git/165017
Comment 13 Chris Aniszczyk CLA 2011-01-18 07:26:00 EST
Fixed with 003c644906eb0d268eca95910fcf0c727de7a488.

Thanks for your patience Severin :)