From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C6E6620401 for ; Tue, 13 Jun 2017 04:29:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbdFME3W (ORCPT ); Tue, 13 Jun 2017 00:29:22 -0400 Received: from mout.web.de ([212.227.15.4]:56762 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbdFME3V (ORCPT ); Tue, 13 Jun 2017 00:29:21 -0400 Received: from [192.168.88.199] ([194.47.243.242]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MTh7A-1dTKeJ04oq-00QR3r; Tue, 13 Jun 2017 06:29:15 +0200 Subject: Re: [PATCH v2] doc: fix location of index in worktree scenatio To: Junio C Hamano References: <20170610090719.8429-1-asheiduk@gmail.com> <20170610173824.19460-1-asheiduk@gmail.com> Cc: Andreas Heiduk , Git Mailing List From: =?UTF-8?Q?Torsten_B=c3=b6gershausen?= Message-ID: <04ad4189-8575-2f0f-2c99-c98672513293@web.de> Date: Tue, 13 Jun 2017 06:29:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:JoaFHCfvrEtzkVUCj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Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 06/12/2017 06:06 PM, Junio C Hamano wrote: > Torsten Bögershausen writes: > >> Thanks for working on this (and keeping me in cc) >> >> The commit head line does not fully match my expactions: >> "doc: fix location of index in worktree scenatio" >> "doc:" is OK, but is the "location of index" fixed ? >> Actually something that includes the important stuff: >> >> "doc" >> "fix" >> "normalize the line endings" >> "worktree scenatio" >> >> could be more helpful. >> >> How about this as a header for the commit: >> "doc: normalize the line endings in a worktree scenatio" > Andreas's patch does not "normalize" anything, though. > > doc: do not encourage `rm .git/index` in an example > > When illustrating how to force normalizing the line endings, > gitattributes documentation tells the user to `rm .git/index`. > > This is incorrect for two reasons. We shouldn't be encouraging > users to futz with the internal implementation of Git using raw > filesystem tools like "rm" too much. Also, when ".git" is not a > directory but a "gitfile" pointing at the real location of the > real ".git" directory, `rm .git/index` would not work anyway. > > The point of the step in the illustration is to remove all > entries from the index without touching the working tree, and > the way to do it with Git is to use `read-tree --empty`. > > perhaps? > > You _could_ mention "worktree scenario" but that is not the sole > user of the gitfile facility (e.g. a submodule working tree also > uses ".git" that is a gitfile pointing at the real repository > location), and "worktree" is not the real root cause of the problem > ("gitfile" is), so I do not think it is essential to do so. If we > really want to, we can add to the second from the paragraph > something like this: > > ... would not work anyway (the use of ".git" that is "gitfile" > is often seen in a secondary working tree managed by "git > worktree" and in a working tree of a submodule). > That's better ... here is my attempt to improve doc: do not use `rm .git/index` when normalizing line endings When illustrating how to normalize the line endings, the documentation in gitattributes tells the user to `rm .git/index`. This is incorrect for two reasons. Users shouldn't be instructed to futz with the internal implementation of Git using raw file system tools like "rm". Second, when submodules or second working trees are used, ".git" is a not a directory but a "gitfile" pointing at the location of the real ".git" directory, `rm .git/index` does not work. The point of the step in the illustration is to remove all entries from the index without touching the working tree, and the way to do it with Git is to use `read-tree --empty`.