{"thread":{"id":"12981","subject":"newbie with broken workflow","startedAt":"2008-04-03T21:45:42Z","lastAt":"2008-04-04T16:30:46Z","messageCount":6,"participants":["James Kingston","Santi Béjar","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73633","messageId":"9d27c6320804031445p3fc80115n59218673dd587795@mail.gmail.com","threadId":"12981","inReplyTo":null,"subject":"newbie with broken workflow","fromName":"James Kingston","fromEmail":"james.kingston@gmail.com","sentAt":"2008-04-03T21:45:42Z","receivedAt":"2008-04-03T21:45:42Z","isPatch":false,"sender":{"key":"james.kingston@gmail.com","avatar":"https://gravatar.com/avatar/6464ee40cf78d033713c606b16aefcf1d7d2fa0dc1d2c891deae019972b03077?d=mp&s=160"},"body":"I am a few days into git and have settled into a workflow that is\napparently very broken, and I'd appreciate it if someone with a more\nexperienced eye can point out where I went wrong.\n\nThe official SCM tool at my work is ClearCase Remote Client, and it's\nvile... pessimistic locking, huge bureaucracy just to create a branch\n(I love experimental branches), no licenses for the native client.  My\nplan was to use git (Git-1.5.4-preview20080202.exe) to track my\nclearcase view directory, and push changes into that repo when\nconvenient from my working directory repo (clearcase makes\nnon-checkedout files read only, which makes working directly in the\nview directory Ugly).\n\nHere is a timeline of how I tried to do this:\n\n/c>\tcd /c/cc\n/c/cc> \tgit init\n/c/cc> \tgit add *\n/c/cc> \tgit commit\n/c/cc> \tmkdir /c/wd\n/c/cc> \tcd /c/wd\n/c/wd>\tgit clone /c/cc\n/c/wd>\tcd cc/\n/c/wd/cc>  ls\n/c/wd/cc>  vi config.ini\n/c/wd/cc>  git checkout -b config_changes\n/c/wd/cc>  git diff\n/c/wd/cc>  git add config.ini\n/c/wd/cc>  git commit\n/c/wd/cc>  git checkout master\n/c/wd/cc>  git merge config_changes\n/c/wd/cc>  vi config.ini\n/c/wd/cc>  git push /c/cc\n/c/wd/cc>  cd /c/cc\n/c/cc> \tvi config.ini # doesn't show the change made in experimental\nbranch, though gitk shows the patch\n/c/cc> \tgit status # says that config.ini has been modified\n/c/cc> \tgit add config.ini # grasping as straws\n/c/cc> \tgit commit # changes nothing, as far as I can tell\n/c/cc> \tgit reset --hard #still changes nothing.  My diffs are there\nin the log, just out of reach\n\nI have much to learn, but in the short term I just need to get those\nchanges into clearcase so QA can pull them\n"},{"id":"73634","messageId":"8aa486160804031503j1ff3adbcu83f41eef14347370@mail.gmail.com","threadId":"12981","inReplyTo":"9d27c6320804031445p3fc80115n59218673dd587795@mail.gmail.com","subject":"Re: newbie with broken workflow","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-04-03T22:03:01Z","receivedAt":"2008-04-03T22:03:01Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Thu, Apr 3, 2008 at 11:45 PM, James Kingston\n<james.kingston@gmail.com> wrote:\n[...]\n\n>\n>  /c>     cd /c/cc\n>  /c/cc>  git init\n>  /c/cc>  git add *\n>  /c/cc>  git commit\n>  /c/cc>  mkdir /c/wd\n>  /c/cc>  cd /c/wd\n>  /c/wd>  git clone /c/cc\n>  /c/wd>  cd cc/\n>  /c/wd/cc>  ls\n>  /c/wd/cc>  vi config.ini\n>  /c/wd/cc>  git checkout -b config_changes\n>  /c/wd/cc>  git diff\n>  /c/wd/cc>  git add config.ini\n>  /c/wd/cc>  git commit\n>  /c/wd/cc>  git checkout master\n>  /c/wd/cc>  git merge config_changes\n>  /c/wd/cc>  vi config.ini\n>  /c/wd/cc>  git push /c/cc\n\ngit push updates the branches, not the working copy, so:\n\ncd /c/cc\ngit pull /c/wd/cc HEAD\n\n>  /c/wd/cc>  cd /c/cc\n>  /c/cc>  vi config.ini # doesn't show the change made in experimental\n>  branch, though gitk shows the patch\n>  /c/cc>  git status # says that config.ini has been modified\n>  /c/cc>  git add config.ini # grasping as straws\n>  /c/cc>  git commit # changes nothing, as far as I can tell\n>  /c/cc>  git reset --hard #still changes nothing.  My diffs are there\n>  in the log, just out of reach\n>\n\nSanti\n"},{"id":"73636","messageId":"9d27c6320804031641s2a1578fcmd7271a06842803fe@mail.gmail.com","threadId":"12981","inReplyTo":"8aa486160804031503j1ff3adbcu83f41eef14347370@mail.gmail.com","subject":"Re: newbie with broken workflow","fromName":"James Kingston","fromEmail":"james.kingston@gmail.com","sentAt":"2008-04-03T23:41:33Z","receivedAt":"2008-04-03T23:41:33Z","isPatch":false,"sender":{"key":"james.kingston@gmail.com","avatar":"https://gravatar.com/avatar/6464ee40cf78d033713c606b16aefcf1d7d2fa0dc1d2c891deae019972b03077?d=mp&s=160"},"body":"On Thu, Apr 3, 2008 at 5:03 PM, Santi Béjar <sbejar@gmail.com> wrote:\n>  git push updates the branches, not the working copy, so:\n>\n>  cd /c/cc\n>  git pull /c/wd/cc HEAD\n>  Santi\n>\n\nThank you.  I also found the FAQ in the wiki, so the reasons are clear.\n"},{"id":"73637","messageId":"alpine.LNX.1.00.0804031957010.19665@iabervon.org","threadId":"12981","inReplyTo":"9d27c6320804031445p3fc80115n59218673dd587795@mail.gmail.com","subject":"Re: newbie with broken workflow","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-04-04T00:05:57Z","receivedAt":"2008-04-04T00:05:57Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Thu, 3 Apr 2008, James Kingston wrote:\n\n> I am a few days into git and have settled into a workflow that is\n> apparently very broken, and I'd appreciate it if someone with a more\n> experienced eye can point out where I went wrong.\n> \n> The official SCM tool at my work is ClearCase Remote Client, and it's\n> vile... pessimistic locking, huge bureaucracy just to create a branch\n> (I love experimental branches), no licenses for the native client.  My\n> plan was to use git (Git-1.5.4-preview20080202.exe) to track my\n> clearcase view directory, and push changes into that repo when\n> convenient from my working directory repo (clearcase makes\n> non-checkedout files read only, which makes working directly in the\n> view directory Ugly).\n> \n> Here is a timeline of how I tried to do this:\n> \n> /c>\tcd /c/cc\n> /c/cc> \tgit init\n> /c/cc> \tgit add *\n> /c/cc> \tgit commit\n> /c/cc> \tmkdir /c/wd\n> /c/cc> \tcd /c/wd\n> /c/wd>\tgit clone /c/cc\n> /c/wd>\tcd cc/\n> /c/wd/cc>  ls\n> /c/wd/cc>  vi config.ini\n> /c/wd/cc>  git checkout -b config_changes\n> /c/wd/cc>  git diff\n> /c/wd/cc>  git add config.ini\n> /c/wd/cc>  git commit\n> /c/wd/cc>  git checkout master\n> /c/wd/cc>  git merge config_changes\n> /c/wd/cc>  vi config.ini\n> /c/wd/cc>  git push /c/cc\n> /c/wd/cc>  cd /c/cc\n> /c/cc> \tvi config.ini # doesn't show the change made in experimental\n> branch, though gitk shows the patch\n> /c/cc> \tgit status # says that config.ini has been modified\n> /c/cc> \tgit add config.ini # grasping as straws\n> /c/cc> \tgit commit # changes nothing, as far as I can tell\n> /c/cc> \tgit reset --hard #still changes nothing.  My diffs are there\n> in the log, just out of reach\n> \n> I have much to learn, but in the short term I just need to get those\n> changes into clearcase so QA can pull them\n\nSo you should actually do:\n\n/c/wd/cc> cd /c/cc\n/c/cc> git pull ../wd/cc\n\nBut wouldn't that fail, because the files are read-only?\n\nI think you'd do:\n\n/c/cc> git fetch ../wd/cc\n/c/cc> git diff --name-only HEAD FETCH_HEAD\n\nTell ClearCase you want to edit those files\n\n/c/cc> git merge FETCH_HEAD\n\nCommit your ClearCase stuff\n\nAlso, IIRC, the sort of normal workflow for dealing with foreign SCMs that \nneed local working directories is actually to put them in \n.git/info/something, and use git diff to get the changes in each of your \ngit commits and git apply (using it like \"patch\", but smarter) to modify \nthe working directory.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"73653","messageId":"9d27c6320804040708l6eace184q9677ca75729b4eef@mail.gmail.com","threadId":"12981","inReplyTo":"alpine.LNX.1.00.0804031957010.19665@iabervon.org","subject":"Re: newbie with broken workflow","fromName":"James Kingston","fromEmail":"james.kingston@gmail.com","sentAt":"2008-04-04T14:08:26Z","receivedAt":"2008-04-04T14:08:26Z","isPatch":false,"sender":{"key":"james.kingston@gmail.com","avatar":"https://gravatar.com/avatar/6464ee40cf78d033713c606b16aefcf1d7d2fa0dc1d2c891deae019972b03077?d=mp&s=160"},"body":"On Thu, Apr 3, 2008 at 7:05 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n>  /c/wd/cc> cd /c/cc\n>  /c/cc> git pull ../wd/cc\n>\n>  But wouldn't that fail, because the files are read-only?\n\nActually, I just tried and it worked beautifully.  The directory is\nwritable, so git replaces rather than modifies the files.  Then I can\nuse CCRC to search for hijacked files, check them out in one swoop\nwith the option to keep my modifications, then check them all in as a\ngroup.\n"},{"id":"73657","messageId":"alpine.LNX.1.00.0804041228250.19665@iabervon.org","threadId":"12981","inReplyTo":"9d27c6320804040708l6eace184q9677ca75729b4eef@mail.gmail.com","subject":"Re: newbie with broken workflow","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-04-04T16:30:46Z","receivedAt":"2008-04-04T16:30:46Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 4 Apr 2008, James Kingston wrote:\n\n> On Thu, Apr 3, 2008 at 7:05 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> >  /c/wd/cc> cd /c/cc\n> >  /c/cc> git pull ../wd/cc\n> >\n> >  But wouldn't that fail, because the files are read-only?\n> \n> Actually, I just tried and it worked beautifully.  The directory is\n> writable, so git replaces rather than modifies the files.  Then I can\n> use CCRC to search for hijacked files, check them out in one swoop\n> with the option to keep my modifications, then check them all in as a\n> group.\n\nAh, yes, I guess that would work. Although I suspect that it would be \nannoying to recover if you failed to get the locks for any of them, since \nyou're missing CC's expected path for conflict resolution.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}