Skip to content
/ AmpScm Public

AmpScm aims to empower/"Amplify" Source Code management tooling.

License

Notifications You must be signed in to change notification settings

AmpScm/AmpScm

Repository files navigation

AmpScm - Amplifying your Git Source Code Management

CI

This project provides a few layers of tools that allow accessing your repository from .Net without external dependencies. Unlike the libGit2 apis the code is completely managed, 100% Apache 2 Licensed, and uses many optional modern Git optimizations (E.g. commit chains, bitmap indexes, etc.) to improve performance over just scanning the repository. So all of this is available for Windows, Linux, Mac OS and even mobile platforms with .Net support (Android, iOS).

To allow easy embedding everything is implemented streamy instead of memory mapped files, to allow working in memory restrained circumstances (like 32 bit code), or as plugin in an existing application.

AmpScm.Buckets

latest version

This library provides zero-copy stream layering over different datasources, modeled like the Apache Serf buckets, but then completely .Net based and fully Async enabled. When you read a bit of data the least amount of work necessary is done up the tree, and only if the highest upper layer reports a delay the task is waiting.

AmpScm.Git.Repository

latest version

Completely managed Git repository level library, providing access to the repository as both IQueryable<> and IAsyncQueryable<>, to allow extending the repository walk algorithm with simple linq interaction.

Soon walking history should be as easy as something like:

// Async
using AmpScm.Git;
    
using (var repo = await GitRepository.OpenAsync(Environment.CurrentDirectory))
{
    await foreach (var r in repo.Head.Revisions)
    {
        Console.WriteLine($"commit {r.Commit.Id}");
        Console.WriteLine($"Author: {r.Commit.Author}"); // Includes timestamp
        Console.WriteLine("");
        Console.WriteLine(r.Commit.Message?.TrimEnd() + "\n");
    }
}

Of course you can also use the non async api if needed. This repository layer is built on top of Amp.Buckets via AmpScm.Buckets.Git, which could be used separately if you want to write your own repository layer.

The IAsyncQueryable<T> support is supported via the hopefully temporary AmpScm.Linq.AsyncQueryable, to avoid usage conflicts between the async and non async implementations that occur when you implement both. (Let's hope this will be fixed in the BCL)

// Non-Async
using AmpScm.Git;
    
using (var repo = GitRepository.Open(Environment.CurrentDirectory))
{
    foreach (var r in repo.Head.Revisions)
    {
        Console.WriteLine($"commit {r.Commit.Id}");
        Console.WriteLine($"Author: {r.Commit.Author}"); // Includes timestamp
        Console.WriteLine("");
        Console.WriteLine(r.Commit.Message?.TrimEnd() + "\n");
    }
}

Currently this library is mostly read-only, but writing simple database entities (blob, commit, tree, tag) to the object store is supported.

AmpScm.Git.Client

latest version

Built on top of the git repository is an early release quick and dirty Git client layer, which forwards operations to the git plumbing code. Mostly intended for testing the lower layers, but probly useful for more users. May become a more advanced client later on.

Git On Disk Format Support

Feature GIT LibGit2 JGit AmpScm
Loose Objects Yes Yes Yes Yes
Packed Object Files Yes Yes Yes Yes
Loose References Yes Yes Yes Yes
Packed References Yes Yes Yes Yes
Sha256 Repositories Yes No No Yes
Reference Table format Expected Soon No Yes Expected Soon
Reference Log Yes Yes Yes Yes
Multipack index Yes Yes No Yes
CommitGraph Yes Yes Soon Yes
Bitmap index Packfiles Yes No Yes Yes
Bitmap index Multipack Index Yes No No Yes
Reverse index Packfiles Yes No No Yes
Reverse index Multipack Index Yes No No Yes
Directory Index format 2,3 Yes Yes Yes Yes
Directory Index format 4 Yes Yes Yes Yes
Split Directory Index format Yes No No Yes
Sparse Index (Cone) support Yes No No Yes
Fast Import support Yes No No Yes
Bundle support Yes No No Yes
'mergetag' (inspect) support Yes No No Yes
OpenPGP signature verification Yes No No Yes
(Open)SSH signature verification Yes No No Yes