On 05/29/2016 01:33 AM, Eric Wong wrote:
Matthieu Moy <matthieu....@grenoble-inp.fr> wrote:
Samuel GROOT <samuel.gr...@grenoble-inp.org> writes:

Parsing and processing in send-email is done in the same loop.

To make the code more maintainable, we create two subroutines:
- `parse_email` to separate header and body
- `parse_header` to retrieve data from header

These routines are not specific to git send-email, nor to Git.

Does it make sense to use an external library, like
http://search.cpan.org/~rjbs/Email-Simple-2.210/lib/Email/Simple.pm ,
either by depending on it, or by copying it in Git's source tree ?

That might be overkill and increase installation/maintenance
burden.  Bundling it would probably be problematic to distros,
too.

We have 5 solutions here:

  1. Make a new dependence to Email::Simple.

  2. Bundle Email::Simple in Git's source tree.

  3. Use Email::Simple if installed, else use our library.

  4. Making our own email parser library.

  5. Duplicate parser loop as we did for our patch to implement
     `--quote-email` as proposed in $gmane/295772 .

Obviously, option (5) is the easiest one for us, but it leaves refactoring for later, and option (1) is also easier but adds a new dependence which is not that good.

Since our project ends next week, we might not have enough time to finish developing a custom parser API so (4) is not a viable option for now but could be done in the future.

We could consider bundling Email::Simple as the best option, as it's developed since 2003 and might be safer to use than anything we could write in several weeks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to