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

Implement Clone-as-Submodule feature #348

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yasuo-ozu
Copy link

Background

There are some needs to manage your ghq root as git repository, for syncing your local stubs, etc.

Changes

This PR changes the default behavior of ghq get like:

  • Check if the target directory is inside git worktree of another git repository.
  • If so, use git submodule add instead.

@Songmu
Copy link
Member

Songmu commented Oct 7, 2022

Thanks for the pull request.
It's an exciting idea to git manage the whole ghq root, but I don't hear much else about the need for it, and honestly, I'm not so positive about including this feature.
I'll stay open to it for a while, but if no one appears who agrees with this feature, I'll close it later.

@yasuo-ozu
Copy link
Author

yasuo-ozu commented Oct 7, 2022

Thanks for reply. I am considering following situations.

  • Using multiple devices (for example, note pc and desktop pc)
  • I want to manage local repos, which I am working now.
  • ~/ghq directory is a git repo (origin is set to my github.com private repo)
    (local repos managed in ~/ghq/ may be anything, like my public repo, my private repo or other's public repo (just looking at).)
  • I can sync the working state between devices, using push/pull mechanism and working branch.
  • Here, 'working state' is repos which I am working on, and working branches which I'm creating temporary commits in.
  • Using 3rd-party automatic file sync (like Dropbox) may break local repos.
  • Using tools like rsync is troublesome, and lack of collision fixing.

@yasuo-ozu
Copy link
Author

I think working directly on ~/ghq/ is enough considerable, but someone may have different opinions.
If there is any other way (or reason why this example is unsound), please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants