git-cc icon indicating copy to clipboard operation
git-cc copied to clipboard

Unwanted files in CC Base after update

Open centy opened this issue 12 years ago • 5 comments

Hi, I just trying gitcc, and I found that by default after I do: gitcc init .. gitcc update ..

git has 2 unwanted files inside:

  • update.2012-03-01T155903+0100.updt
  • view.dat

I have tried to add them to exclude but it does not seems to work. I have check update.py and it ignores excludes.

centy avatar Mar 01 '12 15:03 centy

Hi Centry,

Not 100% what you mean by 'unwanted files'. You should be able to add files/folders you don't want added (in update) to be in .gitignore or .git/info/exclude. You can see in update.py it really just calls 'git add .', which won't add ignored files (assuming they're not already committed).

Once they're already committed to Git you'll have to either start again, or better yet just 'git rm' them and make another commit.

Cheers, Charles

charleso avatar Mar 01 '12 20:03 charleso

Ok, but why exclude does not work with update, include used, but not exclude? Looks like bug for me? This file "update.2012-03-01T155903+0100.updt" is created by gitcc update command.

centy avatar Mar 02 '12 08:03 centy

Include is used to copy the files from the Clearcase directory. After that update.py just runs 'git add .', I don't have any exclude logic here because Git will already do that for you. By adding file names to .gitignore you can exclude whichever files you need to.

Update also runs 'cleartool update' which may produce those files as a report. This is generated from Clearcase, not gitcc. Again, you can just ignore/exclude them in Git as per normal.

I'm sorry, I don't really see what the problem is.

charleso avatar Mar 02 '12 10:03 charleso

I just do not see reason to sync private files from CC to git. If you use git only then there should not be such files at all. Recently I had a case when after checkin few files was left as highjacks. It was strange, because new version was checkin in to CC. So highjacked file had no diffrences, so I undo highjack. I did not notice that CC made me .keep file, so after update I hade not wanted new files. Ofcourse I can add everything in to .gitignore or exclude file. But this usecase looks ugly. You never know what happen. And it is really hard to keep your commits clean. Maybe I do not understand whole idea of gitcc, and I do not want to use rebase. I need just update, checkin scheme. Maybe that is a problem.

centy avatar Mar 02 '12 11:03 centy

Update is really a last resort for when 'gitcc rebase' doesn't work. Update doesn't do anything clever about what is a Clearcase file vs what isn't. It literally just copies all the files to Git from Clearcase, private or otherwise. That's obviously not what you want.

Alternatively you could try rebase, which is what I would normally use. It tries to recreate the Clearcase history in Git as best it can. By doing that you only get Clearcase files and nothing else.

Not sure if this is helping or not. :(

charleso avatar Mar 02 '12 11:03 charleso