Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-10 Thread Jeff King
On Thu, May 10, 2018 at 01:21:19PM +0900, Junio C Hamano wrote: > When diagnosing such an error, we would give hints. The hint would > show possible objects that the user could have meant with X. The > ^{} suffix given to it may be used to limit the hints to > subset of the objects that the

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-09 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> Before we had any disambiguation code, resolving X^{tree} really was two >> independent steps: resolve X, and then peel it to a tree. When we added >> the disambiguation code, the goal was to provide a hint to the first >> step in such a way

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-09 Thread Ævar Arnfjörð Bjarmason
On Wed, May 09 2018, Jeff King wrote: > On Tue, May 08, 2018 at 08:53:10PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> >> "X^{tree}" should *RESULT* in a tree, but it should *REQUIRE* X to >> >> be a tree-ish. It is unclear "should be tree" is about the former >> >> and I read (perhaps mis-read)

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-09 Thread Jeff King
On Tue, May 08, 2018 at 08:53:10PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> "X^{tree}" should *RESULT* in a tree, but it should *REQUIRE* X to > >> be a tree-ish. It is unclear "should be tree" is about the former > >> and I read (perhaps mis-read) it as saying "it should require X to > >> be

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-08 Thread Ævar Arnfjörð Bjarmason
On Tue, May 08 2018, Jeff King wrote: > On Mon, May 07, 2018 at 01:08:46PM +0900, Junio C Hamano wrote: > >> Ævar Arnfjörð Bjarmason writes: >> >> > Right, and I'm with you so far, this makes sense to me for all existing >> > uses of the peel syntax, otherwise v2.17.0^{tree}

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-06 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Right, and I'm with you so far, this makes sense to me for all existing > uses of the peel syntax, otherwise v2.17.0^{tree} wouldn't be the same > as rev-parse v2.17.0^{tree}^{tree}... More importantly, you could spell v2.17.0 part of the

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-04 Thread Ævar Arnfjörð Bjarmason
On Fri, May 04 2018, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> The reason I'm doing this is because I found it confusing that I can't >> do: >> >> for t in tag commit tree blob; do ./git --exec-path=$PWD rev-parse >> 7452^{$t}; done >> >> And get,

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-03 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > The reason I'm doing this is because I found it confusing that I can't > do: > > for t in tag commit tree blob; do ./git --exec-path=$PWD rev-parse > 7452^{$t}; done > > And get, respectively, only the SHAs that match the respective type,

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-03 Thread Ævar Arnfjörð Bjarmason
On Thu, May 03 2018, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> But ^{tree} shows just the trees, but would previously be equivalent >> to the above: >> >> $ git rev-parse e8f2^{tree} >> error: short SHA1 e8f2 is ambiguous >> hint: The candidates

Re: [PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-02 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > But ^{tree} shows just the trees, but would previously be equivalent > to the above: > > $ git rev-parse e8f2^{tree} > error: short SHA1 e8f2 is ambiguous > hint: The candidates are: > hint: e8f2093055 tree > hint:

[PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-01 Thread Ævar Arnfjörð Bjarmason
After the recent series of patches ^{tag} and ^{blob} now work to get just the tags and blobs, but ^{tree} will still list any tree-ish (commits, tags and trees). The previous behavior was added in ed1ca6025f ("peel_onion: disambiguate to favor tree-ish when we know we want a tree-ish",