diff --git a/git/git_branch_age.nu b/git/git_branch_age.nu index 43dd136..fcd477e 100755 --- a/git/git_branch_age.nu +++ b/git/git_branch_age.nu @@ -1,6 +1,15 @@ # Creates a table listing the branches of a git repository and the day of the last commit -git branch | lines | str substring 2, | wrap name | insert "last commit" { - get name | each { - git show $it --no-patch --format=%as - } -} | sort-by "last commit" +def "git age" [] { + git branch | + lines | + str substring 2, | + wrap name | + insert date { + get name | + each { + git show $it --no-patch --format=%as | str to-datetime + } + } | + sort-by date +} +