git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
To: git@vger.kernel.org
Cc: Geoffrey Lee <geoffreyj.lee@gmail.com>
Subject: Re: [RFC] New command: 'git snapshot'.
Date: Wed, 11 Feb 2009 01:05:43 +0100	[thread overview]
Message-ID: <a1b6cb1b0902101605l75c17e64qf9b919264b8d550d@mail.gmail.com> (raw)
In-Reply-To: <a1b6cb1b0902101558s7df025c7hfe078638452413c@mail.gmail.com>

On Wed, Feb 11, 2009 at 12:58 AM, Ulrik Sverdrup
<ulrik.sverdrup@gmail.com> wrote:
>> On Tue, Feb 10, 2009 at 3:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> > Jeff King <peff@peff.net> writes:
>> > How is it different from "git stash create"?
>>
>> Git stash doesn't touch untracked files, whereas git snapshot would.
>> Take another closer look at the table in the original post titled
>> "What are the differences between 'git stash' and 'git snapshot'?"
>>
>> -Geoffrey Lee
>
> I'm understanding this just as I read this, but it seems that implementing a
> git snapshot (I'm myself interested), could be done quickly with a new git.
> (When was git stash create introduced? I don't know it?)
>
> Something like this:
> cp .git/index .git/tmp-index
> GIT_INDEX_FILE=.git/tmp-index
> git add -N .
> git stash create

Ok I didn't test this. Stash creation fails because the add -N status
is not quite "tracked but no content staged", but rather you _have_ to
stage the files at a later point. git add -N is just a reminder thing?

Error output:
plugin-gui.log: not added yet
fatal: git-write-tree: error building trees
Cannot save the current index state

Shame, I wish the above script worked.

Ulrik Sverdrup


>
> So we use add -N to put all files into tracked but unstaged by default, but we
> keep our old index. Now stash is ready to save off the working directory, and
> further logic has to be applied on the returned commit to save it off..
>
>
> Ulrik Sverdrup
>

  reply	other threads:[~2009-02-11  0:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 23:58 [RFC] New command: 'git snapshot' Ulrik Sverdrup
2009-02-11  0:05 ` Ulrik Sverdrup [this message]
2009-02-11  0:08 ` [RFC/PATCH] shortstatus v1 Nanako Shiraishi
  -- strict thread matches above, loose matches on Subject: below --
2009-02-09 18:54 [RFC] New command: 'git snapshot' Fabio Augusto Dal Castel
2009-02-09 19:52 ` Giuseppe Bilotta
     [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

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=a1b6cb1b0902101605l75c17e64qf9b919264b8d550d@mail.gmail.com \
    --to=ulrik.sverdrup@gmail.com \
    --cc=geoffreyj.lee@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 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).