Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing files in branches after git tfs clone #660

Closed
anrichter opened this issue Oct 9, 2014 · 10 comments
Closed

Missing files in branches after git tfs clone #660

anrichter opened this issue Oct 9, 2014 · 10 comments

Comments

@anrichter
Copy link

Hi,

i have a strange error.
In one of our tfs repository is one changeset who renames a branch and add new files.

When i clone that repository and initialize the branches, i can get the renamed branch.
But the added files from the ChangeSet described above are missing in the git repository.
I checked that with git tfs version 0.20 and the current head of the main branch.

Maybe git-tfs detects a renaming branch ChangeSet and handle the renaming correctly but does not handle file add's in the same ChangeSet.

It would be cool, when someone can help me or can fix that issue.

Thanks for your work & Greetings,
Andreas

@pmiossec
Copy link
Member

pmiossec commented Oct 9, 2014

Maybe git-tfs detects a renaming branch ChangeSet and handle the renaming correctly but does not handle file add's in the same ChangeSet

Indeed, that's not supported by git-tfs :(
I don't even know it was possible! When I have added the branch rename support, I remember having verified that we can't have this case. When you rename a branch, a changeset is automatically created. That's why, I have coded the fact that when I found a rename of the directory, I stop trying to all the other changes in the changeset (because I thought it was just file renaming).

If that's not the case, everything change :(

Could you explain me how you end up with a such case? how did you created it?
Perhaps adding the files before renaming the branch and then changes end up embedded in the changeset?

@anrichter
Copy link
Author

Unfortunately i don't commit this ChangeSet so i have to try out how you can create such one.
So i need some time to reproduce this.

@anrichter
Copy link
Author

Ok. You can reproduce it with these steps:

  • Rename Branch
  • Add Items
  • Commit

@anrichter
Copy link
Author

If you like i can give you access to a VS Online TeamProject where i reproduce such a commit.

@pmiossec
Copy link
Member

If reproduce steps are as simple, I prefer reproduce the case on my TFS sandbox repository on codeplex. I let you know if I have problem to reproduce.

That's just that I have to find time to work on that.

@pmiossec
Copy link
Member

@anrichter Could you test #663 that should solve your problem?

@anrichter
Copy link
Author

Hm. Strange.

When i freshly clone a repo with --with-branches your changes fixes my problem.
But when i clone a repo without --with-branches, which is the default i think, than your changes won't fix the problem.

I tried your changes based on the current HEAD of the main-branch.

@pmiossec
Copy link
Member

Can you describe a little more your case? Because it seems there is a little more than what you told me before...

Where is the rename changeset situated? On the trunk or on branch?

And when it don't work, what does contain the git-tfs-id: metadata in your commit? The tfs path of the old branch or the one of the new branch?

@anrichter
Copy link
Author

Hi @pmiossec, sorry for the confusion.

I tried to reproduce the error today with a fresh clone and can't. Never mind i make a
git tfs clone --with-branches
or a
git tfs clone
In both situations the renamed branch contains the added files now.
So i think all is fine und your changes are fixing my initial problem.

Thanks for your work!

Greetings,
Andreas

@pmiossec
Copy link
Member

sorry for the confusion.

No problem. I prefer that, rather than there is still a case not well managed.

But I am happy not have worked on that yesterday ;)

So i think all is fine und your changes are fixing my initial problem.

But that's a quick and dirty fix and there is some more work to merge it in master. And the bad news is that I don't see how to make it cleaner :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants