This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NB dev builds, from a few months back and from now. http://stackoverflow.com/questions/19985906/git-merge-not-creating-merge-commit-no-merge-head I use NB for diffing & committing but do all other Git operations from a shell. On occasion I have noticed that after running ‘git merge <otherbranch>’ when this has conflicts, even if I resolve all of the conflicts (from the shell / Emacs) and ‘git commit’, the commit message shows that I am making a regular commit, not a merge commit; indeed .git/MERGE_HEAD is not present. Of course in this situation the commit is bogus and must be discarded. Finally a comment from another user pointed me to the cause: at the time, NetBeans is running with my project open. If I close NetBeans and retry the whole operation (‘git reset --hard HEAD && git merge <otherbranch> && cat .git/MERGE_HEAD’) then it works fine. Note that not only I am not trying to initiate the merge from the IDE, I am not even switching to the IDE’s window or using it in any way; it is apparently noticing the changes on disk and doing something in the background which winds up deleting MERGE_HEAD. Marking P2 since if you do not know the trigger you can waste a lot of time trying to get the merge to run normally, or (worse) keep the bogus commit with the missing merge parent. Note that this does not seem to happen most of the time, just sometimes. When it happened just now, there was a modify/delete conflict (file deleted in HEAD and modified in the merged branch). MERGE_HEAD is missing before I even try to resolve the conflict.
AFAIK MERGE_HEAD is deleted only when a commit or reset is called from NetBeans and only when that command succeeds. I doubt NB deletes the file while you're working in shell. It might be that CLI git does not even create that file, maybe because a potential read/write conflict when NB is checking for the file's existence (though i doubt it, it sounds like a coincidence with probability closing to zero). And even then it would probably be git's fault. > Note that not only I am not trying to initiate the merge from the IDE, I am not > even switching to the IDE’s window or using it in any way; it is apparently > noticing the changes on disk and doing something in the background which winds > up deleting MERGE_HEAD. i will try it several times, but again, i am not aware of any background task deleting the file.
i cannot reproduce, but as you said it does not always happen. I can try and delay calls to code responsible for checking/reading MREGE_HEAD file for later when the repository is currently locked. fixed: core-main #8f67177d2224
Integrated into 'main-silver', will be available in build *201403100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/8f67177d2224 User: Ondrej Vrabec <ovrabec@netbeans.org> Log: Issue #242625 - With IDE open, sometimes .git/MERGE_HEAD missing after CLI git merge refresh repository info later when the repository contains index.lock file.
Happens also in Product Version: NetBeans IDE 8.0 (Build 201403101706) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb) Which is very bad. I lost hours realize that NB is the cause. I will try a dev build and give you feedback
(In reply to markiewb from comment #4) > Happens also in > Product Version: NetBeans IDE 8.0 (Build 201403101706) > Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70 > Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 > System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb) > > Which is very bad. I lost hours realize that NB is the cause. > I will try a dev build and give you feedback Reopen. Issue is still present in Dev Build 201403270001 Product Version: NetBeans IDE Dev (Build 201403270001) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
(In reply to markiewb from comment #5) > Reopen. Issue is still present in Dev Build 201403270001 That's bad. I have no idea how to reproduce, i am not aware of any place we might delete such a file. If you can reproduce, point me to a specific project i can try it with and provide steps to reproduce (what branches you merge etc.)
Trying another round, there was still a chance that a locked repository was refreshed (metadata read) and CLI process interrupted by NetBeans. Please let me know if you can reproduce it again. fix: http://hg.netbeans.org/core-main/rev/41ff10528665
Integrated into 'main-silver', will be available in build *201404060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/41ff10528665 User: Ondrej Vrabec <ovrabec@netbeans.org> Log: #242625 - With IDE open, sometimes .git/MERGE_HEAD missing after CLI git merge Never start any JGit command while another process is touching the repository. Instead wait for the lock to be released and refresh repository state in NetBeans later.
I think i found it. Happens always when you create new file in IDE. fix: http://hg.netbeans.org/core-main/rev/38a75766c601
Integrated into 'main-silver', will be available in build *201406190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/38a75766c601 User: Ondrej Vrabec <ovrabec@netbeans.org> Log: #242625 - With IDE open, sometimes .git/MERGE_HEAD missing after CLI git merge Never delete the metadata files when running mere reset -- PATHS command