حَدَّثَنَا مُسْلِمُ بْنُ إِبْرَاهِيمَ، وَمُوسَى بْنُ إِسْمَاعِيلَ، - الْمَعْنَى وَاحِدٌ - قَالاَ حَدَّثَنَا أَبَانُ، قَالَ حَدَّثَنَا يَحْيَى، عَنْ مُحَمَّدِ بْنِ إِبْرَاهِيمَ، عَنِ ابْنِ جَابِرِ بْنِ عَتِيكٍ، عَنْ جَابِرِ بْنِ عَتِيكٍ، أَنَّ نَبِيَّ اللَّهِ صلى الله عليه وسلم كَانَ يَقُولُ ‏"‏مِنَ الْغَيْرَةِ مَا يُحِبُّ اللَّهُ وَمِنْهَا مَا يُبْغِضُ اللَّهُ فَأَمَّا الَّتِي يُحِبُّهَا اللَّهُ فَالْغَيْرَةُ فِي الرِّيبَةِ وَأَمَّا الْغَيْرَةُ الَّتِي يُبْغِضُهَا اللَّهُ فَالْغَيْرَةُ فِي غَيْرِ رِيبَةٍ وَإِنَّ مِنَ الْخُيَلاَءِ مَا يُبْغِضُ اللَّهُ وَمِنْهَا مَا يُحِبُّ اللَّهُ فَأَمَّا الْخُيَلاَءُ الَّتِي يُحِبُّ اللَّهُ فَاخْتِيَالُ الرَّجُلِ نَفْسَهُ عِنْدَ الْقِتَالِ وَاخْتِيَالُهُ عِنْدَ الصَّدَقَةِ وَأَمَّا الَّتِي يُبْغِضُ اللَّهُ فَاخْتِيَالُهُ فِي الْبَغْىِ ‏"‏ ‏.‏ قَالَ مُوسَى ‏"‏ وَالْفَخْرِ
Translation
Narrated Jabir ibn Atik

The Prophet (ﷺ) used to say: "Among jealousy, there is that which Allah loves, and among it is that which Allah hates. As for that which Allah loves, it is jealousy in cases of doubt. And as for the jealousy which Allah hates, it is jealousy in other than a case of doubt. And among pride, there is that which Allah hates, and among it is that which Allah loves. As for the pride which Allah loves, it is a man's pride regarding himself at the time of fighting and his pride at the time of giving charity. And as for that which Allah hates, it is his pride in oppression." Musa said: "And boasting."