Re: [PATCH v3 0/2] check-attr: add support to work with revisions
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Dec 17, 2022, 14:52 UTC
- Message-ID
- <CAOLa=ZRp+JjFbdhyv9wFLyQgKmQN8p6xwUsHe7=254_q6xqPxQ@mail.gmail.com>
- In-Reply-To
- <071e44b5-607e-0db5-af90-85daae81f611@dunelm.org.uk>
On Sat, Dec 17, 2022 at 11:53 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 13 quoted lines
> > This is specifically useful in bare repositories wherein the gitattributes are > > only present in the git working tree but not available directly on the > > filesystem. > > I was thinking about this and wondering if the problem is really that > bare repositories ignore attributes because they don't have a working > copy. If that's the case then we should perhaps be looking to fix that > so that all git commands such as diff as log benefit rather than just > adding a flag to check-attr. A simple solution would be to read the > attributes from HEAD in a bare repository in the same way that we > fallback to the index if there are no attributes in the working copy for > non-bare repositories. >
This is actually the direction I started this series in, but I soon realized it's also useful to have a more generic version (which is currently what we have in this patch series) which also satisfies the bare repository scenario. It seemed like a natural extension.
I thought it's also useful because it lets you see how attributes changes over history.