git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: ask4thunder <ask4thunder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to sync changes in GIT to ClearCase or How to get the list of files changed in GIT for a specific branch
Date: Thu, 23 Apr 2009 21:31:15 -0700	[thread overview]
Message-ID: <20090424043114.GC15612@gmail.com> (raw)
In-Reply-To: <23197522.post@talk.nabble.com>

On  0, ask4thunder <ask4thunder@gmail.com> wrote:
> 
> I am intending to use ClearCase in the background and GIT in the front.
> For syncing files from ClearCase to GIT i 
> checkout the git branch
> use rsync command to get the changed files in ClearCase
> and then i do the 'git add' and 'git commit'

To handle files that have been removed make sure to use
	rsync --exclude=.git --delete ...

and
	git add -u

to remove any deleted files from git.


> This works out well, but i want to get a list of files changed in GIt so
> that i can bring that to ClearCase and checkout and checkin files.
> 
> Can someone provide me the commands to
> 
> 1. Get list of files changed in GIT, after i do commit?


One possibility:

move to the root of the clearcase project

set GIT_DIR to point to the .git directory
(which, presumably is outside the clearcase project)

and some combination of:
	git diff --name-only
	git diff-index --name-status HEAD

If clearcase wasn't so painful you would ideally just
run 'git checkout -f' to make clearcase match git,
but clearcase is horrible and you have to explicitly
'clearcase checkout' each file.


> 2. Get list of files changed in GIT after commit, but files changed after a
> tag (baseline).

	git diff --name-only <the-commit>^!

	git diff --name-only <the-tag>..HEAD

(or diff-index, etc)


> 3. Sync these files to ClearCase?

	clearcase checkout the <path>
	git checkout HEAD -- <path>

	(assuming you've set GIT_DIR accordingly
	 and are sitting at the root of the project)


> Hope you gurus can help me....am in desperate need of these commands. 
> Appreciate your help  in this.

If you get this stuff working with native clearcase commands,
then others could benefit from your work.

bi-directional git<->cc can be tricky (and importing all of
branches can be even trickier), but even being able to import
one branch is better than nothing, no?

The reason I replied is that I, too, once wrote a similar
tool to suck cc projects into git.  One project
was so huge (and cc sucks so bad) that it
literally took a few weeks for it to import.

Our organization also ran vob backups at 2am everynight,
so I couldn't just let it run continuously since clearcase
would lock the script out at 2am.

It ran incrementally, and lots of other site-specific
hacks.  I don't know clearcase at all (our site used a bunch
of in-house wrapper commands) so I never bothered to make
it work with raw cc commands. That's why I have nothing
to share.  It was also a total hack and once I got the stuff
I wanted out of it, you can bet that I never looked back
(which is why the bi-directional part was not important
 to me at all).


clearcase.. wow <shudders>

All it does is remind me of this horrible, horrible cc mvfs
kernel module bug that was going around deleting automounts...

okay.. enough scary thoughts.


kudos for fighting the good fight,

-- 

	David

  reply	other threads:[~2009-04-24  4:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 18:59 How to sync changes in GIT to ClearCase or How to get the list of files changed in GIT for a specific branch ask4thunder
2009-04-24  4:31 ` David Aguilar [this message]
2009-04-24  9:20 ` Peter Baumann
2009-04-24 12:10 ` Charles O'Farrell
     [not found] ` <a038bef50904232018w29419030k100ed5a5089f9e8e@mail.gmail.com>
     [not found]   ` <41a31a5a0905071204s597cb76ek524748b8b919b25e@mail.gmail.com>
2009-05-07 21:34     ` Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090424043114.GC15612@gmail.com \
    --to=davvid@gmail.com \
    --cc=ask4thunder@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).