10

To speed up my ability to keep track of my own changes, I'd like to use git. My team is using RTC (Rational Team Concert). There is a nice perforce integration with git: http://kb.perforce.com/article/1417/git-p4. I could not find anything like this yet for git-RTC. Note, there is an article on how you might integrate RTC with another SCM such as git: https://jazz.net/library/article/194. However, I'm looking for the type of detailed workflow instructions provided by the p4-git bridge, such as how you set up your files, how to keep files in sync, how to send git commits to RTC.

I'd like to know if anybody else has solved this problem.

I'm considering either:

  1. Doing a git init at the top of the my RTC sandbox, and making sure that git files are ingored in the .jazzignore.
  2. Maybe having a rsync'd copy of my RTC workspace sandbox, so that I can pick up changes in the sandbox, rsync them to my "git-area", and then apply patches back to the RTC sandbox area. This would keep the git and RTC areas separate.

In either case, I'd do a git stash to save my own changes, so that the sync'ing changes are stored in their own commits.

If I do #1, I'm guessing my changes will simply be ready to commit to RTC, maybe using the GUI or command line.

In the case of #2, if I have done intermediate commits, maybe I can use git rebase to reorder the commits so mine are sequentially at the end, and then create a patch file to apply to the main RTC sandbox.

Another thought is to try to rewrite the p4 scripts to support RTC. I don't yet know enough yet about the RTC command line interface to assess this.

justingordon
  • 12,553
  • 12
  • 72
  • 116

1 Answers1

5

The simplest way remains 1/ "git within the RTC sandbox (local workspace)"

Add the .git directory to your .jazzignore and you can start working.
The pending changes of your RTC will pick up whatever has changed in your git working tree.

However, should you want to keep your git working tree separate from your RTC sandbox, you can consider using GIT-WORK-TREE in order for your git working tree to update itself with any change from your RTC sandbox.
See "Running “git status” against a repository located elsewhere in the system".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I often layer RTC and git SCMs on top of each other. However, the caveat is that if you have both RTC and eGit installed in your Eclipse workspace they often seem to cause non-deterministic problems with regards to what SCM Eclipse thinks it should be using. In short, option 1 works, just don't have eGit installed in the same RTC instance. – Pridkett Apr 06 '12 at 15:12
  • Hi! Do you have a link to understand better the "in order for your git working tree to update itself with any change" part? By this you mean external changes caused by RTC checking-in and merging won't be seen as changes in the Git repo? – LppEdd Jun 01 '18 at 10:48
  • @Lpp They will been seen as changes, but independent, by Git, which does not know about RTC concepts. – VonC Jun 01 '18 at 10:53
  • But I'll have to commit those external changes anyway, right? – LppEdd Jun 01 '18 at 11:52
  • @LppEdd `git commit`, yes. You can do both RTC commit (change set) and `git commit` independently one from another. – VonC Jun 01 '18 at 13:18
  • @VonC but this way I'll have "merge" or "check-in" commits in the Git repository, which I won't have in the RTC one. Better then nothing at all – LppEdd Jun 01 '18 at 13:42
  • @LppEdd yes, the point is: each version control system ignores each other, so there is no one-to-one correspondence between RTC-Git commits. – VonC Jun 01 '18 at 13:44
  • @VonC Sorry for bothering you again. I have a bit of free time to try that now. What I fail to see is the value of creating a new worktree. I mean, look at this VCS log in IntelliJ https://s15.postimg.cc/5gskxc8nf/Immagine.png What would be the differences using a separate worktree? – LppEdd Aug 21 '18 at 09:42
  • @LppEdd Sure, you can keep a common worktree, I simply find having two separate working tree being clearer, making sure to know in which environment (Git or RTC) I am at all time. – VonC Aug 21 '18 at 11:29
  • @VonC Will worktrees share commits? (if I make a commit on worktree1 named "RTC", will worktree2 see this commit's entry? I suppose it's a yes). Thanks again – LppEdd Aug 21 '18 at 12:11
  • @LppEdd No: commits done in an RTC environment have no incident and are ignored in a git worktree (and vice versa) – VonC Aug 21 '18 at 12:11
  • @VonC Oh, I meant worktree1 and worktree2 as both Git components. "RTC" was only the title of the commit – LppEdd Aug 21 '18 at 12:14
  • @LppEdd Then yes, if both worktrees share the same git repo (which is possible with the git worktree command: https://stackoverflow.com/a/30185564/6309) – VonC Aug 21 '18 at 12:15
  • @VonC I think this answer clarified the worktrees workflow. Thanks! – LppEdd Aug 21 '18 at 12:17