Skip to content

Patch command #89

@g4s8

Description

@g4s8

Let's introduce a new command patch: it'll update an existing remote resource without downloading the full spec file. It can accept patch file or patch statements. For patch command it automatically create spec in memory, update it using patch file or statements and modify remote resources according to these changes.

Patch file provides yaml representation of fields that should be updated, e.g. gitstrap patch -f repo.yml g4s8/gitstrap with repo.yml file's content:

spec:
  description: "New repository description"

will change repository description of g4s8/gitstrap repo.

Patch statements can modify specs without editing file. Each statement should be valid YAML document, it should accept one-line documents. E.g. gitstrap patch -s 'spec: { visibility: private }' g4s8/gitstrap changes visibility of repository to private. Patch command can accept one or more statements at once, and one or more changes in one statement: e.g.

gitstrap patch \
  -s 'spec: { visibility: private, license: MIT }' \
  -s 'spec: { features: [issues, pages] }' \
  g4s8/gitstrap

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions