Jump to content

Issue with Distributed Workflow and Dangling Heads


cbotts

Recommended Posts

Hi there,

The team I am on recently switched over to Plastic after some issues with our remote git server. We ended up migrating the repository and are using GitSync to keep things in line as there are still a few people working on the git side of things. More or less though the migration was a success and we are concurrently using git and Plastic with little friction.

 

My problem comes in though with some changes I checked into a local copy of a branch that I cannot push to the cloud. I go to do so and Plastic complains that I have 3 heads and that I need to perform merges such that I only have one head, and that's fine. I grab the GUIDs referenced in the error and go off to the Branch Explorer, throw in the GUIDs, and it takes me to the offending changesets.

 

Now before I would go to do these merges and get some nasty conflicts, which didn't make much sense to me as I figured this work must have already made it back upstream as they are changesets from months ago back when we weren't even using Plastic. After some investigation with another engineer we figured out it must be that I am missing a branch that references where the changesets were merged into (our main branch it turned out, I had only replicated development) and so I replicated the branch in question as well.

 

Now the problem is when I go to merge these "dangling heads" after replicating the other branch these changesets were supposedly already merged into, Plastic then tells me there is nothing to merge and that these changes are already in the destination (which is the real head at the tip of the branch). But then when I go to sync, it still complains that those changesets are dangling heads and it won't let me push.

 

Am I missing something fundamental here about the distributed workflow, or perhaps this is a GitSync issue?

Link to comment
Share on other sites

Hi,

Let's do the following. If you tried to merge these changesets and actually there is nothing to be merged:

I have a workaround to unify the heads. Hack the client to send a merge link meta information in order to set the changeset as "merged" and allow you the replication.
You will need:

1) Switch your workspace to the main branch.
2) Create a file called "plastic.merges" at your "wkspaces<Your_workspace>.plastic" hidden path.
3) Get the changeset multiple head list. (I can see you have them already, you will need the ids)
4) Add the following content.

mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#/#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>
mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#/#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>
mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#/#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>
mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#/#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>
mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#/#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>
......


And replace the "<XXX>" fields by its actual value for you:

<Repo_Name>: Repository name.
<Server_IP_Or_Name>: The server IP Address o the server name
<CSET_ID>: The changeset numbers you have determined as the multiple heads candidates. (Remember to use IDs not GUIDs)

After creating the file and saving it you'll see the pending changes view with a few new pending merge links, you'll be able to check it in and workaround the issue.
Tell me how it goes!

Regards,

Rafael.

Plastic Support Team

Link to comment
Share on other sites

Hi Rafael,

Your suggestion worked! Thank you so much. I did have to tweak one thing which was instead of adding the line:
 

mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#/#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>

I instead added

mount:56e62dd7-241f-41e9-8c6b-dd4ca4513e62#<Repo_Name>@<Server_IP_Or_Name>:8087 merged from: Merge <CSET_ID>

As Plastic complained about the file format when I went into Pending Changes using the original one. I needed to do another merge anyways as I had changes I pulled down from remote and I noticed another line that had it in the later format, so I used that one instead. After that it was just a matter of checking in the merge and then I was finally able to push my branch.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...