Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

2019-06-30 Thread Duy Nguyen
On Sun, Jun 30, 2019 at 4:30 PM Jakub Narebski wrote: > > Bikeshed painting ahead. > > Nguyễn Thái Ngọc Duy writes: > [...] > > The problem is we try every possible way to resolve a rev. Let's have > > some annotation to express that we only want to resolve a rev in a > > certain way: > > > > - @

Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

2019-06-30 Thread Jakub Narebski
Bikeshed painting ahead. Nguyễn Thái Ngọc Duy writes: [...] > The problem is we try every possible way to resolve a rev. Let's have > some annotation to express that we only want to resolve a rev in a > certain way: > > - @{hash} only accepts a full hash or a short hash. If it's a > short hash,

Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

2019-06-27 Thread Junio C Hamano
Duy Nguyen writes: > If refs/heads/master does _not_ exist, then ref/heads/master can > resolve to refs/heads/refs/heads/master, which I think is unexpected. > "ref not found" error or something should be returned instead. Ah, that was what I missed. Thanks.

Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

2019-06-26 Thread Duy Nguyen
On Thu, Jun 27, 2019 at 1:51 AM Junio C Hamano wrote: > > - @{literal} only accepts full ref. No turning "master" into > > "refs/heads/master". > > This is already doable by saying "refs/heads/master", isn't it? Any > ambiguous ones like a branch or a tag whose name is 'refs/heads/master' > (i.

Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

2019-06-26 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > The problem is we try every possible way to resolve a rev. Let's have > some annotation to express that we only want to resolve a rev in a > certain way: > > - @{hash} only accepts a full hash or a short hash. If it's a > short hash, it cannot be ambiguous. This

[PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

2019-06-26 Thread Nguyễn Thái Ngọc Duy
[I feel like this is something we should do, but I'm not sure. Hence RFC. The patch is mostly to play with if you're curious. The die() thing there is definitely wrong. And yeah all the syntax names are placeholders.] get_oid() is flexible and accepts multiple SHA-1 sources. Sometimes this flexibi