Comments (16)
If I type
git branch -f master
In my repository, it tells me the same
fatal: Not a valid object name: 'master'.
same for
git branch -f master2
=> fatal: Not a valid object name: 'master'.
I guess git branch -f master2
tries to create a branch master2 after the current commit of the master branch. But it doesn't seem to exists
from git-cc.
Hi Dolanor,
The problem here is my error reporting. Basically the entire 'rebase' process ran and didn't commit anything. Git needs to have at least one commit before you can do anything interesting (like create branches).
What does your 'branches' configuration look like in the .gitcc config file?
Cheers,
Charles
from git-cc.
When you see:
cleartool diff -diff_format -pred
That's looking for changes to a directory. Git doesn't track directories. To have files you are looking for an output like:
cleartool get -to some/file@/main/1
from git-cc.
Thanks for the quick reply here is my .git/gitcc
[master]
clearcase = /vob/daproject
from git-cc.
Actually I'm afraid I'm still stumped. I can't see the initial lshistory
command listed above Are you using 'rebase --load' with an lshistory.bak file? Or have you 'edited' the snippet you pasted?
Either way, but not specifying branches
in the .gitcc file you should be picking up the /main
branch.
Is /vob/daproject//src/Makefile
a file or a folder? From above git-cc seems to think it's a folder. If you look at .lshistory.bak can you see a line containing that file? Does it have checkinversion
or ``checkindirectory version at the start? Does any file have
checkinversion`?
Actually one thought did occur to me - there might be an error being masked here. Try changing the doCommit()
method to the following (ie remove the finally
block):
doCommit():
branch = getCurrentBranch()
if branch:
git_exec(['checkout', CC_TAG])
commit(cs)
I'm sorry I can't be much help.
from git-cc.
I loaded the history (too many commits otherwise. the history is ~746000 lines long) with rebase --load
The first ct command at the "beginning" (at the end of the lshistory file) are mkelemdirectory. The "first" (last in file) checkin which is a checkindirectory is at line ~738000.
I've launched the version with your doCommit() version. I'll update with the result
from git-cc.
With your doCommit, I got this. My view is static :
Traceback (most recent call last):
File "/home/myUser/git-cc/gitcc", line 51, in ?
main()
File "/home/myUser/git-cc/gitcc", line 14, in main
return invoke(cmd, args)
File "/home/myUser/git-cc/gitcc", line 41, in invoke
cmd.main(*args)
File "/home/myUser/git-cc/rebase.py", line 55, in main
doStash(lambda: doCommit(cs), stash)
File "/home/myUser/git-cc/common.py", line 38, in doStash
f()
File "/home/myUser/git-cc/rebase.py", line 55, in <lambda>
doStash(lambda: doCommit(cs), stash)
File "/home/myUser/git-cc/rebase.py", line 66, in doCommit
commit(cs)
File "/home/myUser/git-cc/rebase.py", line 149, in commit
cs.commit()
File "/home/myUser/git-cc/rebase.py", line 186, in commit
file.add(files)
File "/home/myUser/git-cc/rebase.py", line 215, in add
self._add(self.file, self.version)
File "/home/myUser/git-cc/rebase.py", line 223, in _add
removeFile(toFile)
File "/home/myUser/git-cc/common.py", line 146, in removeFile
os.remove(file)
OSError: [Errno 30] Read-only file system: '/vob/daproject//JUNK/2011_and_before/subdirs.old'
from git-cc.
Hi Dolanor,
Are you still running git-cc in your Clearcase directory? git-cc needs to be run in a directory where it can modify files so it can recreate the history.
Charles
from git-cc.
No, my static view is in /vob/daproject
and the git import dir where I call the git-cc is in /home/myUser/git-cc-import
from git-cc.
Hmm, that doesn't really correspond with the error I'm seeing:
toFile = path(join(GIT_DIR, file))
GIT_DIR
should be the root of the current git directory, and file
is the relative path to JUNK/2011_and_before/subdirs.old
. Maybe put some print statements around that line and see what both those variables are.
from git-cc.
I created a new import, still using my lshistory.bak and changing the directory of the import.
Yes I edited the log just to avoid some privacy issue, but the FS address remains coherent I think.
I added the output in the end
> git ls-files --modified
> git log -n 1 --pretty=format:%ai master_cc
> cleartool ls -recurse -short .
> git branch
> cleartool diff -diff_format -pred /vob/daproject//src@@/main/1
> cleartool lshistory -fmt %o%m|%Nd|%Vn\n /vob/daproject//src/Makefile
> cleartool describe -fmt %Nd /vob/daproject//src@@/main/1
It appears that you may be missing a branch in the includes section of your gitcc config for file '/vob/daproject//src/Makefile'.
> cleartool diff -diff_format -pred /vob/daproject//JUNK/2011_and_before/README@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/apps@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/arith@@/main/1
> cleartool lshistory -fmt %o%m|%Nd|%Vn\n /vob/daproject//src/arith/Makefile
> cleartool describe -fmt %Nd /vob/daproject//src/arith@@/main/1
It appears that you may be missing a branch in the includes section of your gitcc config for file '/vob/daproject//src/arith/Makefile'.
> cleartool diff -diff_format -pred /vob/daproject//src/backoff@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//JUNK/2011_and_before/bin@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/common@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/db@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/finance@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/libdbg@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/models@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//JUNK/2011_and_before/object.old@@/main/1
> cleartool diff -diff_format -pred /vob/daproject//src/risk@@/main/1
GIT_DIR : '/home/myUser/newImportDir', file : '/vob/daproject//JUNK/2011_and_before/subdirs.old'
Traceback (most recent call last):
File "/home/myUser/git-cc/gitcc", line 51, in ?
main()
File "/home/myUser/git-cc/gitcc", line 14, in main
return invoke(cmd, args)
File "/home/myUser/git-cc/gitcc", line 41, in invoke
cmd.main(*args)
File "/home/myUser/git-cc/rebase.py", line 52, in main
doStash(lambda: doCommit(cs), stash)
File "/home/myUser/git-cc/common.py", line 38, in doStash
f()
File "/home/myUser/git-cc/rebase.py", line 52, in <lambda>
doStash(lambda: doCommit(cs), stash)
File "/home/myUser/git-cc/rebase.py", line 63, in doCommit
commit(cs)
File "/home/myUser/git-cc/rebase.py", line 146, in commit
cs.commit()
File "/home/myUser/git-cc/rebase.py", line 183, in commit
file.add(files)
File "/home/myUser/git-cc/rebase.py", line 212, in add
self._add(self.file, self.version)
File "/home/myUser/git-cc/rebase.py", line 221, in _add
removeFile(toFile)
File "/home/myUser/git-cc/common.py", line 146, in removeFile
os.remove(file)
OSError: [Errno 30] Read-only file system: '/vob/daproject//JUNK/2011_and_before/subdirs.old'
GIT_DIR : '/home/myUser/newImportDir', file : '/vob/daproject//JUNK/2011_and_before/subdirs.old'
from git-cc.
Hi Dolandor,
Apologies. I thought you were running git-cc from the wrong place. Turns out join
in Python doesn't quite do what I expect it to do. join('/a', '/b')
will return /b
not /a/b
. So the problem is that file
is absolute, not relative. I'm wondering why that's different for you and how they ended up like that.
In any case you need to strip off the leading '/vob/daproject//' from each file. You can either do that manually by editing lshistory.bak or modifying the python rebase.py
file.
Good luck,
Charles
from git-cc.
It worked !
But the project is too big to be imported, Clearcase stopped seeing revision in the git-cc way of doing things. So I could only import 33 commits on 500k and so the history stays 17 years before…
For that, I modified my lshistory.bak instead of modifying rebase.py
Anyway, I still adapted the gitcc script to work on RedHat 5 without a 2.6 python.
dolanor@c6f0346
from git-cc.
Hey, so does mean you imported all your history after fixing lshistory.bak? Are you switching to Git now, or do you still have to use Clearcase officially?
My apologies that things were so painful, but I hope you can stay on Git now. :)
from git-cc.
I've switched project. Full git for now. They want us to work on TFS or SVN.
We don't give a damn because we will continue on git until we need to release something… Then we will make a major push, and that's it.
from git-cc.
Right on! FYI there are (better) Git bridge tools for both SVN and TFS, and Microsoft actually released the new version of TFS with Git support.
In any case I can't believe people are still using anything but Git these days. Best of luck.
from git-cc.
Related Issues (20)
- would git-cc work properly when cleartool diff is reconfigured? HOT 1
- Unable to initialize gitcc HOT 3
- Changing a symlink into a file in git causes ClearCase checkin to fail HOT 1
- Can I use the program on Linux redhat? HOT 2
- Does the program "git-cc" support python 3.5 HOT 1
- gitcc label erroring out HOT 25
- git-cc fails in subprocess.py HOT 7
- Unable to understand workflow. Where to use git init and where to use gitcc init? HOT 2
- zest.releaser upgrade? HOT 2
- Applying clearcase labels to git commits? HOT 15
- Capturing deleted file history? HOT 6
- git cc rebase - nothing happens HOT 5
- Error during gitcc rebase HOT 1
- Does git-cc support Git to CC HOT 2
- clearcase
- DEBUG in common.py dealt as str after loaded from config file HOT 1
- Only master Branch is creating while migrating but unable to create other branches HOT 1
- Only CC main branch code is migrated for all the branches. HOT 3
- Documentation questions HOT 6
- Version History not reflecting on Git platform HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-cc.