Skip to content

do not run gbp setup-gitattributes by default

Hi,

Could you please make gbp setup-gitattributes an opt-in configuration item rather than opt-out?

The reasons are:

  • if the repository was cloned with gbp then pushed to Salsa, it is not necessary to apply gbp setup-gitattributes again as the files will be stored in the repository without being converted by git; a .gitattributes should not cause any checkout conversion or source archive mismatch to happen unless upstream (or packaging) got either of these fairly wrong
  • if the repository was not cloned with gbp then ignoring gitattributes will definitely break things, e.g. https://salsa.debian.org/jpd/kotlin/-/jobs/7093478#L3479 as the files may be stored after having been (or not) converted by git, and need to be converted again upon checkout to match their expected representation and what is in source archives
  • https://salsa.debian.org/nvidia-team/nvitop/-/jobs/4857558 (from #322 (closed)) is another former example of gbp setup-gitattributes randomly breaking things. I think it triggered a git bug in that case, as the file reported to be modified has exactly the same binary representation as stored in git, as checked out, as extracted from source archives and as stored in upstream git repo; IOW git status reported that the file was changed but actually it was not.
  • these other packages are known to disable the feature:

More generally blindly ignoring git attributes is Absolutely Not a good idea and a practice to be recommended, even though some projects may abuse or misuse them. With cross-platform projects this is very likely to corrupt build scripts, wrapper scripts, test suites and data sets, if the build survives the source tree mismatches as seen above. It also causes more confusion and issues as some objects stored in the gbp-cloned repository may no longer match the same objects as stored in upstream repository.

Also, in the spirit of what is stated in Debian Policy (4.14) and as stated in the current DEP-14 draft the nominal expectation is that a repository checked out with regular tools e.g. git itself should be buildable without additional steps. If the repository requires the use of gbp clone or gbp setup-gitattributes for its build to work then it's almost certain that something was not done correctly while setting up that repository or importing sources, and that needs to be fixed in the repository, not just worked around in the build chain.

I also filed a bug against gbp to change gbp clone default to not apply gbp setup-gitattributes automatically.

Best Regards,

-- Julien Plissonneau Duquène

Edited by Julien Plissonneau Duquène
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information