diff options
author | Jesse Luehrs <doy@tozt.net> | 2024-02-23 00:04:34 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2024-02-23 00:04:34 -0500 |
commit | 5744b78be0d7ff168dcaf777c2f98818aab3862f (patch) | |
tree | 7ec8378834b61ed3ebf7c66bcaaa7d08d1b72787 /local | |
parent | 82afe435a24f4ea88182f3051e6837d5d6c0d68a (diff) | |
download | conf-5744b78be0d7ff168dcaf777c2f98818aab3862f.tar.gz conf-5744b78be0d7ff168dcaf777c2f98818aab3862f.zip |
git helpers should be installed with git, not with the other bin files
Diffstat (limited to 'local')
-rwxr-xr-x | local/.bin/git/git-amend | 13 | ||||
-rwxr-xr-x | local/.bin/git/git-blame-stats | 37 | ||||
-rwxr-xr-x | local/.bin/git/git-default-branch | 4 | ||||
-rwxr-xr-x | local/.bin/git/git-file-size | 5 | ||||
-rwxr-xr-x | local/.bin/git/git-pr | 5 | ||||
-rwxr-xr-x | local/.bin/git/git-record | 13 | ||||
-rwxr-xr-x | local/.bin/git/git-root | 9 |
7 files changed, 0 insertions, 86 deletions
diff --git a/local/.bin/git/git-amend b/local/.bin/git/git-amend deleted file mode 100755 index 3b937ec..0000000 --- a/local/.bin/git/git-amend +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -eu - -if [ -e "$(git root)/.git/branchless" ]; then - exec git branchless amend "$@" -else - if [ "${1:-}" = "-i" ]; then - git add -p - else - git add -u - fi - git commit --amend -fi diff --git a/local/.bin/git/git-blame-stats b/local/.bin/git/git-blame-stats deleted file mode 100755 index 320d755..0000000 --- a/local/.bin/git/git-blame-stats +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/perl - -use Getopt::Long; -use POSIX qw(ceil); -use strict; -Getopt::Long::Configure(qw(bundling)); -my %authors; -my $total; -my $files; -my $rev = shift(@ARGV) || "HEAD"; - -foreach my $file (`git ls-tree --name-only -r $rev`) { - chomp($file); - print STDERR "Processing $file\n"; - foreach my $line (`git blame -M -w $rev -- "$file"`) { - chomp($line); - if (substr($line, 0, 1) eq "^") { - ++$authors{"*initial checkin"}; - } else { - $line =~ s[^.*?\((.*?)\s*\d{4}-\d{2}-\d{2}.*][$1]; - ++$authors{$line}; - } - ++$total; - } -} - -print "Total lines: $total\n"; -my $i = 0; -my $author_ind = ceil(log(scalar(keys %authors)) / log(10)); -my $lines_ind = ceil(log($total) / log(10)); -foreach my $author (sort { $authors{$b} <=> $authors{$a} } keys %authors) { - printf "%${author_ind}s %${lines_ind}u %5.2f%% %s\n", - sprintf("#%u", ++$i), - $authors{$author}, - $authors{$author} * 100 / $total, - $author; -} diff --git a/local/.bin/git/git-default-branch b/local/.bin/git/git-default-branch deleted file mode 100755 index 90e225f..0000000 --- a/local/.bin/git/git-default-branch +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -git symbolic-ref refs/remotes/origin/HEAD | sed 's/.*\///' diff --git a/local/.bin/git/git-file-size b/local/.bin/git/git-file-size deleted file mode 100755 index 0e7d00d..0000000 --- a/local/.bin/git/git-file-size +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -eu -set -o pipefail - -git ls-files -z | xargs -0 du -b | sum diff --git a/local/.bin/git/git-pr b/local/.bin/git/git-pr deleted file mode 100755 index 61346bc..0000000 --- a/local/.bin/git/git-pr +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pr_num="$1" -upstream="${2-origin}" -git fetch "$upstream" "pull/${pr_num}/head:pull-${pr_num}" diff --git a/local/.bin/git/git-record b/local/.bin/git/git-record deleted file mode 100755 index eaa36c9..0000000 --- a/local/.bin/git/git-record +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -eu - -if [ -e "$(git root)/.git/branchless" ]; then - exec git branchless record "$@" -else - if [ "${1:-}" = "-i" ]; then - git add -p - else - git add -u - fi - git commit -fi diff --git a/local/.bin/git/git-root b/local/.bin/git/git-root deleted file mode 100755 index 96fb395..0000000 --- a/local/.bin/git/git-root +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -eu - -root="$(git rev-parse --show-superproject-working-tree 2>/dev/null)" -if [ -n "$root" ]; then - echo "$root" -else - git rev-parse --show-toplevel -fi |