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

Make pushing changes from Git dependency repositories easier #2226

Merged
merged 4 commits into from Apr 25, 2017

Commits on Apr 11, 2017

  1. Cache repository for Git dependency is cloned as a bare mirror

    Bare clone saves disk space as it does not need a working directory. Mirror clone tracks the upstream remote more closely as it always recreates refs.
    tomasdeml committed Apr 11, 2017
    Copy the full SHA
    733c5f4 View commit details
    Browse the repository at this point in the history
  2. paket/lock tag is created and checked out in the downstream reposit…

    …ory when `update`ing/`restore`ing the dependency
    
    This allows user to see what the original checked out commit was when making changes.
    By checking out the tag - instead of resetting the downstream repo `--hard` to the tracking branch - the repo starts in the detached HEAD state which:
    - allows easy experimentation - user can discard her commits simply by checking out the `paket/lock` tag again
    - forces user to checkout a branch when doing meaningful changes.
    Note that the tracking branch for each downstream repo (`b<REPO_PATH_HASH>`) is no longer created.
    tomasdeml committed Apr 11, 2017
    Copy the full SHA
    157ecaf View commit details
    Browse the repository at this point in the history
  3. Downstream repository is configured with the origin remote pointing…

    … to the upstream repository (instead of the cache repository)
    
    Having the upstream repo configured as the `origin` makes pushing changes to the upstream more natural.
    We also want to prevent user from pushing the changes to the cache directly - the cache should be managed by Paket.
    Note that fetching from the cache has been updated to use explicit refspec. This way we do not need an entry with matching URL in gitconfig.
    tomasdeml committed Apr 11, 2017
    Copy the full SHA
    c398909 View commit details
    Browse the repository at this point in the history
  4. Downstream repository is checked for uncommitted changes and commits …

    …made in detached HEAD state when `update`ing/`restore`ing Git dependency
    
    Checking for uncommitted changes prevents hard-to-track bugs as well as non-repeatable builds that might occur by merging user's changes into the new working directory.
    Checking for detached commits makes working in the downstream repository safer - it saves the user from having to inspect reflog after "losing" her commits.
    It also forces the user to move the changes to a permanent branch when making meaningful changes.
    tomasdeml committed Apr 11, 2017
    Copy the full SHA
    117cad1 View commit details
    Browse the repository at this point in the history