From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Andreas Heiduk <asheiduk@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2] doc: fix location of index in worktree scenatio
Date: Tue, 13 Jun 2017 06:29:09 +0200 [thread overview]
Message-ID: <04ad4189-8575-2f0f-2c99-c98672513293@web.de> (raw)
In-Reply-To: <xmqqfuf5p4wk.fsf@gitster.mtv.corp.google.com>
On 06/12/2017 06:06 PM, Junio C Hamano wrote:
> Torsten Bögershausen <tboegi@web.de> 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`.
next prev parent reply other threads:[~2017-06-13 4:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-10 9:07 [PATCH] doc: fix location of index in worktree scenatio Andreas Heiduk
2017-06-10 11:17 ` Junio C Hamano
2017-06-10 17:24 ` Andreas Heiduk
2017-06-10 17:38 ` [PATCH v2] " Andreas Heiduk
2017-06-12 10:03 ` Torsten Bögershausen
2017-06-12 10:48 ` Andreas Heiduk
2017-06-12 16:06 ` Junio C Hamano
2017-06-13 4:29 ` Torsten Bögershausen [this message]
2017-06-13 13:07 ` Junio C Hamano
2017-06-13 22:15 ` [PATCH v3] doc: do not use `rm .git/index` when normalizing line endings Andreas Heiduk
2017-06-14 4:06 ` Torsten Bögershausen
2017-06-14 6:51 ` [PATCH v4] " Andreas Heiduk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=04ad4189-8575-2f0f-2c99-c98672513293@web.de \
--to=tboegi@web.de \
--cc=asheiduk@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).