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

Re: [PATCH v4] diff: do not show submodule with untracked files as "-dirty"

From
Sangeeta NB <sangunb09@gmail.com>
Date
Oct 23, 2020, 18:32 UTC
Message-ID
<CAHjREB5Uye1b=bVZsAc1WPcrWrqxnrMZxBtLT345CrpU7gTpVg@mail.gmail.com>
In-Reply-To
<xmqq7drhhr5o.fsf@gitster.c.googlers.com>
Show 23 quoted lines
>
> What happened to the first/introductory paragraph that was
> excellently written in the previous round?
>
> The usaul way to compose a log message is to
>
>  - Give an observation on how the current system work in the present
>    tense (so no need to say "Currently X is Y", just "X is Y"), and
>    discuss what you perceive as a problem in it.
>
>  - Propose a solution (optional---often, problem description
>    trivially leads to an obvious solution in reader's minds).
>
>  - Give commands to the codebase to "become like so".
>
> The first paragraph you had in the previous round was a good example
> of the "observation".  What we see above is only the "commands"
> part.  To those who have been intimately following the discussion,
> it often is understandable without both, but we are not writing for
> those who review the patches.  We are writing for future readers who
> are not aware of these exchanges we are having, so we should give
> something to prepare them by setting the stage and stating the
> objective.

Oh okay, it makes sense. I thought you told to replace that all with this. Would change it in the next patch.

Show 21 quoted lines
>
> > diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
> > index ca04fac417..98e46ad1ae 100755
> > --- a/t/t3701-add-interactive.sh
> > +++ b/t/t3701-add-interactive.sh
> > @@ -761,7 +761,7 @@ test_expect_success 'setup different kinds of dirty submodules' '
> >               echo dirty >>initial &&
> >               : >untracked
> >       ) &&
> > -     git -C for-submodules diff-files --name-only >actual &&
> > +     git -C for-submodules diff-files --name-only --ignore-submodules=none >actual &&
> >       cat >expected <<-\EOF &&
> >       dirty-both-ways
> >       dirty-head
>
> Hmph, it seems that you chose to give options that are no longer the
> default to command invocations, so that the expected output from the
> previous world order before this patch can be reused, but is that a
> sensible way to go?  If we are changing the default behaviour, shouldn't
> we rather be testing that new behaviour, I wonder?
>

I have tested the new behavior too. I have added tests for both the behavior, when ignore-submodules is none and when no argument is being passed.

Show 11 quoted lines
>
> By the way, in builtin/describe.c there is an invocation of
> "diff-index" without any --ignore-submodules=<what> option.
>
>         /* diff-index command arguments to check if working tree is dirty. */
>         static const char *diff_index_args[] = {
>                 "diff-index", "--quiet", "HEAD", "--", NULL
>         };
>
> Would the behaviour of diff-index invocation in "git describe --dirty"
> affected by the change of the default in any way?

I don't think so because describe was already behaving in the way that we won't. We changed the behavior of git diff to match it with that. So it doesn't make sense to add anything to that. Tell me if I am missing something.

Thanks for reviewing.
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 36 in “diff: do not show submodule with untracked files as "-dirty"”
  1. diff: do not show submodule with untracked files as "-dirty"Sangeeta via GitGitGadget, Oct 15, 2020
  2. Phillip WoodOct 20, 2020
  3. Sangeeta NBOct 20, 2020
  4. Phillip WoodOct 21, 2020
  5. [Outreachy] [PATCH v2] diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Oct 21, 2020
  6. Eric SunshineOct 21, 2020
  7. Sangeeta NBOct 21, 2020
  8. Eric SunshineOct 21, 2020
  9. [Outreachy] [PATCH v3] diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Oct 22, 2020
  10. Junio C HamanoOct 22, 2020
  11. Sangeeta NBOct 23, 2020
  12. Junio C HamanoOct 23, 2020
  13. Sangeeta NBOct 23, 2020
  14. Junio C HamanoOct 23, 2020
  15. Sangeeta NBOct 23, 2020
  16. diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Oct 23, 2020
  17. Junio C HamanoOct 23, 2020
  18. Sangeeta NBOct 23, 2020
  19. Junio C HamanoOct 23, 2020
  20. [Outreachy] [PATCH v4] diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Oct 23, 2020
  21. Junio C HamanoOct 23, 2020
  22. Sangeeta NBOct 25, 2020
  23. Junio C HamanoOct 26, 2020
  24. [Outreachy] [PATCH v5] diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Oct 23, 2020
  25. [Outreachy][PATCH v6] diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Oct 26, 2020
  26. SangeetaNov 3, 2020
  27. Junio C HamanoNov 3, 2020
  28. SangeetaNov 7, 2020
  29. Junio C HamanoDec 8, 2020
  30. Đoàn Trần Công DanhNov 7, 2020
  31. SangeetaNov 9, 2020
  32. Junio C HamanoNov 9, 2020
  33. [Outreachy][PATCH v7] diff: do not show submodule with untracked files as "-dirty"Sangeeta Jain, Nov 10, 2020
  34. Đoàn Trần Công DanhNov 10, 2020
  35. SangeetaDec 8, 2020
  36. Junio C HamanoDec 8, 2020

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.