Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to remove .gitattributes files #285

Closed
wants to merge 1 commit into from

Commits on Jan 17, 2022

  1. Add config option to remove .gitattributes files

    If a staging repo has .gitattributes files containing the `export-subst`
    attribute (example: https://github.com/kubernetes/kubernetes/blob/b6c06a95d7ff262a876b95a1035eaf478a7cb961/staging/src/k8s.io/client-go/pkg/version/.gitattributes),
    then git expands the specified placeholders when git archive is used.
    
    When a published repo is downloaded from GitHub, GitHub does a
    "git archive" under the hood. This means that the placeholders get
    replaced by their relevant values. This type of "git archive"
    application sometimes leads to undesired values. See the example below.
    
    - In client-go, https://github.com/kubernetes/kubernetes/blob/b6c06a95d7ff262a876b95a1035eaf478a7cb961/staging/src/k8s.io/client-go/pkg/version/base.go#L59
    is expanded on a git archive. This line is needed as a fallback to
    inject k8s version info for client-go when this info is not provided
    via ldflags during builds.
    
    - However, when k/client-go is vendored, the line gets expanded to _the
    commit of the project vendoring client-go_ -- which is not helpful at
    all! This also means that the vendored client-go will now contain
    different (expanded) commit shas for different projects.
    
    - To ensure reproducibility of source, this commit adds an option to
    remove the `.gitattributes` files in all published repos.
    Additionally, when client-go is used as a library, we don't care about
    the line being expanded to inject version info so it is also safe to
    remove these files.
    
    The commit adds this feature as a config option in `rules.yaml` so we
    can control publishing of `.gitattributes` files for each repo.
    nikhita committed Jan 17, 2022
    Configuration menu
    Copy the full SHA
    00d89ba View commit details
    Browse the repository at this point in the history