-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
sync: add flag providing path to non-transient problem-specifications
repo
#47
Comments
I agree that this could be nice, even if just for responsiveness. It currently just does the simplest thing that will always work. Quickly testing on a not-so-great connection: git clone --depth 1 https://github.com/exercism/problem-specifications.git takes about 1.8 s, compared to about 0.7 s for a
This silently and non-interactively discards changes to the working directory, which we probably don't want to do even the location is passed explicitly - people could lose uncommitted changes. We could implement it with interaction, e.g.:
But perhaps a good first implementation of this could just fail if we couldn't |
Sure, fair enough. |
I like this suggestion. |
Or, instead of Or, instead of fiddling with the user's problem-spec repo, just give them a message if they're not on the master branch and not at the remote HEAD. |
Being able to specify the path to a prob-specs repo also allows us to finally add some tests. See #4. If anyone is up for adding some integration tests (which should work with the actual binary), that would be fantastic. |
The user can now tell the program to use an existing `problem-specifications` directory, in which case it doesn't make a temporary shallow clone. This saves a significant amount of time, and is probably the biggest possible speed optimisation given that the program running time in non-interactive mode is essentially the time it takes to establish an up-to-date `problem-specifications` directory. But perhaps we could consider adding an "offline-mode" in the future. This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. Closes: exercism#47
The user can now tell the program to use an existing `problem-specifications` directory, in which case it doesn't make a temporary shallow clone. This saves a significant amount of time, and is probably the biggest possible speed optimisation given that the program running time in non-interactive mode is essentially the time it takes to establish an up-to-date `problem-specifications` directory. But perhaps we could consider adding an "offline-mode" in the future. This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. Closes: exercism#47
@coriolinus @glennj There is a related issue opened in #66 and I've added some comments. I'd be interested in hearing your opinions. |
The user can now tell the program to use an existing `problem-specifications` directory, in which case it doesn't make a temporary shallow clone. This saves a significant amount of time, and is probably the biggest possible speed optimisation given that the program running time in non-interactive mode is essentially the time it takes to establish an up-to-date `problem-specifications` directory. But we could add an "offline" option in the future. This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: exercism#47
The user can now tell the program to use an existing `problem-specifications` directory, in which case the program does a `fetch` rather than making a temporary shallow clone. This is one of the biggest possible speed optimisations, given that the program running time in non-interactive mode is limited by the time taken to establish an up-to-date `problem-specifications`directory. However, in the future we could add an `--offline` option (or similar). This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`, at least for now. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: exercism#47
The user can now tell the program to use an existing `problem-specifications` directory, in which case the program does a `fetch` rather than making a temporary shallow clone. This is one of the biggest possible speed optimisations, given that the program running time in non-interactive mode is limited by the time taken to establish an up-to-date `problem-specifications`directory. However, in the future we could add an `--offline` option (or similar). This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`, at least for now. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: exercism#47
The user can now tell the program to use an existing `problem-specifications` directory, in which case the program does a `fetch` rather than making a temporary shallow clone. This is one of the biggest possible speed optimisations, given that the program running time in non-interactive mode is limited by the time taken to establish an up-to-date `problem-specifications`directory. However, in the future we could add an `--offline` option (or similar). This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`, at least for now. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: exercism#47
The user can now tell the program to use an existing `problem-specifications` directory, in which case the program does a `fetch` rather than making a temporary shallow clone. This is one of the biggest possible speed optimisations, given that the program running time in non-interactive mode is limited by the time taken to establish an up-to-date `problem-specifications`directory. However, in the future we could add an `--offline` option (or similar). This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`, at least for now. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: exercism#47 Co-authored-by: Erik Schierboom <[email protected]>
The user can now tell the program to use an existing `problem-specifications` directory, in which case the program does a `fetch` rather than making a temporary shallow clone. This is one of the biggest possible speed optimisations, given that the program running time in non-interactive mode is limited by the time taken to establish an up-to-date `problem-specifications`directory. However, in the future we could add an `--offline` option (or similar). This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`, at least for now. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: #47 Co-authored-by: Erik Schierboom <[email protected]>
The user can now tell the program to use an existing `problem-specifications` directory, in which case the program does a `fetch` rather than making a temporary shallow clone. This is one of the biggest possible speed optimisations, given that the program running time in non-interactive mode is limited by the time taken to establish an up-to-date `problem-specifications`directory. However, in the future we could add an `--offline` option (or similar). This commit also makes it easier to add tests. Decisions: - Show an error if the given `problem-specifications` working directory is not clean, rather than asking the user or stashing changes. - Try to be strict about the user's `problem-specifications` directory, and do not silently `checkout` or `merge`, at least for now. - Don't assume the user has a remote named 'upstream'. - Allow the given `problem-specifications` repo to be a shallow clone: don't check that it's actually a `problem-specifications` repo by requiring it to contain some specified SHA-1. Closes: exercism#47 Co-authored-by: Erik Schierboom <[email protected]>
problem-specifications
repo
It's cool that, left to its own devices, the canonical data syncer shallow-clones the problem-specifications repo into a temporary folder, then cleans up after itself. However, this is somewhat wasteful of bandwidth, even though it's normally fast.
If someone has a permanent problem-specifications repo, then it would be nice if they could provide its location to the syncer, giving the syncer permission to do essentially:
The text was updated successfully, but these errors were encountered: