Comments (6)
Hi Leonidas,
Hmm. So that warning is part of the 'safety' protocol of git-cc that makes sure that the last revision of a file in Git matches the current version of the file in Clearcase. This is to make sure that as git-cc replays your commits in Clearcase that it doesn't accidentally override something.
I would look at the Clearcase history of package/className.java
and see if the last commit matches what is in Git. If it does, or in any case, what you can do is check out the git_cc
branch, which is where the last sync was from, copy the latest version of that file, commit and then rebase master. That will ensure that you've resolved any merge conflicts and don't lose any changes.
I'm also curious why the rebase isn't picking up changes from Clearcase. git-cc works purely off the timestamp. If you get the timestamp of the git_cc
branch commit, and then run cleartool -since $TIME package/className.java
. Does it return what you expect?
Finally, as a work around you can do --force
, but I really wouldn't recommend that.
Good luck, and let me know how all that goes.
Charles
from git-cc.
I didn't understand the fix you propose if the ClearCase history matches the Git history.
What I noticed though is that the command:
$ git log -n 1 --pretty=format:%ai master_cc
2013-10-29 18:24:13 +0000
and when I do a gitcc rebase --stash
the timestamp is 1 second different:
$ gitcc rebase
> git ls-files --modified
> git log -n 1 --pretty=format:%ai master_cc
> cleartool lsh -fmt %o%m|%Nd|%u|%En|%Vn|%Nc\n -recurse -since 29-Oct-2013.18:24:14 .
As it stands at the moment I can't commit my changes to package/className.java
file. I haven't tried the gitcc checkin --force
action yet but I would like to eliminate any other possible solution first (and maybe help resolve a bug)
from git-cc.
Hi Leonidas,
That extra second is intentional. You don't want to re-add the changes that already exist in Git.
What is the output from running cleartool lsh
from above? Or looking at the history tree for that matter?
To work around the issue (and not use --force-
) you can take the contents of the className.java
file and override the contents in Git you can trick git-cc into thinking it rebased the correct contents. Something like (maybe back up your Git repository before running any of these commands):
git checkout git-cc
cleartool update /view # make sure we have the latest
cp /view/package/className.java /git/package/className.java
git add .
git commit -C HEAD # Use an old timestamp so we don't miss anything else
git rebase git-cc master
git branch -f git-ci git-cc # git-cc is the place where we last pushed from, which I'm assuming is equal to git-cc
This is essentially what git-cc does anyway, but without keeping the history. It would be nice to know why lsh
isn't picking up the changes. The problem will most likely be that the last commit on master_cc
will be after the change to className.java
, and thus are no longer picked up.
You could also 'go back in time' and rebase again to see if it managed to pick up the changes.
git branch -f git-cc COMMIT_BEFORE_CHANGE # find out when the history diverged, and go back to a commit before that happened
git rebase --onto git-cc git-ci master # you need to be on master for this stunt to work
git branch -f git-ci git-cc
git-cc rebase # fetch from an older point in time
I hope this is somewhat helpful.
Charles
from git-cc.
Hi Charles,
That is useful as general knowledge. I eventually rebase the whole repository again and applied my changes. I think it could be related to line endings. I know that by default the gitcc use autocrlf=false
but my IDE (Intellij Idea) keeps on asking to "fix" this to autocrlf=true
. I stopped IDEA of making line-endings for GIT and keep them as is (from ClearCase).
Is it possible to leave this ticket open for some time (~1 week) to confirm it's working?
Leonidas
from git-cc.
Hi Leonidas,
Doh! Of course - line endings is the other possibility. I never got around to fixing this problem. It was always easier/safer to not mess with line endings. If you could stick with autocrlf=false
that will certainly make your life easier.
You're welcome to keep this ticket open. Let me know how you go.
Cheers,
Charles
from git-cc.
Seems like the line endings was the problem so I can close this. Thanks!
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 4
- 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.