JGit does not support .gitattributes
. There is a 5 year old bug on that topic.
As a consequence, the ident
macro isn't used by JGit ($Id
expansion).
If you checkout a branch with regular console git
, which supports .gitattributes
and ident
, the macro expansion happens. If you then do git blame
, it doesn't see a difference in lines with the $Id$
macro. Which is expected.
If you then do jgit blame
on that same repo, you get Not Committed Yet
on lines that contain the $Id$
macro.
I found this out while investigating an issue with Sonarqube's Git plugin. The friendly people there opened a bug to followup.
My question: how do I tell regular git
to ignore .gitattributes
while doing a checkout?
Extra brownie points: I need to do this in Jenkins, so preferably out of the box with some twiddling of the Jenkins Git plugin.
To be honest: I don't have high hopes for a positive answer. The best thing would be that JGit gets their act together and supports .gitattributes
. But this is not the place for that rant.