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

Re: [PATCH 1/4] diff.c: emit_line_0 to take string instead of first sign

From
Stefan Beller <sbeller@google.com>
Date
Aug 13, 2018, 18:19 UTC
Message-ID
<CAGZ79kY8-GEWjK5TjkAzv1VoyLLXBD9t-B48UwPcWkogvD0MFA@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1808131340420.71@tvgsbejvaqbjf.bet>

On Mon, Aug 13, 2018 at 4:42 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 9 quoted lines
> > +/*
> > + * Emits
> > + * <set_sign> <first> <reset> <set> <second> <reset> LF
> > + * if they are present. 'first' is a NULL terminated string,
> > + * 'second' is a buffer of length 'len'.
> > + */
>
> That does not make it clear what the role of `first` or `second` is. Could
> you clarify that?

For now it is just "first string" and "second string", where the first is used for signs and indicators, and the second is allowed to have '\0' in it as we give the length as a parameter. This doc tried to be neutral w.r.t. the purpose of the first/second string.

> (TBH I am not so sure myself what roles they serve. Previously, it was
> kind of obvious to me that `first` tried to specify the diff marker, if
> any. But now...?)
Originally I thought we'd split the line into
  "++" "line"
for a range diff, but this is not the case.

As the next patch introduces configurable strings, we'd need this patch. I consider changing the next patch to allow only giving a single character instead, such that we can keep 'first', which indicates the sign character. (So maybe I'd even call it 'sign').

Previous: Johannes SchindelinNext: Stefan Beller
Message 4 of 27 in “Better colors in range-diff!”
  1. 0/4 Better colors in range-diff!Stefan Beller, Aug 10, 2018
  2. 1/4 diff.c: emit_line_0 to take string instead of first signStefan Beller, Aug 10, 2018
  3. Johannes SchindelinAug 13, 2018
  4. Stefan BellerAug 13, 2018
  5. 2/4 diff.c: add --output-indicator-{new, old, context}Stefan Beller, Aug 10, 2018
  6. Johannes SchindelinAug 13, 2018
  7. Stefan BellerAug 13, 2018
  8. 3/4 range-diff: make use of different output indicatorsStefan Beller, Aug 10, 2018
  9. Johannes SchindelinAug 13, 2018
  10. Stefan BellerAug 13, 2018
  11. 4/4 range-diff: indent special lines as contextStefan Beller, Aug 10, 2018
  12. Johannes SchindelinAug 13, 2018
  13. Stefan BellerAug 13, 2018
  14. Johannes SchindelinAug 14, 2018
  15. Stefan BellerAug 14, 2018
  16. Johannes SchindelinAug 16, 2018
  17. 0/3 Better colors in range-diffStefan Beller, Aug 17, 2018
  18. 1/3 diff.c: add --output-indicator-{new, old, context}Stefan Beller, Aug 17, 2018
  19. Johannes SchindelinAug 20, 2018
  20. Stefan BellerAug 20, 2018
  21. Johannes SchindelinAug 21, 2018
  22. diff.c: pass sign_index to emit_line_ws_markupStefan Beller, Aug 22, 2018
  23. Johannes SchindelinAug 23, 2018
  24. 2/3 range-diff: make use of different output indicatorsStefan Beller, Aug 17, 2018
  25. 3/3 range-diff: indent special lines as contextStefan Beller, Aug 17, 2018
  26. Junio C HamanoAug 17, 2018
  27. Stefan BellerAug 17, 2018

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.