{"thread":{"id":"17711","subject":"Re: [RFC] New command: 'git snapshot'.","startedAt":"2009-02-10T23:58:06Z","lastAt":"2009-02-11T00:08:56Z","messageCount":3,"participants":["Ulrik Sverdrup","Nanako Shiraishi"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"104123","messageId":"a1b6cb1b0902101558s7df025c7hfe078638452413c@mail.gmail.com","threadId":"17711","inReplyTo":null,"subject":"Re: [RFC] New command: 'git snapshot'.","fromName":"Ulrik Sverdrup","fromEmail":"ulrik.sverdrup@gmail.com","sentAt":"2009-02-10T23:58:06Z","receivedAt":"2009-02-10T23:58:06Z","isPatch":false,"sender":{"key":"ulrik.sverdrup@gmail.com","avatar":null},"body":"> On Tue, Feb 10, 2009 at 3:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> > Jeff King <peff@peff.net> writes:\n> > How is it different from \"git stash create\"?\n>\n> Git stash doesn't touch untracked files, whereas git snapshot would.\n> Take another closer look at the table in the original post titled\n> \"What are the differences between 'git stash' and 'git snapshot'?\"\n>\n> -Geoffrey Lee\n\nI'm understanding this just as I read this, but it seems that implementing a\ngit snapshot (I'm myself interested), could be done quickly with a new git.\n(When was git stash create introduced? I don't know it?)\n\nSomething like this:\ncp .git/index .git/tmp-index\nGIT_INDEX_FILE=.git/tmp-index\ngit add -N .\ngit stash create\n\nSo we use add -N to put all files into tracked but unstaged by default, but we\nkeep our old index. Now stash is ready to save off the working directory, and\nfurther logic has to be applied on the returned commit to save it off..\n\n\nUlrik Sverdrup\n"},{"id":"104125","messageId":"a1b6cb1b0902101605l75c17e64qf9b919264b8d550d@mail.gmail.com","threadId":"17711","inReplyTo":"a1b6cb1b0902101558s7df025c7hfe078638452413c@mail.gmail.com","subject":"Re: [RFC] New command: 'git snapshot'.","fromName":"Ulrik Sverdrup","fromEmail":"ulrik.sverdrup@gmail.com","sentAt":"2009-02-11T00:05:43Z","receivedAt":"2009-02-11T00:05:43Z","isPatch":false,"sender":{"key":"ulrik.sverdrup@gmail.com","avatar":null},"body":"On Wed, Feb 11, 2009 at 12:58 AM, Ulrik Sverdrup\n<ulrik.sverdrup@gmail.com> wrote:\n>> On Tue, Feb 10, 2009 at 3:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> > Jeff King <peff@peff.net> writes:\n>> > How is it different from \"git stash create\"?\n>>\n>> Git stash doesn't touch untracked files, whereas git snapshot would.\n>> Take another closer look at the table in the original post titled\n>> \"What are the differences between 'git stash' and 'git snapshot'?\"\n>>\n>> -Geoffrey Lee\n>\n> I'm understanding this just as I read this, but it seems that implementing a\n> git snapshot (I'm myself interested), could be done quickly with a new git.\n> (When was git stash create introduced? I don't know it?)\n>\n> Something like this:\n> cp .git/index .git/tmp-index\n> GIT_INDEX_FILE=.git/tmp-index\n> git add -N .\n> git stash create\n\nOk I didn't test this. Stash creation fails because the add -N status\nis not quite \"tracked but no content staged\", but rather you _have_ to\nstage the files at a later point. git add -N is just a reminder thing?\n\nError output:\nplugin-gui.log: not added yet\nfatal: git-write-tree: error building trees\nCannot save the current index state\n\nShame, I wish the above script worked.\n\nUlrik Sverdrup\n\n\n>\n> So we use add -N to put all files into tracked but unstaged by default, but we\n> keep our old index. Now stash is ready to save off the working directory, and\n> further logic has to be applied on the returned commit to save it off..\n>\n>\n> Ulrik Sverdrup\n>\n"},{"id":"104126","messageId":"20090211090856.6117@nanako3.lavabit.com","threadId":"17711","inReplyTo":"a1b6cb1b0902101558s7df025c7hfe078638452413c@mail.gmail.com","subject":"Re: [RFC/PATCH] shortstatus v1","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-02-11T00:08:56Z","receivedAt":"2009-02-11T00:08:56Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Ulrik Sverdrup <ulrik.sverdrup@gmail.com>:\n\n>> On Tue, Feb 10, 2009 at 3:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> > Jeff King <peff@peff.net> writes:\n>> > How is it different from \"git stash create\"?\n>>\n>> Git stash doesn't touch untracked files, whereas git snapshot would.\n>> Take another closer look at the table in the original post titled\n>> \"What are the differences between 'git stash' and 'git snapshot'?\"\n>>\n>> -Geoffrey Lee\n>\n> I'm understanding this just as I read this, but it seems that implementing a\n> git snapshot (I'm myself interested), could be done quickly with a new git.\n> (When was git stash create introduced? I don't know it?)\n\nI did the initial git-stash at the end of June 2007; git-stash create was done by Junio about a week later and was released as a part of v1.5.4.\n\n> Something like this:\n> cp .git/index .git/tmp-index\n> GIT_INDEX_FILE=.git/tmp-index\n> git add -N .\n> git stash create\n>\n> So we use add -N to put all files into tracked but unstaged by default, but we\n> keep our old index. Now stash is ready to save off the working directory, and\n> further logic has to be applied on the returned commit to save it off..\n\ngit-add -N came much later, late August 2008, and is available only in v1.6.1 and later.\n\nI think you want to export GIT_INDEX_FILE you set to the temporary file before running these two commands.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"}]}