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

Re: is this a bug of git-diff?

From
Antoine Pelisse <apelisse@gmail.com>
Date
May 15, 2013, 06:43 UTC
Message-ID
<CALWbr2z338CJgavC9sVGffHSoqr0Sb9nCsr4LKURDYpkOog2TQ@mail.gmail.com>
In-Reply-To
<CABwUO_X8oTzuJh8+v3Oqca2W4ht-cQRNGQ+a1DbEruq5jY+vgA@mail.gmail.com>
On Wed, May 15, 2013 at 8:23 AM, eric liou <accwuya@gmail.com> wrote:
> The output of git-diff is different from my expectation.
> It may skip some lines of context.

git-diff is using a default of 3 lines of context above and below the changes. In your example, there is only two lines of context below the change, so only two lines are displayed. Above the change, three lines are displayed, as expected. That's why the blank line and leading slash line are not displayed. You can change the number of context lines by invoking git-diff with -U<n>.

Hope that helps, Antoine

Previous: eric liouNext: Antoine Pelisse
Message 2 of 27 in “is this a bug of git-diff?”
  1. eric liouMay 15, 2013
  2. Antoine PelisseMay 15, 2013
  3. Antoine PelisseMay 15, 2013
  4. Matthieu MoyMay 15, 2013
  5. John KeepingMay 15, 2013
  6. Default for color.ui (was Re: is this a bug of git-diff?)Matthieu Moy, May 15, 2013
  7. Felipe ContrerasMay 15, 2013
  8. make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  9. Johan HerlandMay 15, 2013
  10. make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  11. Junio C HamanoMay 15, 2013
  12. Matthieu MoyMay 15, 2013
  13. 1/2 config: refactor management of color.ui's default valueMatthieu Moy, May 15, 2013
  14. 2/2 make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  15. Junio C HamanoMay 15, 2013
  16. Stefano LattariniMay 15, 2013
  17. make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  18. Junio C HamanoMay 15, 2013
  19. Matthieu MoyMay 15, 2013
  20. Junio C HamanoMay 15, 2013
  21. Matthieu MoyMay 15, 2013
  22. Junio C HamanoMay 15, 2013
  23. Matthieu MoyMay 15, 2013
  24. Junio C HamanoMay 15, 2013
  25. Felipe ContrerasMay 15, 2013
  26. John KeepingMay 15, 2013
  27. Mike HommeyMay 15, 2013

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.