Skip to content

repository: stop using info/attributes in git 2.43.0

Eric Ju requested to merge ej-stop-using-info-atrributes into master

From 2.43.0, git starts supporting reading .gitattributes from HEAD ref.

Once git 2.43.0 is deployed, we can stop using info/attributes in related RPCs, i.e. ApplyGitattributes() and GetInfoAttributes().

The following actions are taken in order to stop using info/attributes

  1. making ApplyGitattributes() no-op, so that Gitaly clients will stop writing to info/attributes;
  2. making GetInfoAttributes() return the content of HEAD:.gitattributes, this is to address the N+1 problem as discussed here;
  3. making GetInfoAttributes() delete info/attributes file first before calling git cat-file, so that info/attributes will not overwrite .gitattributes (because info/attributes has high precedence);
  4. stop referencing GetInfoAttributes() inside gitaly, use GetFileAttributes() instead, we do this to prepare future deleting GetInfoAttributes();
  5. making GetFileAttributes() delete info/attributes file first before calling git check-attr, so that info/attributes will not overwrite .gitattributes (because info/attributes has high precedence).

Closes #5348 (closed)

Edited by Eric Ju

Merge request reports