List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper
       [not found] <cover.1487952449.git.smithj4@bnl.gov>
@ 2017-02-24 16:18 ` john
  2017-02-25  9:01   ` Jason
  2017-02-24 16:19 ` [PATCH 2/3] Remove angle brackets from {author,committer}_email john
  2017-02-24 16:19 ` [PATCH 3/3] Add support for git's mailmap smithj4
  2 siblings, 1 reply; 7+ messages in thread
From: john @ 2017-02-24 16:18 UTC (permalink / raw)



We provide email addresses to the email filter surrounded by angle
brackets, but we will soon remove these in our internal representation.
Introduce a wrapper so that we only have to add them in one place.

Signed-off-by: John Keeping <john at keeping.me.uk>
Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
---
  cgit.h      | 2 ++
  filter.c    | 5 +++++
  ui-commit.c | 4 ++--
  ui-log.c    | 2 +-
  ui-refs.c   | 6 +++---
  ui-tag.c    | 2 +-
  6 files changed, 14 insertions(+), 7 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-filter-introduce-cgit_open_email_filter-wrapper.patch
Type: text/x-patch
Size: 3803 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20170224/a3237e8e/attachment.bin>


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

* [PATCH 2/3] Remove angle brackets from {author,committer}_email
       [not found] <cover.1487952449.git.smithj4@bnl.gov>
  2017-02-24 16:18 ` [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper john
@ 2017-02-24 16:19 ` john
  2017-02-24 16:19 ` [PATCH 3/3] Add support for git's mailmap smithj4
  2 siblings, 0 replies; 7+ messages in thread
From: john @ 2017-02-24 16:19 UTC (permalink / raw)



This matches the internal representation in libgit.a, so it will make it
much easier to use Git's mailmap code.

The change in ui-atom.c isn't strictly necessary since the code copes
with email addresses both with and without angle brackets, but it's a
nice simplification since we know that the email address will always be
provided in the correct form.

Signed-off-by: John Keeping <john at keeping.me.uk>
Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
---
  filter.c    | 10 +++++++++-
  parsing.c   |  6 +-----
  ui-atom.c   | 13 +------------
  ui-commit.c |  6 ++++--
  ui-tag.c    |  3 ++-
  5 files changed, 17 insertions(+), 21 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Remove-angle-brackets-from-author-committer-_email.patch
Type: text/x-patch
Size: 3385 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20170224/9913690b/attachment.bin>


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

* [PATCH 3/3] Add support for git's mailmap.
       [not found] <cover.1487952449.git.smithj4@bnl.gov>
  2017-02-24 16:18 ` [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper john
  2017-02-24 16:19 ` [PATCH 2/3] Remove angle brackets from {author,committer}_email john
@ 2017-02-24 16:19 ` smithj4
  2 siblings, 0 replies; 7+ messages in thread
From: smithj4 @ 2017-02-24 16:19 UTC (permalink / raw)



If a mailmap file is present in the repo, it will be used to coalesce
commits by the same person, just like git does. When no mailmap file is
found then it functions as before.

Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
---
  cgit.h      |  3 +++
  parsing.c   | 21 +++++++++++++++++++++
  ui-atom.c   | 20 ++++++++++++++------
  ui-commit.c | 22 ++++++++++++++++------
  ui-log.c    | 11 +++++++++--
  ui-refs.c   | 32 ++++++++++++++++++++++++++------
  ui-stats.c  | 13 ++++++++++---
  ui-tag.c    | 14 ++++++++++----
  8 files changed, 109 insertions(+), 27 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-support-for-git-s-mailmap.patch
Type: text/x-patch
Size: 13085 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20170224/1c560ad6/attachment-0001.bin>


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

* [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper
  2017-02-24 16:18 ` [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper john
@ 2017-02-25  9:01   ` Jason
  0 siblings, 0 replies; 7+ messages in thread
From: Jason @ 2017-02-25  9:01 UTC (permalink / raw)


Can you resubmit this series as a normal git-send-email situation?
Very hard to review as attachments like this.

Thanks,
Jason


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

* [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper
  2017-02-25 16:12 [PATCH 0/3] " smithj4
@ 2017-02-25 16:12 ` smithj4
  0 siblings, 0 replies; 7+ messages in thread
From: smithj4 @ 2017-02-25 16:12 UTC (permalink / raw)


From: John Keeping <john at keeping.me.uk>

We provide email addresses to the email filter surrounded by angle
brackets, but we will soon remove these in our internal representation.
Introduce a wrapper so that we only have to add them in one place.

Signed-off-by: John Keeping <john at keeping.me.uk>
Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
---
 cgit.h      | 2 ++
 filter.c    | 5 +++++
 ui-commit.c | 4 ++--
 ui-log.c    | 2 +-
 ui-refs.c   | 6 +++---
 ui-tag.c    | 2 +-
 6 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/cgit.h b/cgit.h
index fbc6c6a..204e59e 100644
--- a/cgit.h
+++ b/cgit.h
@@ -382,6 +382,8 @@ extern struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filterty
 extern void cgit_cleanup_filters(void);
 extern void cgit_init_filters(void);
 
+extern void cgit_open_email_filter(const char *email, const char *origin);
+
 extern void cgit_prepare_repo_env(struct cgit_repo * repo);
 
 extern int readfile(const char *path, char **buf, size_t *size);
diff --git a/filter.c b/filter.c
index 949c931..88098ba 100644
--- a/filter.c
+++ b/filter.c
@@ -454,3 +454,8 @@ struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype)
 
 	die("Invalid filter type: %.*s", (int) len, cmd);
 }
+
+void cgit_open_email_filter(const char *email, const char *origin)
+{
+	cgit_open_filter(ctx.repo->email_filter, email, origin);
+}
diff --git a/ui-commit.c b/ui-commit.c
index db69d54..04f0411 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -47,7 +47,7 @@ void cgit_print_commit(char *hex, const char *prefix)
 	cgit_print_diff_ctrls();
 	html("<table summary='commit info' class='commit-info'>\n");
 	html("<tr><th>author</th><td>");
-	cgit_open_filter(ctx.repo->email_filter, info->author_email, "commit");
+	cgit_open_email_filter(info->author_email, "commit");
 	html_txt(info->author);
 	if (!ctx.cfg.noplainemail) {
 		html(" ");
@@ -59,7 +59,7 @@ void cgit_print_commit(char *hex, const char *prefix)
 				cgit_date_mode(DATE_ISO8601)));
 	html("</td></tr>\n");
 	html("<tr><th>committer</th><td>");
-	cgit_open_filter(ctx.repo->email_filter, info->committer_email, "commit");
+	cgit_open_email_filter(info->committer_email, "commit");
 	html_txt(info->committer);
 	if (!ctx.cfg.noplainemail) {
 		html(" ");
diff --git a/ui-log.c b/ui-log.c
index 3220fd9..b78f56f 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -238,7 +238,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 			 oid_to_hex(&commit->object.oid), ctx.qry.vpath);
 	show_commit_decorations(commit);
 	html("</td><td>");
-	cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
+	cgit_open_email_filter(info->author_email, "log");
 	html_txt(info->author);
 	cgit_close_filter(ctx.repo->email_filter);
 
diff --git a/ui-refs.c b/ui-refs.c
index 75f2789..0c4eef9 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -69,7 +69,7 @@ static int print_branch(struct refinfo *ref)
 	if (ref->object->type == OBJ_COMMIT) {
 		cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL);
 		html("</td><td>");
-		cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs");
+		cgit_open_email_filter(info->author_email, "refs");
 		html_txt(info->author);
 		cgit_close_filter(ctx.repo->email_filter);
 		html("</td><td colspan='2'>");
@@ -143,12 +143,12 @@ static int print_tag(struct refinfo *ref)
 	html("</td><td>");
 	if (info) {
 		if (info->tagger) {
-			cgit_open_filter(ctx.repo->email_filter, info->tagger_email, "refs");
+			cgit_open_email_filter(info->tagger_email, "refs");
 			html_txt(info->tagger);
 			cgit_close_filter(ctx.repo->email_filter);
 		}
 	} else if (ref->object->type == OBJ_COMMIT) {
-		cgit_open_filter(ctx.repo->email_filter, ref->commit->author_email, "refs");
+		cgit_open_email_filter(ref->commit->author_email, "refs");
 		html_txt(ref->commit->author);
 		cgit_close_filter(ctx.repo->email_filter);
 	}
diff --git a/ui-tag.c b/ui-tag.c
index afd7d61..d1e5db9 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -83,7 +83,7 @@ void cgit_print_tag(char *revname)
 		}
 		if (info->tagger) {
 			html("<tr><td>tagged by</td><td>");
-			cgit_open_filter(ctx.repo->email_filter, info->tagger_email, "tag");
+			cgit_open_email_filter(info->tagger_email, "tag");
 			html_txt(info->tagger);
 			if (info->tagger_email && !ctx.cfg.noplainemail) {
 				html(" ");
-- 
2.9.3



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

* [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper
@ 2016-08-29 18:28 john
  0 siblings, 0 replies; 7+ messages in thread
From: john @ 2016-08-29 18:28 UTC (permalink / raw)



We provide email addresses to the email filter surrounded by angle
brackets, but we will soon remove these in our internal representation.
Introduce a wrapper so that we only have to add them in one place.

Signed-off-by: John Keeping <john at keeping.me.uk>
Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
---
  cgit.h      | 2 ++
  filter.c    | 5 +++++
  ui-commit.c | 4 ++--
  ui-log.c    | 2 +-
  ui-refs.c   | 6 +++---
  ui-tag.c    | 2 +-
  6 files changed, 14 insertions(+), 7 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-filter-introduce-cgit_open_email_filter-wrapper.patch
Type: text/x-patch
Size: 3803 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160829/59747ea4/attachment.bin>


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

* [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper
@ 2016-08-26 20:12 john
  0 siblings, 0 replies; 7+ messages in thread
From: john @ 2016-08-26 20:12 UTC (permalink / raw)



We provide email addresses to the email filter surrounded by angle
brackets, but we will soon remove these in our internal representation.
Introduce a wrapper so that we only have to add them in one place.

Signed-off-by: John Keeping <john at keeping.me.uk>
Signed-off-by: Jason A. Smith <smithj4 at bnl.gov>
---
  cgit.h      | 2 ++
  filter.c    | 5 +++++
  ui-commit.c | 4 ++--
  ui-log.c    | 2 +-
  ui-refs.c   | 4 ++--
  5 files changed, 12 insertions(+), 5 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-filter-introduce-cgit_open_email_filter-wrapper.patch
Type: text/x-patch
Size: 3144 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160826/6e95cea0/attachment.bin>


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

end of thread, other threads:[~2017-02-25 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1487952449.git.smithj4@bnl.gov>
2017-02-24 16:18 ` [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper john
2017-02-25  9:01   ` Jason
2017-02-24 16:19 ` [PATCH 2/3] Remove angle brackets from {author,committer}_email john
2017-02-24 16:19 ` [PATCH 3/3] Add support for git's mailmap smithj4
2017-02-25 16:12 [PATCH 0/3] " smithj4
2017-02-25 16:12 ` [PATCH 1/3] filter: introduce cgit_open_email_filter() wrapper smithj4
  -- strict thread matches above, loose matches on Subject: below --
2016-08-29 18:28 john
2016-08-26 20:12 john

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 NNTP newsgroup(s).