* [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command
@ 2021-02-22 17:14 Alejandro Colomar
2021-02-23 16:39 ` [PATCH v2] scripts/bash_aliases: man_gitstaged(): Script around a more stable " Alejandro Colomar
0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2021-02-22 17:14 UTC (permalink / raw)
To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Jakub Wilk
The output of 'git status' is not stable.
The more stable 'git status --porcelain' is more complex,
and scripting around it would be more complex.
However, 'git diff --staged --name-only' produces
almost exactly the output that we were lookiong for.
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
scripts/bash_aliases | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 127ed5d08..dcc0eb28b 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -153,13 +153,11 @@ function pdfman()
function man_gitstaged()
{
- git status \
- |sed "/Changes not staged for commit:/q" \
- |grep -E "^\s*(modified|deleted|new file):" \
- |sed "s/^.*:\s*/, /" \
+ git diff --staged --name-only \
+ |sed "s/$/, /" \
|sed "s%man[1-9]/%%" \
|tr -d '\n' \
- |sed "s/^, //"
+ |sed "s/, $//"
}
########################################################################
--
2.30.1.721.g45526154a5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] scripts/bash_aliases: man_gitstaged(): Script around a more stable git command
2021-02-22 17:14 [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
@ 2021-02-23 16:39 ` Alejandro Colomar
0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2021-02-23 16:39 UTC (permalink / raw)
To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Jakub Wilk
The output of 'git status' is not intended to be stable.
The more stable 'git status --porcelain' is more complex,
and scripting around it would be more complex.
However, 'git diff --staged --name-only' produces
almost exactly the output that we were lookiong for.
This simplifies the script, and makes it more stable and robust.
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
v2: Fix commit message
---
scripts/bash_aliases | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 127ed5d08..dcc0eb28b 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -153,13 +153,11 @@ function pdfman()
function man_gitstaged()
{
- git status \
- |sed "/Changes not staged for commit:/q" \
- |grep -E "^\s*(modified|deleted|new file):" \
- |sed "s/^.*:\s*/, /" \
+ git diff --staged --name-only \
+ |sed "s/$/, /" \
|sed "s%man[1-9]/%%" \
|tr -d '\n' \
- |sed "s/^, //"
+ |sed "s/, $//"
}
########################################################################
--
2.30.1.721.g45526154a5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] fflush.3: SEE ALSO: Add fpurge(3)
@ 2021-05-09 21:38 Alejandro Colomar
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
To: mtk.manpages; +Cc: Alejandro Colomar, linux-man
fpurge(i_stream) does the same as fflush(i_stream), AFAIK.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
Hi Michael,
This is the first of many separate patches that I had pending for you.
Some of them I already sent you, and you should ignore the old versions.
Some of them are new.
Please review them thoroughly, as I may have sent some patch that wasn't
ready. In theory I have reviewed them enough, but there are a lot, and
I might have overlooked something.
When you review this "set", I'll send you another one about the SYNOPSIS.
Thanks,
Alex
man3/fflush.3 | 1 +
1 file changed, 1 insertion(+)
diff --git a/man3/fflush.3 b/man3/fflush.3
index 138c9bcfe..a600da2ae 100644
--- a/man3/fflush.3
+++ b/man3/fflush.3
@@ -133,6 +133,7 @@ or
.BR sync (2),
.BR write (2),
.BR fclose (3),
+.BR fpurge (3),
.BR fileno (3),
.BR fopen (3),
.BR setbuf (3),
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command
2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
@ 2021-05-09 21:38 ` Alejandro Colomar
2021-05-09 23:31 ` Michael Kerrisk (man-pages)
0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Jakub Wilk
The output of 'git status' is not stable.
The more stable 'git status --porcelain' is more complex,
and scripting around it would be more complex.
However, 'git diff --staged --name-only' produces
the output that we were lookiong for.
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
scripts/bash_aliases | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 8cedc4efc..d9b6047d1 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -153,13 +153,11 @@ function pdfman()
function man_gitstaged()
{
- git status \
- |sed "/Changes not staged for commit:/q" \
- |grep -E "^\s*(modified|deleted|new file):" \
- |sed "s/^.*:\s*/, /" \
+ git diff --staged --name-only \
+ |sed "s/$/, /" \
|sed "s%man[1-9]/%%" \
|tr -d '\n' \
- |sed "s/^, //"
+ |sed "s/, $//"
}
########################################################################
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
@ 2021-05-09 23:31 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:31 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Jakub Wilk
Hi Alex,
On 5/10/21 9:38 AM, Alejandro Colomar wrote:
> The output of 'git status' is not stable.
>
> The more stable 'git status --porcelain' is more complex,
> and scripting around it would be more complex.
>
> However, 'git diff --staged --name-only' produces
> the output that we were lookiong for.
>
> Reported-by: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Applied.
Thanks,
Michael
> ---
> scripts/bash_aliases | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index 8cedc4efc..d9b6047d1 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -153,13 +153,11 @@ function pdfman()
>
> function man_gitstaged()
> {
> - git status \
> - |sed "/Changes not staged for commit:/q" \
> - |grep -E "^\s*(modified|deleted|new file):" \
> - |sed "s/^.*:\s*/, /" \
> + git diff --staged --name-only \
> + |sed "s/$/, /" \
> |sed "s%man[1-9]/%%" \
> |tr -d '\n' \
> - |sed "s/^, //"
> + |sed "s/, $//"
> }
>
> ########################################################################
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-09 23:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 17:14 [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
2021-02-23 16:39 ` [PATCH v2] scripts/bash_aliases: man_gitstaged(): Script around a more stable " Alejandro Colomar
2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
2021-05-09 23:31 ` Michael Kerrisk (man-pages)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.