All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: git@vger.kernel.org
Subject: Re: [RFC] New command: 'git snapshot'.
Date: Mon, 09 Feb 2009 20:52:30 +0100	[thread overview]
Message-ID: <gmq1hu$ccn$1@ger.gmane.org> (raw)
In-Reply-To: 38cfbb550902091054u78f2e706u67752b4dc9de6c3b@mail.gmail.com

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

  reply	other threads:[~2009-02-09 19:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 18:54 [RFC] New command: 'git snapshot' Fabio Augusto Dal Castel
2009-02-09 19:52 ` Giuseppe Bilotta [this message]
     [not found]   ` <38cfbb550902101232l4c83b6dfjc70e1e2f79a8c3c1@mail.gmail.com>
2009-02-10 20:48     ` Fabio Augusto Dal Castel
2009-02-09 22:36 ` Brandon Casey
2009-02-10  4:51   ` Sitaram Chamarty
2009-02-10 19:47     ` Jon Loeliger
2009-02-10 20:31       ` Junio C Hamano
2009-02-11  1:22       ` Sitaram Chamarty
2009-02-10 20:40   ` Fabio Augusto Dal Castel
2009-02-10 23:00     ` Jeff King
2009-02-10 23:08       ` Junio C Hamano
2009-02-10 23:38         ` Jeff King
2009-02-10 23:39         ` Geoffrey Lee
2009-02-11 13:43           ` Jeff King
2009-02-11  9:04       ` Matthieu Moy
2009-02-11 20:40         ` Fabio Augusto Dal Castel
  -- strict thread matches above, loose matches on Subject: below --
2009-02-10 23:58 Ulrik Sverdrup
2009-02-11  0:05 ` Ulrik Sverdrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gmq1hu$ccn$1@ger.gmane.org' \
    --to=giuseppe.bilotta@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.