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

Re: [PATCH 2/2] add-patch: render hunks through the pager

From
Rubén Justo <rjusto@gmail.com>
Date
Jul 27, 2024, 14:33 UTC
Message-ID
<82560916-c539-4ae3-a378-391a1da7d80a@gmail.com>
In-Reply-To
<xmqq1q3ftxwe.fsf@gitster.g>
On Fri, Jul 26, 2024 at 06:40:49PM -0700, Junio C Hamano wrote:
Show 26 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > In any case, that is an appropriate thing to say in a commit that
> > fixes use of such a construct, but not a commit that uses the right
> > constuct from the get-go.
> >
> > I have to say that the [4/4] in the previous round, i.e., fc87b2f7
> > (add-patch: render hunks through the pager, 2024-07-25) in my tree,
> > is better than this version.
> 
> I do recall that you once had a version where the code violates the
> guidelines (and breaks dash) in one patch, and gets fixed in another
> patch in the same series.  The above material would be a perfect fit
> in the proposed log message of the latter step.  If we spent so much
> effort and digging to figure out exactly how it breaks with which
> shell, a separate patch to fix, primarily to document the fix, would
> have made sense.
> 
> But the latest squashes the two and avoids making the mistake in the
> first place, eliminating the need for a documented fix.  We generally
> prefer to do so to avoid breaking bisection (and the recommendation
> to keep the fix separate so that we can document it better was made
> as an exception), so squashing them into one is fine.  But if we
> commit to that approach to pretend that there was no silly mistake,
> we should be consistent in pretending that is the case.
> 

Fixing a problematic change with a new commit isn't the best idea if we have the opportunity to prevent the problem in the first place, as Phillip pointed out. Since rj/add-p-pager is still open, it's worthwhile to amend the problematic commit.

Of course, we've now updated the documentation [*1*] and reinforced [*2*] the mechanisms to prevent this from happening again.

However, I think adding a comment about the issue to the amended commit, which I think it has been suggested at some point, seems to me like a good addition. I do not believe that a future reading of the change will lead to confusion for this reason. The added comment does not document a fix, I think, but rather it is an explanation of what we're doing in the commit.

Furthermore, we capture in the history, IMHO, notes of how things have happened, which is also why I intend to apply this series on 506f457e489b2097e2d4fc5ceffd6e242502b2bd, to only amend the last two commits.

   1.- jc/doc-one-shot-export-with-shell-func
   2.- es/shell-check-updates
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 of 29 in “add-p P fixups”
  1. 0/2 add-p P fixupsRubén Justo, Jul 23, 2024
  2. 1/2 t3701: avoid one-shot export for shell functionsRubén Justo, Jul 23, 2024
  3. 2/2 pager: make wait_for_pager a no-op for "cat"Rubén Justo, Jul 23, 2024
  4. Junio C HamanoJul 23, 2024
  5. Phillip WoodJul 23, 2024
  6. Junio C HamanoJul 23, 2024
  7. Rubén JustoJul 23, 2024
  8. phillip.wood123@gmail.comJul 24, 2024
  9. Rubén JustoJul 24, 2024
  10. Phillip WoodJul 25, 2024
  11. Rubén JustoJul 25, 2024
  12. 0/4 squash fixups in rj/add-p-pagerRubén Justo, Jul 25, 2024
  13. 1/4 add-patch: test for 'p' commandRubén Justo, Jul 25, 2024
  14. 2/4 pager: do not close fd 2 unnecessarilyRubén Justo, Jul 25, 2024
  15. 3/4 pager: introduce wait_for_pagerRubén Justo, Jul 25, 2024
  16. 4/4 add-patch: render hunks through the pagerRubén Justo, Jul 25, 2024
  17. Junio C HamanoJul 25, 2024
  18. Re* [PATCH v2 0/2] add-p P fixupsRubén Justo, Jul 25, 2024
  19. 1/2 pager: introduce wait_for_pagerRubén Justo, Jul 25, 2024
  20. 2/2 add-patch: render hunks through the pagerRubén Justo, Jul 25, 2024
  21. Junio C HamanoJul 26, 2024
  22. Junio C HamanoJul 27, 2024
  23. Rubén JustoJul 27, 2024
  24. Junio C HamanoJul 26, 2024
  25. Rubén JustoJul 26, 2024
  26. Junio C HamanoJul 26, 2024
  27. Rubén JustoJul 26, 2024
  28. Rubén JustoJul 28, 2024
  29. Junio C HamanoJul 29, 2024

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.