atom / git-utils

Git Node Module
http://atom.github.io/git-utils
MIT License
166 stars 59 forks source link

git-utils crashes when opening a repository using index version 4 #70

Open niw opened 8 years ago

niw commented 8 years ago

Due to current submodule libgit2 which doesn't support index version 4 and may crash because of tree_iterator implementation issue, git-utils may crash when opening such git repository.

A minimum fix is, at least, merge libgit2/libgit2@4fea9cffbda89562bfdcdd58b0162d31ca4feb3e commit.

A real fix is ask libgit2 to support index version 4 (See https://github.com/libgit2/libgit2/blob/master/src/index.c#L2343-L2345)

Repro steps:

  1. Create a git repository and commit a file.
  2. Run git update-index --index-version=4 to update index version to 4.
  3. Run git.open("path-to-git") on node

Expected behavior: Open git repository

Actual behavior: Crash

Scalahansolo commented 8 years ago

+1 I would like to see this get some traction as this issue makes it hard to use Atom on any such repo.

niw commented 8 years ago

I think it's better to hold this until libgit2/libgit2#3837 gets merged, which is a real fix for this issue.

50Wliu commented 8 years ago

Above PR has been merged.

xcv58 commented 8 years ago

Any update? The libgit2 already released new version to fix this.

niw commented 8 years ago

libgit2/libgit2#3837 is merged on libgit2/libgit2 and on its master, however, it's not released yet. I think it might be better to wait its release, technically we can use its master tho.

niw commented 8 years ago

Just in case I updated atom/git-utils#71 to use 0.24.1, which is their latest release (but that doesn't include libgit2/libgit2#3837)

niw commented 7 years ago

I updated again #71 to use 0.24.2. However, seems like any libgit2 0.24.x may not include libgit2/libgit2#3837 that addresses index version 4 issue. So, probably #71 may not a fix for this issue, however, still #71 that upgrades libgit2 to 0.24.x might be useful because it can solve #73 as @tgandrews mentioned.

damieng commented 7 years ago

Updated to 0.24.3 which stops the crashing but effectively disables git integration when using with a clone that has a v4 index.

niw commented 7 years ago

As I commented before on this thread, libgit2/libgit2#3837 is the real solution for this issue, which is merged in libgit2 master and available as a part of v0.25.0-rc1. Thus, once libgit2/libgit2 v0.25.0 is released, then bump the version, then we can solve this issue also atom/atom#11225.