Re: [RFC] New command: 'git snapshot'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 09 February 2009 19:54, Fabio Augusto Dal Castel wrote:

> 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.

> 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux