Re: [RFC] New command: 'git snapshot'.
- From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- Date
- Feb 9, 2009, 19:52 UTC
- Message-ID
- <gmq1hu$ccn$1@ger.gmane.org>
- In-Reply-To
- <38cfbb550902091054u78f2e706u67752b4dc9de6c3b@mail.gmail.com>
On Monday 09 February 2009 19:54, Fabio Augusto Dal Castel wrote:
Show 10 quoted lines
> Q. What are the differences between 'git stash' and 'git snapshot'? > > A. > > git stash git snapshot > > temporary/short-term permanent/long-term > reflog-based branch-based > applies a "git reset --hard" leaves working dir / index untouched > does not stash untracked files snapshots ALL files (except ignored)
I like this snapshot idea, and I clearly see the difference between this and stash.
For example, I use stash when I want to move away from the current hacking because a new, more urgent change must be done somewhere else.
Instead, I see a usecase for git snapshot for progressive temporary snapshot while working towards a more complex feature while needing temporary intermediate checkpoints: an effect similar to what I currently achieve using git commit (a first time) and git commit --amend as my work progresses.
In this respect, I wouldn't agree with the first difference you remarked, but that's just the usecase I have in mind.
Show 9 quoted lines
> Q. How it works?
>
> A.[What follows is a textual description of my current implementation.
> Of course, there is nothing carved in stone: suggestions and comments
> are MORE than welcome.]
>
> All snapshots are stored in a special branch ("<branch>_snapshots").
> So, if you are on 'master' branch, a 'git snapshot' will create/use a
> 'master_snapshots' branch.I'm not sure I like the idea of creating these branches with these branchnames. What about using another refs/ subtree? So refs/snapshots/somebranchname would contain the snapshot paired with refs/heads/somebranchname.
-- Giuseppe "Oblomov" Bilotta