All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH v3 0/8] teach branch-specific options for format-patch
Date: Tue, 21 May 2019 22:44:23 -0400	[thread overview]
Message-ID: <cover.1558492582.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1558052674.git.liu.denton@gmail.com>

Hi Junio,

I've gotten rid of all the `format.*.coverSubject` stuff and replaced it
with a generic `format.inferCoverSubject` that will read the subject
from the branch description. I've also made `git branch -d` stop
deleting the `format.<branch>.*` variables.

A new addition in this patchset is that format-patch is now taught to
understand the `format.<branch-name>.outputDirectory` configuration.

Changes since v2:

* Replaced `format.<branch-name>.coverSubject` and `--cover-subject`
  with `format.inferCoverSubject` and `--infer-cover-subject` which
  reads the subject from the branch description
* Do not let `git branch -d` delete `format.<branch-name>.*` configs
* More documentation cleanup
* Taught format-patch to read `format.<branch-name>.outputDirectory` as
  well

Changes since v1:

* Used format.<branch-name>.* variables instead of branch.<branch-name>.*


Denton Liu (8):
  t4014: clean up style
  Doc: add more detail for git-format-patch
  format-patch: infer cover letter from branch description
  format-patch: move extra_headers logic later
  string-list: create string_list_append_all
  format-patch: read branch-specific To: and Cc: headers
  format-patch: move output_directory logic later
  format-patch: read branch-specific output directory

 Documentation/config/format.txt    |  17 +-
 Documentation/git-format-patch.txt |  44 +-
 builtin/log.c                      | 237 ++++++---
 string-list.c                      |   9 +
 string-list.h                      |   7 +
 t/t4014-format-patch.sh            | 739 +++++++++++++++++------------
 6 files changed, 667 insertions(+), 386 deletions(-)

Range-diff against v2:
1:  92d7be10aa = 1:  82c0dc9cc8 t4014: clean up style
2:  930a021b7f ! 2:  a8cc599fd2 Doc: add more detail for git-format-patch
    @@ -9,7 +9,10 @@
     
         In addition, document the special value of `--base=auto`.
     
    -    Finally, while we're at it, surround option arguments with <>.
    +    Next, while we're at it, surround option arguments with <>.
    +
    +    Finally, document the `format.outputDirectory` config and change
    +    `format.coverletter` to use camelcase.
     
         Signed-off-by: Denton Liu <liu.denton@gmail.com>
     
    @@ -67,3 +70,25 @@
      
      --root::
      	Treat the revision argument as a <revision range>, even if it
    +@@
    + -------------
    + You can specify extra mail header lines to be added to each message,
    + defaults for the subject prefix and file suffix, number patches when
    +-outputting more than one patch, add "To" or "Cc:" headers, configure
    +-attachments, and sign off patches with configuration variables.
    ++outputting more than one patch, add "To:" or "Cc:" headers, configure
    ++attachments, change the patch output directory, and sign off patches
    ++with configuration variables.
    + 
    + ------------
    + [format]
    +@@
    + 	cc = <email>
    + 	attach [ = mime-boundary-string ]
    + 	signOff = true
    +-	coverletter = auto
    ++	outputDirectory = <directory>
    ++	coverLetter = auto
    + ------------
    + 
    + 
3:  075e2c0721 < -:  ---------- format-patch: make cover letter subject configurable
-:  ---------- > 3:  e3b8c96b1c format-patch: infer cover letter from branch description
4:  323179377e ! 4:  52ee126825 format-patch: move extra_headers logic later
    @@ -7,10 +7,10 @@
         logic later in the function so that this happens. (This patch is best
         viewed with `git diff --color-moved`.)
     
    -    Note that this logic only depends on the `git_config` and
    +    Note that this logic only depends on `git_config` and
         `repo_init_revisions` and is depended on by the patch creation logic
    -    which is directly below it so this move is effectively a no-op as
    -    no dependencies being reordered.
    +    which is directly below it so this move is effectively a no-op as no
    +    dependencies being reordered.
     
         Signed-off-by: Denton Liu <liu.denton@gmail.com>
     
5:  7a8fa4f5f6 = 5:  27c60c715c string-list: create string_list_append_all
6:  9d7338f067 ! 6:  f2a1546b2d format-patch: read branch-specific To: and Cc: headers
    @@ -59,29 +59,20 @@
      	far (from config or command line).
      
     @@
    - -------------
    - You can specify extra mail header lines to be added to each message,
    - defaults for the subject prefix and file suffix, number patches when
    --outputting more than one patch, add "To" or "Cc:" headers, configure
    -+outputting more than one patch, add "To:" or "Cc:" headers, configure
    - attachments, and sign off patches with configuration variables.
    - 
    - ------------
    -@@
    + 	inferCoverSubject = true
      ------------
      
    - In addition, for a specific branch, you can specify a custom cover
    --letter subject.
    ++In addition, for a specific branch, you can specify a custom cover
     +letter subject, and add additional "To:" or "Cc:" headers.
    - 
    - ------------
    - [format "branch-name"]
    - 	coverSubject = "subject for branch-name only"
    ++
    ++------------
    ++[format "branch-name"]
     +	to = <email>
     +	cc = <email>
    - ------------
    ++------------
      
      DISCUSSION
    + ----------
     
      diff --git a/builtin/log.c b/builtin/log.c
      --- a/builtin/log.c
    @@ -96,7 +87,7 @@
      static void add_header(const char *value)
      {
     @@
    - 	return 0;
    + 	fprintf(rev->diffopt.file, "\n");
      }
      
     +static void add_branch_headers(struct rev_info *rev, const char *branch_name)
    @@ -186,25 +177,6 @@
      		strbuf_addstr(&buf, extra_hdr.items[i].string);
      		strbuf_addch(&buf, '\n');
     
    - diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
    - --- a/t/t3200-branch.sh
    - +++ b/t/t3200-branch.sh
    -@@
    - 
    - test_expect_success 'test deleting branch deletes branch config' '
    - 	git config format.my7.coverSubject "cover subject" &&
    -+	git config format.my7.to "To Me <to@example.com>" &&
    -+	git config format.my7.cc "Cc Me <cc@example.com>" &&
    - 	git branch -d my7 &&
    - 	test -z "$(git config branch.my7.remote)" &&
    - 	test -z "$(git config branch.my7.merge)" &&
    - 	test -z "$(git config format.my7.coverSubject)"
    -+	test -z "$(git config format.my7.to)" &&
    -+	test -z "$(git config format.my7.cc)"
    - '
    - 
    - test_expect_success 'test deleting branch without config' '
    -
      diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
      --- a/t/t4014-format-patch.sh
      +++ b/t/t4014-format-patch.sh
-:  ---------- > 7:  70e28c5472 format-patch: move output_directory logic later
-:  ---------- > 8:  b23c3c16f7 format-patch: read branch-specific output directory
-- 
2.22.0.rc1.169.g49223abbf8


  parent reply	other threads:[~2019-05-22  2:44 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 16:24 [PATCH 0/7] teach branch-specific options for format-patch Denton Liu
2019-05-05 16:24 ` [PATCH 1/7] t4014: clean up style Denton Liu
2019-05-05 16:24 ` [PATCH 2/7] Doc: add more detail for git-format-patch Denton Liu
2019-05-05 16:24 ` [PATCH 3/7] branch.c: extract read_branch_config function Denton Liu
2019-05-05 16:24 ` [PATCH 4/7] format-patch: make cover letter subject configurable Denton Liu
2019-05-05 16:24 ` [PATCH 5/7] format-patch: move extra_headers logic later Denton Liu
2019-05-05 16:24 ` [PATCH 6/7] string-list: create string_list_append_all Denton Liu
2019-05-05 16:24 ` [PATCH 7/7] format-patch: read branch-specific To: and Cc: headers Denton Liu
2019-05-07  8:56 ` [PATCH 0/7] teach branch-specific options for format-patch Junio C Hamano
2019-05-07 14:19   ` Denton Liu
2019-05-07 15:05     ` Junio C Hamano
2019-05-07 15:21       ` Denton Liu
2019-05-07 15:46         ` Ævar Arnfjörð Bjarmason
2019-05-08  1:45           ` Junio C Hamano
2019-05-31  2:00             ` [RFC PATCH] config: learn the "onbranch:" includeIf condition Denton Liu
2019-05-31 12:58               ` Johannes Schindelin
2019-05-31 13:16                 ` Denton Liu
2019-05-31 17:23                   ` Johannes Schindelin
2019-05-31 18:44                     ` Denton Liu
2019-05-31 19:33               ` [PATCH v2] " Denton Liu
2019-05-31 20:14                 ` Johannes Schindelin
2019-06-05  8:02                   ` Johannes Schindelin
2019-06-05 10:08                 ` Duy Nguyen
2019-06-05 21:21                 ` [PATCH v3] " Denton Liu
2019-06-06 12:52                   ` Johannes Schindelin
2019-05-17  0:27 ` [PATCH v2 0/6] teach branch-specific options for format-patch Denton Liu
2019-05-17  0:27   ` [PATCH v2 1/6] t4014: clean up style Denton Liu
2019-05-17  0:27   ` [PATCH v2 2/6] Doc: add more detail for git-format-patch Denton Liu
2019-05-17  0:27   ` [PATCH v2 3/6] format-patch: make cover letter subject configurable Denton Liu
2019-05-17  0:27   ` [PATCH v2 4/6] format-patch: move extra_headers logic later Denton Liu
2019-05-17  0:27   ` [PATCH v2 5/6] string-list: create string_list_append_all Denton Liu
2019-05-17  0:27   ` [PATCH v2 6/6] format-patch: read branch-specific To: and Cc: headers Denton Liu
2019-05-17  4:12   ` [PATCH v2 0/6] teach branch-specific options for format-patch Junio C Hamano
2019-05-17  7:25     ` Denton Liu
2019-05-17 16:54       ` Denton Liu
2019-05-22  2:44   ` Denton Liu [this message]
2019-05-22  2:44     ` [PATCH v3 1/8] t4014: clean up style Denton Liu
2019-05-22  2:44     ` [PATCH v3 2/8] Doc: add more detail for git-format-patch Denton Liu
2019-05-22  2:44     ` [PATCH v3 3/8] format-patch: infer cover letter from branch description Denton Liu
2019-05-22  2:44     ` [PATCH v3 4/8] format-patch: move extra_headers logic later Denton Liu
2019-05-22  2:44     ` [PATCH v3 5/8] string-list: create string_list_append_all Denton Liu
2019-05-22  2:44     ` [PATCH v3 6/8] format-patch: read branch-specific To: and Cc: headers Denton Liu
2019-05-22  2:44     ` [PATCH v3 7/8] format-patch: move output_directory logic later Denton Liu
2019-05-22  2:44     ` [PATCH v3 8/8] format-patch: read branch-specific output directory Denton Liu
2019-05-31  0:30     ` [PATCH v3 0/8] teach branch-specific options for format-patch Denton Liu
2019-06-14 21:56     ` [RESEND PATCH " Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 1/8] t4014: clean up style Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 2/8] Doc: add more detail for git-format-patch Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 3/8] format-patch: infer cover letter from branch description Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 4/8] format-patch: move extra_headers logic later Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 5/8] string-list: create string_list_append_all Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 6/8] format-patch: read branch-specific To: and Cc: headers Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 7/8] format-patch: move output_directory logic later Denton Liu
2019-06-14 21:56       ` [RESEND PATCH v3 8/8] format-patch: read branch-specific output directory Denton Liu
2019-10-15  9:06     ` [PATCH v6 0/3] format-patch: learn --infer-cover-subject option (also t4014 cleanup) Denton Liu
2019-10-15  9:06       ` [PATCH v6 1/3] format-patch: replace erroneous and condition Denton Liu
2019-10-15  9:06       ` [PATCH v6 2/3] format-patch: use enum variables Denton Liu
2019-10-15  9:06       ` [PATCH v6 3/3] format-patch: teach --cover-from-description option Denton Liu
2019-10-16  1:28       ` [PATCH v6 0/3] format-patch: learn --infer-cover-subject option (also t4014 cleanup) Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1558492582.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.