Re: [PATCH] Add git-save script
- From
しらいしななこ <nanako3@bluebottle.com>
- Date
- Jun 27, 2007, 09:38 UTC
- Message-ID
- <200706270938.l5R9c583019275@mi0.bluebottle.com>
- In-Reply-To
- <7vsl8euryx.fsf@assigned-by-dhcp.pobox.com>
Quoting Junio C Hamano <gitster@pobox.com>:
Show 11 quoted lines
> I think it would make much more sense to represent a stash like > this: > > .------o commit to represent index state > / \ > ---o---o----------o > HEAD commit to represent worktree state > > That is, "index" and "worktree" state are represented as one > commit each, both are direct child of the HEAD, with an added > twist of the latter being also a child of the former.
I do not know if I understand you correctly. Do you mean that I should create a stash this way?
i_tree=$(git-write-tree) i_commit=$(echo index | git-commit-tree $i_tree -p HEAD) w_tree=$( what I did to create w_tree in my previous patch ) w_commit=$(echo $msg | git-commit-tree $w_tree -p HEAD -p $i_commit)
and when unstashing the stash, I should:
git-merge-recursive $stash^^{tree} -- $stash^^{tree} $stash^{tree}I think I can make it work, but if that is not what you meant, please let me know.
Show 7 quoted lines
> I am not absolutely sure if "git reset --hard" belongs here.
> > You can certainly type one less command in your example sequence
> > ("stash; pull; restore"). But I suspect there may be a case
> > that would be more useful if "git save" did not do the reset
> > itself. I dunno....
>
> I now think "git reset --hard" here is fine.I see.
I will try to update and resend my patch this weekend.
-- Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/ ---------------------------------------------------------------------- Get a free email address with REAL anti-spam protection. http://www.bluebottle.com