git-machete-intellij-plugin icon indicating copy to clipboard operation
git-machete-intellij-plugin copied to clipboard

Entry to machete file added even when slide in failure

Open micpiotrowski opened this issue 5 years ago • 8 comments

In case when slide in failure (e.g. submodule misconfiguration) new branch entry is added to machete file anyway

micpiotrowski avatar Jul 30 '20 21:07 micpiotrowski

@micpiotrowski please add the specific steps to reproduce this one

mkondratek avatar Jul 31 '20 10:07 mkondratek

  1. create git repository and subrepository in it
  2. corrupt submodule settings (e.g. edit patch to submodule in main-repo/.git/modules/<submodule-name>/config in worktree key
  3. try to to slide in new branch in that submodule repo

As effect branch will not been created (creation failure) but branch entry will be added to machete file

This is one of examples why branch creation may failed (in this case it is missconfiguration)

micpiotrowski avatar Jul 31 '20 11:07 micpiotrowski

corrupt submodule settings (e.g. edit path to submodule ...)

Hmm to be fair very little can be guaranteed (also by git itself) in case someone corrupts vital settings like this one...

PawelLipski avatar Jul 31 '20 12:07 PawelLipski

I think this one is at most minor (if it's an issue at all) unless it's also likely to affect users in more frequent corner cases

PawelLipski avatar Jul 31 '20 12:07 PawelLipski

Hmm to be fair very little can be guaranteed (also by git itself) in case someone corrupts vital settings like this one...

Yes, I agree but the same can happen if by any other reason branch will not been created. But ok, it's not so important as now.

micpiotrowski avatar Jul 31 '20 13:07 micpiotrowski

@micpiotrowski but do we know any other reason that might lead to this issue?

After a quick look at the present approach, I can say that there is no way to handle branch creation failures. Ofc we could get deeper and use GitBranchWorker (where the handling seems to be possible) directly. We lose the reused dialog then.

mkondratek avatar Aug 03 '20 06:08 mkondratek

@micpiotrowski but do we know any other reason that might lead to this issue?

Actually, no.

After a quick look at the present approach, I can say that there is no way to handle branch creation failures. Ofc we could get deeper and use GitBranchWorker (where the handling seems to be possible) directly. We lose the reused dialog then.

So leave as is. It seems to be really not so important that I think at the beginning.

micpiotrowski avatar Aug 03 '20 07:08 micpiotrowski

Whoops, actually this seems to also happen when the checkout is declined by the user (due to possible file conflicts)... branch is still getting slid in. Which I think merits NOT considering this issue minor anymore :/

PawelLipski avatar Sep 30 '20 14:09 PawelLipski

I have a little bit of problem in reproducing the issue.

vzmerr avatar Sep 23 '22 09:09 vzmerr

Quite likely the issue no longer exists, might've been fixed over the last two years without us noticing ;) Closing then

PawelLipski avatar Sep 23 '22 09:09 PawelLipski

new issue: the entry does not get deleted from the machete file, upon the deletion of the branch.

vzmerr avatar Sep 23 '22 10:09 vzmerr

upon the deletion of the branch

You mean when branch is deleted e.g. via git branch -d ..., outside of git-machete right? that's expected in general!

PawelLipski avatar Sep 23 '22 11:09 PawelLipski