git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: `git check-attr' problems & questions

From
Eli Barzilay <eli@barzilay.org>
Date
Mar 29, 2010, 15:28 UTC
Message-ID
<19376.50971.397375.810974@winooski.ccs.neu.edu>
In-Reply-To
<20100328014208.GA23015@progeny.tock>
On Mar 27, Jonathan Nieder wrote:
Show 14 quoted lines
> Hi,
> 
> [quoted text reordered for convenience]
> 
> Eli Barzilay wrote:
> 
> > I'm trying to use .gitattributes to use some custom properties that we
> > have in an svn repository which is migrating to git,
> [...]
> > So my first question is -- am I missing something obvious?  It almost
> > looks like `check-attr' is intended only for low-level use...
> 
> Yep.  It’s listed under “purehelpers” (Internal helper commands) in
> command-list.txt and hence git(1).
(Ah, it would be nice to have that in the `git-check-attr' man page.)
Show 11 quoted lines
> I suspect a good place to put a user-visible equivalent would be a
> future ‘git ls’ command [1].
> 
> Therefore...
> 
> > Fixing the first problem seems like it would be easy with a quick
> > shell script (maybe even with just an alias),
> 
> If it proves pleasant to use, it would be very nice if you could
> send a copy of such a shell script after a while.  Experiments like
> this are the foundation of a good UI.

A script is easy, but even if it's for internal use, I don't see the point in `check-attr' not doing so...

Show 16 quoted lines
> > 2. I'm also trying to use an attribute on a hook script on the server
> >    (with the idea that email notifications are sent according to the
> >    set of modified files) -- but it looks like `git check-attr'
> >    doesn't work on a bare repository.
> 
> Current ‘git check-attr’ reads its attributes from actual .gitattribute
> files in the work tree first and then examines the versions registered
> in the index.  So the secret is to read the .gitattribute files you care
> about into a temporary index file --- e.g., something like this.
> 
>  : "Usage: $0 commit check-attr-args" &&
> 
>  GIT_INDEX=tmp-index git read-tree --reset -i "$1" &&
>  shift &&
>  GIT_INDEX=tmp-index git check-attr "$@" &&
>  rm tmp-index
I tried that, but it doesn't work.  (I used GIT_INDEX_FILE.)
-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Previous: Jonathan NiederNext: Eli Barzilay
Message 3 of 12 in “`git check-attr' problems & questions”
  1. Eli BarzilayMar 26, 2010
  2. Jonathan NiederMar 28, 2010
  3. Eli BarzilayMar 29, 2010
  4. Eli BarzilayMar 29, 2010
  5. git check-attr in bare repositoriesJonathan Nieder, Mar 29, 2010
  6. Eli BarzilayMar 30, 2010
  7. Jonathan NiederMar 30, 2010
  8. Jakub NarebskiMar 30, 2010
  9. Eli BarzilayMar 31, 2010
  10. Carrying over attributes when moving filesJonathan Nieder, Mar 30, 2010
  11. Eli BarzilayMar 31, 2010
  12. Junio C HamanoMar 31, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.