Skip to main content
Open

Ability to stash branch changes

Related products:Software Factory

Dave Bieleveld Starcode
Vanguard

New idea in consultation with Dave, written by Mark Jongeling:

I would like to be able to stash any changes I made to a branch similar to how Git does it: Git - git-stash Documentation (git-scm.com)

One way of achiving this is an additional option in the Revert branch task with which I can indicate that I want to revert my branch to a point in time, and that the current state of the branch is stored, or Stashed; for example as a new branch. This new branch is in essence a copy of my branch with all the changes, then after that branch is created, reverting my original branch to the indicated point in time. That will leave me with two branches; the original one which is reverted and the stashed one which has all of the changes I originally made.

At a later time, I can then merge the stashed branch into my original branch, effectively applying my changes again.

 

 

Old idea:

Show content

Long story short, I'd like to be able to set the origin model version during the creation of a merge sesion.

Casus:

Let's say I have a branch A. I've made some development during the period X->Y. Let's say I want to park my changes by creating a branch B and reverting branch A to timestamp X.

Then, when I eventually want to merge branch B into A, the merge session wrongly assumes that all my changes are deleted in branch A, because branch A is relatively in the past to branch B. So we want to have both model A and B to have a same base origin model version for the merge. That way, the merge sees the delta actions for branch B as additions from B->A instead of A->B.

 

Did this topic help you find an answer to your question?

6 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23

Hi Dave,

I get the idea but this is not the way we would like to support such case.

You basically would like to stash your changes and apply them later. We could achieve that by providing a Stash branch option in the Revert branch task. In addition to reverting the branch to a previous moment in time, a copy of the branch can be created of the current state of the branch.

This branch(S) can be merged into the reverted branch(R) at a later point and effectively applies all changes done in that branch(S) to the branch(R) merged with.

The origin model version indicates the moment in time the branch was branched-off its origin; or when it was updated after a reciprocal merge. Changing this has the possibilty to leave the target branch in a "broken” state.

Question: What do you think of a Stash branch option?


Dave Bieleveld Starcode
Vanguard
Forum|alt.badge.img+2

@Mark Jongeling I like the idea of stashing, however, is it still possible to continue to work in a stashed branch?


Mark Jongeling
Administrator
Forum|alt.badge.img+23
Dave Bieleveld Starcode wrote:

@Mark Jongeling I like the idea of stashing, however, is it still possible to continue to work in a stashed branch?

Yes, it will be a regular branch in which you could continue working. At any moment you can merge it to an arbitrary branch within the same model.

So you effectively copy BranchA into Stash_BranchA (f.e.) and BranchA will be reverted to the moment in time you chose in the Revert branch task. When the time comes, you can merge Stash_BranchA into BranchA and archive/delete Stash_BranchA.


Dave Bieleveld Starcode
Vanguard
Forum|alt.badge.img+2

@Mark Jongeling Right! If I’m not mistaken this is not implemented yet? And if not, what should we do with this idea?


Mark Jongeling
Administrator
Forum|alt.badge.img+23

It's not implemented like this at the moment no, but you could achieve it by making a copy of your branch manually and reverting the original one. I'll update this idea tomorrow 👍


Mark Jongeling
Administrator
Forum|alt.badge.img+23
Needs feedbackOpen
 
Updated the idea using the above discussion

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings