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

Re: [PATCH 2/2] diff_index: honor in-index, not working-tree, .gitattributes

From
Jay Soffian <jaysoffian@gmail.com>
Date
Sep 23, 2011, 21:32 UTC
Message-ID
<CAG+J_DwGuR6bqE4iG26-xwc0_TuRRKUDmmJZ44Qr+y5EEzTnNA@mail.gmail.com>
In-Reply-To
<7vobybw6mv.fsf@alter.siamese.dyndns.org>
On Fri, Sep 23, 2011 at 12:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> If you want to allow use of in-tree attributes in _all_ callers of
> diff_tree_sha1(), then the right approach is to add an instance of "struct
> index_state" to "struct diff_options", have the caller _explicitly_ ask
> for use of in-tree attributes by setting a bit somewhere in "struct
> diff_options", and read the tree into that separate index_state using
> tree.c::read_tree(). I however doubt it is worth it.
>
> I would think it makes more sense to add a codeblock like that at the
> beginning of builtin/diff.c::builtin_diff_tree() when a new command option
> asks for it. In that codepath, you _know_ that we are not using the index
> at all, and reading the index there will not interfere with other uses of
> the index in the program.

Hmm, I looked at that, but then it would work for git-diff, but not git-diff-tree. I don't think there's any other diff options that work only at the porcelain layer, are there?

j.
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 11 in “Teach '--cached' option to check-attr”
  1. 1/2 Teach '--cached' option to check-attrJay Soffian, Sep 22, 2011
  2. 2/2 diff_index: honor in-index, not working-tree, .gitattributesJay Soffian, Sep 22, 2011
  3. Junio C HamanoSep 22, 2011
  4. Jay SoffianSep 23, 2011
  5. Jay SoffianSep 23, 2011
  6. Junio C HamanoSep 23, 2011
  7. Jay SoffianSep 23, 2011
  8. Junio C HamanoSep 23, 2011
  9. Michael HaggertySep 23, 2011
  10. Jay SoffianSep 23, 2011
  11. Junio C HamanoSep 22, 2011

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.