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

Re: [PATCH 1/4] diff-highlight: add `less -r` to cmd in README

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 3, 2015, 02:41 UTC
Message-ID
<xmqq7flzerda.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1446516334-27652-2-git-send-email-jonathan.lebon@gmail.com>
Jonathan Lebon <jonathan.lebon@gmail.com> writes:
> As it is, the suggested command for trying out diff-highlight will just
> dump the whole git log output to the terminal. Let's pipe it through
> `less` so users aren't surprised on the first try.
That justifies the "less" part but not your choice of "-r".

I am assuming that you are telling "less" not to show the ANSI "color" escape sequences using the caret notation with "-r", which is a very natural and sensible thing to do when using `highlight`.

But if that is the case, you don't want "-r" (raw control chars for everything). You would want to say "-R", I think.

Other than that, looks like a sensible thing to do to me.
Thanks.
Show 22 quoted lines
> Signed-off-by: Jonathan Lebon <jonathan.lebon@gmail.com>
> ---
>  contrib/diff-highlight/README | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/diff-highlight/README b/contrib/diff-highlight/README
> index 836b97a..bbbfdda 100644
> --- a/contrib/diff-highlight/README
> +++ b/contrib/diff-highlight/README
> @@ -44,9 +44,9 @@ Use
>  
>  You can try out the diff-highlight program with:
>  
> ----------------------------------------------
> -git log -p --color | /path/to/diff-highlight
> ----------------------------------------------
> +------------------------------------------------------
> +git log -p --color | /path/to/diff-highlight | less -r
> +------------------------------------------------------
>  
>  If you want to use it all the time, drop it in your $PATH and put the
>  following in your git configuration:
Previous: Jonathan LebonNext: Jonathan Lebon
Message 3 of 17 in “diff-highlight: make a few improvements”
  1. 0/4 diff-highlight: make a few improvementsJonathan Lebon, Nov 3, 2015
  2. 1/4 diff-highlight: add `less -r` to cmd in READMEJonathan Lebon, Nov 3, 2015
  3. Junio C HamanoNov 3, 2015
  4. Jonathan LebonNov 3, 2015
  5. Jeff KingNov 3, 2015
  6. Junio C HamanoNov 3, 2015
  7. Jeff KingNov 3, 2015
  8. 2/4 diff-highlight: factor out prefix/suffix functionsJonathan Lebon, Nov 3, 2015
  9. Jeff KingNov 3, 2015
  10. 3/4 diff-highlight: match up lines before highlightingJonathan Lebon, Nov 3, 2015
  11. Jeff KingNov 3, 2015
  12. Jeff KingNov 3, 2015
  13. Jonathan LebonNov 17, 2015
  14. Jeff KingNov 17, 2015
  15. 4/4 diff-highlight: add maxhunksize config optionJonathan Lebon, Nov 3, 2015
  16. Jeff KingNov 3, 2015
  17. Jeff KingNov 3, 2015

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.