4

Recently, I've switched to using git-tfs so that TFS isn't a nightmare to work with. :) However, I've noticed an annoying detail that I can't seem to track down searching around in the docs and on the web.

The issue is with comments when using git tfs checkintool. When the Visual Studio Check-in dialogue box appears, all my past commit comments appear appended to the current comment.

I then have to delete all but the last comment before check-in.

This might be due to the fact that I'm using TFS gated check-ins, however, I'm not sure. When using gated check-ins the check-in never commits to the server. I just get back Checkin cancelled!. Then, once the gated build has passed, I do a git tfs pull to merge everything together.

Has anyone else seen this? What is the best action to clear the comment trail?

MORE INFO:

This indeed does have to do with the TFS gated checkin. When the gated checkin was turned off, and I made a single checkin, the comments cleared.

So, I think the same behavior should be able to be seen if many checkins are canceled and I do many git tfs pull requests over time. I think the local master branch never fully registers a push to the server.

What would be a way to indicate this to git locally?

Davin Tryon
  • 66,517
  • 15
  • 143
  • 132

1 Answers1

1

Not sure I fully understand your workflow, but have you tried using the flag "--no-build-default-comment" with checkintool? By default checkintool concatenates all the comments since the last time it thinks it was in sync with tfs, but this flag overrides this behaviour, leaving you with an empty dialog.

Anders
  • 544
  • 2
  • 8
  • That does clear the comments, however, it also clears my current commit comment. So, a step in the right directory, but not quite there. Also, this doesn't clear the comments permanently. The next `git tfs ct` will show all again. – Davin Tryon Mar 12 '13 at 10:06
  • I don't understand why you want to keep only the last commit message. Checkintool is supposed to create a "merge" commit with all of the commits on the current branch since it deviated from the branch called tfs/default; that's why it brings in all of the messages from the branch. Maybe the problem is that you're not rebasing or merging your feature branch with the tfs/default branch, so it brings in the entire history? – Anders Mar 12 '13 at 13:12
  • I don't think merging or rebase is the problem. When I commit a new set of changes I use `git commit -m "message"`. If I then use --no-build-default-comment, then I lose the message that I committed with. Does that help to clarify? – Davin Tryon Mar 12 '13 at 14:32