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

Re: [BUG] log --graph corrupts patch

From
PWPhillip Wood <phillip.wood@talktalk.net>
Date
Mar 20, 2018, 09:58 UTC
Message-ID
<1e686ea0-90ac-f3f4-7bcf-6951c9253598@talktalk.net>
In-Reply-To
<20180320060931.GE15813@sigill.intra.peff.net>
On 20/03/18 06:09, Jeff King wrote:
Show 29 quoted lines
> On Mon, Mar 19, 2018 at 10:21:56AM +0000, Phillip Wood wrote:
> 
>> I've just been reviewing some patches with 'git log --graph --patch' and
>> came across what looked like a bug:
>>
>> | @@ -272,6 +272,9 @@ do
>> |       --keep-empty)
>> |               keep_empty=yes
>> |               ;;
>> |       --allow-empty-message)
>> | +     --no-keep-empty)
>> | +             keep_empty=
>> | +             ;;
>> |               allow_empty_message=--allow-empty-message
>> |               ;;
>>
>> However when I looked at the file it was fine, "--allow-empty-message)"
>> was actually below the insertions. 'git log --patch' gives the correct
>> patch:
>> [...]
>> git fetch https://github.com/phillipwood/git.git log-graph-breaks-patch
> 
> That's really strange. I can't seem to replicate it here, though; it
> looks correct with our without --graph. Knowing how the graph code is
> implemented, it seems like an unlikely bug for us to output lines out of
> order (but of course anything's possible).
> 
> Are you using any exotic filters for your pager? If you use "git
> --no-pager" does the problem persist?

Hi Peff, thanks for taking the time to check this, I had forgotten about the pager. I'm using diff-highlight and it seems that is causing the problems.

Thanks again
Phillip
> -Peff
> 
Previous: Jeff KingNext: Jeff King
Message 3 of 15 in “[BUG] log --graph corrupts patch”
  1. Phillip WoodMar 19, 2018
  2. Jeff KingMar 20, 2018
  3. Phillip WoodMar 20, 2018
  4. Jeff KingMar 20, 2018
  5. Jeff KingMar 21, 2018
  6. 1/7 diff-highlight: correct test graph diagramJeff King, Mar 21, 2018
  7. 2/7 diff-highlight: use test_tick in graph testJeff King, Mar 21, 2018
  8. 3/7 diff-highlight: prefer "echo" to "cat" in testsJeff King, Mar 21, 2018
  9. 4/7 diff-highlight: test interleaved parallel lines of historyJeff King, Mar 21, 2018
  10. 5/7 diff-highlight: test graphs with --colorJeff King, Mar 21, 2018
  11. 6/7 diff-highlight: use flush() helper consistentlyJeff King, Mar 21, 2018
  12. 7/7 diff-highlight: detect --graph by indentJeff King, Mar 21, 2018
  13. Phillip WoodMar 22, 2018
  14. Jeff KingMar 22, 2018
  15. Junio C HamanoMar 21, 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.