0

I am working to setup a local git that bases it's repository on a SVN store.

All looks ok but how do I link a work item id with a comment to svn store when I run "git svn dcommit"?

Matt Passell
  • 4,549
  • 3
  • 24
  • 39
batta
  • 355
  • 1
  • 11
  • 1
    What do you mean with this link? Do you ask how to transfer the commit message, or how to generate the git-svn-id line? – Rudi Mar 21 '11 at 08:55
  • Let's say I have a work item number. When i do a 'dcommit' how do I transfer commit message with a ticket id so svn picks up the commit message and the work item id. If you've used eclipse-svn to commit you'll use these two - work item number and a commit message. How does git svn dcommit accomplish that? Am I clear? – batta Mar 21 '11 at 11:12
  • Do you mean the subversion bugtraq-property? – Mot Mar 21 '11 at 12:15

3 Answers3

1

You can also run git svn dcommit -e and add the tags interactively to each commit during the dcommit process. Our svn hooks require the bug ID in the first line of the commit message, and since that messes with git log --oneline output, I like to wait until I dcommit to add it.

AJ Lewis
  • 11
  • 1
1

For every svn commit git svn dcommit takes the commit message from the corresponding git commit. So you write your ticket id in the commit message like you did in subversion before you transfer it into svn.

When you already made your commits without these IDs, you can use git rebase -i HEAD~10 to edit the message of a commit, before you push it into svn.

Rudi
  • 19,366
  • 3
  • 55
  • 77
  • Ok. So the last git commit's message is used. Hmm, wonder how Jazz (rational ticket management tool) reads this. I'll try it out and let you know. Thanks a bunch. – batta Mar 21 '11 at 12:31
  • @batta It is the last commit message in the sense of the last commit message assigned to a git commit. But when you have more than one pending commits in git then you get also more than one commit in svn. For the Jazz part, typically this is done by the post-commit hook on the svn server. – Rudi Mar 21 '11 at 13:28
0

Took a while to remember I asked this question. The solution was pretty simple. I just has to format the git commit message so the post commit hook was able to read the commit and dispatch it wherever. We are using mantgis and buildmaster user Issue : : XXXXX format where XXXXX is a number. So your commit message simply looks like "my commit message Issue : : XXXXX". You can even add "Reviewed By : : K. Colleague" before "Issue" token. Remember to check your buildmaster what format he uses for the hooks. It varies...

batta
  • 355
  • 1
  • 11