* Feature Request: Capability to save and load the workspace
@ 2009-07-31 8:45 Yakup Akbay
2009-07-31 9:09 ` Erik Faye-Lund
2009-07-31 9:20 ` Jakub Narebski
0 siblings, 2 replies; 6+ messages in thread
From: Yakup Akbay @ 2009-07-31 8:45 UTC (permalink / raw)
To: git
I'm not sure whether such a feature exists or not. But let me explain my
concern.
Say, we have different profiles for different products. When I work on a
profile (edit, configure, build etc.) I can't switch to another profile
before I distclean the existing one. So, when I have to work on 2
projects at the same time, I have to have 2 copies of the same source
tree. This might be OK for 2, but if the repository is around 3 gigs
this is not quite suitable for more than 2 profiles.
IT WOULD BE NICE to have a feature in git that allows us to save the
current workspace then work on a different profile on a clean
environment. Then save that profile and switch back to the previous
profile at any time without losing the environment.
Currently, I'm doing this myself using some scripts like:
work on foo
$ ./project-save foo
work on bar
$ ./project-save bar
$ ./project-load foo
keep working on foo
etc.
where, project-save looks like:
1. BRANCH=<current branch>
2. echo $BRANCH > .BRANCH
3. git checkout -q -b foo
4. git add -f .
5. git commit -q -m 'Save foo'
6. git checkout -q $BRANCH
This simply forks a new branch 'foo' then adds/commits all untracked +
gitignore'd files to 'foo'. In addition, it stores the current branch
name in a temporary file (.BRANCH). (All binary files and even temporary
file are committed.)
and, project-load looks like:
1. git checkout -q -f foo -- .BRANCH
2. BRANCH=`cat .BRANCH`
3. git checkout -q -f $BRANCH
4. git checkout -q -f foo -- .
5. git reset -q
6. rm -f .BRANCH
This gets the target branch name from the file .BRANCH in 'foo',
switches to that branch and checks out all files from 'foo'. At the end
it removes .BRANCH file.
If I want to completely remove the project foo, then I simply remove the
branch 'foo'.
---
The problem is that this works way too slow :-( (this has some other
problems as well). I believe, such a feature could be implemented more
efficiently in the core, but I'm so familiar with core git.
What do you think?
Yakup
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Feature Request: Capability to save and load the workspace
2009-07-31 8:45 Feature Request: Capability to save and load the workspace Yakup Akbay
@ 2009-07-31 9:09 ` Erik Faye-Lund
2009-07-31 9:16 ` Yakup Akbay
2009-07-31 9:20 ` Jakub Narebski
1 sibling, 1 reply; 6+ messages in thread
From: Erik Faye-Lund @ 2009-07-31 9:09 UTC (permalink / raw)
To: Yakup Akbay; +Cc: git
On Fri, Jul 31, 2009 at 10:45 AM, Yakup Akbay<yakbay@ubicom.com> wrote:
> IT WOULD BE NICE to have a feature in git that allows us to save the
> current workspace then work on a different profile on a clean
> environment. Then save that profile and switch back to the previous
> profile at any time without losing the environment.
Did you have a look at the stash command yet? I might be missing
something, but it looks to me like it's exactly what you're looking
for...
--
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Feature Request: Capability to save and load the workspace
2009-07-31 9:09 ` Erik Faye-Lund
@ 2009-07-31 9:16 ` Yakup Akbay
2009-07-31 10:14 ` Johannes Schindelin
2009-07-31 12:08 ` Matthieu Moy
0 siblings, 2 replies; 6+ messages in thread
From: Yakup Akbay @ 2009-07-31 9:16 UTC (permalink / raw)
To: Erik Faye-Lund; +Cc: git
AFAIK, git-stash does not save untracked and ignored files. What I need
is to save them, too.
But yes, git-stash could be a good candidate for this.
Yakup
-----Original Message-----
From: Erik Faye-Lund [mailto:kusmabite@googlemail.com]
Sent: Freitag, 31. Juli 2009 12:10
To: Yakup Akbay
Cc: git@vger.kernel.org
Subject: Re: Feature Request: Capability to save and load the workspace
On Fri, Jul 31, 2009 at 10:45 AM, Yakup Akbay<yakbay@ubicom.com> wrote:
> IT WOULD BE NICE to have a feature in git that allows us to save the
> current workspace then work on a different profile on a clean
> environment. Then save that profile and switch back to the previous
> profile at any time without losing the environment.
Did you have a look at the stash command yet? I might be missing
something, but it looks to me like it's exactly what you're looking
for...
--
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Feature Request: Capability to save and load the workspace
2009-07-31 8:45 Feature Request: Capability to save and load the workspace Yakup Akbay
2009-07-31 9:09 ` Erik Faye-Lund
@ 2009-07-31 9:20 ` Jakub Narebski
1 sibling, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2009-07-31 9:20 UTC (permalink / raw)
To: Yakup Akbay; +Cc: git
Yakup Akbay <yakbay@ubicom.com> writes:
> I'm not sure whether such a feature exists or not. But let me explain my
> concern.
>
> Say, we have different profiles for different products. When I work on a
> profile (edit, configure, build etc.) I can't switch to another profile
> before I distclean the existing one. So, when I have to work on 2
> projects at the same time, I have to have 2 copies of the same source
> tree. This might be OK for 2, but if the repository is around 3 gigs
> this is not quite suitable for more than 2 profiles.
>
> IT WOULD BE NICE to have a feature in git that allows us to save the
> current workspace then work on a different profile on a clean
> environment. Then save that profile and switch back to the previous
> profile at any time without losing the environment.
First, if the problem is repository size, you can use git-new-workdir
script from contrib/ to have multiple checkouts for a single
repository (but each checkout better be on different branch).
As to "save current state": take a look at 'git stash' command, which
saves state of working directory (and index).
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Feature Request: Capability to save and load the workspace
2009-07-31 9:16 ` Yakup Akbay
@ 2009-07-31 10:14 ` Johannes Schindelin
2009-07-31 12:08 ` Matthieu Moy
1 sibling, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2009-07-31 10:14 UTC (permalink / raw)
To: Yakup Akbay; +Cc: Erik Faye-Lund, git
Hi,
On Fri, 31 Jul 2009, Yakup Akbay wrote:
> AFAIK, git-stash does not save untracked and ignored files. What I need
> is to save them, too.
So... "git add . && git stash" You can even make an alias.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Feature Request: Capability to save and load the workspace
2009-07-31 9:16 ` Yakup Akbay
2009-07-31 10:14 ` Johannes Schindelin
@ 2009-07-31 12:08 ` Matthieu Moy
1 sibling, 0 replies; 6+ messages in thread
From: Matthieu Moy @ 2009-07-31 12:08 UTC (permalink / raw)
To: Yakup Akbay; +Cc: Erik Faye-Lund, git
"Yakup Akbay" <yakbay@ubicom.com> writes:
> AFAIK, git-stash does not save untracked and ignored files. What I need
> is to save them, too.
See
http://thread.gmane.org/gmane.comp.version-control.git/109103
for a discussion around the same idea.
--
Matthieu
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-31 12:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-31 8:45 Feature Request: Capability to save and load the workspace Yakup Akbay
2009-07-31 9:09 ` Erik Faye-Lund
2009-07-31 9:16 ` Yakup Akbay
2009-07-31 10:14 ` Johannes Schindelin
2009-07-31 12:08 ` Matthieu Moy
2009-07-31 9:20 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).