add a `revert` command
- Dominant language
- JavaScript
- Stars
- 233
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
# Specifcation
First iteration will be as simple as possible; we can expand later as requested:
* only options are `--continue` and `--abort`
* support for only a single commit (no `..` notation)
* Will prompt user to edit a message initialized with `Revert "$message'` as with Git
* We *will* show the status of the changes to be committed, e.g.:
```
# On branch master
# Changes to be committed:
#\tdeleted: foo
```
* submodule commits
* the revert command will generate only one commit in each submodule, no matter how many were introduced by the meta-repo commit being generated
* this commit will have the same commit message as that selected for the meta-repo
# Implementation
* Will add a new REVERT sequencer type
* Will be similar to cherry-pick in that we will write a sequencer entry in the meta-repo but not submodules
* `--continue` just fails if there are conflicts, and commits changed submodules otherwise -- nothing really to continue -- though be sure to fail if nothing is staged
* logic to apply to submodules:
* abort if commit to revert introduced URL-only changes (`CherryPickUtil.ensureNoURLChanges`)
* compute submodule changes via `exports.changeSubmodules`
* apply inverse of returned `simpleChanges` using `CherryPickUtil.changeSubmodules`
* for non-simple changes, generate the diff for `oldSha` to `newSha` and attempt to apply it to each submodule, opening if necessary
* this diff can be used along with `DiffUtil.getRepostatus` to obtain a `RepoStatus` object that can be used with `PrintStatusUtil` to obtain the text need for the commit message prompt
* see `CherryPickUtil.rewriteCommit` for more info
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.