roll=ArcTan[g3,g2];
pitch=ArcTan[-g1,(Sqrt[(g2^2)+(g3^2)])];

(({{D[roll,g1], D[roll,g2], D[roll,g3]}, {D[pitch,g1], D[pitch,g2], D[pitch,g3]}, {0, 0, 0}}))//FullSimplify