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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 16, 2024, 17:35 UTC
Message-ID
<xmqq7cbbqz6a.fsf@gitster.g>
In-Reply-To
<cba63486-2186-4e8e-aad4-ed7f54606ec7@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 11 quoted lines
> Because we know what the unedited patch
> looked like and that the pre-image lines should be unchanged it is
> possible to provide much better error messages than we get from trying
> to apply the whole patch with "git apply". It also makes it possible
> to restore deleted pre-image lines.
> ...
> [1] https://github.com/phillipwood/git/tree/wip/add-p-editing-improvements
>     Note that the later patches do not even compile at the moment. I've
>     been meaning to split out the first eight patches and clean them up
>     as they're mostly functional and just need the commit messages
>     cleaning up.

I'd love this. With both patches before and after the edit session, we should be able to give more accurate line counts than having "git apply" look at only the post-edit shape of the hunk, which wouldn't see where any brokenness of the hunk comes from even if it wanted to. We should probably be able to stop relying on "--recount" once we do this right, which would be very nice outcome, too.

Thanks.
Previous: Phillip WoodNext: Rubén Justo
Message 3 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.