git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Johannes Schindelin
Message 11 of 12 in “Add git-save script”
  1. Add git-save scriptNanako Shiraishi, Jun 23, 2007
  2. Johannes SchindelinJun 23, 2007
  3. Bill LearJun 23, 2007
  4. Johannes SchindelinJun 23, 2007
  5. しらいしななこJun 25, 2007
  6. Junio C HamanoJun 25, 2007
  7. Junio C HamanoJun 23, 2007
  8. Nanako ShiraishiJun 24, 2007
  9. Junio C HamanoJun 24, 2007
  10. Junio C HamanoJun 27, 2007
  11. しらいしななこJun 27, 2007
  12. Johannes SchindelinJun 25, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.