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

Re: [PATCH v2] add-patch: edit the hunk again

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 23, 2024, 16:02 UTC
Message-ID
<xmqqbk0e5pff.fsf@gitster.g>
In-Reply-To
<2ad1f7b1-714c-4d6e-89a6-fd65271222b9@gmail.com>
phillip.wood123@gmail.com writes:
Show 9 quoted lines
> Thanks for the re-roll. I'm still not convinced that changing this
> without keeping an easy way to get the current behavior is a good
> idea.
>
> This is not very obvious to the user, it would be much better to give
> them the choice when we prompt them about editing the hunk
> again. We've been giving the user the original hunk for the last six
> and a half years so I think it's a bit late to unilaterally change
> that now.

I almost never use the (e)dit in "add -p", but after trying it and deliberately screwing up the edit, I tend to agree with you. It is very easy to lose what the original change was, what you wanted it to say after the edit in the end state, and how the patch for the current state should look like, and being able to easily start over (and more importantly, knowing that I'd get the version that has none of my screw-ups) was the only thing that convinced me that I might in the future try to use the (e)dit mode again when I find an applicable situation.

Thanks for review.
Previous: phillip.wood123@gmail.comNext: Rubén Justo
Message 9 of 17 in “add-patch: edit the hunk again”
  1. add-patch: edit the hunk againRubén Justo, Sep 15, 2024
  2. Phillip WoodSep 16, 2024
  3. Junio C HamanoSep 16, 2024
  4. Rubén JustoSep 16, 2024
  5. phillip.wood123@gmail.comSep 18, 2024
  6. Rubén JustoSep 18, 2024
  7. add-patch: edit the hunk againRubén Justo, Sep 18, 2024
  8. phillip.wood123@gmail.comSep 23, 2024
  9. Junio C HamanoSep 23, 2024
  10. Rubén JustoSep 24, 2024
  11. Phillip WoodOct 1, 2024
  12. Rubén JustoOct 2, 2024
  13. add-patch: edit the hunk againRubén Justo, Sep 28, 2024
  14. Phillip WoodOct 1, 2024
  15. Junio C HamanoOct 1, 2024
  16. Rubén JustoOct 2, 2024
  17. Rubén JustoOct 2, 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.