Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-12-05 Thread Martin von Zweigbergk
On Tue, Dec 4, 2012 at 9:46 PM, Junio C Hamano gits...@pobox.com wrote: Martin von Zweigbergk martinv...@gmail.com writes: More importantly, when is it desirable not to delete deleted entries? When I am trying to check out contents of Documentation/ directory as of an older edition because

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-12-04 Thread Martin von Zweigbergk
On Sat, Dec 1, 2012 at 1:24 AM, Junio C Hamano gits...@pobox.com wrote: Martin von Zweigbergk martinv...@gmail.com writes: On Thu, Nov 29, 2012 at 2:00 PM, Martin von Zweigbergk martinv...@gmail.com wrote: Slightly off topic, but another difference (or somehow another aspect of the same

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-12-04 Thread Junio C Hamano
Martin von Zweigbergk martinv...@gmail.com writes: More importantly, when is it desirable not to delete deleted entries? When I am trying to check out contents of Documentation/ directory as of an older edition because we made mistakes updating the files in recent versions, with git checkout

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-12-01 Thread Junio C Hamano
Martin von Zweigbergk martinv...@gmail.com writes: On Thu, Nov 29, 2012 at 2:00 PM, Martin von Zweigbergk martinv...@gmail.com wrote: Slightly off topic, but another difference (or somehow another aspect of the same difference?) that has tripped me up a few times is that git checkout $rev .

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-30 Thread Martin von Zweigbergk
On Thu, Nov 29, 2012 at 2:00 PM, Martin von Zweigbergk martinv...@gmail.com wrote: Slightly off topic, but another difference (or somehow another aspect of the same difference?) that has tripped me up a few times is that git checkout $rev . only affects added and modified files (in $rev

[RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-29 Thread Martin von Zweigbergk
In cases where HEAD is not supposed to be updated, there is no reason that git reset should require a commit, a tree should be enough. So make git reset $rev^{tree} work just like git reset $rev, except that the former will not update HEAD (since there is no commit to point it to). Disallow

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-29 Thread Junio C Hamano
Martin von Zweigbergk martinv...@gmail.com writes: In cases where HEAD is not supposed to be updated, there is no reason that git reset should require a commit, a tree should be enough. So make git reset $rev^{tree} work just like git reset $rev, except that the former will not update HEAD

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-29 Thread Martin von Zweigbergk
On Thu, Nov 29, 2012 at 10:47 AM, Junio C Hamano gits...@pobox.com wrote: Martin von Zweigbergk martinv...@gmail.com writes: In cases where HEAD is not supposed to be updated, there is no reason that git reset should require a commit, a tree should be enough. So make git reset $rev^{tree}

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-29 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Martin von Zweigbergk martinv...@gmail.com writes: In cases where HEAD is not supposed to be updated, there is no reason that git reset should require a commit, a tree should be enough. So make git reset $rev^{tree} work just like git reset $rev,

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-29 Thread Junio C Hamano
Martin von Zweigbergk martinv...@gmail.com writes: Would the correct fix be to first make git reset --hard -- $path work (*sigh*)? I have never understood why that doesn't (shouldn't) work. What does it even mean, even when you are on an existing commit, to hard reset partially? Perhaps you

Re: [RFC/PATCH 1/2] reset: learn to reset to tree

2012-11-29 Thread Martin von Zweigbergk
On Thu, Nov 29, 2012 at 11:13 AM, Junio C Hamano gits...@pobox.com wrote: [...]These two commands, reset and checkout, share that the source we grab the blobs out of only need to be a tree and does not have to be a commit, and the only difference between them is where the blobs we grabbed out