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

Git Worktree Broken in 2.16.0 #1440

Closed
1 task done
KellyDeveloped opened this issue Jan 20, 2018 · 4 comments
Closed
1 task done

Git Worktree Broken in 2.16.0 #1440

KellyDeveloped opened this issue Jan 20, 2018 · 4 comments
Milestone

Comments

@KellyDeveloped
Copy link

KellyDeveloped commented Jan 20, 2018

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

** PS F:\git-test> git --version --build-options
git version 2.16.0.windows.2
cpu: x86_64
built from commit: a56c4f9e2a9513d2be57dc4346e0e84887399cd9
sizeof-long: 4 **
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

** Microsoft Windows [Version 10.0.16299.192] **
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** Editor Option: Nano
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** N/A **

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** PowerShell, CMD **

**  PS F:\git-test> git init
Initialized empty Git repository in F:/git-test/.git/
PS F:\git-test> echo "test file" > test.txt
PS F:\git-test> git add test.txt
PS F:\git-test> git commit -m "Test Commit"
[master (root-commit) 3db9464] Test Commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test.txt
PS F:\git-test> git worktree add -b branch test
Preparing test (identifier test)
error: unable to stat just-written file test.txt: No such file or directory
fatal: Could not reset index file to revision 'HEAD'. **
  • What did you expect to occur after running these commands?

** I expected two things to have happened - a new branch named "branch" to have been created, and for it to be viewable in a folder named "test" **

  • What actually happened instead?

** Instead, the command threw an error saying

error: unable to stat just-written file test.txt: No such file or directory
fatal: Could not reset index file to revision 'HEAD'.

This meant that the folder containing the branch was not made.

This branch CAN be checked out using the git checkout command without issue. But cannot be used as a worktree **

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

** N/A - this occurs on multiple repositories **

@atetubou
Copy link

Sorry, I confirmed my commit fcba80a introduced this regression. This commits also caused similar issue #1437
@dscho please revert this.

@KellyDeveloped
Copy link
Author

How long will it take for a patch/revert to come out? Just so I know whether to roll back to a previous version or wait.

@PhilipOakley
Copy link

There are upstream breakages as well that probably hit some GfW repos as well, plus @dscho is currently on an well earned vacation. So a maintenance release could be a a week or two away.

@atetubou could you create a PR that does the revert? That way @dscho can apply it easily.

@atetubou
Copy link

@PhilipOakley sure.

dscho added a commit to git-for-windows/build-extra that referenced this issue Jan 22, 2018
A set of regressions introduced by patches intended
to speed up `reset` and `checkout` was fixed (issues
[#1437](git-for-windows/git#1437),
[#1438](git-for-windows/git#1438),
[#1440](git-for-windows/git#1440) and
[#1442](git-for-windows/git#1442).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Jan 22, 2018
The recent speedup to `git reset` sadly broke things, as the cached stat
data is no longer accurate after writing the file(s). And that is exactly
what `git reset` does: writing the file(s).

This patch is identical to the one provided in
#1445 but added a bit more
detailed information, as well as marking it as a fixup so that the next
merging-rebase will drop the patch altogether.

This fixes #1437 and
#1440.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho added this to the v2.16.0(3) milestone Jan 22, 2018
@dscho dscho closed this as completed Jan 22, 2018
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

4 participants