You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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:
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... :)
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:
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.
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.
Activity
aehimself commentedon May 30, 2026
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
iceberg53 commentedon Jun 25, 2026
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.
aehimself commentedon Jun 26, 2026
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:
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... :)
iceberg53 commentedon Jun 27, 2026
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.
aehimself commentedon Jun 28, 2026
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.