Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-17 Thread Ramkumar Ramachandra
So, I read through git-stash.sh a little more, and found the following: 1. Any stash that can be shown can be applied, but not necessarily popped or dropped (as the documentation indicates). The reason for this is simple: a pop/drop attempts to clear the entry in the stash reflog as well, but

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-17 Thread Junio C Hamano
Ramkumar Ramachandra artag...@gmail.com writes: 1. Any stash that can be shown can be applied, but not necessarily popped or dropped (as the documentation indicates). The reason for this is simple: a pop/drop attempts to clear the entry in the stash reflog as well, but all stashes need to

[Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Ramkumar Ramachandra
While a 'git stash show stash^{/quuxery}' works just fine, a 'git stash pop stash^{/quuxery}' complains with: 'stash^{/quuxery} is not a stash reference'. This confusing behavior arises from the differences in logic that 'show' and 'pop' internally employ to validate the specified ref. Document

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Junio C Hamano
Ramkumar Ramachandra artag...@gmail.com writes: While a 'git stash show stash^{/quuxery}' works just fine, a 'git stash pop stash^{/quuxery}' complains with: 'stash^{/quuxery} is not a stash reference'. This confusing behavior arises from the differences in logic that 'show' and 'pop'

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Brandon Casey
On Tue, Apr 16, 2013 at 11:09 AM, Ramkumar Ramachandra artag...@gmail.com wrote: While a 'git stash show stash^{/quuxery}' works just fine, a 'git stash pop stash^{/quuxery}' complains with: 'stash^{/quuxery} is not a stash reference'. I don't think it is appropriate to use the ^{/text}

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Junio C Hamano
Brandon Casey draf...@gmail.com writes: The stash is implemented using the reflog. The ^{/text} notation searches the commit history, not the reflog. So I think it will be able to match the first entry in your stash stack, but not any of the other ones. Good point, together with... An

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Brandon Casey
On Tue, Apr 16, 2013 at 12:11 PM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: The stash is implemented using the reflog. The ^{/text} notation searches the commit history, not the reflog. So I think it will be able to match the first entry in your stash

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Ramkumar Ramachandra
Junio C Hamano wrote: Brandon Casey writes: Just a bit of advice, maybe you should think about softening your tone a bit hmm? I find this last sentence to be somewhat repelling and tend to refrain from responding to such. Oh, so it wasn't just me. I was about to say something similar,

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Ramkumar Ramachandra
Brandon Casey wrote: # Save another stash here echo bash file git add file git stash save something # Now git stash show stash^{/quuxery} no longer works. Ah, yes. My stupidity. Why was I expecting ^{/quuxery} to dig through the

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Ramkumar Ramachandra
Junio C Hamano wrote: I do not think anybody considered the approach to look at the commit object name and making sure it appears in the reflog that implements the stash. It sounds like a more robust check if done right. Actually, if you think about it, there is really only one way to specify

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Junio C Hamano
Ramkumar Ramachandra artag...@gmail.com writes: Junio C Hamano wrote: I do not think anybody considered the approach to look at the commit object name and making sure it appears in the reflog that implements the stash. It sounds like a more robust check if done right. Actually, if you think

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Brandon Casey
On Tue, Apr 16, 2013 at 1:11 PM, Ramkumar Ramachandra artag...@gmail.com wrote: Brandon Casey wrote: # Save another stash here echo bash file git add file git stash save something # Now git stash show stash^{/quuxery} no longer