Warmcat homepage andy@warmcat.com
libwebsockets
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1745907377, "reponame":"cgit", "desc":"CGI gitweb", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/cgit", "f":3, "items": [ {"schema":"libjg2-1", "cid":"41d7d67beec4a254105b09c7117e70d5", "commit": {"type":"commit", "time": 1530592110, "time_ofs": 480, "oid_tree": { "oid": "6c707a6aa325ffea8322ac8a7ae5e7565a338d09", "alias": []}, "oid":{ "oid": "a2bbd93f443993c025b101c040d0726778b91dd0", "alias": []}, "msg": "client-side: compute the line number extent but let client add them to DOM in tree", "sig_commit": { "git_time": { "time": 1530592110, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1530581562, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "client-side: compute the line number extent but let client add them to DOM in tree\n\nThere's no point generating and sending potentially thousands of\ndumb line number links when the client can synthesize and add them.\n\nBlame fragments the line numbers into divs reflecting the extent\nof each commit, so it's left as generated for now.\n\nSigned-off-by: Andy Green \u003candy@warmcat.com\u003e" , "diff": "diff --git a/ui-blame.c b/ui-blame.c\nindex c9cca18..82fd875 100644\n--- a/ui-blame.c\n+++ b/ui-blame.c\n@@ -170,7 +170,10 @@ static void print_object(const struct object_id *oid, const char *path,\n \n \t/* Line numbers */\n \tif (ctx.cfg.enable_tree_linenumbers) {\n-\t\thtml(\u0022\u003ctd id\u003d'linenumbers' class\u003d'linenumbers'\u003e\u0022);\n+\t\tunsigned long count \u003d 0;\n+\n+\t\thtmlf(\u0022\u003ctd id\u003d'linenumbers' class\u003d'linenumbers' count\u003d%lu\u003e\u0022,\n+\t\t\tcount);\n \t\tfor (ent \u003d sb.ent; ent; ent \u003d ent-\u003enext) {\n \t\t\thtml(\u0022\u003cdiv class\u003d'alt'\u003e\u003cpre\u003e\u0022);\n \t\t\temit_blame_entry_linenumber(ent);\ndiff --git a/ui-tree.c b/ui-tree.c\nindex 7a55e77..299901a 100644\n--- a/ui-tree.c\n+++ b/ui-tree.c\n@@ -56,17 +56,22 @@ static int string_list_wildcard_check(struct string_list *sl,\n \n static void print_text_buffer(const char *name, char *buf, unsigned long size)\n {\n-\tunsigned long lineno, idx;\n+\tunsigned long lineno \u003d 0, idx \u003d 0;\n \tconst char *numberfmt \u003d \u0022\u003ca id\u003d'n%1$d' href\u003d'#n%1$d'\u003e%1$d\u003c/a\u003e\u005cn\u0022;\n \n \thtml(\u0022\u003ctable summary\u003d'blob content' class\u003d'blob'\u003e\u005cn\u0022);\n \n \tif (ctx.cfg.enable_tree_linenumbers) {\n-\t\thtml(\u0022\u003ctr\u003e\u003ctd id\u003d'linenumbers' class\u003d'linenumbers'\u003e\u003cpre\u003e\u0022);\n-\t\tidx \u003d 0;\n-\t\tlineno \u003d 0;\n+\t\tif (ctx.cfg.clientside) {\n+\t\t\twhile (idx \u003c size)\n+\t\t\t\tif (buf[idx++] \u003d\u003d '\u005cn')\n+\t\t\t\t\tlineno++;\n+\t\t}\n+\n+\t\thtmlf(\u0022\u003ctr\u003e\u003ctd id\u003d'linenumbers' class\u003d'linenumbers' count\u003d%lu\u003e\u003cpre\u003e\u0022,\n+\t\t lineno);\n \n-\t\tif (size) {\n+\t\tif (!ctx.cfg.clientside \u0026\u0026 size) {\n \t\t\thtmlf(numberfmt, ++lineno);\n \t\t\twhile (idx \u003c size - 1) { // skip absolute last newline\n \t\t\t\tif (buf[idx] \u003d\u003d '\u005cn')\n","s":{"c":1745907377,"u": 1455}} ],"g": 2215,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}