git-tfs
git-tfs copied to clipboard
Invalid selective merges instead of cherry picks
I have converted repository with all branches using --with-branches
.
Unfortunately the end result is that partial merges from TFS (merge of specific revisions) are converted to git merges which completely break history and ability to merge and diff branches with git.
Could you explain more explicitly in which way it "break history and ability to merge and diff branches with git"?
Consider this example:
- branch A is created from Trunk
- file foo is added to A
- someone merges single revision from A to Trunk
Now after conversion, git thinks that A is fully merged into Trunk (up to the merge commit). When you try merging Trunk into A, git removes
foo
since it thinks it was removed from Trunk by merge commit from point 3.
Could you test this branch : https://github.com/git-tfs/git-tfs/compare/master...pmiossec:manage_partial_merge
or at least these binaries: https://ci.appveyor.com/api/buildjobs/1g2ekv9lg02ha3gt/artifacts/git-tfs_fac25f51825c9e8d5c264f0631b508dc8d209020.zip
and tell me if it solve your problem?
Thanks for quick fix. I am going to test it now but it will take some time to clone the repo again. I'll report results tomorrow.
ok thanks.
BTW can you add a list of merged commits (as git hashes) to commit message ? Maybe something like:
git-tfs-cherry-picks: <commit1> <commit2> ...
or maybe one per line.
BTW can you add a list of merged commits (as git hashes) to commit message ?
That's something to do much more complicated that what is managed at the moment. If you need such a thing, I encourage you to dig in the code and propose a pull request. I won't fix all the broken choice of TFVC architecture using the awful tfs api ;)
No difference :(
According to Partial
documentation it's about whether particular changeset was partially merged, not whether merge includes all changesets from source branch. Perhaps MergeSources
object contains right information...
Is there a tool that can show complete TFS changeset metadata ?
I looked a bit more into this and it seems that there is no metadata in TFVC that distinguishes full merge from a partial one. Instead, I'm detecting cherry picks based on non-empty list of merge candidates. Some initial code is in my repository: https://github.com/git-tfs/git-tfs/compare/master...mwisnicki:manage_partial_merge
Sadly my use of GetMergeCandidates
to achieve this is wrong. There is no way to look for merge candidates at specific changeset - it always shows status for latest versions of branches.
@mwisnicki Did you ever find a solution to this issue? I'm facing this exact issue right now. I've migrated some quite big TFS repos and we did "selective merges" on a regular basis. So the history of our git repo is quite a mess unfortunately.
@nk111 unfortunately no. I had no need to use TFS since then