git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Fabio Augusto Dal CastelNext: Brandon Casey
Message 2 of 16 in “[RFC] New command: 'git snapshot'.”
  1. Fabio Augusto Dal CastelFeb 9, 2009
  2. Giuseppe BilottaFeb 9, 2009
  3. Brandon CaseyFeb 9, 2009
  4. Sitaram ChamartyFeb 10, 2009
  5. Jon LoeligerFeb 10, 2009
  6. Junio C HamanoFeb 10, 2009
  7. Sitaram ChamartyFeb 11, 2009
  8. Fabio Augusto Dal CastelFeb 10, 2009
  9. Jeff KingFeb 10, 2009
  10. Junio C HamanoFeb 10, 2009
  11. Jeff KingFeb 10, 2009
  12. Geoffrey LeeFeb 10, 2009
  13. Jeff KingFeb 11, 2009
  14. Matthieu MoyFeb 11, 2009
  15. Fabio Augusto Dal CastelFeb 11, 2009
  16. Fabio Augusto Dal CastelFeb 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.