Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312892 - Permanent deletion of incorrect version of Spring JARs
Summary: Permanent deletion of incorrect version of Spring JARs
Status: RESOLVED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Git (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eclipse Webmaster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 07:38 EDT by Glyn Normington CLA
Modified: 2010-06-01 13:12 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glyn Normington CLA 2010-05-14 07:38:32 EDT
In git.eclipse.org/gitroot/virgo/org.eclipse.virgo.kernel-tools.git, commit 94f03d4bd0b865e5e8adf16e0b5538f843027aa2 deletes the following 3 files which were checked in in error:

* org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.beans-2.5.4.A.jar

* org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.context-2.5.4.A.jar

* org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.core-2.5.4.A.jar

Please could you permanently delete these files. Thanks.
Comment 1 Denis Roy CLA 2010-05-14 09:41:07 EDT
My first one!  Here's what I did... Can you please confirm that it worked?

node2:/gitroot/virgo/org.eclipse.virgo.kernel-tools.git # git filter-branch --tree-filter 'rm -f src/test/resources/dependency-locator/repository/bundles/org.springframework.beans-2.5.4.A.jar' HEAD
Rewrite 94f03d4bd0b865e5e8adf16e0b5538f843027aa2 (3/3)
WARNING: Ref 'refs/heads/master' is unchanged

node2:/gitroot/virgo/org.eclipse.virgo.kernel-tools.git # git filter-branch --tree-filter 'rm -f src/test/resources/dependency-locator/repository/bundles/org.springframework.context-2.5.4.A.jar' HEAD
Rewrite 94f03d4bd0b865e5e8adf16e0b5538f843027aa2 (3/3)
WARNING: Ref 'refs/heads/master' is unchanged

node2:/gitroot/virgo/org.eclipse.virgo.kernel-tools.git # git filter-branch --tree-filter 'rm -f src/test/resources/dependency-locator/repository/bundles/org.springframework.core-2.5.4.A.jar' HEAD
Rewrite 94f03d4bd0b865e5e8adf16e0b5538f843027aa2 (3/3)
WARNING: Ref 'refs/heads/master' is unchanged
Comment 2 Glyn Normington CLA 2010-05-14 10:02:54 EDT
(In reply to comment #1)
> My first one!  Here's what I did... Can you please confirm that it worked?

I'm afraid it didn't work. Here's what I did to obtain the files which should have gone:

[gnormington-desktop:virgo]$ git clone ssh://gnormington@git.eclipse.org/gitroot/virgo/org.eclipse.virgo.kernel-tools.git
Initialized empty Git repository in /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/.git/
remote: Counting objects: 130, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 130 (delta 18), reused 0 (delta 0)
Receiving objects: 100% (130/130), 3.29 MiB | 271 KiB/s, done.
Resolving deltas: 100% (18/18), done.
[gnormington-desktop:virgo]$ cd org.eclipse.virgo.kernel-tools/
[gnormington-desktop:org.eclipse.virgo.kernel-tools master]$ git checkout 7e6862d6d22efdf548f4127e0f075f9e2d33c1c4
Note: moving to '7e6862d6d22efdf548f4127e0f075f9e2d33c1c4' which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at 7e6862d... initial checkin from dm Server kernel-tools repository  commit ed98bf2ecf8afee3b53daeaabe31546295a8f4a8
[gnormington-desktop:org.eclipse.virgo.kernel-tools (no branch)]$ find . -name "*.jar"
./org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/lib/com.springsource.org.apache.commons.logging-1.1.1.jar
./org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/lib/org.eclipse.osgi-3.4.0.v20080529-1200.jar
./org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.beans-2.5.4.A.jar
./org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.context-2.5.4.A.jar
./org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.core-2.5.4.A.jar

I tried a variation on what you did (http://github.com/guides/completely-remove-a-file-from-all-revisions), but that didn't work either. If we get stuck, we can blow this repo away and re-create it from scratch with the correct files. But feel free to use this to learn the technique. :-)
Comment 3 Denis Roy CLA 2010-05-14 13:57:21 EDT
This command is about the only one that yields "Ref 'refs/heads/master' was rewritten"

git filter-branch --index-filter 'git rm --cached --ignore-unmatch ./org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.beans-2.5.4.A.jar' HEAD

However, after running this, git clone says I've cloned an empty repo  :/
Comment 4 Denis Roy CLA 2010-05-14 14:13:40 EDT
I've reverted the repo to its previous state.

Shawn, I really hate to bring you in on this, but herein lies the most frequent use case of code removal we'll ever see here at Eclipse.  I've followed every doc I could find with no luck.  Do you have any clues as to what I'm doing wrong?
Comment 5 Shawn Pearce CLA 2010-05-14 14:25:43 EDT
$ git filter-branch --index-filter 'git rm --cached --ignore-unmatch org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.beans-2.5.4.A.jar org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.context-2.5.4.A.jar org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.core-2.5.4.A.jar' master

Rewrite 7e6862d6d22efdf548f4127e0f075f9e2d33c1c4 (2/3)
rm 'org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.beans-2.5.4.A.jar'
rm 'org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.context-2.5.4.A.jar'
rm 'org.eclipse.virgo.kernel.tools/src/test/resources/dependency-locator/repository/bundles/org.springframework.core-2.5.4.A.jar'
Rewrite 94f03d4bd0b865e5e8adf16e0b5538f843027aa2 (3/3)
Ref 'refs/heads/master' was rewritten

$ git push --force master

Compare with what you had before, you used --tree-filter not --index-filter, and you had the wrong file paths.  So actually maybe what you had in comment #1 would have worked... if you had the right file paths as listed by Glyn in comment 0.  But if all you are doing is rms of files, --index-filter is *way* faster.  So that would be what you want to document/script-in-a-utility.
Comment 6 Denis Roy CLA 2010-05-14 15:39:09 EDT
Shawn, thanks for the clue.  I was trying to do all this as root on the central repo.

So I've removed the files.  Of course, this rewrites all your history, and all your sha1 ids have changed.  Let me know how that works out.
Comment 7 Denis Roy CLA 2010-05-14 15:41:19 EDT
$ git clone ssh://droy@git.eclipse.org/gitroot/virgo/org.eclipse.virgo.kernel-tools.git

$ git rev-list HEAD
f9e83bf74243037c1c27ffd26fde019ff686521c
3b1af4081ad4e2e6e433746f365a9178d8fee993
45f1d308a67896dae819e7a345c0fd3b1b0550fd

$ git checkout 45f1d308a67896dae819e7a345c0fd3b1b0550fd
[snip]
$ find . -name "*.jar"
$ (nothing)
Comment 8 Glyn Normington CLA 2010-05-17 04:06:49 EDT
(In reply to comment #7)
> $ git clone
> ssh://droy@git.eclipse.org/gitroot/virgo/org.eclipse.virgo.kernel-tools.git
> 
> $ git rev-list HEAD
> f9e83bf74243037c1c27ffd26fde019ff686521c
> 3b1af4081ad4e2e6e433746f365a9178d8fee993
> 45f1d308a67896dae819e7a345c0fd3b1b0550fd
> 
> $ git checkout 45f1d308a67896dae819e7a345c0fd3b1b0550fd
> [snip]
> $ find . -name "*.jar"
> $ (nothing)

Thanks. Everything seems correct now.
Comment 9 Denis Roy CLA 2010-06-01 13:12:30 EDT
Closing fixed.  Thanks for the experience!