Skip to content

vcsh rename: Renaming a repository fails to rename or re-whitelist the corresponding ".gitignore.d" file #163

@leycec

Description

@leycec

When renaming an existing repository from old_repo to new_repo, the "vcsh rename old_repo new_repo" command currently fails to rename and re-whitelist the corresponding .gitignore file (if any) from ~/.gitignore.d/old_repo to ~/.gitignore.d/new_repo.

Apologies if this issue has already been noted. My Google-fu is supremely lacking.

Side Effects

Unsurprisingly, this has a number of unfortunate side effects. After the repository rename:

  • All files previously ignored by that repository will be instead marked as untracked. Which basically means everything (...including the recently misshapen kitchen sink).
  • After the user manually renames ~/.gitignore.d/old_repo to ~/.gitignore.d/new_repo, ~/.gitignore.d/new_repo will itself be ignored until the user manually re-whitelists that file (e.g., by changing the line resembling "!/.gitignore.d/old_repo" to read "!/.gitignore.d/new_repo").

Possible Solutions

Automating both the file rename and re-whitelisting appears feasible... but probably non-trivial. Until someone scripts up a robust solution for this, it'd be awesome if the vcsh rename subcommand could at least be revised to:

  1. Detect the existence of a ~/.gitignore.d/old_repo file.
  2. If such file exists, print a non-fatal warning recommending that such file be manually:
    1. Renamed to ~/.gitignore.d/new_repo.
    2. Edited so as to re-whitelist itself.

In Synopsis

Thanks for the omnipresent effort, Rich and crew. vcsh is simple greatness, and you all are the reason why. Hamsters for all! 🐹

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