[go: up one dir, main page]

Gitaly stops using info/attributes

Working on gitaly to make it 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).

The reason to add logic to removeing info/attributeslogic is from here. A short summary is that we want to keep updating info/gitattributes until it's removed. After gitlab#414855 (closed), rails will still be able to update info/gitattributes, because ApplyGitattributes() is still in use. Now, it is time for gitaly to stop using ApplyGitattributes(), we can start removing info/gitattributes.

This temporary logic should be removed once proper house keeping jobs are called so that all info/gitattributes files are removed, see #5347 (closed).

Edited by Eric Ju