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 checkout of origin branch fails due to long pathname #1084

Closed
1 task
lrech opened this issue Mar 6, 2017 · 2 comments
Closed
1 task

git checkout of origin branch fails due to long pathname #1084

lrech opened this issue Mar 6, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@lrech
Copy link

lrech commented Mar 6, 2017

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

Setup

$ git --version --build-options
git version 2.12.0.windows.1
built from commit: d4baef1cdfef9de62d43f9682a98ba57adc842e4
sizeof-long: 4
machine: x86_64
  • 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 6.1.7601]
  • 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"

Path Option: CmdTools
SSH Option: OpenSSH
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?

A business decision was made at the beginning of the project to include all node_modules as part of the repository. We are also running an inhouse git server.

Details

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

I am currently using PowerShell, but the error also occurs when using CMD, Git Bash and GitExtensions.

  • What commands did you run to trigger this issue? If you can provide a

    If you don't mind I'm going to obscure our internal project name, I don't think it's relevant to outcome/reproducibility of the issue.

git clone ssh://server/path/to/repos/Project.git
cd .\Project
git checkout -b develop origin/develop

  • What did you expect to occur after running these commands?

Expectation was to have a tracked local develop branch checked out.

  • What actually happened instead?

The following error was reported:
$ > git co -b develop origin/develop
fatal: cannot create directory at 'ProjectMVC/node_modules/gulp-autoprefixer/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids': No such file or directory

It should be noted that we have "git config --global --add core.longpaths true" and that the checkout command above succeeds when using git version 2.9.2.windows.1

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

As mentioned above, we are using an inhouse git server.

@red1939
Copy link

red1939 commented Mar 8, 2017

Have the same issue. git-svn fetch works, but when trying to checkout contents of commit (via git reset --hard) I get the "No such file or directory".

Windows 10 Redstone 1 (14393) x64
git version 2.12.0.windows.1

Path Option: BashOnly
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled

@red1939
Copy link

red1939 commented Mar 9, 2017

I've debugged a little bit and the scenario is as follows:

  1. Relative (input) path is of size 226
  2. Full path prefix is of size 27
  3. UTF 2 wide char succeeds mingw.h@xuftowcs_path_ex:623
  4. Long path doesn't convert the path to UNC as we are both below 260 limit (253) and relative mingw.c@handle_long_path:2947
  5. Unmodified path is passed to _wmkdir mingw.c@mingw_mkdir:502
  6. _wmkdir fails (ret = -1), errno is ... 0, but get last error is set to 206 (ERROR_FILENAME_EXCED_RANGE)

Also I found a note that in case of paths, the max_path is not 260 (as the value itself) but 248. I proposed my change in #1088.

@dscho dscho closed this as completed in 599fd1d Mar 10, 2017
@dscho dscho added the bug label Mar 10, 2017
@dscho dscho self-assigned this Mar 10, 2017
@dscho dscho added this to the v2.12.1 milestone Mar 10, 2017
dscho added a commit to git-for-windows/build-extra that referenced this issue Mar 10, 2017
Long paths between 248 and 260 characters were not handled
correctly since Git for Windows v2.11.1, which [is now
fixed](git-for-windows/git#1084).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants