Re: [RFC/PATCH] shortstatus v1

From
Nanako Shiraishi <hidden>
Date
2016-06-15 22:46:08
Reply to
Ulrik Sverdrup, 2016-06-15
Quoting Ulrik Sverdrup [off-list ref]:
quoted
On Tue, Feb 10, 2009 at 3:08 PM, Junio C Hamano [off-list ref] wrote:
quoted
Jeff King [off-list ref] 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?)
I 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.
Something like this:
cp .git/index .git/tmp-index
GIT_INDEX_FILE=.git/tmp-index
git add -N .
git stash create

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..
git-add -N came much later, late August 2008, and is available only in v1.6.1 and later.

I think you want to export GIT_INDEX_FILE you set to the temporary file before running these two commands.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Thread (3 messages) 3 messages, 2 authors, last reply 2016-06-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help