Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tig status and git-worktree #437

Closed
stenja opened this issue Sep 4, 2015 · 3 comments
Closed

tig status and git-worktree #437

stenja opened this issue Sep 4, 2015 · 3 comments

Comments

@stenja
Copy link

stenja commented Sep 4, 2015

tig status doesn't seem to be playing nicely with the new git worktree features. From a worktree, git status shows every file in the repository as staged, with the branch listed as "Initial commit". If you refresh the view with F5 or R, it corrects itself and shows the correct branch and correct modified/staged files.

Similarly, the log view in tig does not have the staged and unstaged changes entries. Refreshing the log view does not fix it like it does with the status view.

I'm using tig version 2.1.1-67-g65cb5b4 with git 2.6.0-rc0. I see the exact same behavior in windows using git 2.5.0.windows.1 and tig 2.1.1-48-geecfbda (compiled in cygwin)

@jonas
Copy link
Owner

jonas commented Sep 7, 2015

I've never used Tig with git-worktree. Can you help coming up with a shell
script that sets up worktree and some command that shows the expected
output? Then I'll create a test script and see if I can get it to work.

On Fri, Sep 4, 2015 at 4:27 PM, stenja notifications@github.com wrote:

tig status doesn't seem to be playing nicely with the new git worktree
features. From a worktree, git status shows every file in the repository as
staged, with the branch listed as "Initial commit". If you refresh the view
with F5 or R, it corrects itself and shows the correct branch and correct
modified/staged files.

Similarly, the log view in tig does not have the staged and unstaged
changes entries. Refreshing the log view does not fix it like it does with
the status view.

I'm using tig version 2.1.1-67-g65cb5b4 with git 2.6.0-rc0. I see the
exact same behavior in windows using git 2.5.0.windows.1 and tig
2.1.1-48-geecfbda (compiled in cygwin)


Reply to this email directly or view it on GitHub
#437.

Jonas Fonseca

@stenja
Copy link
Author

stenja commented Sep 7, 2015

Sure

git init wttest
cd wttest
echo "test file" > testfile.txt
git add testfile.txt
git commit -m "initial commit"
git branch dev
git worktree add wtfolder dev
cd wtfolder
tig status

The expected output would be:

On branch dev
Changes to be committed:
  (no files)
Changed but not updated:
  (no files)
Untracked files:
  (no files)

But instead I see:

Initial commit
Changes to be committed:
A testfile.txt
Changed but not updated:
  (no files)
Untracked files:
  (no files)

Pressing R or F5 corrects it, showing "On branch dev" with no staged files

Similarly, just running "tig" for the main view, there is no "Staged changes" or "Unstaged changes" bubble like there normally is, even if you make changes

@jonas
Copy link
Owner

jonas commented Sep 9, 2015

Thanks.

From TIG_TRACE=out tig status, listing of refs in the repo fails with:

git ls-remote /opt/tig/test/tmp/status/worktree-test/repo/.git/worktrees/work dir
fatal: '/opt/tig/test/tmp/status/worktree-test/repo/.git/worktrees/work dir' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

... which causes the status view to use:

git ls-files -z --cached --exclude-standard

instead of:

git diff-index -z --diff-filter=ACDMRTXB -C --cached HEAD --

for listing staged files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants