From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 4EA011F45A for ; Thu, 27 Oct 2022 15:16:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236444AbiJ0PPG (ORCPT ); Thu, 27 Oct 2022 11:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236492AbiJ0POk (ORCPT ); Thu, 27 Oct 2022 11:14:40 -0400 Received: from smtp.hosts.co.uk (smtp.hosts.co.uk [85.233.160.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C8D719ABFB for ; Thu, 27 Oct 2022 08:11:23 -0700 (PDT) Received: from 88-110-102-84.dynamic.dsl.as9105.com ([88.110.102.84] helo=[192.168.1.57]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1oo4Wv-0009L9-Aa; Thu, 27 Oct 2022 16:10:49 +0100 Message-ID: Date: Thu, 27 Oct 2022 16:10:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: Git add documentation error Content-Language: en-GB To: Angelo Borsotti , git References: From: Philip Oakley In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, On 27/10/2022 12:53, Angelo Borsotti wrote: > Hello, > > the reference manual for the "git add" command does not > specify what that command does when applied to an > unmodified file. I presume that this file is already tracked.. > By testing this, I have seen that it does not add the file > to the index, How was this tested? If you have no changes, thaen the status diff will have no mention of that file. Perhaps change the tracked mode bits to see if that is noticed (note though, not all mode bits are tracked..) > and consequently it does not add it when a > subsequent commit is done. I suspect this is a subtle mental model misunderstanding about the distinction between a commit as a snapshot, and a commit being reported as the diff relative to its parent (and here, there is none, if the file is unmodified) > I think that this should be documented. A test script with sample output would help here. -- Philip