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

support buffer-based git repo? #44

Closed
goweol opened this issue Nov 16, 2015 · 5 comments
Closed

support buffer-based git repo? #44

goweol opened this issue Nov 16, 2015 · 5 comments

Comments

@goweol
Copy link

goweol commented Nov 16, 2015

When I open a file in another git repo, ':Magit' shows status for current repo (where I started vim).
Fugitive (Gstatus) shows status for another repo (for current buffer).

I hope magit support buffer-based git repo (optional?).

BTW, ':cd %:p:h' didnot help. :Magit shows old repo status, though I changed to another repo. I expected magit shows status for VIM's current directory.
It may related to submodule feature (I use many submodules).

$ git rev-parse --show-toplevel
/data/test/lib

$ git rev-parse --git-dir
/data/test/.git/modules/lib

If I start VIM in that another repo, :Magit shows status for that repo.

@jreybert
Copy link
Owner

No, magit does not handle it for the moment.

See #29 and #34

@haifengkao
Copy link

#29 has a easy fix for it

@jreybert
Copy link
Owner

The fix is easy, but I can't predict what are the side effects. vimagit use a lot of buffer variables to cache some stuff. But I have no time at this moment to perform a deep code review to check that nothing is broken, and the actual test suite does not cover this case.

Like I said in #29, I prefer a solution where I open a new buffer for each git repository, but it asks some time to develop.

Actually, you can try the #29 pull request. It may even work! But as long as I don't add a test case for this, it won't be merged in vimagit.

@jreybert
Copy link
Owner

I believe that this feature is now added in branch dev/multiple_repo.

I'll wait for your feedback before merging it in next.

@goweol
Copy link
Author

goweol commented Nov 17, 2015 via email

jreybert added a commit that referenced this issue Nov 20, 2015
* dev/multiple_repo:
  plugin/magit.vim: in show_magit(), always open buffer with :buffer command (fix #41)
  plugin/magit.vim,autoload/git.vim: yet another rework of magit#show_magit() (fix #41)
  plugin/magit.vim,autoload/{git,sign}.vim: magit can handle multiple git repository within one vim session (fix #44,#34,#29)
@jreybert jreybert modified the milestone: Release 1.5.0 Nov 21, 2015
jreybert added a commit that referenced this issue Nov 30, 2015
* next:
  Update Changelog
  plugin/magit.vim: move s:magit_commit_mode to buffer variable b:magit_current_commit_mode
  plugin/magit.vim: move s:state to buffer variable b:state
  plugin/magit.vim: display commit mode in Info section
  syntax/magit.vim: rework section title color
  Update Changelog
  README,doc: add notes that magit handles multiple git repo
  README,doc: misc changes
  plugin/magit.vim: add mappings N and P to jump to next and previous hunk (fix #25)
  syntax/magit.vim: add some color in Info section
  plugin/magit.vim: disable inline help by default (fix #46)
  plugin/magit.vim: update inline help
  state.vim: display modified files first
  plugin/magit.vim: in show_magit(), always open buffer with :buffer command (fix #41)
  plugin/magit.vim,autoload/git.vim: yet another rework of magit#show_magit() (fix #41)
  plugin/magit.vim,autoload/{git,sign}.vim: magit can handle multiple git repository within one vim session (fix #44,#34,#29)
  plugin/magit.vim: add MagitOnly command
  plugin/magit.vim: better handling of magit buffer, including clean quit command (fix #43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants