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

Re: Question: Getting 'git diff' to generate /usr/bin/diff output

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 18, 2016, 07:23 UTC
Message-ID
<alpine.DEB.2.20.1607180922580.28832@virtualbox>
In-Reply-To
<201607171726.u6HHQShO005227@shell1.rawbw.com>
Hi Norm,
On Sun, 17 Jul 2016, norm@dad.org wrote:
Show 9 quoted lines
> <l.s.r@web.de> writes:
> >
> >The other replies covered how to use the system's own diff instead.
> >Just curious: What makes using git diff difficult and its output hard to
> >deal with for you?
> 
> In decreasing importance order:
> 
> I am 84 years old.
Wow. Chapeau! I am impressed.
Show 5 quoted lines
> I have been using /usr/bin/diff for more than four decades.  And having
> to learn how to read the output of 'git diff' makes learning how to use
> git a more difficult trick for this old dog to learn. True, the diff of
> today is very different from the diff of 1972, but the changes happened
> gradually.
Curious: do you use context diff (GNU diff's default) or unified diffs?
> I have scripts which process the output of /usr/bin/diff.

Even more curious: what do those scripts do? Maybe they do things that we either can already do with Git's diff, or that we can teach Git.

> 'git diff' outputs escape characters which clutter my terminal. Yes, I
> can sed them out, but then why are they there?

Those are most likely the ANSI sequences to add color. Can you call Git with the --no-color option and see whether the escape characters go away?

Ciao, Johannes

Previous: norm@dad.orgNext: Eric Wong
Message 7 of 12 in “Question: Getting 'git diff' to generate /usr/bin/diff output”
  1. norm@dad.orgJul 16, 2016
  2. Perry HutchisonJul 16, 2016
  3. Johannes SchindelinJul 17, 2016
  4. norm@dad.orgJul 19, 2016
  5. René ScharfeJul 17, 2016
  6. norm@dad.orgJul 17, 2016
  7. Johannes SchindelinJul 18, 2016
  8. pager: disable color when pager is "more"Eric Wong, Jul 18, 2016
  9. Jeff KingJul 18, 2016
  10. Junio C HamanoJul 18, 2016
  11. Jeff KingJul 18, 2016
  12. Eric WongJul 19, 2016

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.