Re: [PATCH 2/2] check-attr: move to the top of working tree when in non-bare repository

2014-02-16 Thread Michael Haggerty
On 02/06/2014 09:17 PM, Jonathan Nieder wrote: How do I use the only-look-at-HEAD mode from a non-bare repo? If I want attributes with respect to some other commit instead of HEAD, is there a syntax for that? The command doesn't seem to have been well thought out. I agree that it would be

[PATCH 2/2] check-attr: move to the top of working tree when in non-bare repository

2014-02-06 Thread Junio C Hamano
Lasse Makholm noticed that running git check-attr from a place totally unrelated to $GIT_DIR and $GIT_WORK_TREE does not give expected results. I think it is because the command does not say it wants to call setup_work_tree(). We still need to support use cases where only a bare repository is

Re: [PATCH 2/2] check-attr: move to the top of working tree when in non-bare repository

2014-02-06 Thread Jonathan Nieder
Hi, Junio C Hamano wrote: --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -94,6 +94,9 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix) struct git_attr_check *check; int cnt, i, doubledash, filei; + if (!is_bare_repository()) +

Re: [PATCH 2/2] check-attr: move to the top of working tree when in non-bare repository

2014-02-06 Thread Jonathan Nieder
Hi again, Jonathan Nieder wrote: Junio C Hamano wrote: +if (!is_bare_repository()) +setup_work_tree(); Hm. Shouldn't check-attr error out when run without a worktree and without --cached? That would mean something like diff --git i/builtin/check-attr.c

Re: [PATCH 2/2] check-attr: move to the top of working tree when in non-bare repository

2014-02-06 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Someone asked in a private reply how this interacts with t0003. It was me mistakenly using reply not reply all. t0003 tries check-attr in a bare repository. The question is, is that a desirable feature, and are people relying on it? Running