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: Could not hash object when staging selected ranges #58874

Closed
alexdima opened this issue Sep 18, 2018 · 3 comments
Closed

Git: Could not hash object when staging selected ranges #58874

alexdima opened this issue Sep 18, 2018 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues help wanted Issues identified as good community contribution opportunities wont-fix
Milestone

Comments

@alexdima
Copy link
Member

Issue Type: Bug

  • Have a diff like a one line added in a file.
  • Select the line and at least one line above and at least one line below.
  • Run Git: Stage Selected Ranges

Observe Error:
image

Here are the last (relevant) contents of the git log:

> git remote --verbose
> git fetch
> git show :src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
> git ls-tree -l HEAD -- c:\Alex\src\vscode\src\vs\workbench\api\node\extHost.protocol.ts
> git show 079fb3a64d81a059555a7b650793b2e72c8c528e
> git show HEAD:src/vs/workbench/api/node/extHost.protocol.ts
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse master
> git rev-parse --symbolic-full-name master@{u}
> git rev-list --left-right master...refs/remotes/origin/master
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
> git show HEAD:src/vs/workbench/api/node/extHost.protocol.ts
> git hash-object --stdin -w --path src/vs/workbench/api/node/extHost.protocol.ts
> git hash-object --stdin -w --path src/vs/workbench/api/node/extHost.protocol.ts
> git hash-object --stdin -w --path src/vs/workbench/api/node/extHost.protocol.ts
> git hash-object --stdin -w --path src/vs/workbench/api/node/extHost.protocol.ts

Here is the git version:

> git --version
git version 2.18.0.windows.1

VS Code version: Code - Insiders 1.28.0-insider (98d2fd8, 2018-09-18T06:10:01.706Z)
OS version: Windows_NT ia32 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 x 3592)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.95GB (9.63GB free)
Process Argv C:\Alex\Programs\Microsoft VS Code Insiders\Code - Insiders.exe
Screen Reader no
VM 67%
@vscodebot vscodebot bot added the insiders label Sep 18, 2018
@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Sep 19, 2018
@joaomoreno
Copy link
Member

Can't repro, maybe show me?

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug git GIT issues help wanted Issues identified as good community contribution opportunities and removed insiders info-needed Issue requires more information from poster labels Sep 19, 2018
@joaomoreno joaomoreno added this to the Backlog milestone Sep 19, 2018
@joaomoreno
Copy link
Member

joaomoreno commented Sep 19, 2018

This happens because git show is returning LF on our repo, since @alexandrudima has core.safecrlf = true, even though we have .gitattributes set. Then, git hash-object fails with a EOL warning.

@JarLob
Copy link

JarLob commented Jul 31, 2019

Ran into the same issue. The repro is clear. Could you please fix it?

@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues help wanted Issues identified as good community contribution opportunities wont-fix
Projects
None yet
Development

No branches or pull requests

3 participants