From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS54825 147.75.192.0/21 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id BBA281F405 for ; Fri, 19 Jan 2024 02:58:21 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=bb0M5Pg3; dkim-atps=neutral Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EB0FE1C22C67 for ; Fri, 19 Jan 2024 02:58:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECC55186F; Fri, 19 Jan 2024 02:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bb0M5Pg3" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CC6F1367 for ; Fri, 19 Jan 2024 02:58:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705633091; cv=none; b=PLwUpsPksb5AsY1hrTbw5++VQy1FViGlrD/Muh0Fj12A6e9+8n8I8U9ixZN29iy+Pts2N1dVroWsqhIepfarOUqeO7ic596Nkp6dVwbOqeQ2zW1UA/nhoQ3K7fH5gQUrA8MWJo/QC6tDxR+VpMCFBe0lBFurTwWUlxmlQRF5eNc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705633091; c=relaxed/simple; bh=v1+xYFiAxe0rNgKuNr1l+qzQPTxA1RbX57NRe4w/MKk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jW7qWfC5+8KIhJtY6Wc3hXbbE0hypOUrf2c851UpbT++wcitTmIdzd67LPApcjuiPrt7dz9cItz+oTdYfB+goyz5sgZuChnF5usxigytap9nAfy5m70H8tagJop9j9qTSEfAbnrkhvaBydRE48/Dwpz7IlRa3FlJmpB81rwrouM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bb0M5Pg3; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-50ea98440a7so286564e87.1 for ; Thu, 18 Jan 2024 18:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705633088; x=1706237888; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zbEmbMrBBPq97xtuV492bz34SSJHCVymJhV6VSj3Cic=; b=bb0M5Pg3jE21osYuhvDux4Is3l60VxbWvjBep1DpAmwhcM0flQGVEuUoDPBiDpeZ2M hDKNh1zwZchintjVgAefon8Vdx9VsvI6B3t2gW8ByXNJmmVcMCa3sxIumt+GhkatUe3a ti24OuoFvuP0QjlfWt3Y2NjgBLHEXsRXBY7yaCDy5Sby3KiESIkwGI4RHSRyGzbhynqI SUz1JS6JC0qU7cMTktFmQBY5iSB0UsBBPb0B8jY7XrVWqPwI8fUM179Ee/IAfLia+sgU OD6mZP79aPm7bC6WmvRtzl/gS49XkTLjYFExM6/4aUb5ujfmf9vsYSyoqEJhMIJoGJKu RPZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705633088; x=1706237888; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zbEmbMrBBPq97xtuV492bz34SSJHCVymJhV6VSj3Cic=; b=Lnq/RRpkDwxZqhVSq0eeF/fCME6YgT9Dlpqw+PeEpFWTIqhr1vWebzvaA7lQpxNEZS Dw+MKwWMsHCyNUSSWjOcVb7bnfKJgLqm+jv5h+NIvKHnkPebEPQS4Hv27OBmLYYHZxyR 7FSR7NzKLPIMzPdx/MHGb5NhevzSJUmeU9xwcqTIhnhfJwLUdGY5kqCHVxOmUnDFI9a/ 4TGazLGi3p9P1K/PJX8QtpNPz8LDiP8foOz3CoCfNJsYhynY3UY3eNNYkevWJbQ/dwI0 WpftwTHWkFgxK+x9smMwVUqnDcPYnBTeErRUiJBKKI17xizDSZguStXGi3deL++/6sZV ouPA== X-Gm-Message-State: AOJu0YwKJq34pZHM5Govpbgvc88yYaMa+KjopxdTspsJtjAFz7ze4T5j UvYYYpQ+yBDElQUU3hBfSd+o7ej0LTBY0Z+/obkk2boL/7s2/7PK43ZZttTkzpxnlisC1YuYONF dqltZvTXGJ7asakcaB6B9AhQHOqE= X-Google-Smtp-Source: AGHT+IELxlRK+ZGZoahWq3XQUPcXLdQUSqXQT/eLNUmoDKN9L5W5jFCDYR4sT5mflP3MbEfZgMWCkQ26bfRD155bwj8= X-Received: by 2002:a05:6512:3da7:b0:50e:7d4f:a31a with SMTP id k39-20020a0565123da700b0050e7d4fa31amr213733lfv.53.1705633088036; Thu, 18 Jan 2024 18:58:08 -0800 (PST) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <298F7067-D572-433F-A7DD-5256B43B97D7@icloud.com> In-Reply-To: From: Elijah Newren Date: Thu, 18 Jan 2024 18:58:00 -0800 Message-ID: Subject: Re: [PATCH] precious-files.txt: new document proposing new precious file type To: Junio C Hamano Cc: Sebastian Thiel , Elijah Newren via GitGitGadget , git@vger.kernel.org, Josh Triplett , Phillip Wood Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Thu, Jan 18, 2024 at 11:14=E2=80=AFAM Junio C Hamano = wrote: > [...] > So, all it boils down to is these two questions. Thanks for summarizing this. > * Which one between "'git add .' adds '.config' that users did not > want to add" and "'git clean -f' removes '.config' together with > other files" a larger problem to the users, who participate in a > project that already decided to use the new .gitignore feature to > mark ".config" as "precious", of older versions of Git that > predate "precious"? Accidental "git add ." comes with 3 opportunities to correct the problem before it becomes permanent: before commiting, after committing but before pushing, and after publishing for patch review (where it can even be caught by third parties) but before the patch/PR/MR is accepted and included. At each stage there's a chance to go back and correct the problem. Accidental nuking of a file (via either git clean or git checkout or git merge or whatever), cannot be reviewed or corrected; it's immediately too late. And given that we're calling this feature "precious", that seems a little extra unfortunate. > * What are projects doing to paths that they want to make > "precious" with the current system? Do they leave them out of > ".gitignore" and have them subject to accidental "git add ." to > protect them from "git clean -f"? Or do they list them in > ".gitignore" to prevent "git add ." from touching, but leave them > susceptible to accidental removal by "git clean -f"? Good questions; I have no answers to these. However, on a closely related note, in my response to Sebastian I point out that the '$' syntax permits individual teams to prioritize avoiding either accidental deletions or accidental adds on a filename or glob granularity, so if folks are concerned with handling by older Git versions or are just extra concerned with certain files, they can optimize accordingly. Sadly, the '#(keep)' syntax does not permit such prioritization and always treats avoiding accidental adds as the priority (which, in my opinion, is the less important one to generally prioritze).