aboutsummaryrefslogtreecommitdiff
path: root/git-construct.pl
diff options
context:
space:
mode:
authorEmil Williams2025-08-19 11:10:10 +0000
committerEmil Williams2025-08-19 11:10:10 +0000
commit7d53ee43f82cc5eda12e7f585e785933b4aa18dc (patch)
treeee88ad97ad1f95b8ec0faa46b7560508a0ede2c4 /git-construct.pl
parent0475e7bc4084d02654cf09885ac9698da40f9e77 (diff)
downloadgorillanest-7d53ee43f82cc5eda12e7f585e785933b4aa18dc.tar.xz
gorillanest-7d53ee43f82cc5eda12e7f585e785933b4aa18dc.tar.zst
Ratifying Pure Functionality Of Nothing New
Diffstat (limited to 'git-construct.pl')
-rwxr-xr-xgit-construct.pl58
1 files changed, 0 insertions, 58 deletions
diff --git a/git-construct.pl b/git-construct.pl
deleted file mode 100755
index 4024ef1..0000000
--- a/git-construct.pl
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use Git::Repository;
-use Cwd 'realpath';
-use File::Basename;
-
-use Data::Dumper;
-
-sub new_repository {
- my ($path) = @_;
- $path = realpath($path);
-
- my $name = basename($path);
- my $repo = Git::Repository->new(work_tree => $path);
-
- my @raw_branches = $repo->run('branch');
- my @branches;
-
- for my $b (@raw_branches) {
- chomp $b;
- my $is_active = 0;
-
- if ($b =~ /^\* /) {
- $b =~ s/^\* //;
- $is_active = 1;
- }
-
- my @commits;
- my @logs = $repo->run(log => $b, '--pretty=format:%H;%an;%s');
- for my $line (@logs) {
- my ($hash, $author, $message) = split /;/, $line, 3;
- push @commits, {
- hash => $hash,
- author => $author,
- message => $message,
- };
- }
-
- push @branches, {
- name => $b,
- is_active => $is_active,
- commits => \@commits,
- };
- }
-
- # first commiter as a fallback
- my $owner = ($repo->run('log', '--reverse', '--pretty=format:%an'))[0];
-
- return {
- name => $name,
- owner => $owner,
- branches => \@branches,
- };
-}
-
-print Dumper( new_repository('./') );