Egit is based on JGit, and "not-for-merge
" is only used in org.eclipse.jgit.transport.FetchHeadRecord
That notForMerge
variable of the FetchHeadRecord is set in the org.eclipse.jgit.transport.FetchProcess#want
method.
fhr.notForMerge = spec.getDestination() != null;
If the the refspec destination isn't null, then this fetched HEAD isn't for merge.
When you fetching a remote, the destination of a remote branches is refs/remotes/yourRemote
, because of the local config for fetch refspec:
[remote "origin"]
fetch +refs/heads/*:refs/remotes/origin/*
The one branch that would be fetched without a direct destination would be one which is tracking a remote branch:
[branch "master"]
remote = origin
merge = refs/heads/master
That is why, after a fetch of JGit repo (in command line, not in Eclipse Egit), I see:
C:\Users\VonC\prog\git\jgit\.git>type FETCH_HEAD
c2a9f9e742f7e6633af130823c154a485e6071b2 branch 'master' of https://github.com/eclipse/jgit
51d1af9489924ff03fa10ec963110c608c2882a3 not-for-merge branch 'stable-0.10' of https://github.com/eclipse/jgit
989149736ad1cd09c15e143aa598028b9f9b6502 not-for-merge branch 'stable-0.11' of https://github.com/eclipse/jgit
b2b58feba7400269df8b31ef8495b695af3a9793 not-for-merge branch 'stable-0.12' of https://github.com/eclipse/jgit
Let's try to reproduce that in Egit/JGit (Luna, Egit 3.0, Win7 64-bits):
After several fetch, I never see an entry without a not-for-merge
though.
Even a pull which would merge new comits from a remote branch would still generate a FETCH_HEAD
with:
220c4502ecea147ef4beaae8039b168965e148e9 not-for-merge branch 'master' of ..\..\jgit
I guess the behavior of JGit differs on that aspect.