Move the script to maintainers/scripts/pluginupdate.py.
Importing it from the vim and kakoune update scripts
is done in the commit afterwards to cleanup the diff.
The result of repo.index.add() contains the list of files that
have been added, even though they may be unchanged since the
latest commit. We only commit if at least one file has changed.
- Use git.Repo(ROOT, search_parent_directories=True) to find nixpkgs
repo.
- Don't commit overrides.nix.
- Remove "-a" short argument.
- Remove "--commit" flag and commit by default.
- Improve help/error messages.
- Favor closure pattern over classes.Use a closure to wrap the update
function with state rather than a callable class.
- break NixpkgsRepo class into functions
- Optional None-type arguments
- Remove repo checks from update.py. Git is too flexible and permits too
many workflows for my attempt to replace documentation with code to work.
My goal would be to separate the `--add` functionality from the update
functionality in the near term and then there will be no reason for this
usage to create commits anyway.
- When redirections are detected, rather than printing instructions,
update.py now creates two commits -- one with the plugin updates and
another with redirected plugin names updated to their new repos.
- Added a --allow-dirty flag so that one can run ./update.py --commit
with a dirty nixpkgs repository, which is necessary for development.
I wouldn't mind removing this before merging if it's not in our flag
budget but it's necessary scaffolding for now.
In response to @timokau's review here are a couple changes:
- Decrease the fragility of the replacement code by normalizing
whitespace on each line.
- Throw an error when plugins are renamed rather than silently aliasing
to the new name.
Many of the plugins in vim-plugin-names are out of date and redirect to
their new github repos. This commit adds a flag to automatically update
these and defines a process for committing these updates into nixpkgs.
Updating vim-plugins recently started timing out regularly for me. It
may have to do with an ISP switch on my side, but I don't think that
should cause timeouts. I guess I'm probably not the only one
experiencing this, so in this comment I introduce exponential backoff.
Every request will be retried up to 3 times (3 seconds, 6 seconds, 12
seconds delay).
Plugins in `plugin-list` can now optionally specify an alias name, to
avoid naming collisions if plugins have the same repo name. For example,
specifying `author/common-plugin as author-common-plugin` will use
`author-common-plugin` as the package name in `generated.nix`.
Vim plugins were previously represented as strings by default,
necessitating a `knownPlugins` set. Backwards compatibility is kept
(strings are still accepted), so vam plugins should continue to work.