-
Notifications
You must be signed in to change notification settings - Fork 38
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
clone
subcommand
#10
clone
subcommand
#10
Conversation
cmd/clone/clone.go
Outdated
} | ||
|
||
c.Printf("Creating branch %s in %s/%s\n", dir.Name, parentPath, repo.RepoName) | ||
err = exec.Execute(c, workingCopyPath, "git", "checkout", "-b", dir.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use go-git
in the medium term; git
is used for parity and ease of testing (using same infra as the testing for execution of gh)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised #13 to track explicitly
clone
turbolift clone
So that future refactoring away from using CLI binaries is easier.
dir, _ := os.Getwd() | ||
dirBasename := path.Base(dir) | ||
|
||
file, err := os.Open("repos.txt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this I suggest something a bit more structured, like yaml.
It would then be trivial to unmarshall it, instead of the scanner and parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is something I'd like to push back on; having it be text based makes it really easy to generate from a variety of tools.
My worry with using a structured file format for this list is that it'd force people to write a program or do some clever text munging to generate the input.
Perhaps an option to consider later might be to have YAML input in addition, depending on whether a repos.yaml
or repos.txt
file is present.
For what it's worth, I'd consider the entire campaign directory to be its own kind of structured format: we have a file which just contains a list of repos and a file which just contains the PR title/description in markdown format. Both of those could be combined into a single structured file, but I think that having them separated optimizes for each of input/editing.
Co-authored-by: Sebastien Le Digabel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; first implementation of clone
Thanks @sledigabel |
turbolift clone
usinggh
andgit
. Not using git worktrees for simplicity (the space saving probably isn't worth it, especially at this stage).Resolves #2