~ecs/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH 1/3] g: rtfm: clean up sed expression

Evan Johnston <evan@d2evs.net>
Details
Message ID
<20210913061412.1217-1-evan@d2evs.net>
DKIM signature
missing
Download raw message
Patch: +1 -1
---
 bin/g | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/g b/bin/g
index cd9e083..6766c48 100755
--- a/bin/g
@@ -30,7 +30,7 @@ case "$CMD" in
	"pf") CMD="push -f" ;;
	"r") CMD="rm" ;;
	"rc") CMD="rm --cached" ;;
	"rtfm") exec man $(find /usr/share/man -name "git-*" | sed "s/.*\///;s/\..*//" | shuf -n1) ;;
	"rtfm") exec man $(find /usr/share/man -name "git-*" | sed -e 's:.*/::' -e 's/\..*//' | shuf -n1) ;;
	"s") CMD="status" ;;
	"se") export GIT_EDITOR="$EDITOR" CMD="send-email" ;;
	"sl") CMD="shortlog" ;;
-- 
2.33.0

[PATCH 2/3] g: rtfm: fix quoting

Evan Johnston <evan@d2evs.net>
Details
Message ID
<20210913061412.1217-2-evan@d2evs.net>
In-Reply-To
<20210913061412.1217-1-evan@d2evs.net> (view parent)
DKIM signature
missing
Download raw message
Patch: +1 -1
---
 bin/g | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/g b/bin/g
index 6766c48..12879b9 100755
--- a/bin/g
@@ -30,7 +30,7 @@ case "$CMD" in
	"pf") CMD="push -f" ;;
	"r") CMD="rm" ;;
	"rc") CMD="rm --cached" ;;
	"rtfm") exec man $(find /usr/share/man -name "git-*" | sed -e 's:.*/::' -e 's/\..*//' | shuf -n1) ;;
	"rtfm") exec man "$(find /usr/share/man -name "git-*" | sed -e 's:.*/::' -e 's/\..*//' | shuf -n1)" ;;
	"s") CMD="status" ;;
	"se") export GIT_EDITOR="$EDITOR" CMD="send-email" ;;
	"sl") CMD="shortlog" ;;
-- 
2.33.0

[PATCH 3/3] g: rtfm: posix compliance

Evan Johnston <evan@d2evs.net>
Details
Message ID
<20210913061412.1217-3-evan@d2evs.net>
In-Reply-To
<20210913061412.1217-1-evan@d2evs.net> (view parent)
DKIM signature
missing
Download raw message
Patch: +4 -1
---
 bin/g | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/g b/bin/g
index 12879b9..387962e 100755
--- a/bin/g
@@ -30,7 +30,10 @@ case "$CMD" in
	"pf") CMD="push -f" ;;
	"r") CMD="rm" ;;
	"rc") CMD="rm --cached" ;;
	"rtfm") exec man "$(find /usr/share/man -name "git-*" | sed -e 's:.*/::' -e 's/\..*//' | shuf -n1)" ;;
	"rtfm") exec man "$(find /usr/share/man -name "git-*" |
		sed -e 's:.*/::' -e 's/\..*//' |
		awk 'BEGIN{srand()}{print rand() * 1000000 "\t" $0}' |
		sort -n | head -n1 | cut -f2-)" ;;
	"s") CMD="status" ;;
	"se") export GIT_EDITOR="$EDITOR" CMD="send-email" ;;
	"sl") CMD="shortlog" ;;
-- 
2.33.0

Re: [PATCH 3/3] g: rtfm: posix compliance

Details
Message ID
<CE8LN56BFTZX.26SUXRJ5FFH67@eiger>
In-Reply-To
<20210913061412.1217-3-evan@d2evs.net> (view parent)
DKIM signature
missing
Download raw message
Quick note: since this list is used for more than just my dotfiles,
please set format.subjectPrefix to 'PATCH dotfiles'. Thanks!

On Mon Sep 13, 2021 at 6:14 AM UTC, Evan Johnston wrote:
> ---
> bin/g | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/bin/g b/bin/g
> index 12879b9..387962e 100755
> --- a/bin/g
> +++ b/bin/g
> @@ -30,7 +30,10 @@ case "$CMD" in
> "pf") CMD="push -f" ;;
> "r") CMD="rm" ;;
> "rc") CMD="rm --cached" ;;
> - "rtfm") exec man "$(find /usr/share/man -name "git-*" | sed -e 's:.*/::' -e 's/\..*//' | shuf -n1)" ;;
> + "rtfm") exec man "$(find /usr/share/man -name "git-*" |
> + sed -e 's:.*/::' -e 's/\..*//' |
> + awk 'BEGIN{srand()}{print rand() * 1000000 "\t" $0}' |

Once we're bringing awk in, let's drop the sed in favor of sub(). We
also don't need the second sed expr - not sure why I had it in the first
place.

In addition, please add a space between the BEGIN block and the second
block.

> + sort -n | head -n1 | cut -f2-)" ;;
> "s") CMD="status" ;;
> "se") export GIT_EDITOR="$EDITOR" CMD="send-email" ;;
> "sl") CMD="shortlog" ;;
> --
> 2.33.0
Reply to thread Export thread (mbox)