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

Cannot stage changes #52

Closed
fpnick opened this issue Dec 7, 2015 · 7 comments
Closed

Cannot stage changes #52

fpnick opened this issue Dec 7, 2015 · 7 comments

Comments

@fpnick
Copy link

fpnick commented Dec 7, 2015

Hi,

I installed Vimagit via bundle and made a small change to my test-repository (which I could share, if necessary.)

Then I ran ':Magit' and got a buffer showing staged and unstaged changes.
I moved the cursor to the line 'modified: bar' under 'unstaged changes and pressed 'S' to stage the changes.

All I got though was an error message saying

Fehler beim Ausführen von "function
magit#stage_hunk..magit#stage_block..magit#git#git_apply":
Zeile 8:
Git error: error: No changes^@
Zeile 9:
Git cmd: GIT_CONFIG=/dev/null GIT_CONFIG_NOSYSTEM=1 XDG_CONFIG_HOME=/ git apply > --recount --no-index --cached -
Zeile 10:
Tried to aply this
Zeile 11:
['error: invalid option: --patch', '']

Where "Fehler beim Ausführen" means "Error executing" and "Zeile" means "line".

I'm using Vim version 7.4.629 on Linux.

Thanks,
Fabian.

@jreybert
Copy link
Owner

jreybert commented Dec 7, 2015

Hi,

could you please checkout the branch dev/issue_52 and give me the error output? Please note that this branch won't fix your issue.

Futhermore, what is your git version? Do you use non ascii characters in your filenames?

Thanks for your report.

@fpnick
Copy link
Author

fpnick commented Dec 8, 2015

Thanks for having a look at this. With the new branch the error looks like this (translated from German to English by me):

Git error: ['error: invalid option: --patch']
Git cmd: git diff --no-ext-diff --no-color --patch -- "bar"
Error executing "function > magit#show_magit..magit#update_buffer..magit#state#update..magit#state#add_file..magit#git#git_diff":
line 12:
E605: Exception not caught: diff error

I'm trying this on my workstation at work and unfortunately my git version is pretty old: 1.7.1.
If this should turn out to be the problem, I could talk to our IT department though...

The filename is 'bar', so no non-ascii charactars.

Cheers,
Fabian.

@jreybert
Copy link
Owner

jreybert commented Dec 8, 2015

OK, I think your old git version is the problem. Actually, --patch may be overkill as it is the default for diff.

Let me check at which git version diff --patch appeared, and I let disable this patch for older versions.

@jreybert
Copy link
Owner

jreybert commented Dec 8, 2015

--patch is an alias of -p, and appeared on git 1.7.10.

branch next should fix your problem.

@fpnick
Copy link
Author

fpnick commented Dec 8, 2015

Now it works, thanks!

@fpnick fpnick closed this as completed Dec 8, 2015
@jreybert
Copy link
Owner

jreybert commented Dec 8, 2015

Thank you for your responsiveness!

@jreybert jreybert added this to the Release 1.6.0 milestone Dec 8, 2015
@jreybert
Copy link
Owner

jreybert commented Dec 8, 2015

I reopen it until it is merged in master

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

2 participants