Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pre-receive hook should try to avoid ref collisions #136

@mostynb

Description

@mostynb

A situation came up recently with our critic instance, which caused some trouble for related services: a branch was pushed with a refname that matched a commit hash. This didn't bother critic, but other systems which had git checkouts with an origin remote and a critic remote could no longer checkout the commit via "git checkout " (they would get the branch instead).

We think it would make sense for critic to reject pushes that upload a new branch with a name that looks like a git commit hash (40 hex characters). Apparently github implements a hook that does this (mentioned in jupyterhub/binderhub#299 for example). Would you recommend doing this in src/hooks/pre-receive rather than in the critic service that it talks to?

Do you think it is worth trying to reject clashes between branch and tag names also?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions