From: Don Zickus <dzickus@redhat.com>
To: git@vger.kernel.org
Cc: Don Zickus <dzickus@redhat.com>
Subject: [PATCH 2/5] add the ability to select more email header fields to output
Date: Tue, 6 Mar 2007 16:57:40 -0500 [thread overview]
Message-ID: <11732182643385-git-send-email-dzickus@redhat.com> (raw)
In-Reply-To: <1173218263315-git-send-email-dzickus@redhat.com>
This is useful when scripts need more than just the basic email headers to
parse. By specifying the "-x=" option, one can search and output any header
field they want.
Signed-off-by: Don Zickus <dzickus@redhat.com>
---
builtin-mailinfo.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 7456d8a..0532003 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -848,11 +848,12 @@ int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
}
static const char mailinfo_usage[] =
- "git-mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
+ "git-mailinfo [-k] [-u | --encoding=<encoding>] [-x=<field>] msg patch <mail >info";
int cmd_mailinfo(int argc, const char **argv, const char *prefix)
{
const char *def_charset;
+ int top;
/* NEEDSWORK: might want to do the optional .git/ directory
* discovery
@@ -862,6 +863,8 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
def_charset = (git_commit_encoding ? git_commit_encoding : "utf-8");
metainfo_charset = def_charset;
+ for (top=0; header[top]; top++){ ; }
+
while (1 < argc && argv[1][0] == '-') {
if (!strcmp(argv[1], "-k"))
keep_subject = 1;
@@ -871,7 +874,10 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
metainfo_charset = NULL;
else if (!prefixcmp(argv[1], "--encoding="))
metainfo_charset = argv[1] + 11;
- else
+ else if (!prefixcmp(argv[1], "-x=")) {
+ header[top] = xmalloc(256*sizeof(char));
+ strncpy(header[top++], argv[1]+3, 256);
+ } else
usage(mailinfo_usage);
argc--; argv++;
}
--
1.5.0.2.212.gd52f-dirty
next prev parent reply other threads:[~2007-03-06 21:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 21:57 [PATCH 1/5] builtin-mailinfo.c infrastrcture changes Don Zickus
2007-03-06 21:57 ` Don Zickus [this message]
2007-03-06 21:57 ` [PATCH 3/5] restrict the patch filtering Don Zickus
2007-03-06 21:57 ` [PATCH 4/5] Add a couple more test cases to the suite Don Zickus
2007-03-06 21:57 ` [PATCH 5/5] fix a utf8 issue in t5100/patch005 Don Zickus
2007-03-06 22:19 ` [PATCH 3/5] restrict the patch filtering Linus Torvalds
2007-03-07 5:34 ` [PATCH 1/5] builtin-mailinfo.c infrastrcture changes Junio C Hamano
2007-03-07 17:17 ` Don Zickus
-- strict thread matches above, loose matches on Subject: below --
2007-03-12 19:52 [PATCH 0/5] git-mailinfo fixes/features Don Zickus
2007-03-12 19:52 ` [PATCH 2/5] add the ability to select more email header fields to output Don Zickus
2007-03-13 0:55 ` Junio C Hamano
2007-03-13 1:21 ` Don Zickus
2007-03-13 2:34 ` Junio C Hamano
2007-03-14 20:12 git-mailinfo fixes/features v3 Don Zickus
2007-03-14 20:12 ` [PATCH 2/5] add the ability to select more email header fields to output Don Zickus
2007-03-15 14:36 ` Don Zickus
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=11732182643385-git-send-email-dzickus@redhat.com \
--to=dzickus@redhat.com \
--cc=git@vger.kernel.org \
/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.