From: Jonathan Nieder <jrnieder@gmail.com>
To: Eli Barzilay <eli@barzilay.org>
Cc: git@vger.kernel.org
Subject: git check-attr in bare repositories
Date: Mon, 29 Mar 2010 18:15:01 -0500 [thread overview]
Message-ID: <20100329231501.GA28194@progeny.tock> (raw)
In-Reply-To: <19376.53419.640007.930897@winooski.ccs.neu.edu>
Eli Barzilay wrote:
> On Mar 29, Eli Barzilay wrote:
>> On Mar 27, Jonathan Nieder wrote:
[in a bare repository]
>>> GIT_INDEX=tmp-index git check-attr "$@" &&
[...]
>> I tried that, but it doesn't work. (I used GIT_INDEX_FILE.)
Yes, not sure how I confused myself.
git explicitly guards against that in attr.c.
/*
* Read from parent directories and push them down
*/
if (!is_bare_repository() || direction == GIT_ATTR_INDEX) {
That check comes from v1.5.6-rc3~9^2 (Ignore .gitattributes in bare
repositories, 2008-06-08). This is consistent with how bare
repositories generally work: they are guarded against use with a
populated index, since what filesystem tree would that index track?
To support your use case, it would be nice for check-attr to learn a
--direction option. Maybe it would be safe to let check-attr read
from the index in bare repositories by default anyway, since the
index is usually missing anyway.
Properly supporting general work in a bare repository would require
a larger effort. Maybe:
- Teach code that checks is_bare_repository() to check
get_git_work_tree() == NULL or similar instead.
- Make the work_tree and git_dir variables the responsibility of the
setup code.
- If the user sets GIT_INDEX_FILE or GIT_WORK_TREE, let the setup
code respect that wish even if core.bare is set.
Thoughts?
Jonathan
next prev parent reply other threads:[~2010-03-29 23:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-26 3:57 `git check-attr' problems & questions Eli Barzilay
2010-03-28 1:42 ` Jonathan Nieder
2010-03-29 15:28 ` Eli Barzilay
2010-03-29 16:09 ` Eli Barzilay
2010-03-29 23:15 ` Jonathan Nieder [this message]
2010-03-30 4:53 ` git check-attr in bare repositories Eli Barzilay
2010-03-30 21:22 ` Jonathan Nieder
2010-03-30 21:39 ` Jakub Narebski
2010-03-31 3:15 ` Eli Barzilay
2010-03-30 21:30 ` Carrying over attributes when moving files Jonathan Nieder
2010-03-31 3:30 ` Eli Barzilay
2010-03-31 4:05 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100329231501.GA28194@progeny.tock \
--to=jrnieder@gmail.com \
--cc=eli@barzilay.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).