{"thread":{"id":"20312","subject":"Feature Request: Capability to save and load the workspace","startedAt":"2009-07-31T08:45:16Z","lastAt":"2009-07-31T12:08:41Z","messageCount":6,"participants":["Yakup Akbay","Erik Faye-Lund","Jakub Narebski","Johannes Schindelin","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119222","messageId":"4A72AF1C.1020500@ubicom.com","threadId":"20312","inReplyTo":null,"subject":"Feature Request: Capability to save and load the workspace","fromName":"Yakup Akbay","fromEmail":"yakbay@ubicom.com","sentAt":"2009-07-31T08:45:16Z","receivedAt":"2009-07-31T08:45:16Z","isPatch":false,"sender":{"key":"yakbay@ubicom.com","avatar":"https://gravatar.com/avatar/b1a445348437a895f93c412e183919a84c8b1298747b5e6f285b233225a274cf?d=mp&s=160"},"body":"I'm not sure whether such a feature exists or not. But let me explain my\nconcern.\n\nSay, we have different profiles for different products. When I work on a\nprofile (edit, configure, build etc.) I can't switch to another profile\nbefore I distclean the existing one. So, when I have to work on 2\nprojects at the same time, I have to have 2 copies of the same source\ntree. This might be OK for 2, but if the repository is around 3 gigs\nthis is not quite suitable for more than 2 profiles.\n\nIT WOULD BE NICE to have a feature in git that allows us to save the\ncurrent workspace then work on a different profile on a clean\nenvironment. Then save that profile and switch back to the previous\nprofile at any time without losing the environment.\n\nCurrently, I'm doing this myself using some scripts like:\n\n\nwork on foo\n\n$ ./project-save foo\nwork on bar\n$ ./project-save bar\n$ ./project-load foo\nkeep working on foo\netc.\n\n\nwhere, project-save looks like:\n1. BRANCH=<current branch>\n2. echo $BRANCH > .BRANCH\n3. git checkout -q -b foo\n4. git add -f .\n5. git commit -q -m 'Save foo'\n6. git checkout -q $BRANCH\n\nThis simply forks a new branch 'foo' then adds/commits all untracked +\ngitignore'd files to 'foo'. In addition, it stores the current branch\nname in a temporary file (.BRANCH). (All binary files and even temporary\nfile are committed.)\n\n\nand, project-load looks like:\n1. git checkout -q -f foo -- .BRANCH\n2. BRANCH=`cat .BRANCH`\n3. git checkout -q -f $BRANCH\n4. git checkout -q -f foo -- .\n5. git reset -q\n6. rm -f .BRANCH\n\nThis gets the target branch name from the file .BRANCH in 'foo',\nswitches to that branch and checks out all files from 'foo'. At the end\nit removes .BRANCH file. \n\nIf I want to completely remove the project foo, then I simply remove the\nbranch 'foo'.\n---\n\nThe problem is that this works way too slow  :-(  (this has some other\nproblems as well). I believe, such a feature could be implemented more\nefficiently in the core, but I'm so familiar with core git.\n \n\nWhat do you think?\n\nYakup\n\n\n \n"},{"id":"119223","messageId":"40aa078e0907310209p458cf912r1eb4329a409cefa7@mail.gmail.com","threadId":"20312","inReplyTo":"4A72AF1C.1020500@ubicom.com","subject":"Re: Feature Request: Capability to save and load the workspace","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2009-07-31T09:09:58Z","receivedAt":"2009-07-31T09:09:58Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Jul 31, 2009 at 10:45 AM, Yakup Akbay<yakbay@ubicom.com> wrote:\n> IT WOULD BE NICE to have a feature in git that allows us to save the\n> current workspace then work on a different profile on a clean\n> environment. Then save that profile and switch back to the previous\n> profile at any time without losing the environment.\n\nDid you have a look at the stash command yet? I might be missing\nsomething, but it looks to me like it's exactly what you're looking\nfor...\n\n-- \nErik \"kusma\" Faye-Lund\nkusmabite@gmail.com\n(+47) 986 59 656\n"},{"id":"119225","messageId":"CB2DD11991B27C4F99935E6229450D3204837B8F@STORK.scenix.com","threadId":"20312","inReplyTo":"40aa078e0907310209p458cf912r1eb4329a409cefa7@mail.gmail.com","subject":"RE: Feature Request: Capability to save and load the workspace","fromName":"Yakup Akbay","fromEmail":"yakbay@ubicom.com","sentAt":"2009-07-31T09:16:58Z","receivedAt":"2009-07-31T09:16:58Z","isPatch":false,"sender":{"key":"yakbay@ubicom.com","avatar":"https://gravatar.com/avatar/b1a445348437a895f93c412e183919a84c8b1298747b5e6f285b233225a274cf?d=mp&s=160"},"body":"AFAIK, git-stash does not save untracked and ignored files. What I need\nis to save them, too.\n\nBut yes, git-stash could be a good candidate for this.\n\nYakup\n\n-----Original Message-----\nFrom: Erik Faye-Lund [mailto:kusmabite@googlemail.com] \nSent: Freitag, 31. Juli 2009 12:10\nTo: Yakup Akbay\nCc: git@vger.kernel.org\nSubject: Re: Feature Request: Capability to save and load the workspace\n\nOn Fri, Jul 31, 2009 at 10:45 AM, Yakup Akbay<yakbay@ubicom.com> wrote:\n> IT WOULD BE NICE to have a feature in git that allows us to save the\n> current workspace then work on a different profile on a clean\n> environment. Then save that profile and switch back to the previous\n> profile at any time without losing the environment.\n\nDid you have a look at the stash command yet? I might be missing\nsomething, but it looks to me like it's exactly what you're looking\nfor...\n\n-- \nErik \"kusma\" Faye-Lund\nkusmabite@gmail.com\n(+47) 986 59 656\n"},{"id":"119226","messageId":"m3prbhryn7.fsf@localhost.localdomain","threadId":"20312","inReplyTo":"4A72AF1C.1020500@ubicom.com","subject":"Re: Feature Request: Capability to save and load the workspace","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-07-31T09:20:25Z","receivedAt":"2009-07-31T09:20:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Yakup Akbay <yakbay@ubicom.com> writes:\n\n> I'm not sure whether such a feature exists or not. But let me explain my\n> concern.\n> \n> Say, we have different profiles for different products. When I work on a\n> profile (edit, configure, build etc.) I can't switch to another profile\n> before I distclean the existing one. So, when I have to work on 2\n> projects at the same time, I have to have 2 copies of the same source\n> tree. This might be OK for 2, but if the repository is around 3 gigs\n> this is not quite suitable for more than 2 profiles.\n> \n> IT WOULD BE NICE to have a feature in git that allows us to save the\n> current workspace then work on a different profile on a clean\n> environment. Then save that profile and switch back to the previous\n> profile at any time without losing the environment.\n\nFirst, if the problem is repository size, you can use git-new-workdir\nscript from contrib/ to have multiple checkouts for a single\nrepository (but each checkout better be on different branch).\n\nAs to \"save current state\": take a look at 'git stash' command, which\nsaves state of working directory (and index).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"119246","messageId":"alpine.DEB.1.00.0907311213300.4503@intel-tinevez-2-302","threadId":"20312","inReplyTo":"CB2DD11991B27C4F99935E6229450D3204837B8F@STORK.scenix.com","subject":"RE: Feature Request: Capability to save and load the workspace","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-31T10:14:06Z","receivedAt":"2009-07-31T10:14:06Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 31 Jul 2009, Yakup Akbay wrote:\n\n> AFAIK, git-stash does not save untracked and ignored files. What I need \n> is to save them, too.\n\nSo...  \"git add . && git stash\"  You can even make an alias.\n\nCiao,\nDscho\n"},{"id":"119258","messageId":"vpqr5vxukae.fsf@bauges.imag.fr","threadId":"20312","inReplyTo":"CB2DD11991B27C4F99935E6229450D3204837B8F@STORK.scenix.com","subject":"Re: Feature Request: Capability to save and load the workspace","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-07-31T12:08:41Z","receivedAt":"2009-07-31T12:08:41Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Yakup Akbay\" <yakbay@ubicom.com> writes:\n\n> AFAIK, git-stash does not save untracked and ignored files. What I need\n> is to save them, too.\n\nSee\nhttp://thread.gmane.org/gmane.comp.version-control.git/109103\nfor a discussion around the same idea.\n\n-- \nMatthieu\n"}]}