List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 0/4] Add "stat only" diff mode
@ 2014-10-05  9:59 john
  2014-10-05  9:59 ` [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link() john
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: john @ 2014-10-05  9:59 UTC (permalink / raw)


This series extends the diff type combobox to include a new "stat only"
mode, which outputs only the stat section of the diff.

The first two patches are preparatory cleanups to remove some references
to the existing "ssdiff" flag, then we change that flag to an enum in
patch 3 and add the "stat only" value in the final patch.

John Keeping (4):
  ui-shared: remove toggle_ssdiff arg to cgit_commit_link()
  ui-shared: remove toggle_ssdiff arg to cgit_diff_link()
  Change "ss" diff flag to an enum
  ui-diff: add "stat only" diff type

 cgit.c      | 12 ++++++++----
 cgit.h      | 10 +++++++---
 ui-commit.c |  6 +++---
 ui-diff.c   | 16 +++++++++++-----
 ui-log.c    |  4 ++--
 ui-refs.c   |  2 +-
 ui-shared.c | 23 +++++++++++------------
 ui-shared.h |  5 ++---
 8 files changed, 45 insertions(+), 33 deletions(-)

-- 
2.1.0.374.g390713e



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

* [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link()
  2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
@ 2014-10-05  9:59 ` john
  2014-12-24  1:48   ` Jason
  2014-10-05  9:59 ` [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link() john
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: john @ 2014-10-05  9:59 UTC (permalink / raw)


This argument is never used with a value other than zero, so remove it
and simplify the code.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 ui-commit.c |  4 ++--
 ui-log.c    |  4 ++--
 ui-refs.c   |  2 +-
 ui-shared.c | 11 +++++------
 ui-shared.h |  3 +--
 5 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/ui-commit.c b/ui-commit.c
index c48bfe8..ec99264 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -67,7 +67,7 @@ void cgit_print_commit(char *hex, const char *prefix)
 	html("</td></tr>\n");
 	html("<tr><th>commit</th><td colspan='2' class='sha1'>");
 	tmp = sha1_to_hex(commit->object.sha1);
-	cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0);
+	cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix);
 	html(" (");
 	cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix);
 	html(")</td></tr>\n");
@@ -96,7 +96,7 @@ void cgit_print_commit(char *hex, const char *prefix)
 			parent_info = cgit_parse_commit(parent);
 			tmp2 = parent_info->subject;
 		}
-		cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0);
+		cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix);
 		html(" (");
 		cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
 			       sha1_to_hex(p->item->object.sha1), prefix, 0);
diff --git a/ui-log.c b/ui-log.c
index bcdb666..ad2f5fc 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -90,7 +90,7 @@ void show_commit_decorations(struct commit *commit)
 			strncpy(buf, deco->name, sizeof(buf) - 1);
 			cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
 					 sha1_to_hex(commit->object.sha1),
-					 ctx.qry.vpath, 0);
+					 ctx.qry.vpath);
 		}
 next:
 		deco = deco->next;
@@ -165,7 +165,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 		}
 	}
 	cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
-			 sha1_to_hex(commit->object.sha1), ctx.qry.vpath, 0);
+			 sha1_to_hex(commit->object.sha1), ctx.qry.vpath);
 	show_commit_decorations(commit);
 	html("</td><td>");
 	cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
diff --git a/ui-refs.c b/ui-refs.c
index 7e58737..d2ba48d 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -67,7 +67,7 @@ static int print_branch(struct refinfo *ref)
 	html("</td><td>");
 
 	if (ref->object->type == OBJ_COMMIT) {
-		cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL, 0);
+		cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL);
 		html("</td><td>");
 		cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs");
 		html_txt(info->author);
diff --git a/ui-shared.c b/ui-shared.c
index 9dde0a3..497dfd0 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -328,8 +328,7 @@ void cgit_log_link(const char *name, const char *title, const char *class,
 }
 
 void cgit_commit_link(char *name, const char *title, const char *class,
-		      const char *head, const char *rev, const char *path,
-		      int toggle_ssdiff)
+		      const char *head, const char *rev, const char *path)
 {
 	if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
 		name[ctx.cfg.max_msg_len] = '\0';
@@ -347,7 +346,7 @@ void cgit_commit_link(char *name, const char *title, const char *class,
 		html_url_arg(rev);
 		delim = "&amp;";
 	}
-	if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
+	if (ctx.qry.ssdiff) {
 		html(delim);
 		html("ss=1");
 		delim = "&amp;";
@@ -463,7 +462,7 @@ static void cgit_self_link(char *name, const char *title, const char *class)
 	else if (!strcmp(ctx.qry.page, "commit"))
 		cgit_commit_link(name, title, class, ctx.qry.head,
 				 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
-				 ctx.qry.path, 0);
+				 ctx.qry.path);
 	else if (!strcmp(ctx.qry.page, "patch"))
 		cgit_patch_link(name, title, class, ctx.qry.head,
 				ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
@@ -503,7 +502,7 @@ void cgit_object_link(struct object *obj)
 	shortrev[10] = '\0';
 	if (obj->type == OBJ_COMMIT) {
 		cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
-				 ctx.qry.head, fullrev, NULL, 0);
+				 ctx.qry.head, fullrev, NULL);
 		return;
 	} else if (obj->type == OBJ_TREE)
 		page = "tree";
@@ -875,7 +874,7 @@ void cgit_print_pageheader(void)
 		cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head,
 			       ctx.qry.sha1, ctx.qry.vpath);
 		cgit_commit_link("commit", NULL, hc("commit"),
-				 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath, 0);
+				 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
 		cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
 			       ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0);
 		if (ctx.repo->max_stats)
diff --git a/ui-shared.h b/ui-shared.h
index 3e7a91b..bb193ec 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -30,8 +30,7 @@ extern void cgit_log_link(const char *name, const char *title,
 			  const char *pattern, int showmsg);
 extern void cgit_commit_link(char *name, const char *title,
 			     const char *class, const char *head,
-			     const char *rev, const char *path,
-			     int toggle_ssdiff);
+			     const char *rev, const char *path);
 extern void cgit_patch_link(const char *name, const char *title,
 			    const char *class, const char *head,
 			    const char *rev, const char *path);
-- 
2.1.0.374.g390713e



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

* [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link()
  2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
  2014-10-05  9:59 ` [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link() john
@ 2014-10-05  9:59 ` john
  2014-12-24  1:49   ` Jason
  2014-10-05  9:59 ` [PATCH 3/4] Change "ss" diff flag to an enum john
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: john @ 2014-10-05  9:59 UTC (permalink / raw)


This argument is never used with a value other than zero, so remove it
and simplify the code.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 ui-commit.c | 2 +-
 ui-diff.c   | 4 ++--
 ui-shared.c | 8 ++++----
 ui-shared.h | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ui-commit.c b/ui-commit.c
index ec99264..d5a888d 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -99,7 +99,7 @@ void cgit_print_commit(char *hex, const char *prefix)
 		cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix);
 		html(" (");
 		cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
-			       sha1_to_hex(p->item->object.sha1), prefix, 0);
+			       sha1_to_hex(p->item->object.sha1), prefix);
 		html(")</td></tr>");
 		parents++;
 	}
diff --git a/ui-diff.c b/ui-diff.c
index 71273aa..49bd748 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -97,7 +97,7 @@ static void print_fileinfo(struct fileinfo *info)
 	}
 	htmlf("</td><td class='%s'>", class);
 	cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
-		       ctx.qry.sha2, info->new_path, 0);
+		       ctx.qry.sha2, info->new_path);
 	if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) {
 		htmlf(" (%s from ",
 		      info->status == DIFF_STATUS_COPIED ? "copied" : "renamed");
@@ -175,7 +175,7 @@ static void cgit_print_diffstat(const unsigned char *old_sha1,
 
 	html("<div class='diffstat-header'>");
 	cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.sha1,
-		       ctx.qry.sha2, NULL, 0);
+		       ctx.qry.sha2, NULL);
 	if (prefix) {
 		html(" (limited to '");
 		html_txt(prefix);
diff --git a/ui-shared.c b/ui-shared.c
index 497dfd0..68e0d7c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -385,7 +385,7 @@ void cgit_snapshot_link(const char *name, const char *title, const char *class,
 
 void cgit_diff_link(const char *name, const char *title, const char *class,
 		    const char *head, const char *new_rev, const char *old_rev,
-		    const char *path, int toggle_ssdiff)
+		    const char *path)
 {
 	char *delim;
 
@@ -402,7 +402,7 @@ void cgit_diff_link(const char *name, const char *title, const char *class,
 		html_url_arg(old_rev);
 		delim = "&amp;";
 	}
-	if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
+	if (ctx.qry.ssdiff) {
 		html(delim);
 		html("ss=1");
 		delim = "&amp;";
@@ -478,7 +478,7 @@ static void cgit_self_link(char *name, const char *title, const char *class)
 	else if (!strcmp(ctx.qry.page, "diff"))
 		cgit_diff_link(name, title, class, ctx.qry.head,
 			       ctx.qry.sha1, ctx.qry.sha2,
-			       ctx.qry.path, 0);
+			       ctx.qry.path);
 	else if (!strcmp(ctx.qry.page, "stats"))
 		cgit_stats_link(name, title, class, ctx.qry.head,
 				ctx.qry.path);
@@ -876,7 +876,7 @@ void cgit_print_pageheader(void)
 		cgit_commit_link("commit", NULL, hc("commit"),
 				 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
 		cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
-			       ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0);
+			       ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath);
 		if (ctx.repo->max_stats)
 			cgit_stats_link("stats", NULL, hc("stats"),
 					ctx.qry.head, ctx.qry.vpath);
diff --git a/ui-shared.h b/ui-shared.h
index bb193ec..fc9be3b 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -43,7 +43,7 @@ extern void cgit_snapshot_link(const char *name, const char *title,
 extern void cgit_diff_link(const char *name, const char *title,
 			   const char *class, const char *head,
 			   const char *new_rev, const char *old_rev,
-			   const char *path, int toggle_ssdiff);
+			   const char *path);
 extern void cgit_stats_link(const char *name, const char *title,
 			    const char *class, const char *head,
 			    const char *path);
-- 
2.1.0.374.g390713e



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

* [PATCH 3/4] Change "ss" diff flag to an enum
  2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
  2014-10-05  9:59 ` [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link() john
  2014-10-05  9:59 ` [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link() john
@ 2014-10-05  9:59 ` john
  2014-12-24  1:49   ` Jason
  2014-10-05  9:59 ` [PATCH 4/4] ui-diff: add "stat only" diff type john
  2014-10-06  3:01 ` [PATCH 0/4] Add "stat only" diff mode Jason
  4 siblings, 1 reply; 12+ messages in thread
From: john @ 2014-10-05  9:59 UTC (permalink / raw)


This will allow us to introduce a new "stat only" diff mode without
needing an explosion of mutually incompatible flags.

The old "ss" query parameter is still accepted in order to avoid
breaking saved links, but we no longer generate any URIs using it;
instead the new "dt" (diff type) parameter is used.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 cgit.c      | 12 ++++++++----
 cgit.h      | 10 +++++++---
 ui-diff.c   |  8 +++++---
 ui-shared.c |  8 ++++----
 4 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/cgit.c b/cgit.c
index 8c4517d..db60107 100644
--- a/cgit.c
+++ b/cgit.c
@@ -237,7 +237,7 @@ static void config_cb(const char *name, const char *value)
 	else if (!strcmp(name, "summary-tags"))
 		ctx.cfg.summary_tags = atoi(value);
 	else if (!strcmp(name, "side-by-side-diffs"))
-		ctx.cfg.ssdiff = atoi(value);
+		ctx.cfg.difftype = atoi(value) ? DIFF_SSDIFF : DIFF_UNIFIED;
 	else if (!strcmp(name, "agefile"))
 		ctx.cfg.agefile = xstrdup(value);
 	else if (!strcmp(name, "mimetype-file"))
@@ -312,9 +312,13 @@ static void querystring_cb(const char *name, const char *value)
 		ctx.qry.showmsg = atoi(value);
 	} else if (!strcmp(name, "period")) {
 		ctx.qry.period = xstrdup(value);
+	} else if (!strcmp(name, "dt")) {
+		ctx.qry.difftype = atoi(value);
+		ctx.qry.has_difftype = 1;
 	} else if (!strcmp(name, "ss")) {
-		ctx.qry.ssdiff = atoi(value);
-		ctx.qry.has_ssdiff = 1;
+		/* No longer generated, but there may be links out there. */
+		ctx.qry.difftype = atoi(value) ? DIFF_SSDIFF : DIFF_UNIFIED;
+		ctx.qry.has_difftype = 1;
 	} else if (!strcmp(name, "all")) {
 		ctx.qry.show_all = atoi(value);
 	} else if (!strcmp(name, "context")) {
@@ -372,7 +376,7 @@ static void prepare_context(void)
 	ctx.cfg.summary_log = 10;
 	ctx.cfg.summary_tags = 10;
 	ctx.cfg.max_atom_items = 10;
-	ctx.cfg.ssdiff = 0;
+	ctx.cfg.difftype = DIFF_UNIFIED;
 	ctx.env.cgit_config = getenv("CGIT_CONFIG");
 	ctx.env.http_host = getenv("HTTP_HOST");
 	ctx.env.https = getenv("HTTPS");
diff --git a/cgit.h b/cgit.h
index 0badc64..0eb5ed5 100644
--- a/cgit.h
+++ b/cgit.h
@@ -53,6 +53,10 @@ typedef void (*filepair_fn)(struct diff_filepair *pair);
 typedef void (*linediff_fn)(char *line, int len);
 
 typedef enum {
+	DIFF_UNIFIED, DIFF_SSDIFF
+} diff_type;
+
+typedef enum {
 	ABOUT, COMMIT, SOURCE, EMAIL, AUTH
 } filter_type;
 
@@ -150,7 +154,7 @@ struct reflist {
 struct cgit_query {
 	int has_symref;
 	int has_sha1;
-	int has_ssdiff;
+	int has_difftype;
 	char *raw;
 	char *repo;
 	char *page;
@@ -168,7 +172,7 @@ struct cgit_query {
 	int nohead;
 	char *sort;
 	int showmsg;
-	int ssdiff;
+	diff_type difftype;
 	int show_all;
 	int context;
 	int ignorews;
@@ -245,7 +249,7 @@ struct cgit_config {
 	int summary_branches;
 	int summary_log;
 	int summary_tags;
-	int ssdiff;
+	diff_type difftype;
 	int branch_sort;
 	int commit_sort;
 	struct string_list mimetypes;
diff --git a/ui-diff.c b/ui-diff.c
index 49bd748..a4ade4d 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -345,8 +345,8 @@ void cgit_print_diff_ctrls()
 	html("</tr><tr>");
 	html("<td class='label'>mode:</td>");
 	html("<td class='ctrl'>");
-	html("<select name='ss' onchange='this.form.submit();'>");
-	curr = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff;
+	html("<select name='dt' onchange='this.form.submit();'>");
+	curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype;
 	html_intoption(0, "unified", curr);
 	html_intoption(1, "ssdiff", curr);
 	html("</select></td></tr>");
@@ -362,6 +362,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
 {
 	struct commit *commit, *commit2;
 	const unsigned char *old_tree_sha1, *new_tree_sha1;
+	diff_type difftype;
 
 	if (!new_rev)
 		new_rev = ctx.qry.head;
@@ -420,7 +421,8 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
 		return;
 	}
 
-	use_ssdiff = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff;
+	difftype = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype;
+	use_ssdiff = difftype == DIFF_SSDIFF;
 
 	if (show_ctrls)
 		cgit_print_diff_ctrls();
diff --git a/ui-shared.c b/ui-shared.c
index 68e0d7c..6243d1b 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -346,9 +346,9 @@ void cgit_commit_link(char *name, const char *title, const char *class,
 		html_url_arg(rev);
 		delim = "&amp;";
 	}
-	if (ctx.qry.ssdiff) {
+	if (ctx.qry.difftype) {
 		html(delim);
-		html("ss=1");
+		htmlf("dt=%d", ctx.qry.difftype);
 		delim = "&amp;";
 	}
 	if (ctx.qry.context > 0 && ctx.qry.context != 3) {
@@ -402,9 +402,9 @@ void cgit_diff_link(const char *name, const char *title, const char *class,
 		html_url_arg(old_rev);
 		delim = "&amp;";
 	}
-	if (ctx.qry.ssdiff) {
+	if (ctx.qry.difftype) {
 		html(delim);
-		html("ss=1");
+		htmlf("dt=%d", ctx.qry.difftype);
 		delim = "&amp;";
 	}
 	if (ctx.qry.context > 0 && ctx.qry.context != 3) {
-- 
2.1.0.374.g390713e



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

* [PATCH 4/4] ui-diff: add "stat only" diff type
  2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
                   ` (2 preceding siblings ...)
  2014-10-05  9:59 ` [PATCH 3/4] Change "ss" diff flag to an enum john
@ 2014-10-05  9:59 ` john
  2014-12-24  1:49   ` Jason
  2014-10-06  3:01 ` [PATCH 0/4] Add "stat only" diff mode Jason
  4 siblings, 1 reply; 12+ messages in thread
From: john @ 2014-10-05  9:59 UTC (permalink / raw)


This prints the diffstat but stops before printing (or generating) any
of the body of the diff.

No cgitrc option is added here so that we can wait to see how useful
this is before letting people set it as the default.

Suggested-by: Konstantin Ryabitsev <mricon at kernel.org>
Signed-off-by: John Keeping <john at keeping.me.uk>
---
 cgit.h    | 2 +-
 ui-diff.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/cgit.h b/cgit.h
index 0eb5ed5..0c1585d 100644
--- a/cgit.h
+++ b/cgit.h
@@ -53,7 +53,7 @@ typedef void (*filepair_fn)(struct diff_filepair *pair);
 typedef void (*linediff_fn)(char *line, int len);
 
 typedef enum {
-	DIFF_UNIFIED, DIFF_SSDIFF
+	DIFF_UNIFIED, DIFF_SSDIFF, DIFF_STATONLY
 } diff_type;
 
 typedef enum {
diff --git a/ui-diff.c b/ui-diff.c
index a4ade4d..bf2ec57 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -349,6 +349,7 @@ void cgit_print_diff_ctrls()
 	curr = ctx.qry.has_difftype ? ctx.qry.difftype : ctx.cfg.difftype;
 	html_intoption(0, "unified", curr);
 	html_intoption(1, "ssdiff", curr);
+	html_intoption(2, "stat only", curr);
 	html("</select></td></tr>");
 	html("<tr><td/><td class='ctrl'>");
 	html("<noscript><input type='submit' value='reload'/></noscript>");
@@ -429,6 +430,9 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
 
 	cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix);
 
+	if (difftype == DIFF_STATONLY)
+		return;
+
 	if (use_ssdiff) {
 		html("<table summary='ssdiff' class='ssdiff'>");
 	} else {
-- 
2.1.0.374.g390713e



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

* [PATCH 0/4] Add "stat only" diff mode
  2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
                   ` (3 preceding siblings ...)
  2014-10-05  9:59 ` [PATCH 4/4] ui-diff: add "stat only" diff type john
@ 2014-10-06  3:01 ` Jason
  2014-10-06  6:10   ` cgit
  4 siblings, 1 reply; 12+ messages in thread
From: Jason @ 2014-10-06  3:01 UTC (permalink / raw)


Curious to know the motivation behind this patchset. Why would you want
stat-only?

Will review very soon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20141006/492695d8/attachment.html>


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

* [PATCH 0/4] Add "stat only" diff mode
  2014-10-06  3:01 ` [PATCH 0/4] Add "stat only" diff mode Jason
@ 2014-10-06  6:10   ` cgit
  2014-10-06 13:25     ` mricon
  0 siblings, 1 reply; 12+ messages in thread
From: cgit @ 2014-10-06  6:10 UTC (permalink / raw)


On Mon, 06 Oct 2014 at 05:01:41, Jason A. Donenfeld wrote:
> Curious to know the motivation behind this patchset. Why would you want
> stat-only?
> [...]

To avoid loading the whole diff when you're only interested in changes
to a single file [1].

[1] http://lists.zx2c4.com/pipermail/cgit/2014-September/002235.html


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

* [PATCH 0/4] Add "stat only" diff mode
  2014-10-06  6:10   ` cgit
@ 2014-10-06 13:25     ` mricon
  0 siblings, 0 replies; 12+ messages in thread
From: mricon @ 2014-10-06 13:25 UTC (permalink / raw)


On 06/10/14 02:10 AM, Lukas Fleischer wrote:
> On Mon, 06 Oct 2014 at 05:01:41, Jason A. Donenfeld wrote:
>> Curious to know the motivation behind this patchset. Why would you want
>> stat-only?
>> [...]
> 
> To avoid loading the whole diff when you're only interested in changes
> to a single file [1].
> 
> [1] http://lists.zx2c4.com/pipermail/cgit/2014-September/002235.html

\o/

Yes, to use a more relevant example, we get quite a bit of traffic to
the following page:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/diff/?id=v3.17&id2=v3.16
(warning, trying to load it may kill your browser)

However, people are only interested in seeing diffs to specific drivers
or submodules, not the whole thing. Generating the whole diff 3.17-3.16
is pretty much useless to anyone not certifiably insane, and it eats up
a ton of traffic for no purpose. Having the ability to only display
diffstat would be extremely handy.

Best,
-- 
Konstantin Ryabitsev
Linux Foundation Collab Projects
Montr?al, Qu?bec


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

* [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link()
  2014-10-05  9:59 ` [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link() john
@ 2014-12-24  1:48   ` Jason
  0 siblings, 0 replies; 12+ messages in thread
From: Jason @ 2014-12-24  1:48 UTC (permalink / raw)


Merged, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20141223/a5cd5cf1/attachment.html>


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

* [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link()
  2014-10-05  9:59 ` [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link() john
@ 2014-12-24  1:49   ` Jason
  0 siblings, 0 replies; 12+ messages in thread
From: Jason @ 2014-12-24  1:49 UTC (permalink / raw)


Likewise, merged. Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20141223/95cb8457/attachment.html>


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

* [PATCH 3/4] Change "ss" diff flag to an enum
  2014-10-05  9:59 ` [PATCH 3/4] Change "ss" diff flag to an enum john
@ 2014-12-24  1:49   ` Jason
  0 siblings, 0 replies; 12+ messages in thread
From: Jason @ 2014-12-24  1:49 UTC (permalink / raw)


Merged.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20141223/5b688fc6/attachment.html>


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

* [PATCH 4/4] ui-diff: add "stat only" diff type
  2014-10-05  9:59 ` [PATCH 4/4] ui-diff: add "stat only" diff type john
@ 2014-12-24  1:49   ` Jason
  0 siblings, 0 replies; 12+ messages in thread
From: Jason @ 2014-12-24  1:49 UTC (permalink / raw)


Merged.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20141223/c5403a9f/attachment.html>


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

end of thread, other threads:[~2014-12-24  1:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-05  9:59 [PATCH 0/4] Add "stat only" diff mode john
2014-10-05  9:59 ` [PATCH 1/4] ui-shared: remove toggle_ssdiff arg to cgit_commit_link() john
2014-12-24  1:48   ` Jason
2014-10-05  9:59 ` [PATCH 2/4] ui-shared: remove toggle_ssdiff arg to cgit_diff_link() john
2014-12-24  1:49   ` Jason
2014-10-05  9:59 ` [PATCH 3/4] Change "ss" diff flag to an enum john
2014-12-24  1:49   ` Jason
2014-10-05  9:59 ` [PATCH 4/4] ui-diff: add "stat only" diff type john
2014-12-24  1:49   ` Jason
2014-10-06  3:01 ` [PATCH 0/4] Add "stat only" diff mode Jason
2014-10-06  6:10   ` cgit
2014-10-06 13:25     ` mricon

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).