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

Re: [GSoC][PATCH 4/8] submodule: port submodule subcommand 'status' from shell to C

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2017, 22:32 UTC
Message-ID
<xmqqmv81ml4i.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kb48kNggPv64ubbBNK-Sk8AW4eXxhZt=PZZCPKr9OiuLQ@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 13 quoted lines
>> +       if (!lstat(list_item->name, &st) && !ce_match_stat(list_item, &st, 0)) {
>> +               print_status(info, ' ', list_item->name, sub_sha1, displaypath);
>
> The question from the last round still stands
> https://public-inbox.org/git/CAGZ79kb18z5zc9iu3Vv5aVZWJmoZzmwbMVpy89VC-t-ei2M+bw@mail.gmail.com/
>
>   I am not an expert in the diff area  and wonder how
>   the cmd_diff_files functionality is achieved with just a stat call
>   and then comparing it to  ce_match_stat. 'Using "dirty" ignores
>   all changes to the work tree of submodules, only changes to the
>   commits stored in the superproject are shown.' So I'd have
>   expected ce->oid to be compared (is there an index entry differing,
>   i.e. more than one stage?)

ce_match_stat() calls into ce_compare_gitlink() for a 160000 entry, which would resolve HEAD ref there and compares ce->oid with it.

But as you said, this is probably insufficient to emulate the original. Shouldn't it call into run_diff_files(), which is the in-core way to run the equivalent of "diff-files"?

Previous: Stefan BellerNext: Stefan Beller
Message 7 of 18 in “Update: Week 9”
  1. Prathamesh ChavanJul 18, 2017
  2. [GSoC][PATCH 1/8] submodule--helper: introduce get_submodule_displaypath()Prathamesh Chavan, Jul 18, 2017
  3. [GSoC][PATCH 2/8] submodule--helper: introduce for_each_submodule_list()Prathamesh Chavan, Jul 18, 2017
  4. [GSoC][PATCH 3/8] submodule: port set_name_rev() from shell to CPrathamesh Chavan, Jul 18, 2017
  5. [GSoC][PATCH 4/8] submodule: port submodule subcommand 'status' from shell to CPrathamesh Chavan, Jul 18, 2017
  6. Stefan BellerJul 18, 2017
  7. Junio C HamanoJul 18, 2017
  8. Stefan BellerJul 18, 2017
  9. Junio C HamanoJul 18, 2017
  10. [GSoC][PATCH 5/8] submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jul 18, 2017
  11. Stefan BellerJul 18, 2017
  12. Prathamesh ChavanJul 20, 2017
  13. Stefan BellerJul 20, 2017
  14. [GSoC][PATCH 6/8] submodule: port submodule subcommand 'deinit' from shell to CPrathamesh Chavan, Jul 18, 2017
  15. Christian CouderJul 19, 2017
  16. [GSoC][PATCH 7/8] diff: change scope of the function count_lines()Prathamesh Chavan, Jul 18, 2017
  17. [GSoC][PATCH 8/8] submodule: port submodule subcommand 'summary' from shell to CPrathamesh Chavan, Jul 18, 2017
  18. Christian CouderJul 19, 2017

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.