Article View: linux.kernel.git
Article #2538Re: git-ls-files(1) avoiding symlinks
From: Alejandro Colomar
Date: Fri, 06 Nov 2026 19:36
Date: Fri, 06 Nov 2026 19:36
88 lines
10524 bytes
10524 bytes
--wiyvbp77ygcid7vz Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable From: Alejandro Colomar <alx+git@kernel.org> To: Ben Knoble <ben.knoble@gmail.com> Cc: git@vger.kernel.org, Andy Shevchenko <andy@kernel.org>, Linus Torvalds <torvalds@linux-foundation.org>, Krzysztof Kozlowski <krzk@kernel.org> Subject: Re: git-ls-files(1) avoiding symlinks Message-ID: <au4rmQRjRtIv1Oru@debian> References: <au3lu4jYwZ5hBZSy@devuan> <AE63992D-7BEA-413D-A372-78708CFA8F6F@gmail.com> MIME-Version: 1.0 In-Reply-To: <AE63992D-7BEA-413D-A372-78708CFA8F6F@gmail.com> Hi Ben, > Date: 2026-11-06 12:34:20-0500 > From: Ben Knoble <ben.knoble@gmail.com> > [...] > > Hmmm, that could work. Thanks! > >=20 > > $ git ls-files --format=3D'%(objectmode) %(path)' \ > > | grep -v ^120000 \ > > | sed 's/^.* //' \ > > | grep '\.[ch]$' \ > > | xargs grepc creat; > >=20 > > With -z it becomes a bit tedious: > >=20 > > $ git ls-files -z --format=3D'%(objectmode) %(path)' \ > > | grep -zv ^120000 \ > > | sed -z 's/^.* //' \ > > | grep -z '\.[ch]$' \ > > | xargs -0 grepc creat; >=20 > The filtering for C files can also be done by Git, I believe: >=20 > git ls-files =E2=80=A6 '*.[ch]' I prefer regexes over globs; they're more powerful, and they're hot in brain memory. :) > > But, indeed, I don't care about files with spaces often, because I don't > > create them in my stuff. > >=20 > > I expect git-ls-files(1) could make this much simpler, though: > >=20 > > $ git ls-files --type f \ > > | grep '\.[ch]$' \ > > | xargs grepc creat; >=20 > I believe the expression is =E2=80=9Cpatches [scratching your own itch ar= e] welcome=E2=80=9D ;)=20 Nice! If the idea is welcome, I can certainly work on a patch. :) Have a lovely night! Alex --=20 <https://www.alejandro-colomar.es> --wiyvbp77ygcid7vz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmruLD8ACgkQ64mZXMKQ wqmv4w//WOK6c9yElT/g4r7756NLSXotHAqfEafLb1jML5x0muIIgek+p1rDkbKs X/TygZDIFYIolX6JHQb6ALrgfF1l6805QjFP+TOrRgVvod0YUb+hva+EUR8ntahC XdElmjObRoc7XCMHX3b1sBgAfc+vo5Tqbi+/Ho12vtiaUZjkMYZYxG7zo0NK1l4A D4vFYlXUDzjKBm4OWyJ65q0sLC5V4o+5YsVIKOGcD+FFUmHJT2gfEMyP0Opl6qt7 DBEgf45pXV/eSBkpJhLyxS+/aSQm9fTw5PO/6GNl1r/9ZdtfsnEW6Zvr1d8/DVfr 9T1pZNDS3hbY6wgVCFd7KuqdI3i2i7I1MBCQvFLMWJhqtjGg6Ren8Oqs+Z04Qe6N QsXc0Tu+YAa8qC/Sr2ahtQAiUsqsgTeHE8VDu0k8MCBf/M2X6pUtHWp9szKeTKE4 fV3DbsysMF24jBCVbYGUNFtb1puSin7anifZbyuYamwEH3O//FeLDN3mhdbeT7AK aUEOo5kgRU4e1/qFSw2JF34Urg3n2IsbREF5TVo86Un/k+aMcuT02KIxz6MpKBHR 4kGf5a8dWJgtGlC5agWLeotesJ4NrY+KZR57xISftmBYCsnjhmmVEG4nbYtPUpnJ 5aWsfGMU47A+YRJtn96ix197WMqUy09v9M7LwdoiCfIrOhs/g7k= =4ZDg -----END PGP SIGNATURE----- --wiyvbp77ygcid7vz--
Technical Details
Message-ID:
<au4rmQRjRtIv1Oru@debian>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74718-linux-kernel-git=dewy.ruReferences:
<au3lu4jYwZ5hBZSy@devuan> <AE63992D-7BEA-413D-A372-78708CFA8F6F@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74718-linux-kernel-git=dewy.ru From: alx+git@kernel.org (Alejandro Colomar) Newsgroups: linux.kernel.git Subject: Re: git-ls-files(1) avoiding symlinks Date: Fri, 6 Nov 2026 20:36:31 +0100 Organization: Usenet Network Message-ID: <au4rmQRjRtIv1Oru@debian> References: <au3lu4jYwZ5hBZSy@devuan> <AE63992D-7BEA-413D-A372-78708CFA8F6F@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wiyvbp77ygcid7vz" Injection-Info: usenet.network; logging-data="3958840"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:DS/AmxV9vQ/NPQn4n+P3Xy6obq0= sha256:5vmZ4fCM7UlDZ8A3zYVbIA6tCj+31puSo/a8cYtbfVE= sha1:FUIB96TjDQyqOhQeWo6ex8feZ9s= sha256:Hd+YB2hJfw514BaZJbUWE7PKoOpc9qmoRB+XsC7t/Mw= Content-Disposition: inline List-ID: <git.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 39D831132E0; Fri, 6 Nov 2026 22:39:05 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Status: No, score=-2.301 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R8zQ2XDNv-GS; Fri, 6 Nov 2026 22:38:57 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-74718-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 365FF113215; Fri, 6 Nov 2026 22:38:49 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 2C21538824; Fri, 6 Nov 2026 19:36:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793993801; b=KOzEhAHENMzBSMLsqFAzMGCq/xROfss6JiA7qrBX6wn07W7RUslmZPFY4bEfUrZJsvqr nGORdij5E/QNQ7rAlXY1pbNSpSSaVMEsPeWIt6ivVBdXFGwNz3yDL9fpn4cWL6QlKTMDr LtLEfvlF3EQcNwT82k4cv+cN1+9wlJnFZr69cCHRlE1A4iGxlQdNFNtIlbBHYYutInI+c 0hS1id7GHFMc8l6/66YyKuEqeVYRZY8m3LDQAWqXXQiQmnrY9x76qIG1nX7gmV0I+NyQH H9xwW9KUWyXSeDGDLwXVVzAgGbNTNfLNPMeP/a4gS9xr93L5ZK76mw77/GSR6628sgA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793993801; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=g4vgkadlBzwY4REghO8cfzqssIfOOmOwnfp055pgPik=; b=VW7wCRM7aY93oyWEz3YHAXqpWDltyXRw3dRUWujTm3GIm/BPsj5LMGqkaZ1SxjcvZn8g 49lKcG9FZi0lqQkJybwPn8qUSa+L7FazniKpkfye8tT/hb/JhNm/8MnHXY+BIcXwdq+B+ 92eQAVXeJjXzQBfoZLtcP7jCLtyeC7VRFEnWb9HHjNzT6mbzltYm8dKWAZMNoBMJ2Pokm 9YW3ahh3emHfHJSV/L8OciXP04Pp9XyVCmTrXSagVq6gsFj1djs9EjOrnPNdPgnuTPvVZ 4ylHbYRDedcHAwxIpgUTlK66vopZsQHp1Qnqv956EF3dNWqza4P/0zj+otPr4PJYeZQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dvnZJag1; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03C4E606A32E; Fri, 6 Nov 2026 19:36:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dvnZJag1 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793993800; b=Js0Uc5ojWPhWde6Xb/QAatCfKnEavO0YiWZCVxUe5atRlLRSWuiCpLLBiT8iOrzqqlVR 4siQuNXDPQWvNlEczmJ/y0CIGvEKXn8hUp4QQxD7p8iN11Rjn/l9K0SECIvz+iY9k+gls UJzyY2ZpHGHRF7B+52DyasGXjNEXyOAN8Cnag/Ja3ZZvuCIRG5ao8nUUNGFdiCnbPDeTR dBbAryuZgmhgQ6RGjSZrg7WBjNo1hDI53TYKJedAmK555FpijHG9Pkll7bhZQnPfoBDDH jEBsgjim9Jxo17WBKhRSc6Z69LRjxt12jE6YDW3GXnyLKAKIELNwMZGCF31kavpBHvQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793993800; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=g4vgkadlBzwY4REghO8cfzqssIfOOmOwnfp055pgPik=; b=hOU5su32V21ZfM4ol6IzRxU3REyJEsFAaAtMk+EtuCFcUa2lbHrXCOZka6GXtZxxw+bu fuqrV3uI/aE6YwvvcZGy36WIDNW2zgyqTvvV4CPxHY0wQPXQ6knh++Td4Fhq7RMxtE6fi W2dE8fJiXLOjJuWb2AdC6pvlCHtzWhV7szmKAHavHP2aSJahcQ1z2gSwuX481cvk9Tm+s 28CEAMdQnEapwPwBeBhXFuExA/dnDZRYOwXfC73Ayi9m/UAUMg3Qdtvfw+m2VuN9LwpvJ m0pjnW5Ft3huCQaqTL9usRUaAFmJfHrGPTh0nWYkyrRM29/m/jDL9DAxVp83xlrV85w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dvnZJag1; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF526606A32C for <git@vger.kernel.org>; Fri, 6 Nov 2026 19:36:39 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 189961F008BC; Fri, 6 Nov 2026 19:36:35 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793993799; bh=g4vgkadlBzwY4REghO8cfzqssIfOOmOwnfp055pgPik=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dvnZJag1trF2pwXgc/ES4Hw6e7WQcF6z2LTOgqPDFfZVfaSFkK88pV3mvXwNW5xqI Pj1T7kUfVwHT3xjjAHj18nd7rhro+VfzteuHAVrSrfAWH1hItmAPBd1KXOkKbK584r sDsEz6pqIudIGMJNfka20Bb55LtTmxtam6STqlnf94uGi4JsPlIipVEguhCLID4ll1 138Rh73Dbqn3+8LZmjZ1dtrraSMsr2gbtljgZRqh5MXtPvnhTfuPJdNPEKHwWdZARY KneIFcbN2KKx07SpSSFbh0HhMPMSezXkWF86UNtKgK0vRqw42rn6TkOBqruwM0QRV2 StwGm8R2n/SSw== X-Cc: git@vger.kernel.org, Andy Shevchenko <andy@kernel.org>, Linus Torvalds <torvalds@linux-foundation.org>, Krzysztof Kozlowski <krzk@kernel.org> X-Mailing-List: git@vger.kernel.org X-List-Post: <mailto:git@vger.kernel.org> X-List-Help: <mailto:git+help@vger.kernel.org> X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:git+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <AE63992D-7BEA-413D-A372-78708CFA8F6F@gmail.com>