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

Re: [PATCH] send-email: support NNTP

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 25, 2013, 17:35 UTC
Message-ID
<7vbo924ipd.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vppxi4kkv.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> l.stelmach@samsung.com (Łukasz Stelmach) writes:
>
>> OK, I see. Good point. Where would you recommend me to put these modules
>> and how to name them? I mean I don't want to make to much mess here (;
>
> I would not recommend you to do any of the above now.  As I said, the
> open-coded if/elsif cascade version you posted is fine as a starting
> point.  I'd prefer to see it made work correctly as advertised first
> with documentation updates and tests.
>
> A Perl guru might want to come and refactor the result once the code
> solidifies, but that should be left as a separate series.

An alternative structure of the patch, if you are feeling brave, could go like this:

 (1) With a thought process similar to what I illustrated in my
     message you responded with "OK, I see. Good point.", identify
     all the codepaths that will need to become methods that are
     specific to the transport (SMTP or NNTP).
 (2) Without adding any NNTP goodies, refactor the current code to
     use a single class for driving conversation with a SMTP server.
     You will implement all the methods you identified in the
     previous step and the result will become "[PATCH 1/2]
     send-email: refactor to use a transport-specific class".
 (3) Implement a new class to drive conversation with an NNTP
     server, that has the same set of methods as the SMTP one you
     wrote in the previous step.  The result will become "[PATCH
     2/2] send-email: introduce NNTP transport".  This would need
     updates to the documentation.

I do not necessarily suggest you to go this route, by the way. It is up to you and depends on how proficient you are (and how comfortable you feel) dealing with modular Perl programs.

Previous: Junio C HamanoNext: Eric Sunshine
Message 7 of 14 in “send-email: support NNTP”
  1. send-email: support NNTPŁukasz Stelmach, Apr 23, 2013
  2. Junio C HamanoApr 23, 2013
  3. Łukasz StelmachApr 24, 2013
  4. Junio C HamanoApr 24, 2013
  5. Łukasz StelmachApr 25, 2013
  6. Junio C HamanoApr 25, 2013
  7. Junio C HamanoApr 25, 2013
  8. Eric SunshineApr 24, 2013
  9. Łukasz StelmachApr 24, 2013
  10. Thomas RastApr 24, 2013
  11. Łukasz StelmachApr 24, 2013
  12. Thomas RastApr 24, 2013
  13. Junio C HamanoApr 24, 2013
  14. Łukasz StelmachApr 25, 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.