go-git

command module
v0.0.0-...-7498d52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2025 License: Unlicense Imports: 0 Imported by: 0

README

go-git

Purpose

Take the following git alias and make it faster with Go:

lines=!f() { git ls-files -- '*.go' ':!bindata.go' ':!vendor/**' | while read f; do git --no-pager blame -w -M -C -C --line-porcelain "$f" | grep '^author '; done | sort -f | uniq -ci | sort -nr; }; cd -- ${GIT_PREFIX:-.} && f

Pipe breakdown

File list (git ls-files)

git ls-files is taking a few glob arguments in the alias, so this section should handle the same.

Blame with porcelain (git blame --line-porcelain)

Pulling out the author for each line, basically.

sort | uniq | sort

Collating authors and line counts.

cd -- ${GIT_PREFIX:-.}

Default to running from current directory if no other directory is specified.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL