From 31852852aa70022e8416ff3aea899460f15fa723 Mon Sep 17 00:00:00 2001 From: chriswalz Date: Sun, 11 Oct 2020 23:41:48 -0400 Subject: [PATCH 1/2] fix git effort --- a.MD | 5 +++++ cmd/info.go | 6 ++++-- gitextras/git-effort.go | 2 +- gitextras/git-summary.go | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/a.MD b/a.MD index 56827aa..2e8c452 100644 --- a/a.MD +++ b/a.MD @@ -93,3 +93,8 @@ bash history git-effort failing bit release bump man page parsing + flag suggestions for all commands + + +git log --pretty=format:"* [%s](https://github.com/chriswalz/bit/commit/%H)" 09facd30..HEAD + +deleting tags from local and origin is painful \ No newline at end of file diff --git a/cmd/info.go b/cmd/info.go index f6746c1..1d0c1f9 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -21,8 +21,10 @@ var infoCmd = &cobra.Command{ fmt.Println("--- SUMMARY ---") RunInTerminalWithColor("/bin/sh", []string{`-c`, gitextras.GitSummary}) - fmt.Println("--- EFFORT ---") - RunInTerminalWithColor("/bin/sh", []string{`-c`, gitextras.GitEffort}) + fmt.Println("\n--- EFFORT ---\n") + fmt.Println("Commits | Files") + // git log --pretty=format: --name-only | sort | uniq -c | sort -rg | awk 'NR > 1 { print }' | head -15 + RunInTerminalWithColor("/bin/sh", []string{`-c`, `git log --pretty=format: --name-only | sort | uniq -c | sort -rg | awk 'NR > 1 { print }' | head -15`}) }, //Args: cobra.MaximumNArgs(1), } diff --git a/gitextras/git-effort.go b/gitextras/git-effort.go index fda54e4..eb5d342 100644 --- a/gitextras/git-effort.go +++ b/gitextras/git-effort.go @@ -3,7 +3,7 @@ package gitextras // GitEffort is the git-effort bash script from git-extras const GitEffort = `#!/usr/bin/env bash -tmp=$(git_extra_mktemp) +tmp=bittmpbittmp above=0 # if the output won't be printed to tty, disable the color test -t 1 && to_tty=true diff --git a/gitextras/git-summary.go b/gitextras/git-summary.go index fa34b3c..9bafe92 100644 --- a/gitextras/git-summary.go +++ b/gitextras/git-summary.go @@ -2,7 +2,7 @@ package gitextras // GitSummary is the git-summary bash script from git-extras const GitSummary = `#!/usr/bin/env bash -cd "$(git root)" || { echo "Can't cd to top level directory";exit 1; } +# cd "$(git root)" || { echo "Can't cd to top level directory";exit 1; } SUMMARY_BY_LINE= DEDUP_BY_EMAIL= From 596447a3ff97104e8572440eda6e6e8593b2500e Mon Sep 17 00:00:00 2001 From: chriswalz Date: Sun, 11 Oct 2020 23:45:04 -0400 Subject: [PATCH 2/2] fix bit effort --- cmd/info.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/info.go b/cmd/info.go index 1d0c1f9..3f5f685 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -21,9 +21,8 @@ var infoCmd = &cobra.Command{ fmt.Println("--- SUMMARY ---") RunInTerminalWithColor("/bin/sh", []string{`-c`, gitextras.GitSummary}) - fmt.Println("\n--- EFFORT ---\n") - fmt.Println("Commits | Files") - // git log --pretty=format: --name-only | sort | uniq -c | sort -rg | awk 'NR > 1 { print }' | head -15 + fmt.Println("\n--- EFFORT ---") + fmt.Println("\nCommits | Files") RunInTerminalWithColor("/bin/sh", []string{`-c`, `git log --pretty=format: --name-only | sort | uniq -c | sort -rg | awk 'NR > 1 { print }' | head -15`}) }, //Args: cobra.MaximumNArgs(1),