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

Uncaught exception when staging/unstaging multiple files #30

Closed
h3xx opened this issue Nov 4, 2015 · 4 comments
Closed

Uncaught exception when staging/unstaging multiple files #30

h3xx opened this issue Nov 4, 2015 · 4 comments
Labels

Comments

@h3xx
Copy link

h3xx commented Nov 4, 2015

Magit version affected: <1.4.1> 3c3baa3

Steps to reproduce:

  1. Run :Magit while running vim with no arguments from a git working directory with unstaged changes.
  2. Move cursor down to Unstaged changes section on the line with the first unstaged file.
  3. Press V to enter VISUAL LINE mode.
  4. Select any number of lines in the Unstaged changes section.
  5. Press S.

Produces error:

Error detected while processing function magit#stage_vselect[8]..<SNR>33_mg_create_diff_from_select[3]..<SNR>33_mg_select_hunk_block[1]..<SNR>33_mg_search_block:                         
line    9:                                                                                                                                                                                
E605: Exception not caught: out_of_block                                                                                                                                                  
Press ENTER or type command to continue

Also note:

  • Using L to stage by lines while in VISUAL LINE mode isn't vmapped to an action.
  • Behavior is also present when attempting to unstage changes from the Staged changes section.
@jreybert
Copy link
Owner

jreybert commented Nov 4, 2015

Hi h3xx,

stage multiple files at once by visually selecting them is not supported for the moment. I know this would be a great feature. I am planning to integrate such feature, but I don't know when.

Anyway, maybe the documentation is not clear enough about this limitation. Here you can see that:

  • If some lines in the hunk are selected (using v), stage only visual selected lines (only works for staging).
  • If some lines in the hunk are marked (using M), stage only marked lines (only works for staging).

For your other points:

  • Using L to stage by lines while in VISUAL LINE mode isn't vmapped to an action.

I am not comfortable with such mapping. The semantic of L is to stage one single line. What vimagit should do if you select multiple lines and press L?

  • Behavior is also present when attempting to unstage changes from the Staged changes section.

This is a current limitation of vimagit, also stated in documentation.

I split your issue in multiple issues.

Thanks for your report!

@jreybert jreybert closed this as completed Nov 4, 2015
@jreybert jreybert reopened this Nov 4, 2015
@jreybert jreybert changed the title Uncaught exception when staging/unstaging multiple files feature: stage multiple files at once by visually selecting them Nov 4, 2015
@jreybert
Copy link
Owner

jreybert commented Nov 4, 2015

@h3xx
Copy link
Author

h3xx commented Nov 4, 2015

Don't you think that if the feature simply isn't implemented, it shouldn't cause the code to break and throw an exception?

I'm not expecting this feature to be created, I'm just reporting that I was able to very easily cause the plugin to scream and die simply by doing what seemed to me (as a long-time vim-fugitive user) to be normal intuitive usage.

@jreybert jreybert added bug and removed new feature labels Nov 4, 2015
@jreybert jreybert changed the title feature: stage multiple files at once by visually selecting them Uncaught exception when staging/unstaging multiple files Nov 4, 2015
@jreybert
Copy link
Owner

jreybert commented Nov 4, 2015

You were right, I missed your point.

Thanks

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

2 participants