From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 809E0C433DB for ; Mon, 22 Feb 2021 14:59:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2022364E21 for ; Mon, 22 Feb 2021 14:59:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbhBVO6v (ORCPT ); Mon, 22 Feb 2021 09:58:51 -0500 Received: from smtpout1.mo804.mail-out.ovh.net ([79.137.123.220]:43817 "EHLO smtpout1.mo804.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbhBVO6u (ORCPT ); Mon, 22 Feb 2021 09:58:50 -0500 Received: from mxplan6.mail.ovh.net (unknown [10.109.146.241]) by mo804.mail-out.ovh.net (Postfix) with ESMTPS id D5DDF8FF3FC8; Mon, 22 Feb 2021 15:58:06 +0100 (CET) Received: from jwilk.net (37.59.142.95) by DAG4EX2.mxp6.local (172.16.2.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 22 Feb 2021 15:58:04 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-95G001ffb3f091-ce1d-45f7-b3b6-2b3b4c71e03d, A2E1988F04140D9B9A9FE8CB33A6270137CAA94F) smtp.auth=jwilk@jwilk.net X-OVh-ClientIp: 5.173.72.242 Date: Mon, 22 Feb 2021 15:58:02 +0100 From: Jakub Wilk To: Alejandro Colomar CC: Michael Kerrisk , Subject: Re: [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Message-ID: <20210222145802.w3oljdtz7vie2v4y@jwilk.net> References: <20210222140344.3862-1-alx.manpages@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Disposition: inline In-Reply-To: <20210222140344.3862-1-alx.manpages@gmail.com> User-Agent: NeoMutt/20180716 X-Originating-IP: [37.59.142.95] X-ClientProxiedBy: DAG2EX1.mxp6.local (172.16.2.11) To DAG4EX2.mxp6.local (172.16.2.32) X-Ovh-Tracer-GUID: 3aa23c9f-11af-40a6-904b-17e1a82b637f X-Ovh-Tracer-Id: 14302869467527829469 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrkeefgdejtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepfffhvffukfhfgggtuggjfghisehttdertddtredvnecuhfhrohhmpeflrghkuhgsucghihhlkhcuoehjfihilhhksehjfihilhhkrdhnvghtqeenucggtffrrghtthgvrhhnpefhfedvfeehvefhkeeltdejgeelteefvdefvdduvdefgfduueeitdeitedvtdehgfenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghniedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehjfihilhhksehjfihilhhkrdhnvghtpdhrtghpthhtoheplhhinhhugidqmhgrnhesvhhgvghrrdhkvghrnhgvlhdrohhrgh Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org * Alejandro Colomar , 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