Skip to content

Examples #5

Open
Open

Description

@serhatsarica

Could you please include usage examples as well?

Activity

  1. aehimself commented on May 30, 2026

    @aehimself

    I'm trying to put together a class which encapsulates all libgit2 API calls and exposes Delphi types only. Feel free to check it out for examples / use it as it is.

    https://github.com/aehimself/AEGitrepository

  2. iceberg53 commented on Jun 25, 2026

    @iceberg53

    I'm also working on a GUI using this library at https://github.com/iceberg53/GitBuddy . There's a class where I put most of my git functions and this could help you.

  3. aehimself commented on Jun 26, 2026

    @aehimself

    My version improved a lot since it's birth. Now I have a fully object-oriented way to access everything, like...

    repo := TAEGitRepository.Create;
    repo.GitRepositoryDirectory := 'C:\My\Repos\repo001';

    For var filename In repo.Workspace.FileNames Do
    Begin
    WriteLn('File ' + filename + ' has been changed');

    WriteLn(repo.Workspace.Files[filename].Diff); // print HEAD -> workspace diff
    WriteLn(repo.Workspace.Files[filename].StagedDiff); // print workspace -> index diff
    End;

    For var a := 0 To repo.Stashes.Count - 1 Do
    Begin
    repo.Stashes[a].Drop;
    End;

    At the moment I'm working on the file diff in files changed in stash entries. After a little bit of battle-testing I'll push my local changes upstream.

    My GUI is different, I wanted one tool to handle each and every git repository I have in the most compact manner:

    Image

    With a single glance you see incoming, outgoing commit amounts, number of changed files, can change branches. By expanding the panel you see the changed file list where you can stage, unstage or revert. Full branch / stash handling functionality (except merge, I don't like merge) is available in the dotted menu.

    I might opensource that one too, once it's stable enough... :)

  4. iceberg53 commented on Jun 27, 2026

    @iceberg53

    My version improved a lot since it's birth. Now I have a fully object-oriented way to access everything, like...

    repo := TAEGitRepository.Create; repo.GitRepositoryDirectory := 'C:\My\Repos\repo001';

    For var filename In repo.Workspace.FileNames Do Begin WriteLn('File ' + filename + ' has been changed');

    WriteLn(repo.Workspace.Files[filename].Diff); // print HEAD -> workspace diff WriteLn(repo.Workspace.Files[filename].StagedDiff); // print workspace -> index diff End;

    For var a := 0 To repo.Stashes.Count - 1 Do Begin repo.Stashes[a].Drop; End;

    At the moment I'm working on the file diff in files changed in stash entries. After a little bit of battle-testing I'll push my local changes upstream.

    My GUI is different, I wanted one tool to handle each and every git repository I have in the most compact manner:

    Image With a single glance you see incoming, outgoing commit amounts, number of changed files, can change branches. By expanding the panel you see the changed file list where you can stage, unstage or revert. Full branch / stash handling functionality (except merge, I don't like merge) is available in the dotted menu.

    I might opensource that one too, once it's stable enough... :)

    It looks good and I'll take a look to learn more about the right way to use the library. I'm still new to Lazarus and Free Pascal so I could really benefit from more experienced guys.

  5. aehimself commented on Jun 28, 2026

    @aehimself

    I realized that Git actually supports having stable and not-so-stable versions in the same repository. I uploaded the object-oriented version in the experiemental branch, feel free to check it out.
    This is how I imagined a library handling Git repositories.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions