module documentation

Common repository setup functionality.

Function check_gitattributes Verify the treeish doesn’t contain non-empty .gitattributes files.
Function is_gitattributes_set_up Return True if git attributes have been set up correctly:
Function set_user_name_and_email Undocumented
Function setup_gitattributes Setup .git/info/attributes in a way to prevent transformations from interfering with packaging, because the working tree files can differ from the Git revision history (and from the source packages).
Variable attr_glob_defns Undocumented
Variable dgit_attr_macro_defn Undocumented
Variable dgit_attr_macro_re Undocumented
def check_gitattributes(repo, treeish):

Verify the treeish doesn’t contain non-empty .gitattributes files.

Returns
boolUndocumented
def is_gitattributes_set_up(repo):

Return True if git attributes have been set up correctly:

  • dgit-defuse-attrs macro exists
  • dgit-defuse-attrs includes attributes we’re interested in
  • dgit-defuse-attrs is enabled for *
  • export-subst and export-ignore are unset for *
Returns
boolUndocumented
def set_user_name_and_email(repo_user, repo_email, repo):

Undocumented

def setup_gitattributes(repo, treeish='HEAD'):

Setup .git/info/attributes in a way to prevent transformations from interfering with packaging, because the working tree files can differ from the Git revision history (and from the source packages).

Similar functionality has been implemented by dgit and git-deborig, so we try to stay compatible and re-use the name of the attribute macro. Since dgit doesn’t disable export-subst and export-ignore, which may interfere with export-orig, we add this on top the same way git-deborig does.

attr_glob_defns: set[str] =

Undocumented

dgit_attr_macro_defn: str =

Undocumented

dgit_attr_macro_re =

Undocumented