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-
Signed-off-by: Andreas Heiduk <asheiduk@xxxxxxxxx>
Helped-by: Junio C Hamano <gitster@xxxxxxxxx>
---
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"