Bug 333620 - remove initial commit from org.eclipse.mylyn.docs repository
Summary: remove initial commit from org.eclipse.mylyn.docs repository
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: 3.7   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on: 373321
Blocks:
  Show dependency tree
 
Reported: 2011-01-05 22:27 EST by Steffen Pingel CLA
Modified: 2012-03-06 10:49 EST (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 Steffen Pingel CLA 2011-01-05 22:27:50 EST
The commit activity timeline for the Mylyn Docs project looks a bit funny due to a (meaningless) back dated commit that was necessary for the initial import from CVS: http://eclipse.org/projects/project_summary.php?projectid=mylyn.docs . What is the cleanest way to remove the commit?
Comment 1 Wayne Beaton CLA 2011-01-05 23:40:03 EST
I deleted the offending row from the database and have updated the Git log parser to ignore any records with a year earlier than 2000.

Is this the right solution? Or can we rewrite the commit's date somehow?
Comment 2 Denis Roy CLA 2011-01-06 11:26:42 EST
(In reply to comment #1)
> Or can we rewrite the commit's date somehow?

http://stackoverflow.com/questions/454734/how-can-one-change-the-timestamp-of-an-old-commit-in-git
Comment 3 Denis Roy CLA 2011-03-10 14:39:53 EST
Steffen, did you ever get this to work?
Comment 4 Steffen Pingel CLA 2011-03-10 15:14:13 EST
I have to admit I didn't try. I'll take a look after EclipseCon.
Comment 5 Steffen Pingel CLA 2011-09-26 11:49:24 EDT
I believe this command would remove the bogus initial commit:

git filter-branch --commit-filter '
		if [ "$GIT_COMMIT" = "33e5e678f27f4593b6b55764dff29daeaa9df640" ];
        then
                skip_commit "$@";
        else
                git commit-tree "$@";
        fi' HEAD --all

Since commit hashes are based on parent commits changing the initial commit necessarily means to rewrite the entire history of the org.eclipse.mylyn.docs repository.

I don't think it's worth doing that just to get rid of the commit which mostly a cosmetic problem. If we have another reason to change the history of the repository in the future (e.g. to split the repository) we should consider removing the commit as part of that.

I'll move this bug to Mylyn and to track this on our end. Thanks for the input.
Comment 6 David Green CLA 2011-09-26 14:52:43 EDT
+1 

I'd really hate to have the whole commit history rewritten
Comment 7 Steffen Pingel CLA 2012-02-25 07:24:05 EST
git clone --mirror /gitroot/mylyn/org.eclipse.mylyn.docs.git
cd org.eclipse.mylyn.docs.git
git filter-branch --commit-filter 'test "$GIT_COMMIT" = "33e5e678f27f4593b6b55764dff29daeaa9df640" && skip_commit "$@" || git commit-tree "$@"' -- --all
rm -rf refs/original/
git reflog expire --expire=now --all
git gc --aggressive --prune=now
Comment 8 Steffen Pingel CLA 2012-02-25 07:27:55 EST
This is actually causing more confusion and harm than I had previously thought, e.g. https://www.ohloh.net/p/mylyn. 

Considering that it's low risk I think we should do it now. While rewriting the history will cause some disruption the earlier we do it the better. I'll raise this on the mailing list.
Comment 9 Steffen Pingel CLA 2012-02-25 08:18:47 EST
I am proposing that we go ahead with the rewrite end of next week (March 1, 2012) as per this mail to mylyn-docs-dev: http://dev.eclipse.org/mhonarc/lists/mylyn-dev/msg01553.html
Comment 10 David Green CLA 2012-02-27 16:08:57 EST
+1
Comment 11 Steffen Pingel CLA 2012-03-05 03:57:02 EST
I have executed the steps in comment 7 on build.eclipse.org and pushed the repository to https://github.com/spingel/org.eclipse.mylyn.docs for testing.
Comment 12 Steffen Pingel CLA 2012-03-06 10:49:48 EST
This is now complete. Please reclone the repository (or pull with --force and reset with --hard to origin).