Skip to content

Make 'reset' respect selection; fix several crashes

Eric Sunshine requested to merge sunshineco/reposurgeon:es/reset into master

It is not uncommon for a fast-import stream to contain multiple resets of a particular name. For instance, a fast-export dump of an entire repository will typically reset refs/heads/master just before the first commit on that branch, and then again just after the last commit.

The reset command unconditionally operates on all resets. The move subcommand refuses to operate on multiple resets. This makes it impossible, therefore, to reset refs/heads/master (say, for example, if the penultimate and final commits have been swapped and refs/heads/master needs to be reset to point at the new final commit).

Lift this limitation by having reset respect the selection, thus providing control over the set of events consulted when searching for the specified reset name.

While at it, also fix crashes in each of the reset subcommands, move, delete, rename, and add tests to ensure these actions remain functional.

Finally, fix a few minor botches in the documentation of reset and its nearby neighbors.

Merge request reports