git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] doc: fix location of index in worktree scenatio

From
Torsten Bögershausen <tboegi@web.de>
Date
Jun 12, 2017, 10:03 UTC
Message-ID
<b4906d3f-7e4d-f4dc-dc39-7eac5da8292d@web.de>
In-Reply-To
<20170610173824.19460-1-asheiduk@gmail.com>
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"

On 10/06/17 19:38, Andreas Heiduk wrote:
> When setting `.gitattributes` in a second worktree, a plain `rm .git/index`
> does not actually delete the index.

This feels somewhat short. setting .gitattributes is (in general) independent of the index. In normalizing line endings case the user needs to do both, fix attribiutes, and re-read the work tree, discarding the index.

How about this:

When line endings are normalized in a second worktree, a plain `rm .git/index` does not actually delete the index. Fix a long standing bug in the documentaton and use "git read-tree --empty" instead-

Show 21 quoted lines
> 
> Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> ---
>   Documentation/gitattributes.txt | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
> index 473648386..2a2d7e2a4 100644
> --- a/Documentation/gitattributes.txt
> +++ b/Documentation/gitattributes.txt
> @@ -229,7 +229,7 @@ From a clean working directory:
>   
>   -------------------------------------------------
>   $ echo "* text=auto" >.gitattributes
> -$ rm .git/index     # Remove the index to re-scan the working directory
> +$ git read-tree --empty   # Clean index, force re-scan of working directory
>   $ git add .
>   $ git status        # Show files that will be normalized
>   $ git commit -m "Introduce end-of-line normalization"
> 
Previous: Andreas HeidukNext: Andreas Heiduk
Message 5 of 12 in “doc: fix location of index in worktree scenatio”
  1. doc: fix location of index in worktree scenatioAndreas Heiduk, Jun 10, 2017
  2. Junio C HamanoJun 10, 2017
  3. Andreas HeidukJun 10, 2017
  4. doc: fix location of index in worktree scenatioAndreas Heiduk, Jun 10, 2017
  5. Torsten BögershausenJun 12, 2017
  6. Andreas HeidukJun 12, 2017
  7. Junio C HamanoJun 12, 2017
  8. Torsten BögershausenJun 13, 2017
  9. Junio C HamanoJun 13, 2017
  10. doc: do not use `rm .git/index` when normalizing line endingsAndreas Heiduk, Jun 13, 2017
  11. Torsten BögershausenJun 14, 2017
  12. doc: do not use `rm .git/index` when normalizing line endingsAndreas Heiduk, Jun 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.