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

Re: [PATCH 2/2] t3430: update to test with custom commentChar

From
Daniel Harding <dharding@living180.net>
Date
Jul 9, 2018, 18:22 UTC
Message-ID
<13a876a2-7fbc-de05-2e82-814c782e8a80@living180.net>
In-Reply-To
<nycvar.QRO.7.76.6.1807090944400.75@tvgsbejvaqbjf.bet>
Hi Johannes,
On Mon, 09 Jul 2018 at 10:52:13 +0300, Johannes Schindelin wrote:
Show 26 quoted lines
> Hi Brian,
> 
> On Sun, 8 Jul 2018, brian m. carlson wrote:
> 
>> On Sun, Jul 08, 2018 at 09:41:11PM +0300, Daniel Harding wrote:
>>> Signed-off-by: Daniel Harding <dharding@living180.net>
>>
>> I think maybe, as you suggested, a separate test for this would be
>> beneficial.  It might be as simple as modifying 'script-from-scratch' by
>> doing "sed 's/#/>/'".
> 
> It might be even simpler if you come up with a new "fake editor" to merely
> copy the todo list, then run a rebase without overridden
> commentChar, then one with overridden commentChar, then pipe the todo list
> of the first through that `sed` call:
> 
> 
>          write_script copy-todo-list.sh <<-\EOF &&
>          cp "$1" todo-list.copy
>          EOF
> 	test_config sequence.editor \""$PWD"/copy-todo-list.sh\" &&
> 	git rebase -r <base> &&
> 	sed "s/#/%/" <todo-list.copy >expect &&
> 	test_config core.commentChar % &&
> 	git rebase -r <base> &&
> 	test_cmp expect todo-list.copy

Indeed, as I thought about it more, using a "no-op" todo editor seemed like a good approach. Thanks for giving me a head start - I'll play with that and try to get a new patch with an improved test posted in the next couple of days.

One question about my original patch - there I had replaced a "grep -v" call with a "git stripspace" call in the 'generate correct todo list' test. Is relying on "git stripspace" in a test acceptable, or should external text manipulation tools like grep, sed etc. be preferred?

Thanks,
Daniel Harding
Previous: Junio C HamanoNext: Johannes Schindelin
Message 7 of 24 in “Fix --rebase-merges with custom commentChar”
  1. 0/2 Fix --rebase-merges with custom commentCharDaniel Harding, Jul 8, 2018
  2. 1/2 sequencer: fix --rebase-merges with custom commentCharDaniel Harding, Jul 8, 2018
  3. 2/2 t3430: update to test with custom commentCharDaniel Harding, Jul 8, 2018
  4. brian m. carlsonJul 8, 2018
  5. Johannes SchindelinJul 9, 2018
  6. Junio C HamanoJul 9, 2018
  7. Daniel HardingJul 9, 2018
  8. Johannes SchindelinJul 9, 2018
  9. Junio C HamanoJul 9, 2018
  10. Daniel HardingJul 9, 2018
  11. Johannes SchindelinJul 9, 2018
  12. Daniel HardingJul 10, 2018
  13. Johannes SchindelinJul 10, 2018
  14. Daniel HardingJul 10, 2018
  15. Johannes SchindelinOct 2, 2018
  16. brian m. carlsonJul 9, 2018
  17. Johannes SchindelinJul 9, 2018
  18. Daniel HardingJul 10, 2018
  19. Aaron SchrabJul 12, 2018
  20. Junio C HamanoJul 12, 2018
  21. sequencer: use configured comment characterAaron Schrab, Jul 16, 2018
  22. Johannes SchindelinJul 16, 2018
  23. Daniel HardingJul 16, 2018
  24. Johannes SchindelinJul 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.