Add an option to not abandon revisions on reorg
Categories
(Conduit :: moz-phab, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: zalun, Assigned: sheehan)
References
Details
(Keywords: conduit-triaged)
Attachments
(1 file, 1 obsolete file)
Let's assume we've got a branch A
from which we've moved one commit to a new branch B
, then added a new commit on top of it.
* B1[D5] (HEAD -> branch B)
|
* A2[D2]
|
| * A4[D4] (branch A)
| |
| * A3[D3]
| |
| * A1[D1]
|/
* BASE (branches/default/tip)
We would like to keep both branches and fix the parent-child relationship.
Running moz-phab reorg
would result with abandoning revisions from different branch.
moz-phab reorg
...
Stack will be reorganised:
* A1[D1] will be abandoned
* B1[D5] will depend on A2[D2]
* A3[D3] will be abandoned
* A4[D4] will be abandoned
Note: I've edited the moz-phab responses to make the example more readable.
I propose we add a --keep
(temp name) option which would switch off abandoning revisions.
To replicate the tree in Suite:
git checkout -b A
echo a1 > A1; git add A1; git commit -am A1; echo a2 > A2; git add A2; git commit -am A2; echo a3 > A3; git add A3; git commit -am A3; echo a4 > A4; git add A4; git commit -am A4
moz-phab -b 1 -y
git checkout branches/default/tip
git checkout -b B
# STOP HERE TO GET SHA_A2
git cherry-pick SHA_A2
git checkout A
# STOP TO MANUALLY REBASE
git rebase -i HEAD~4
git checkout B
echo b1 > B1; git add B1; git commit -am B1
moz-phab -b 1 --single -y
Reporter | ||
Comment 1•4 years ago
|
||
B[D2]
removed from A[D1] < B[D2] < C[D3]
$ moz-phab reorg
Reorganisation based on 2 commits:
Stack will be reorganised:
* D3 will depend on D1
* D2 will be abandoned
Perform reorganisation (YES/No)? n
$ moz-phab reorg --keep
Reorganisation based on 2 commits:
Stack will be reorganised:
* D3 will depend on D1
* D2 will no longer depend on D1
Perform reorganisation (YES/No)?
Stack has been reorganised.
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
This is rather straightforward and I'm already doing some moz-phab reorg
work, so I'm going to add it.
Assignee | ||
Comment 3•1 year ago
|
||
Adds a --no-abandon
flag to avoid abandoning revisions during
moz-phab reorg
. Revisions are abandoned when they are present
in the remote Phabricator stack but dropped from the local VCS
stack. This flag avoids adding the abandon
transaction when
the flag is passed on the command line.
Depends on D167182
Assignee | ||
Comment 4•1 year ago
|
||
This is available in 1.4.0rc0
and later.
Updated•1 year ago
|
Description
•