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

Re: [PATCH 0/5] Make :(attr) pathspec work with "git log"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 19, 2018, 11:42 UTC
Message-ID
<877eh91egn.fsf@evledraar.gmail.com>
In-Reply-To
<20181118164800.32759-1-pclouds@gmail.com>
On Sun, Nov 18 2018, Nguyễn Thái Ngọc Duy wrote:
Show 19 quoted lines
> When :(attr) was added, it supported one of the two main pathspec
> matching functions, the one that works on a list of paths. The other
> one works on a tree, tree_entry_interesting(), which gets :(attr)
> support in this series.
>
> With this, "git grep <pattern> <tree> -- :(attr)" or "git log :(attr)"
> will not abort with BUG() anymore.
>
> But this also reveals an interesting thing: even though we walk on a
> tree, we check attributes from _worktree_ (and optionally fall back to
> the index). This is how attributes are implemented since forever. I
> think this is not a big deal if we communicate clearly with the user.
> But otherwise, this series can be scraped, as reading attributes from
> a specific tree could be a lot of work.
>
> The main patch is the last one. The others are just to open a path to
> pass "struct index_state *" down to tree_entry_interesting(). This may
> become standard procedure because we don't want to stick the_index (or
> the_repository) here and there.

Another side-note (this thread is turning into my personal blog at this point...) I found an old related thread: https://public-inbox.org/git/20170509225219.GB106700@google.com/

So this series fixes 1/2 of the issues noted there, but git-ls-tree will still die with the same error.

Previous: Junio C HamanoNext: Duy Nguyen
Message 14 of 15 in “Make :(attr) pathspec work with "git log"”
  1. 0/5 Make :(attr) pathspec work with "git log"Nguyễn Thái Ngọc Duy, Nov 18, 2018
  2. 1/5 tree.c: make read_tree*() take 'struct repository *'Nguyễn Thái Ngọc Duy, Nov 18, 2018
  3. 2/5 tree-walk.c: make tree_entry_interesting() take an indexNguyễn Thái Ngọc Duy, Nov 18, 2018
  4. 3/5 pathspec.h: clean up "extern" in function declarationsNguyễn Thái Ngọc Duy, Nov 18, 2018
  5. 4/5 dir.c: move, rename and export match_attrs()Nguyễn Thái Ngọc Duy, Nov 18, 2018
  6. 5/5 tree-walk: support :(attr) matchingNguyễn Thái Ngọc Duy, Nov 18, 2018
  7. Ævar Arnfjörð BjarmasonNov 18, 2018
  8. Duy NguyenNov 19, 2018
  9. Ævar Arnfjörð BjarmasonNov 18, 2018
  10. Ævar Arnfjörð BjarmasonNov 19, 2018
  11. Duy NguyenNov 19, 2018
  12. Jeff KingNov 19, 2018
  13. Junio C HamanoNov 19, 2018
  14. Ævar Arnfjörð BjarmasonNov 19, 2018
  15. Duy NguyenNov 19, 2018

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.