git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/5] format-patch: Add --{to,cc}-cmd support
@ 2023-01-19 22:38 Zev Weiss
  2023-01-19 22:38 ` [PATCH 1/5] t4014: Add test checking cover-letter To header Zev Weiss
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Zev Weiss @ 2023-01-19 22:38 UTC (permalink / raw)
  To: git
  Cc: Zev Weiss, Junio C Hamano, Eric Sunshine, brian m. carlson,
	Ævar Arnfjörð Bjarmason, Patrick Hemmer,
	René Scharfe, Denton Liu, Emma Brooks, Hamza Mahfooz

Hello,

On more than one occasion I've found myself wishing that git's
format-patch command supported the --to-cmd/--cc-cmd flags that
send-email does; this patch series is my attempt at implementing it.

This is my first foray into the git codebase, so odds are good I've
bungled something or missed the existence of some useful API, but it
passes the existing test suite (and the tests added for the new
feature), and I'm giving it its inaugural dogfooding on this very
series with `contrib/contacts/git-contacts`.

The first patch adds a test I found myself wanting when I realized I
had accidentally broken something that wasn't covered by the existing
tests.  The next two do a bit of refactoring and rearrangement, the
fourth adds a bit of library infrastructure to pretty.c, and the final
patch implements the feature itself.

There are a few points where I wasn't sure if the approach I chose was
really the best:

 - The 'name_and_address_only' pretty_print_context flag added in the
   fourth patch is kind of clunky, but I didn't see any other obvious
   great way to reuse the bits of pp_user_info() that I wanted.

 - Fork/exec-ing another internal format-patch command to generate the
   temporary patch file to run the commands on -- my attempts to
   recurse back into show_log() to do it more directly didn't go well.

 - As currently written any commands specified are only run on the
   patches themselves, not on the cover letter.  The slight
   inconsistency with git-send-email is a bit unfortunate, but I
   figure it's probably not often all that useful in that context
   anyway (and the implementation looked like it would be just
   non-trivial enough that laziness may have played a role as well).

Suggestions on better alternatives there (or elsewhere) are of course
welcome.


Thanks,
Zev Weiss

Zev Weiss (5):
  t4014: Add test checking cover-letter To header
  log: Refactor duplicated code to headerize recipient lists
  log: Push to/cc handling down into show_log()
  pretty: Add name_and_address_only parameter
  format-patch: Add support for --{to,cc}-cmd flags

 builtin/log.c           |  31 +++---
 log-tree.c              | 208 +++++++++++++++++++++++++++++++++++++++-
 log-tree.h              |   1 +
 pretty.c                |  15 ++-
 pretty.h                |   1 +
 revision.h              |   4 +
 t/t4014-format-patch.sh |  26 +++++
 7 files changed, 262 insertions(+), 24 deletions(-)

-- 
2.39.1.236.ga8a28b9eace8


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-02-01 23:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 22:38 [PATCH 0/5] format-patch: Add --{to,cc}-cmd support Zev Weiss
2023-01-19 22:38 ` [PATCH 1/5] t4014: Add test checking cover-letter To header Zev Weiss
2023-02-01 23:52   ` Calvin Wan
2023-01-19 22:38 ` [PATCH 2/5] log: Refactor duplicated code to headerize recipient lists Zev Weiss
2023-01-25  2:11   ` Junio C Hamano
2023-01-19 22:38 ` [PATCH 3/5] log: Push to/cc handling down into show_log() Zev Weiss
2023-01-20  0:33   ` Junio C Hamano
2023-02-01 23:52   ` Calvin Wan
2023-01-19 22:38 ` [PATCH 4/5] pretty: Add name_and_address_only parameter Zev Weiss
2023-01-25  2:23   ` Junio C Hamano
2023-02-01 23:52   ` Calvin Wan
2023-01-19 22:38 ` [PATCH 5/5] format-patch: Add support for --{to,cc}-cmd flags Zev Weiss
2023-02-01 23:52   ` Calvin Wan
2023-02-01 23:52 ` [PATCH 0/5] format-patch: Add --{to,cc}-cmd support Calvin Wan

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).