0

cherry-pick from multi-commit/squashed view

Ulrich Scholz 10 months ago updated 10 months ago 4

With "multi-commit/squashed view", I mean the entries in the Files tab when two commits of a branch are selected. The files are given with their cumulative changes. Please edit the header with the correct term.

RFE: Allow to cherry-pick from this cumulative view. In detail, that would be

  1. create a new temporary local branch for the later of the two selected commits
  2. squash the commits between the two
  3. cherry-pick the selected files as it is implemented currently for single commits
  4. delete the temporary branch

Although I hope my request is understandable, I should have been more precise:

    1. create a new temporary local branch based on the later of the two selected commits
    2. enter the new branch
    3. squash the commits between the earlier commit (excluding) and the later commit (including)
    4. cherry-pick the selected files as it is currently implemented for single commits
    5. change into the original branch
    6. delete the temporary branch

I have a long running branch to develop a complex new feature. Part of that effort is extending some existing parts of the code base. To reduce the size of the feature branch and to test the extensions separately, I cherry-pick them into a separate branch. But those extensions evolved over time and their changes are spread over several commits. To cherry-pick just and all of the extension changes, I perform the actions given in my request.

Improvement over the existing behavior: Either you have to perform the actions given in my request. Or else you have to cherry-pick the commits one by one and discard the unwanted changes.

Because the changes for the feature (not the ones for the existing part of the code base) may cause conflicts. It can be a lot of manual work to sort that out.

The extensions of the existing code base usually do not cause conflicts. That's the reason to cherry-pick them into a branch of their own and to test them separately.