Reverting file content after checkbox uncheck in git tfs ct

95 views
Skip to first unread message

Andrej Had

unread,
Dec 14, 2011, 10:42:28 AM12/14/11
to git-t...@googlegroups.com
Hi,
I don't know if this is an issue or I'm missing something in correct git-tfs workflow. (also I'm new to git)

I've made a change involving couple of files. Made a commit into git, but I wanted to split this commit into two separate checkins to TFS.
i've run git tfs ct. In checkintool window I've unselected some of these files, believing I will checkin them later.

What was done:
Selected files were succesfully checked into tfs. Unselected files were reverted back to their previous state.
I've lost my change and had to do it again.

Expecting behaviour:
Unselected files will be left with their current content.


Also I can see that git tfs ct is also pulling latest changes from tfs, is this wanted behaviour ?
I thought that this will be done by git tfs pull.

Thanks,
A.

Ivan Danilov

unread,
Dec 14, 2011, 11:16:42 AM12/14/11
to git-t...@googlegroups.com
Hi! Thanks for the question.

git-tfs supposed to be a bridge between git and TFS, i.e. it only mirrors changesets/commits in two repositories on demand. When you do checking in (regardless of the actual way - rcheckin, checkin, checintool or something else) - it basically pends changes to TFS, and then pulls them back to ensure that TFS has correct version.

Also it is possible that somebody checked in to TFS something else in between. Say, we have current changeset #5 and it is synchronized with out git repository. Then we are making some changes and commit them to git. Meanwhile somebody checks in changeset #6, that is NOT conflicting with our change. If we try just to checkin our changes (which will have changeset id #7) - we mark current git's state as synchronized with changeset #7, but it is not in reality as we missed #6!

That's why git-tfs making fetch after each checkin - to preserve correct history in git so that it is the same as history in the TFS.

Thus said, checkintool is just a convenient tool to make last minute review of your changes and is not supposed to select things to checkin. If you need to divide changes into two chunks - use git's features that is _much_ more powerful than TFS's ones. For example, if you want to divide commit in two, do a soft reset to previous commit and commit things to two commits. Then execute git tfs rcheckin and you'll have these two commits in the TFS as well.
Reply all
Reply to author
Forward
0 new messages