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

Re: [PATCH 1/1] diff-lib: use worktree mode in diffs from i-t-a entries

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Aug 8, 2020, 14:21 UTC
Message-ID
<CAN0heSpY5w5n71C24bNSfJr3tThbVQgHxKS4Wb4PvEECCYHu-A@mail.gmail.com>
In-Reply-To
<C4RJZM9BYO1C.21M5GRE871JIN@ziyou.local>
On Sat, 8 Aug 2020 at 13:24, Raymond E. Pasco <ray@ameretat.dev> wrote:
Show 15 quoted lines
>
> On Sat Aug 8, 2020 at 4:48 AM EDT, Martin Ågren wrote:
> > Describing the current state of affairs and using imperative mode, it
> > could be something like:
> >
> > When creating "new file" diffs against i-t-a index entries, diff-lib
> > erroneously uses the mode of the cache entry rather than the mode of
> > the file in the worktree. Change run_diff_files() to correctly use the
> > mode of the worktree file in this case.
>
> I see both styles around in the tree (past for the state of the world
> before this patch, present for the state of the world as of this patch,
> vs. present for the state of the world just before and just after
> applying this patch). Neither is unreadable to me so I just want to do
> whatever's the standard around here.

Yeah, there are all kinds of log messages in the history. SubmittingPatches (search for "imperative") recommends this way of writing.

Show 6 quoted lines
> (I'm not convinced, as a matter of grammar, that the
> commit-message-present verb form is really in the imperative mood; I
> think the freeform nature of English grammar obscures that it's the
> present active infinitive, analogous to, say, the fact that a French
> software program with an "open file" button will say "ouvrir" and not
> "ouvrez".)
When you put it that way, I'm also not sure. :-)
> The whole set of i-t-a diffing behaviors needs a test suite (unless I've
> grepped very poorly), which will come in another patchset. t4140 in this
> thread's main patchset assumes they work.

I did grep a little when I wrote my previous reply and I didn't find anything either.

I guess you could add a very small testcase here and then base that future series on top of this commit. Or in lieu of a test, maybe this could be used:

  Tested-by: Martin Ågren <martin.agren@gmail.com>
Martin
Previous: Raymond E. PascoNext: Junio C Hamano
Message 37 of 53 in “apply: Allow "new file" patches on i-t-a entries”
  1. apply: Allow "new file" patches on i-t-a entriesRaymond E. Pasco, Aug 4, 2020
  2. Junio C HamanoAug 4, 2020
  3. Raymond E. PascoAug 4, 2020
  4. apply: allow "new file" patches on i-t-a entriesRaymond E. Pasco, Aug 4, 2020
  5. apply: allow "new file" patches on i-t-a entriesRaymond E. Pasco, Aug 4, 2020
  6. Junio C HamanoAug 4, 2020
  7. Raymond E. PascoAug 5, 2020
  8. 0/3 apply: handle i-t-a entries in indexRaymond E. Pasco, Aug 6, 2020
  9. 1/3 apply: allow "new file" patches on i-t-a entriesRaymond E. Pasco, Aug 6, 2020
  10. 2/3 apply: make i-t-a entries never match worktreeRaymond E. Pasco, Aug 6, 2020
  11. Junio C HamanoAug 6, 2020
  12. Raymond E. PascoAug 6, 2020
  13. 3/3 t4140: test apply with i-t-a pathsRaymond E. Pasco, Aug 6, 2020
  14. Junio C HamanoAug 6, 2020
  15. Raymond E. PascoAug 7, 2020
  16. 0/3 apply: handle i-t-a entries in indexRaymond E. Pasco, Aug 8, 2020
  17. 1/3 apply: allow "new file" patches on i-t-a entriesRaymond E. Pasco, Aug 8, 2020
  18. Phillip WoodAug 8, 2020
  19. 2/3 apply: make i-t-a entries never match worktreeRaymond E. Pasco, Aug 8, 2020
  20. Phillip WoodAug 8, 2020
  21. Raymond E. PascoAug 8, 2020
  22. Phillip WoodAug 8, 2020
  23. Raymond E. PascoAug 8, 2020
  24. Phillip WoodAug 9, 2020
  25. Junio C HamanoAug 9, 2020
  26. git-apply.txt: correct description of --cachedRaymond E. Pasco, Aug 10, 2020
  27. Junio C HamanoAug 10, 2020
  28. Phillip WoodAug 12, 2020
  29. Junio C HamanoAug 12, 2020
  30. Raymond E. PascoAug 12, 2020
  31. Phillip WoodAug 12, 2020
  32. 3/3 t4140: test apply with i-t-a pathsRaymond E. Pasco, Aug 8, 2020
  33. Phillip WoodAug 23, 2020
  34. 1/1 diff-lib: use worktree mode in diffs from i-t-a entriesRaymond E. Pasco, Aug 8, 2020
  35. Martin ÅgrenAug 8, 2020
  36. Raymond E. PascoAug 8, 2020
  37. Martin ÅgrenAug 8, 2020
  38. Junio C HamanoAug 9, 2020
  39. t4069: test diff behavior with i-t-a pathsRaymond E. Pasco, Aug 10, 2020
  40. diff-lib: use worktree mode in diffs from i-t-a entriesRaymond E. Pasco, Aug 10, 2020
  41. diff-lib: use worktree mode in diffs from i-t-a entriesRaymond E. Pasco, Aug 10, 2020
  42. Junio C HamanoAug 10, 2020
  43. Eric SunshineAug 10, 2020
  44. Eric SunshineAug 10, 2020
  45. Junio C HamanoAug 10, 2020
  46. Eric SunshineAug 10, 2020
  47. Junio C HamanoAug 10, 2020
  48. Raymond E. PascoAug 10, 2020
  49. Eric SunshineAug 10, 2020
  50. Junio C HamanoAug 11, 2020
  51. 0/2 apply: reject modification diffs to i-t-a entriesRaymond E. Pasco, Aug 8, 2020
  52. 1/2 apply: reject modification diffs to i-t-a entriesRaymond E. Pasco, Aug 8, 2020
  53. 2/2 t4140: test failure of diff from empty blob to i-t-a pathRaymond E. Pasco, Aug 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.