Re: [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* 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".

--
Jakub Wilk



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux