Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 17, 2013, 17:37 UTC
- Message-ID
- <7vbo9df48a.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CALkWK0kJOSBN8XTJKBLOqi4tUjjm9unr=No65TtW9V0qvKmV-A@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 5 quoted lines
> 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 have a corresponding reflog > entry (for instance, those created with 'stash create').
Correct.
To show or apply, you only need a product of "stash create" that may not be linked anywhere in the refs or reflogs. But you can only pop or drop something on the stash reflog.
> 2. IS_STASH_LIKE is a misnomer: all it checks is that the given <rev> > is a merge commit.
The purpose of the logic is to reject a mistake to name stuff that is clearly not a product of "stash create". The name is just being humble by not claiming "I know this is definitely a product of stash-create" but merely hinting "This smells like such an object"; I am not sure if that is a "misnomer".
You are free to try to think of a way to tighten the implemention to reject a random two-or-three parent merge commit that is not a product of "stash create". People already have looked at this code since it was written, and didn't find a reasonable way to tighten it without triggering false negatives, so I wouldn't be surprised if anybody tried it again today and failed.