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

Re: [PATCH v1 3/3] convert: add filter.<driver>.useProtocol option

From
Lars Schneider <larsxschneider@gmail.com>
Date
Jul 24, 2016, 12:09 UTC
Message-ID
<D4012F2A-9774-408B-A355-B7442A4FBF26@gmail.com>
In-Reply-To
<32d8feda-0fff-6c8c-1ac3-9cc3d783d0ef@web.de>
On 23 Jul 2016, at 00:32, Torsten Bögershausen <tboegi@web.de> wrote:
Show 12 quoted lines
> On 07/22/2016 05:49 PM, larsxschneider@gmail.com wrote:
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> [...]
>> 
>> 1. Git starts the filter on first usage and expects a welcome message
>> with protocol version number:
>> 	Git <-- Filter: "git-filter-protocol\n"
>> 	Git <-- Filter: "version 1"
> Is there no terminator here ?
> How long should the reading side wait without a '\n', or should it read
> "version 1\n" ?
I agree, I will add the "\n" terminator!
Show 5 quoted lines
>> [...]
>> 
>> Please note that the protocol filters do not support stream processing
>> with this implemenatation because the filter needs to know the length of
>            ^^^^^^^^^^^^^^^^typo
Thanks!
Show 18 quoted lines
>> [...]
>> 
>> +
>> +test_expect_success EXPENSIVE 'protocol filter large file' '
>> +	test_config_global filter.protocol.clean \"$TEST_DIRECTORY/t0021/rot13.pl\" &&
>> +	test_config_global filter.protocol.smudge \"$TEST_DIRECTORY/t0021/rot13.pl\" &&
>> +	rm -rf repo &&
>> +	mkdir repo &&
>> +	(
>> +		cd repo &&
>> +		git init &&
>> +
>> +		echo "2GB filter=largefile" >.gitattributes &&
>> +		for i in $(test_seq 1 2048); do printf "%1048576d" 1; done >2GB &&
> Side question:
> Is there a way to "re-use" the 2GB test file through t0021?
> It takes a long time to produce it, especially on my 32 Bit systems ;-)
> But this may be a different patch.

I would like to keep the tests as unentangled as possible and therefore a direct reuse might not be ideal. However, I could add a new "EXPENSIVE setup test" that prepares the file for both tests.

Show 6 quoted lines
>> [...]
>> +
>> +		printf "" >output.log &&
> Is this the same as
> >output.log
> to produce an empty file ?
Yes, thank you :-)
Show 6 quoted lines
>> [...]
>> +++ b/t/t0021/rot13.pl
>> @@ -0,0 +1,80 @@
>> +#!/usr/bin/env perl
> Should this be
> "$PERL_PATH" ?

I think we can't use this variable directly in the script. I could create the script file for the test and set the shebang to this value. However, no other "Perl file test" does it and therefore I wonder if it is necessary: t/t0202/test.pl t/t9000/test.pl t/t9700/test.pl According to the documentation this is useful to avoid trouble on Windows. I will check this test on Windows.

I also just noticed that all other Perl tests use "#!/usr/bin/perl". Should I change mine to match those?

> And do we need to protect the TC with
> test_have_prereq PERL or similar ?

Probably not as the documentation states "Even without the PERL prerequisite, tests can assume there is a usable perl interpreter". However, all other Perl file tests do the same and therefore I think it is a good idea.

Show 8 quoted lines
>> [...]
>> +
>> +print STDOUT "git-filter-protocol\nversion 1";
> Again, I don't like the missing terminator here.
> What if we step up to protocol "version 10" ?
> Could it work to use one and only one line,
> with one terminator, like this ?
> print STDOUT "git-filter-protocol version 1\1";

The missing terminator was a mistake. As mentioned above, I will add it!

Thanks for the review, Lars

Previous: Torsten BögershausenNext: Ramsay Jones
Message 8 of 77 in “Git filter protocol”
  1. 0/3 Git filter protocollarsxschneider@gmail.com, Jul 22, 2016
  2. 1/3 convert: quote filter names in error messageslarsxschneider@gmail.com, Jul 22, 2016
  3. 2/3 convert: modernize testslarsxschneider@gmail.com, Jul 22, 2016
  4. Remi Galan AlfonsoJul 26, 2016
  5. Junio C HamanoJul 26, 2016
  6. 3/3 convert: add filter.<driver>.useProtocol optionlarsxschneider@gmail.com, Jul 22, 2016
  7. Torsten BögershausenJul 22, 2016
  8. Lars SchneiderJul 24, 2016
  9. Ramsay JonesJul 22, 2016
  10. Ramsay JonesJul 22, 2016
  11. Lars SchneiderJul 24, 2016
  12. Ramsay JonesJul 24, 2016
  13. Jakub NarębskiJul 24, 2016
  14. Lars SchneiderJul 25, 2016
  15. Jakub NarębskiJul 26, 2016
  16. Lars SchneiderJul 25, 2016
  17. Jakub NarębskiJul 23, 2016
  18. Eric WongJul 23, 2016
  19. Jeff KingJul 26, 2016
  20. Lars SchneiderJul 24, 2016
  21. Jakub NarębskiJul 24, 2016
  22. Jakub NarębskiJul 24, 2016
  23. Lars SchneiderJul 25, 2016
  24. Jakub NarębskiJul 26, 2016
  25. Lars SchneiderJul 25, 2016
  26. Jakub NarębskiJul 26, 2016
  27. Eric WongJul 23, 2016
  28. Lars SchneiderJul 24, 2016
  29. Eric WongJul 25, 2016
  30. Duy NguyenJul 25, 2016
  31. Junio C HamanoJul 22, 2016
  32. Lars SchneiderJul 24, 2016
  33. Jeff KingJul 26, 2016
  34. 0/5 Git filter protocollarsxschneider@gmail.com, Jul 27, 2016
  35. 2/5 convert: modernize testslarsxschneider@gmail.com, Jul 27, 2016
  36. 3/5 pkt-line: extract and use `set_packet_header` functionlarsxschneider@gmail.com, Jul 27, 2016
  37. Junio C HamanoJul 27, 2016
  38. Lars SchneiderJul 27, 2016
  39. Junio C HamanoJul 27, 2016
  40. 4/5 convert: generate large test files only oncelarsxschneider@gmail.com, Jul 27, 2016
  41. Torsten BögershausenJul 27, 2016
  42. Jeff KingJul 27, 2016
  43. Lars SchneiderJul 27, 2016
  44. 5/5 convert: add filter.<driver>.process optionlarsxschneider@gmail.com, Jul 27, 2016
  45. Jeff KingJul 27, 2016
  46. Lars SchneiderJul 27, 2016
  47. Jeff KingJul 27, 2016
  48. Lars SchneiderJul 28, 2016
  49. Jeff KingJul 28, 2016
  50. Eric WongJul 27, 2016
  51. Lars SchneiderJul 29, 2016
  52. Jakub NarębskiJul 29, 2016
  53. Lars SchneiderJul 29, 2016
  54. Eric WongAug 5, 2016
  55. Lars SchneiderAug 5, 2016
  56. Eric WongAug 5, 2016
  57. Jakub NarębskiJul 27, 2016
  58. Lars SchneiderJul 29, 2016
  59. Junio C HamanoJul 29, 2016
  60. Jakub NarębskiJul 29, 2016
  61. Lars SchneiderJul 29, 2016
  62. Jakub NarębskiJul 30, 2016
  63. Torsten BögershausenJul 28, 2016
  64. 1/5 convert: quote filter names in error messageslarsxschneider@gmail.com, Jul 27, 2016
  65. Jakub NarębskiJul 27, 2016
  66. Lars SchneiderJul 28, 2016
  67. Jakub NarębskiJul 27, 2016
  68. Lars SchneiderJul 28, 2016
  69. Jakub NarębskiJul 28, 2016
  70. Jeff KingJul 28, 2016
  71. Jakub NarębskiJul 29, 2016
  72. Lars SchneiderJul 29, 2016
  73. Jeff KingJul 29, 2016
  74. Lars SchneiderJul 29, 2016
  75. Jeff KingJul 29, 2016
  76. Lars SchneiderJul 29, 2016
  77. Jeff KingJul 29, 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.