Hey Jakub,
On 2/22/21 3:58 PM, Jakub Wilk wrote:
* Alejandro Colomar <alx.manpages@xxxxxxxxx>, 2021-02-22, 15:03:
+ git status \
+ |sed '/Changes not staged for commit:/q' \
+ |grep -E '^\s*(modified|deleted|new file):' \
"git status" (without further options) is not suitable for scripting:
"The default, long format, is designed to be human readable, verbose and
descriptive. Its contents and format are subject to change at any time." >
You could use "git status --porcelain" instead, which has stable and
(supposedly) easy to parse format. Or, better, you could use "git diff
--staged --name-only".
I know I shouldn't script around 'git status'; actually I found out that
yesterday. When I read that, I tried to script around 'git status
--porcelain', but it's more complex (at least to me, at first glance),
and I gave up.
However, 'git diff --staged --name-only' is exactly what I need! I'll
prepare a patch with that in a few minutes.
Michael, so that git can follow the code movement relatively easily,
I'll write that patch on top of this one, so you can already apply this one.
Thanks a lot!!
Alex
--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/