Scenario 2: Combine two changes to remove "noise" from the history
Suppose you add a feature in change NNN. A reviewer finds a problem with it, so you make another change to fix the problem. Then you realize that the second change is just adding noise to the history.
To fix this, you would do the following:
(We assume your first change is NNN and your second change is MMM)
-
Unsubmit both changes:
$ p4 unsubmit //...@NNN,@MMM Change MMM unsubmitted and shelved Change NNN unsubmitted and shelved
-
Start the partially-interactive resubmit process:
$ p4 resubmit -e
Now change NNN is open for edit.
- Make the change you originally made in changelist NNN.
-
Update the change description:
$ p4 change NNN
-
Resume the resubmit process:
$ p4 resubmit -Re
Now the second change is open for edit but you don’t need it. You can demonstrate this to yourself by running
p4 resolve
,p4 diff
, andp4 revert -a
to see that nothing is changed by the second change. -
Delete the second change:
$ p4 shelve -d -c MMM $ p4 change -d -c MMM
Alternatively, to delete the second change you could run
p4 resubmit -i
and choosed
.