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

Linked workdirs break typo-correction.

From
Bjørnar Snoksrud <snoksrud@gmail.com>
Date
Jun 25, 2015, 14:15 UTC
Message-ID
<CA+cck7GD+JgR4O-XoBeUX1gJAG6suP9iLwASyRygK8hR4KP7pw@mail.gmail.com>
This is a weird one..

When standing in a folder inside a linked working copy, the typo-correction breaks all commands.

Repro:
~/git $ git --version
git version 2.4.4.600.g6397abd
~/git $ git init bar
Initialized empty Git repository in ~/git/bar/.git/
~/git $ cd bar
~/git/bar (master #) $ git commit -m init --allow-empty
[master (root-commit) 554ea84] init
~/git/bar (master) $ mkdir folder
~/git/bar (master) $ touch folder/file
~/git/bar (master) $ git add folder
~/git/bar (master +) $ git commit -m folder
[master 8c00ba8] folder
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 folder/file
~/git/bar (master) $ cd folder/
~/git/bar/folder (master) $ git shw
WARNING: You called a Git command named 'shw', which does not exist.
Continuing under the assumption that you meant 'show'
in 0.1 seconds automatically...
commit 8c00ba8d30cff0e0d1b9cf110a65ea8f33edf8b2
Author: Bjørnar Snoksrud <bsnoksru@cisco.com>
Date:   Thu Jun 25 16:08:01 2015 +0200
    folder
diff --git a/folder/file b/folder/file
new file mode 100644
index 0000000..e69de29
bsnoksru@calculon ~/git/bar/folder (master) $ git branch foo
bsnoksru@calculon ~/git/bar/folder (master) $ git checkout foo --to
~/git/foo
Enter /home/bsnoksru/git/foo (identifier foo)
Switched to branch 'foo'
bsnoksru@calculon ~/git/bar/folder (master) $ cd ../../foo/folder/
~/git/foo/folder (foo) $ git shw
WARNING: You called a Git command named 'shw', which does not exist.
Continuing under the assumption that you meant 'show'
in 0.1 seconds automatically...
fatal: internal error: work tree has already been set
Current worktree: ~/git/foo
New worktree: ~/git/foo/folder
~/git/foo/folder (foo) $ git brnch baz
WARNING: You called a Git command named 'brnch', which does not exist.
Continuing under the assumption that you meant 'branch'
in 0.1 seconds automatically...
fatal: internal error: work tree has already been set
Current worktree: /home/bsnoksru/git/foo
New worktree: /home/bsnoksru/git/foo/folder
-- 
bjornar@snoksrud.no
Next: Nguyễn Thái Ngọc Duy
Message 1 of 7 in “Linked workdirs break typo-correction.”
  1. Bjørnar SnoksrudJun 25, 2015
  2. setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIRNguyễn Thái Ngọc Duy, Jun 26, 2015
  3. Jeff KingJun 26, 2015
  4. Duy NguyenJun 27, 2015
  5. Junio C HamanoJun 26, 2015
  6. Junio C HamanoJun 26, 2015
  7. Junio C HamanoJun 26, 2015

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.