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

Re: [PATCH] commit: Avoid redundant scissor line with --cleanup=scissors -v

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2024, 17:10 UTC
Message-ID
<xmqqedcxvnn8.fsf@gitster.g>
In-Reply-To
<Zd2eLxPelxvP8FDk@localhost>
Josh Triplett <josh@joshtriplett.org> writes:
Show 5 quoted lines
> I could add statefulness to wt_status_add_cut_line instead, on the
> assumption that it's the only thing that should be adding a cut line,
> and having it not add the line if previously added. For instance, it
> could accept a pointer to the full wt_status rather than just the fp,
> and keep a boolean state there.

Yeah, that approach also has to assume that wt_status structure is used only once to create a single message buffer without being reused, but I think that is a safe assumption, too. The function being the only thing that adds the scissors line should also be a safe assumption in code hygiene standpoint---if somebody else tries to manually write such a line, we'll shoot such a patch down and tell them to call this function anyway ;-).

> I did run the testsuite, and it passed. I can add a simple test easily
> enough.
It would be prudent to do so.
Thanks.
Previous: Junio C Hamano
Message 11 of 11 in “commit: Avoid redundant scissor line with --cleanup=scissors -v”
  1. commit: Avoid redundant scissor line with --cleanup=scissors -vJosh Triplett, Feb 26, 2024
  2. Junio C HamanoFeb 26, 2024
  3. Josh TriplettFeb 27, 2024
  4. 1/2 commit: Avoid redundant scissor line with --cleanup=scissors -vJosh Triplett, Feb 27, 2024
  5. 2/2 commit: Unify logic to avoid multiple scissors lines when mergingJosh Triplett, Feb 27, 2024
  6. Junio C HamanoFeb 27, 2024
  7. Josh TriplettFeb 29, 2024
  8. Junio C HamanoFeb 29, 2024
  9. Josh TriplettFeb 29, 2024
  10. Junio C HamanoFeb 29, 2024
  11. Junio C HamanoFeb 27, 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.