Re: [PATCH] Add git-save script

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

 



Quoting Junio C Hamano <gitster@xxxxxxxxx>:

> 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.

> 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

-
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