A DRCS (git, bzr, merc) that has “pending changesets” like perforce?
We have perforce at work and one thing about it really seems to work quite well with the workflow and that is pending changesets.
I can make a new pending changeset, assign changes to it, assign jira tickets to it, etc… I can shelve files there and make other changes in other changesets. Then when it’s checkin time I can push just those changes by simply providing the changeset ID.
- Versioning SQL Server?
- Is there any harmful commands using GIT and HG
- Mercurial: Named Branches vs Multiple Repositories
- Mercurial convert extension not able to pull from remote Git repository
- Have you converted from subversion to mercurial? Was it worth the effort?
- Hg update -C mercurial command equivalent in git
Do any of the main distributed revision control systems offer anything like this? I see that most offer a variant of shelving, but pending changesets?
Edit – an example to clarify:
I have a project with files A-Z. I do an update right before making changes for a source change I’m making. I notice that a change I’m not ready to adopt has been made so I create a hack around it by modifying A and B. I then make changes to files C, D, and E.
I only want to check in the latter three and I want to attach the jira ticket I’m responding to. In p4v this is as simple as creating a new “pending changeset” and checking off the files I want in it along with the ticket number. Then I commit my pending changeset. I can then keep my hack around for the next run or revert it.
3 Solutions collect form web for “A DRCS (git, bzr, merc) that has “pending changesets” like perforce?”
Mercurial has two features that are very similar to this. The first, and older one, is called Mercurial Queues these are based on Quilt but are integrated into Mercurial. That book chapter is worth reading, but they basically let you have a series of overlap changesets that can be pushed, popped, and edited willy-nilly. They differ from shelve (git’s or Mercurial’s) in that they can be pushed/pulled and can actually be version controlled themself in a separate queue-specific repo.
The second, newer feature along those lines is the Phases feature. It tracks a phase for each changeset which can be
secret. The wiki page has the full details but basically
public is anything you’ve pushed to another repo,
draft is anything you haven’t yet pushed (and thus can edit w/o worrying about breaking people’s histories), and
private is a changeset that won’t be pushed when you
hg push. You can use phases along with
commit --amend and even Mercurial queues to make sure a changeset doesn’t leave your machine until you’re happy with it.
Git has the concept of stashes, which are similar–you can have multiple stashes with descriptions of what’s in them. The main difference is that stashes are local, while P4’s pending changelists are on the server. That could be important if anyone else needs to see your pending changelists.
Git also has the concept of the index. You can add files to the index and, by default, it only commits files that are in the index. You can modify a number of files and put some of them in the index and leave others in the workspace. You can even have one file modified and queued in the index and different modifications to that same file in the workspace.