-
Notifications
You must be signed in to change notification settings - Fork 1
Description
(offtop) Hi! First of all, I've been searching exactly this tool for a while now. I'm glad to have had the luck to run into it by accident and that I'm not the only one who had this exact workflow in mind -- thank you!
I assume that the main audience of this project is people who already have a CPython repository cloned locally.
I'm proposing adding support for reference cloning, which tells Git to borrow objects from the existing local repository instead of pulling them from the internet. The speedup can be quite big; let me know if you're interested in more data on that.
I'd mainly use every-python to attach snippets running uvx every-python commands in CPython tickets so that others could quickly copy-and-paste them to reproduce differences in behaviors between revisions. Most people reading things there already have a CPython repo clone locally, so it would be especially cool if every-python could use that optimization 🚀
A user would have to indicate where their existing repo is, possibly like every-python --from-cpython-repo . (or whatever is least confusing), and then in _ensure_repo() we'd pass --reference-if-able path/to/cpython, and ideally --dissociate to make sure the borrowed objects become standalone copies so that when the reference repository gets deleted, the clones of every-python remain intact. --dissociate is a no-op without a reference repository, so no worries if the reference repository isn't found but the clone proceeds because of --reference-if-able. Since this flag causes incorrect reference repository directories to not throw a terminal failure, I'm tempted to propose that the current working directory is the default for --reference-if-able, but I'll understand if that's not preferred to expose such implicit behavior without a better reason than my personal workflow.
I've already used uvx every-python to demonstrate something in python/cpython#86153. I can attach --from-cpython-repo . by default, and note at all times that the command best runs in the CPython clone, to achieve the desired effect.
And of course, I can work on this patch if you think that it's worth it (I'm OK with a "no", sometimes simpler is better).