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

ConflictError: Cannot add lines after given line since there are already lines. #1235

Closed
tims0 opened this issue Jan 22, 2016 · 6 comments
Closed

Comments

@tims0
Copy link

tims0 commented Jan 22, 2016

pasted image at 2016_01_21 11_22 pm

There is the error message. If you have more questions, ask me.

@sils
Copy link
Member

sils commented Jan 22, 2016

@Makman2 I think this is a usability issue, probably relevant for 0.5... ish?

Could you tell us what you were expecting coala to do in this case? Print the same patch again? Are you aware that the patch would be no longer valid because the files on your FS have changed?

@Makman2
Copy link
Member

Makman2 commented Jan 22, 2016

@sils1297 wouldn't that also happen on Linux systems?
But yeah that's a bit difficult now what to expect. First the "apply the patch"-action should be removed after applying the patch. Second for the print-patch-action there are two possibilities:

  1. Remove it also from the choice list after applying the patch
  2. Display the old patch (which would be the better option imo)
    I'm not sure when coala does write back stuffs, it was immediately, wasn't it? Depending on how this is handled it gets more or less difficult to regain the old file content. Maybe we keep two versions in memory, the old one and a working copy that gets written back to files after each apply or so^^

@sils
Copy link
Member

sils commented Jan 22, 2016

@Makman2 we have the new version in the memory always and also on the filesystem. Would be hard to print the patch after it's applied. I'd rather remove that action after the patch was applied together with the apply action. That would be done by #1064 then.

@Makman2
Copy link
Member

Makman2 commented Jan 22, 2016

@sils1297 yes that's why we need to keep the old version if we want to print the patch and refer to that. I would like to be able to print the patch still, sometimes it's like "oh coala found something, just apply... oh wait damn, that was from SpecialSuperBear, omg need to check that again what I did..."
Even though git tracks changes and you could see them, this would only work when you work with git :)

@sils
Copy link
Member

sils commented Jan 22, 2016

@Makman2 I don't see any way to do this cleanly from a technical POV. I.e. we can't provide an action with the means to do that kind of thing without doing something completely weird, complicated that would work just for this one usecase which isn't that important anyway. I would rather think about executing applypatchaction automatically before applying the patch or so.

@Makman2
Copy link
Member

Makman2 commented Jan 22, 2016

Alright then let's remove the choice for displaying the patch when a user already applied it.

AbdealiLoKo added a commit that referenced this issue Feb 21, 2016
Earlier, is_applicable() was not very smart and just checked
if the diff existed. Now, we check if the diff has a conflict.
If there is a conflict, this action is not applicable.
We use a similar condition to ApplyPatchAction, as when the
patch is viewable, it should also be applicable.

Fixes #1235
@AbdealiLoKo AbdealiLoKo self-assigned this Feb 21, 2016
@rultor rultor closed this as completed in 04baa48 Feb 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants