Split out a changeset while it is in progress
Hey all,
I'm working on some diseparate changes within the same file, but I failed at marking the first changeset as completed. Now I am unable to move individual changes (as opposed to files or folders) between changesets. Has this been implemented? —if not, is it a planned feature, and what is the best way to do it as things stand? (I'm assuming that I'd have to create a patch and do some partial merges back into my workspace—making sure that I mark any changesets as incomplete.)
I think the function I'm looking for is similar to git add -p. (If you're unaware of this command, check out this pair of screencasts or this blog post if you would rather not end up browsing YouTube inadvertently.)
Cheers,
Peter
One answer
The blog post seems to imply that the similar function you want is before committing to choose what you want to commit. In your example, it sounds like you've already committed and want to split the changes in a file to be in separate change sets.
You can do this but you'll have to at least create another change set and use a patch. There is no built-in function to choose a hunk to move to another change set. If your change set is completed, you'll have to create two new change sets. The key point is you check-in what you want as one change set and complete that change set. Then you check-in the rest of the code to the second change set. Beware that the second change set will depend on the first one and you cannot deliver the second change set without delivering the first one.
You can also suspend the first change set before checking in your remaining changes to the second change set. This will make the change sets independent of each other. However, if you want to deliver them together or have them in the same configuration at the same time, you will have to merge the changes.
You can do this but you'll have to at least create another change set and use a patch. There is no built-in function to choose a hunk to move to another change set. If your change set is completed, you'll have to create two new change sets. The key point is you check-in what you want as one change set and complete that change set. Then you check-in the rest of the code to the second change set. Beware that the second change set will depend on the first one and you cannot deliver the second change set without delivering the first one.
You can also suspend the first change set before checking in your remaining changes to the second change set. This will make the change sets independent of each other. However, if you want to deliver them together or have them in the same configuration at the same time, you will have to merge the changes.
Comments
showing 5 of 8
show 3 more comments
Comments
Clement Liu
Apr 08 '13, 12:37 p.m.Peter Weller
Apr 09 '13, 5:31 a.m.