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

Re: [PATCH v3] Isolate If-Modified-Since handling in gitweb

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2012, 19:22 UTC
Message-ID
<7vmx7921yz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120321173824.GA31490@odin.tremily.us>
"W. Trevor King" <wking@drexel.edu> writes:
Show 8 quoted lines
>> I think it would be better to add initial tests with refactoring, and
>> snapshot specific tests with snapshot support, e.g.:
>> 
>>   1/2: gitweb: Refactor If-Modified-Since handling and add tests
>>   2/2: gitweb: Add If-Modified-Since support for snapshots
>
> But the new tests would be for the new functionality (i.e. snapshot
> support), so they wouldn't belong in the general refactoring commit.
Then you are planning to split it in a wrong way.

As I said, I do not think it matters that much for a small patch like this, but if the plan is to make the part to create i-m-s helper function as a standalone "refactoring" patch, then what Jakub outlined is the right way to go about it.

In the first patch, you create i-m-s helper and update the existing code that can use the helper, without changing anything else. Do not touch snapshot code in this patch, if the current code does not support i-m-s in snapshot. And in the same patch, add tests for codepaths that use i-m-s to make sure your refactoring did not break them. In other words, if you remove the change to gitweb/ from the first patch and apply only the changes to the tests, the resulting new tests should pass with the current code that has i-m-s support inline without the i-m-s helper. And if you add back your change to gitweb/ for the refactoring, the test should still pass.

And then in the second patch, you update the snapshot code and whatever else that can use i-m-s helper to support i-m-s. You can add tests to protect the new feature from future breakages in this patch.

Previous: W. Trevor KingNext: W. Trevor King
Message 10 of 43 in “What's cooking in git.git (Mar 2012, #07; Mon, 19)”
  1. Junio C HamanoMar 20, 2012
  2. W. Trevor KingMar 20, 2012
  3. Junio C HamanoMar 20, 2012
  4. Incremental updates to What's cookingJunio C Hamano, Mar 20, 2012
  5. Isolate If-Modified-Since handling in gitwebW. Trevor King, Mar 21, 2012
  6. Jakub NarebskiMar 21, 2012
  7. W. Trevor KingMar 21, 2012
  8. Jakub NarebskiMar 21, 2012
  9. W. Trevor KingMar 21, 2012
  10. Junio C HamanoMar 21, 2012
  11. W. Trevor KingMar 21, 2012
  12. Jakub NarebskiMar 21, 2012
  13. Junio C HamanoMar 21, 2012
  14. W. Trevor KingMar 21, 2012
  15. Jakub NarebskiMar 22, 2012
  16. Junio C HamanoMar 21, 2012
  17. Jakub NarebskiMar 22, 2012
  18. Junio C HamanoMar 22, 2012
  19. W. Trevor KingMar 26, 2012
  20. 1/3 gitweb: add `status` headers to git_feed() responses.W. Trevor King, Mar 26, 2012
  21. 2/3 gitweb: refactor If-Modified-Since handlingW. Trevor King, Mar 26, 2012
  22. Junio C HamanoMar 26, 2012
  23. W. Trevor KingMar 26, 2012
  24. Junio C HamanoMar 26, 2012
  25. W. Trevor KingMar 26, 2012
  26. Jakub NarebskiMar 27, 2012
  27. W. Trevor KingMar 28, 2012
  28. Jakub NarebskiMar 28, 2012
  29. 0/3 gitweb: refactor If-Modified-Since handlingwking@tremily.us, Mar 28, 2012
  30. W. Trevor KingMar 28, 2012
  31. 1/3 gitweb: add `status` headers to git_feed() responses.wking@tremily.us, Mar 28, 2012
  32. 2/3 gitweb: refactor If-Modified-Since handlingwking@tremily.us, Mar 28, 2012
  33. 3/3 gitweb: add If-Modified-Since handling to git_snapshot().wking@tremily.us, Mar 28, 2012
  34. Jakub NarebskiMar 28, 2012
  35. W. Trevor KingMar 26, 2012
  36. Jakub NarebskiMar 27, 2012
  37. W. Trevor KingMar 28, 2012
  38. 3/3 gitweb: add If-Modified-Since handling to git_snapshot().W. Trevor King, Mar 26, 2012
  39. Jakub NarebskiMar 27, 2012
  40. W. Trevor KingMar 27, 2012
  41. Jakub NarebskiMar 27, 2012
  42. W. Trevor KingMar 27, 2012
  43. Junio C HamanoMar 27, 2012

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.