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

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

 



On Wed, Feb 11, 2009 at 12:58 AM, Ulrik Sverdrup
<ulrik.sverdrup@xxxxxxxxx> wrote:
>> On Tue, Feb 10, 2009 at 3:08 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> > Jeff King <peff@xxxxxxxx> 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
>
--
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