Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Chocolatey History #193

Merged
merged 21 commits into from
May 23, 2015
Merged

Import Chocolatey History #193

merged 21 commits into from
May 23, 2015

Conversation

dahlbyk
Copy link
Owner

@dahlbyk dahlbyk commented May 23, 2015

Self-imposed prerequisite to #184 (cc @ferventcoder).

Here's the bit of LibGit2Sharp I used to filter down to clean, useful history:

// git clone https://github.com/ferventcoder/chocolatey-packages.git C:\Temp\posh-git-choco
public void Rewrite()
{
    using (var repo = new Repository(@"C:\Temp\posh-git-choco"))
    {
        repo.Refs.RewriteHistory(new RewriteHistoryOptions
        {
            CommitTreeRewriter = MovePoshGit,
            PruneEmptyCommits = true,
        }, repo.Head.Commits);
    }
}

private static TreeDefinition MovePoshGit(Commit commit)
{
    var poshgit = commit.Tree["manual/poshgit"] ?? commit.Tree["poshgit"];
    return poshgit == null
               ? new TreeDefinition()
               : new TreeDefinition()
                     .Add("chocolatey", (Tree)poshgit.Target);
}

/cc @nulltoken @ben because LG2S RewriteHistory API is awesome.

ferventcoder and others added 21 commits April 30, 2011 13:30
…atest version. Adding the admin tag for packages that require administrative rights.
In detail:
* Charset to UTF-8 with BOM
* EOL to CRLF
* Insert final newline
* Trim trailing whitespace
@dahlbyk dahlbyk merged commit 2490619 into master May 23, 2015
@nulltoken
Copy link

/cc @nulltoken @ben because LG2S RewriteHistory API is awesome.

@dahlbyk 💟 @ben made it happen (and I'm so thankful to him for this) ! But you worked on it a tad, didn't you? 😉

@ben
Copy link

ben commented May 24, 2015

😘❤️

@dahlbyk
Copy link
Owner Author

dahlbyk commented May 24, 2015

Team effort 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants