List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 0/6] Update to a more recent Git
@ 2013-03-02 12:32 john
  2013-03-02 12:32 ` [PATCH 1/6] Update git to v1.7.5.4 john
                   ` (9 more replies)
  0 siblings, 10 replies; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


I've had these changes lying around for a while but never got round to
tidying them up.  These are split into one patch for each Git version
that requires changes - where we can skip forward multiple versions
without changes I just have a single patch.

The changes here are reasonably straightforward, but v1.8.0 makes things
a lot more difficult due to Git commit ba35480 (graph.c: mark private
file-scope symbols as static, 2012-09-15).  I'll see if Junio can be
persuaded to revert that before trying anything too horrible here -
without those methods we'll need to filter Git's graph output to convert
ANSI colour escape sequences into HTML.

John Keeping (6):
  Update git to v1.7.5.4
  Update git to v1.7.6.5
  Update git to v1.7.7.7
  Update git to v1.7.8.6
  Update git to v1.7.9.7
  Update git to v1.7.12.4

 cgit.c        |  2 +-
 cgit.h        |  3 +++
 git           |  2 +-
 shared.c      | 10 +++++-----
 ui-blob.c     | 22 ++++++++++++++++++----
 ui-plain.c    | 17 ++++++++++++-----
 ui-snapshot.c | 54 +++++++++++++++++++++++++++++++++---------------------
 ui-stats.c    |  2 +-
 ui-tree.c     | 16 +++++++++++++---
 9 files changed, 87 insertions(+), 41 deletions(-)

-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 1/6] Update git to v1.7.5.4
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
@ 2013-03-02 12:32 ` john
  2013-03-02 15:12   ` Jason
  2013-03-02 12:32 ` [PATCH 2/6] Update git to v1.7.6.5 john
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


Some changes to diff options:

- no_merges has become the more general max_parents
- path restriction now uses struct pathspec

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 git        |  2 +-
 shared.c   | 10 +++++-----
 ui-stats.c |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/git b/git
index 7ed863a..e5af0de 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 7ed863a85a6ce2c4ac4476848310b8f917ab41f9
+Subproject commit e5af0de202e885b793482d416b8ce9d50dd2b8bc
diff --git a/shared.c b/shared.c
index 8e5ae48..0967f92 100644
--- a/shared.c
+++ b/shared.c
@@ -307,7 +307,7 @@ void cgit_diff_tree(const unsigned char *old_sha1,
 		    filepair_fn fn, const char *prefix, int ignorews)
 {
 	struct diff_options opt;
-	int prefixlen;
+	struct pathspec_item item;
 
 	diff_setup(&opt);
 	opt.output_format = DIFF_FORMAT_CALLBACK;
@@ -319,10 +319,10 @@ void cgit_diff_tree(const unsigned char *old_sha1,
 	opt.format_callback = cgit_diff_tree_cb;
 	opt.format_callback_data = fn;
 	if (prefix) {
-		opt.nr_paths = 1;
-		opt.paths = &prefix;
-		prefixlen = strlen(prefix);
-		opt.pathlens = &prefixlen;
+		item.match = prefix;
+		item.len = strlen(prefix);
+		opt.pathspec.nr = 1;
+		opt.pathspec.items = &item;
 	}
 	diff_setup_done(&opt);
 
diff --git a/ui-stats.c b/ui-stats.c
index 59f4c1e..51dd6a2 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -239,7 +239,7 @@ struct string_list collect_stats(struct cgit_context *ctx,
 	init_revisions(&rev, NULL);
 	rev.abbrev = DEFAULT_ABBREV;
 	rev.commit_format = CMIT_FMT_DEFAULT;
-	rev.no_merges = 1;
+	rev.max_parents = 1;
 	rev.verbose_header = 1;
 	rev.show_root_diff = 0;
 	setup_revisions(argc, argv, &rev, NULL);
-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 2/6] Update git to v1.7.6.5
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
  2013-03-02 12:32 ` [PATCH 1/6] Update git to v1.7.5.4 john
@ 2013-03-02 12:32 ` john
  2013-03-02 15:13   ` Jason
  2013-03-02 12:32 ` [PATCH 3/6] Update git to v1.7.7.7 john
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


struct pathspec is now used in more places.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 git        |  2 +-
 ui-blob.c  | 22 ++++++++++++++++++----
 ui-plain.c | 17 ++++++++++++-----
 ui-tree.c  | 16 +++++++++++++---
 4 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/git b/git
index e5af0de..15b7898 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit e5af0de202e885b793482d416b8ce9d50dd2b8bc
+Subproject commit 15b7898c5e9fc6fed9a6064213cfcd08cf7d7314
diff --git a/ui-blob.c b/ui-blob.c
index ec435e1..3de4473 100644
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -32,7 +32,14 @@ int cgit_print_file(char *path, const char *head)
 	char *buf;
 	unsigned long size;
 	struct commit *commit;
-	const char *paths[] = {path, NULL};
+	struct pathspec_item path_items = {
+		.match = path,
+		.len = strlen(path)
+	};
+	struct pathspec paths = {
+		.nr = 1,
+		.items = &path_items
+	};
 	if (get_sha1(head, sha1))
 		return -1;
 	type = sha1_object_info(sha1, &size);
@@ -41,7 +48,7 @@ int cgit_print_file(char *path, const char *head)
 		match_path = path;
 		matched_sha1 = sha1;
 		found_path = 0;
-		read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
+		read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL);
 		if (!found_path)
 			return -1;
 		type = sha1_object_info(sha1, &size);
@@ -63,7 +70,14 @@ void cgit_print_blob(const char *hex, char *path, const char *head)
 	char *buf;
 	unsigned long size;
 	struct commit *commit;
-	const char *paths[] = {path, NULL};
+	struct pathspec_item path_items = {
+		.match = path,
+		.len = strlen(path)
+	};
+	struct pathspec paths = {
+		.nr = 1,
+		.items = &path_items
+	};
 
 	if (hex) {
 		if (get_sha1_hex(hex, sha1)){
@@ -83,7 +97,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head)
 		commit = lookup_commit_reference(sha1);
 		match_path = path;
 		matched_sha1 = sha1;
-		read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
+		read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL);
 		type = sha1_object_info(sha1,&size);
 	}
 
diff --git a/ui-plain.c b/ui-plain.c
index 85877d7..c21d38f 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -197,7 +197,14 @@ void cgit_print_plain(struct cgit_context *ctx)
 	const char *rev = ctx->qry.sha1;
 	unsigned char sha1[20];
 	struct commit *commit;
-	const char *paths[] = {ctx->qry.path, NULL};
+	struct pathspec_item path_items = {
+		.match = ctx->qry.path,
+		.len = ctx->qry.path ? strlen(ctx->qry.path) : 0
+	};
+	struct pathspec paths = {
+		.nr = 1,
+		.items = &path_items
+	};
 
 	if (!rev)
 		rev = ctx->qry.head;
@@ -211,14 +218,14 @@ void cgit_print_plain(struct cgit_context *ctx)
 		html_status(404, "Not found", 0);
 		return;
 	}
-	if (!paths[0]) {
-		paths[0] = "";
+	if (!path_items.match) {
+		path_items.match = "";
 		match_baselen = -1;
 		print_dir(commit->tree->object.sha1, "", 0, "");
 	}
 	else
-		match_baselen = basedir_len(paths[0]);
-	read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
+		match_baselen = basedir_len(path_items.match);
+	read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL);
 	if (!match)
 		html_status(404, "Not found", 0);
 	else if (match == 2)
diff --git a/ui-tree.c b/ui-tree.c
index b1adcc7..b544440 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -202,6 +202,9 @@ static void ls_tail()
 static void ls_tree(const unsigned char *sha1, char *path)
 {
 	struct tree *tree;
+	struct pathspec paths = {
+		.nr = 0
+	};
 
 	tree = parse_tree_indirect(sha1);
 	if (!tree) {
@@ -211,7 +214,7 @@ static void ls_tree(const unsigned char *sha1, char *path)
 	}
 
 	ls_head();
-	read_tree_recursive(tree, "", 0, 1, NULL, ls_item, NULL);
+	read_tree_recursive(tree, "", 0, 1, &paths, ls_item, NULL);
 	ls_tail();
 }
 
@@ -252,7 +255,14 @@ void cgit_print_tree(const char *rev, char *path)
 {
 	unsigned char sha1[20];
 	struct commit *commit;
-	const char *paths[] = {path, NULL};
+	struct pathspec_item path_items = {
+		.match = path,
+		.len = path ? strlen(path) : 0
+	};
+	struct pathspec paths = {
+		.nr = path ? 1 : 0,
+		.items = &path_items
+	};
 
 	if (!rev)
 		rev = ctx.qry.head;
@@ -274,6 +284,6 @@ void cgit_print_tree(const char *rev, char *path)
 	}
 
 	match_path = path;
-	read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
+	read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL);
 	ls_tail();
 }
-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
  2013-03-02 12:32 ` [PATCH 1/6] Update git to v1.7.5.4 john
  2013-03-02 12:32 ` [PATCH 2/6] Update git to v1.7.6.5 john
@ 2013-03-02 12:32 ` john
  2013-03-02 15:19   ` Jason
  2013-03-04  4:53   ` Jason
  2013-03-02 12:32 ` [PATCH 4/6] Update git to v1.7.8.6 john
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


This release changes the archive interface so that we now need to pass
argv into write_archive().

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 cgit.h        |  3 +++
 git           |  2 +-
 ui-snapshot.c | 54 +++++++++++++++++++++++++++++++++---------------------
 3 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/cgit.h b/cgit.h
index f3d2556..c655bd8 100644
--- a/cgit.h
+++ b/cgit.h
@@ -11,6 +11,7 @@
 #include <tag.h>
 #include <diff.h>
 #include <diffcore.h>
+#include <argv-array.h>
 #include <refs.h>
 #include <revision.h>
 #include <log-tree.h>
@@ -274,6 +275,8 @@ struct cgit_context {
 	struct cgit_page page;
 };
 
+typedef int (*write_archive_fn_t)(const char *, const char *);
+
 struct cgit_snapshot_format {
 	const char *suffix;
 	const char *mimetype;
diff --git a/git b/git
index 15b7898..8258858 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 15b7898c5e9fc6fed9a6064213cfcd08cf7d7314
+Subproject commit 8258858493ad3504630c3bfa7dfde61df811994a
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 47432bd..324fd9f 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -11,7 +11,31 @@
 #include "html.h"
 #include "ui-shared.h"
 
-static int write_compressed_tar_archive(struct archiver_args *args, char *filter_argv[])
+static int write_archive_type(const char *format, const char *hex, const char *prefix)
+{
+	struct argv_array argv = ARGV_ARRAY_INIT;
+	argv_array_push(&argv, format);
+	if (prefix) {
+		argv_array_push(&argv, "--prefix");
+		argv_array_push(&argv, fmt("%s/", prefix));
+	}
+	argv_array_push(&argv, hex);
+	return write_archive(argv.argc, argv.argv, NULL, 1, NULL, 0);
+}
+
+static int write_tar_archive(const char *hex, const char *prefix)
+{
+	return write_archive_type("--format=tar", hex, prefix);
+}
+
+static int write_zip_archive(const char *hex, const char *prefix)
+{
+	return write_archive_type("--format=zip", hex, prefix);
+}
+
+static int write_compressed_tar_archive(const char *hex,
+					const char *prefix,
+					char *filter_argv[])
 {
 	int rv;
 	struct cgit_filter f;
@@ -19,27 +43,27 @@ static int write_compressed_tar_archive(struct archiver_args *args, char *filter
 	f.cmd = filter_argv[0];
 	f.argv = filter_argv;
 	cgit_open_filter(&f);
-	rv = write_tar_archive(args);
+	rv = write_tar_archive(hex, prefix);
 	cgit_close_filter(&f);
 	return rv;
 }
 
-static int write_tar_gzip_archive(struct archiver_args *args)
+static int write_tar_gzip_archive(const char *hex, const char *prefix)
 {
 	char *argv[] = { "gzip", "-n", NULL };
-	return write_compressed_tar_archive(args, argv);
+	return write_compressed_tar_archive(hex, prefix, argv);
 }
 
-static int write_tar_bzip2_archive(struct archiver_args *args)
+static int write_tar_bzip2_archive(const char *hex, const char *prefix)
 {
 	char *argv[] = { "bzip2", NULL };
-	return write_compressed_tar_archive(args, argv);
+	return write_compressed_tar_archive(hex, prefix, argv);
 }
 
-static int write_tar_xz_archive(struct archiver_args *args)
+static int write_tar_xz_archive(const char *hex, const char *prefix)
 {
 	char *argv[] = { "xz", NULL };
-	return write_compressed_tar_archive(args, argv);
+	return write_compressed_tar_archive(hex, prefix, argv);
 }
 
 const struct cgit_snapshot_format cgit_snapshot_formats[] = {
@@ -71,7 +95,6 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
 			 const char *hex, const char *prefix,
 			 const char *filename)
 {
-	struct archiver_args args;
 	struct commit *commit;
 	unsigned char sha1[20];
 
@@ -84,21 +107,10 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
 		cgit_print_error(fmt("Not a commit reference: %s", hex));
 		return 1;
 	}
-	memset(&args, 0, sizeof(args));
-	if (prefix) {
-		args.base = fmt("%s/", prefix);
-		args.baselen = strlen(prefix) + 1;
-	} else {
-		args.base = "";
-		args.baselen = 0;
-	}
-	args.tree = commit->tree;
-	args.time = commit->date;
-	args.compression_level = Z_DEFAULT_COMPRESSION;
 	ctx.page.mimetype = xstrdup(format->mimetype);
 	ctx.page.filename = xstrdup(filename);
 	cgit_print_http_headers(&ctx);
-	format->write_func(&args);
+	format->write_func(hex, prefix);
 	return 0;
 }
 
-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 4/6] Update git to v1.7.8.6
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (2 preceding siblings ...)
  2013-03-02 12:32 ` [PATCH 3/6] Update git to v1.7.7.7 john
@ 2013-03-02 12:32 ` john
  2013-03-02 15:20   ` Jason
  2013-03-02 12:32 ` [PATCH 5/6] Update git to v1.7.9.7 john
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


No changes required.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git b/git
index 8258858..d9f5ef7 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 8258858493ad3504630c3bfa7dfde61df811994a
+Subproject commit d9f5ef7a4a760d58f1f824f9fb8c12ef0371d3a9
-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 5/6] Update git to v1.7.9.7
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (3 preceding siblings ...)
  2013-03-02 12:32 ` [PATCH 4/6] Update git to v1.7.8.6 john
@ 2013-03-02 12:32 ` john
  2013-03-02 15:21   ` Jason
  2013-03-02 12:32 ` [PATCH 6/6] Update git to v1.7.12.4 john
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


resolve_ref() is renamed to resolve_ref_unsafe().  CGit's usage is safe.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 cgit.c | 2 +-
 git    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cgit.c b/cgit.c
index 11edd81..d615315 100644
--- a/cgit.c
+++ b/cgit.c
@@ -450,7 +450,7 @@ static char *guess_defbranch(const char *repo_path)
 	const char *ref;
 	unsigned char sha1[20];
 
-	ref = resolve_ref("HEAD", sha1, 0, NULL);
+	ref = resolve_ref_unsafe("HEAD", sha1, 0, NULL);
 	if (!ref || prefixcmp(ref, "refs/heads/"))
 		return "master";
 	return xstrdup(ref + 11);
diff --git a/git b/git
index d9f5ef7..d0f1ea6 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit d9f5ef7a4a760d58f1f824f9fb8c12ef0371d3a9
+Subproject commit d0f1ea6003d97e63110fa7d50bb07f546a909b6e
-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 6/6] Update git to v1.7.12.4
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (4 preceding siblings ...)
  2013-03-02 12:32 ` [PATCH 5/6] Update git to v1.7.9.7 john
@ 2013-03-02 12:32 ` john
  2013-03-02 15:21   ` Jason
  2013-03-02 15:06 ` [PATCH 0/6] Update to a more recent Git mailings
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 12:32 UTC (permalink / raw)


No changes needed.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git b/git
index d0f1ea6..7e20105 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit d0f1ea6003d97e63110fa7d50bb07f546a909b6e
+Subproject commit 7e2010537e96d0a1144520222f20ba1dc3d61441
-- 
1.8.2.rc1.339.g93ec2c9





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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (5 preceding siblings ...)
  2013-03-02 12:32 ` [PATCH 6/6] Update git to v1.7.12.4 john
@ 2013-03-02 15:06 ` mailings
  2013-03-02 15:08 ` Jason
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: mailings @ 2013-03-02 15:06 UTC (permalink / raw)


Awesome!

Didn't look into these in detail but if they're good then let's put them 
on master ASAP ;-)

Like that you split the updates!

On 02/03/13 13:32, John Keeping wrote:
> I've had these changes lying around for a while but never got round to
> tidying them up.  These are split into one patch for each Git version
> that requires changes - where we can skip forward multiple versions
> without changes I just have a single patch.
>
> The changes here are reasonably straightforward, but v1.8.0 makes things
> a lot more difficult due to Git commit ba35480 (graph.c: mark private
> file-scope symbols as static, 2012-09-15).  I'll see if Junio can be
> persuaded to revert that before trying anything too horrible here -

good idea

> without those methods we'll need to filter Git's graph output to convert
> ANSI colour escape sequences into HTML.
>
> John Keeping (6):
>    Update git to v1.7.5.4
>    Update git to v1.7.6.5
>    Update git to v1.7.7.7
>    Update git to v1.7.8.6
>    Update git to v1.7.9.7
>    Update git to v1.7.12.4
>
>   cgit.c        |  2 +-
>   cgit.h        |  3 +++
>   git           |  2 +-
>   shared.c      | 10 +++++-----
>   ui-blob.c     | 22 ++++++++++++++++++----
>   ui-plain.c    | 17 ++++++++++++-----
>   ui-snapshot.c | 54 +++++++++++++++++++++++++++++++++---------------------
>   ui-stats.c    |  2 +-
>   ui-tree.c     | 16 +++++++++++++---
>   9 files changed, 87 insertions(+), 41 deletions(-)
>

-- 
Ferry Huberts




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (6 preceding siblings ...)
  2013-03-02 15:06 ` [PATCH 0/6] Update to a more recent Git mailings
@ 2013-03-02 15:08 ` Jason
  2013-03-02 15:28   ` john
  2013-03-02 15:43 ` Jason
  2013-03-20 20:21 ` Jason
  9 siblings, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-02 15:08 UTC (permalink / raw)


These patches are great. Thanks a lot for them -- I was going to do
this myself, not realizing others were already on the case. Great.
They're in the upstream-git branch for the moment during review.

http://git.zx2c4.com/cgit/log/?h=upstream-git

On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> The changes here are reasonably straightforward, but v1.8.0 makes things
> a lot more difficult due to Git commit ba35480 (graph.c: mark private
> file-scope symbols as static, 2012-09-15).  I'll see if Junio can be
> persuaded to revert that before trying anything too horrible here -

I saw that a little bit earlier as well.
http://www.mail-archive.com/git at vger.kernel.org/msg08134.html

The reason evidently is that without the static modifier, it caused a
few warnings about not being forward declared:
http://www.mail-archive.com/git at vger.kernel.org/msg08125.html

I don't think it should be that much of a hassle, therefore, to
convince Junio, if we provide a patch that also squelches such
warnings. That said, we want to tread lightly. Git doesn't provide an
API, and if we start requesting changes in the name of "api
interoperability", or what have you, the git mailing list is going to
tell us to switch to libgit2 and rework a bunch of things. And while
that might make sense somewhere somehow at some point, it's part of a
separate debate I really do not want to have right now (and if you're
thinking about replying to this thread commenting on this sentence and
mentioning something about libgit2 PLEASE DO NOT -- it's for a
separate ML thread). So let's use some tact when approaching Junio
about this.

> without those methods we'll need to filter Git's graph output to convert
> ANSI colour escape sequences into HTML.

Right. Possible, but ugly.




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

* [PATCH 1/6] Update git to v1.7.5.4
  2013-03-02 12:32 ` [PATCH 1/6] Update git to v1.7.5.4 john
@ 2013-03-02 15:12   ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-02 15:12 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
>  git        |  2 +-
>  shared.c   | 10 +++++-----
>  ui-stats.c |  2 +-
>  3 files changed, 7 insertions(+), 7 deletions(-)

Uncontroversial, I'll be merging this one after some testing.

Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>




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

* [PATCH 2/6] Update git to v1.7.6.5
  2013-03-02 12:32 ` [PATCH 2/6] Update git to v1.7.6.5 john
@ 2013-03-02 15:13   ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-02 15:13 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
>  git        |  2 +-
>  ui-blob.c  | 22 ++++++++++++++++++----
>  ui-plain.c | 17 ++++++++++++-----
>  ui-tree.c  | 16 +++++++++++++---
>  4 files changed, 44 insertions(+), 13 deletions(-)

Uncontroversial, I'll be merging this one after some testing.

Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-02 12:32 ` [PATCH 3/6] Update git to v1.7.7.7 john
@ 2013-03-02 15:19   ` Jason
  2013-03-02 15:31     ` john
  2013-03-04  4:53   ` Jason
  1 sibling, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-02 15:19 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> This release changes the archive interface so that we now need to pass
> argv into write_archive().

It's a bit of a bummer having to do it this way -- I rather liked
struct archiver_args. Such is life.

> -       args.time = commit->date;

Do we loose something significant by not being able to provide the
date like this, or do the new args take care of this automatically
when parsing the hex?

Also, can we axe the commit lookup code, now that that pointer isn't used?

 	struct commit *commit;
 	commit = lookup_commit_reference(sha1);
 	if(!commit) {
 		cgit_print_error(fmt("Not a commit reference: %s", hex));
 		return 1;
 	}

Or are we unable to handle errors later on, and so it's best to
validate here? At the very least, we don't need the commit pointer
hanging around any longer.




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

* [PATCH 4/6] Update git to v1.7.8.6
  2013-03-02 12:32 ` [PATCH 4/6] Update git to v1.7.8.6 john
@ 2013-03-02 15:20   ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-02 15:20 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> No changes required.

Will merge.

Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>




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

* [PATCH 5/6] Update git to v1.7.9.7
  2013-03-02 12:32 ` [PATCH 5/6] Update git to v1.7.9.7 john
@ 2013-03-02 15:21   ` Jason
  2013-03-02 15:35     ` john
  0 siblings, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-02 15:21 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> resolve_ref() is renamed to resolve_ref_unsafe().  CGit's usage is safe.

Is there a safe usage we ought to consider as an alternative? I
haven't looked into the details here yet.




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

* [PATCH 6/6] Update git to v1.7.12.4
  2013-03-02 12:32 ` [PATCH 6/6] Update git to v1.7.12.4 john
@ 2013-03-02 15:21   ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-02 15:21 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> No changes needed.

Will merge.

Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 15:08 ` Jason
@ 2013-03-02 15:28   ` john
  2013-03-02 15:32     ` Jason
  0 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 15:28 UTC (permalink / raw)


On Sat, Mar 02, 2013 at 10:08:53AM -0500, Jason A. Donenfeld wrote:
> The reason evidently is that without the static modifier, it caused a
> few warnings about not being forward declared:
> http://www.mail-archive.com/git at vger.kernel.org/msg08125.html

I don't think that applies in this case - the functions are declared in
the header file.  It looks to me like those warnings triggered a round
of marking anything that wasn't used elsewhere as private.

> I don't think it should be that much of a hassle, therefore, to
> convince Junio, if we provide a patch that also squelches such
> warnings. That said, we want to tread lightly. Git doesn't provide an
> API, and if we start requesting changes in the name of "api
> interoperability", or what have you, the git mailing list is going to
> tell us to switch to libgit2 and rework a bunch of things. And while
> that might make sense somewhere somehow at some point, it's part of a
> separate debate I really do not want to have right now (and if you're
> thinking about replying to this thread commenting on this sentence and
> mentioning something about libgit2 PLEASE DO NOT -- it's for a
> separate ML thread). So let's use some tact when approaching Junio
> about this.

Well, I've sent a message[1] so we'll see what happens...

[1] http://article.gmane.org/gmane.comp.version-control.git/217326




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-02 15:19   ` Jason
@ 2013-03-02 15:31     ` john
  2013-03-02 15:39       ` Jason
  0 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 15:31 UTC (permalink / raw)


On Sat, Mar 02, 2013 at 10:19:32AM -0500, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> > This release changes the archive interface so that we now need to pass
> > argv into write_archive().
> 
> It's a bit of a bummer having to do it this way -- I rather liked
> struct archiver_args. Such is life.
> 
> > -       args.time = commit->date;
> 
> Do we loose something significant by not being able to provide the
> date like this, or do the new args take care of this automatically
> when parsing the hex?

The Git write_archive() method does exactly this, so nothing is lost
here.

> Also, can we axe the commit lookup code, now that that pointer isn't used?
> 
>  	struct commit *commit;
>  	commit = lookup_commit_reference(sha1);
>  	if(!commit) {
>  		cgit_print_error(fmt("Not a commit reference: %s", hex));
>  		return 1;
>  	}
> 
> Or are we unable to handle errors later on, and so it's best to
> validate here? At the very least, we don't need the commit pointer
> hanging around any longer.

If we pass something invalid into Git it will die() on us, so I left
this in so that we can provide a sensible error message.

You're right that we can get rid of the "commit" variable.  Can you do
that as a fixup or would you like me to re-send?


John




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 15:28   ` john
@ 2013-03-02 15:32     ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-02 15:32 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 10:28 AM, John Keeping <john at keeping.me.uk> wrote:
>
> Well, I've sent a message[1] so we'll see what happens...
>
> [1] http://article.gmane.org/gmane.comp.version-control.git/217326

Perfect.




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

* [PATCH 5/6] Update git to v1.7.9.7
  2013-03-02 15:21   ` Jason
@ 2013-03-02 15:35     ` john
  2013-03-02 15:39       ` Jason
  0 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-02 15:35 UTC (permalink / raw)


On Sat, Mar 02, 2013 at 10:21:09AM -0500, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> > resolve_ref() is renamed to resolve_ref_unsafe().  CGit's usage is safe.
> 
> Is there a safe usage we ought to consider as an alternative? I
> haven't looked into the details here yet.

resolve_ref was renamed to resolve_ref_unsafe in Git commit 8cad474
(Rename resolve_ref() to resolve_ref_unsafe(), 2011-12-12) to indicate
that it returns a static buffer that will be overwritten by the next
call.  CGit strdup's the returned value immediately so there's nothing
to worry about here.


John




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-02 15:31     ` john
@ 2013-03-02 15:39       ` Jason
  2013-03-02 15:50         ` john
  0 siblings, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-02 15:39 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 10:31 AM, John Keeping <john at keeping.me.uk> wrote:
> Can you do
> that as a fixup

Done. In the branch.




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

* [PATCH 5/6] Update git to v1.7.9.7
  2013-03-02 15:35     ` john
@ 2013-03-02 15:39       ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-02 15:39 UTC (permalink / raw)


Great.




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (7 preceding siblings ...)
  2013-03-02 15:08 ` Jason
@ 2013-03-02 15:43 ` Jason
  2013-03-02 15:44   ` mailings
  2013-03-20 20:21 ` Jason
  9 siblings, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-02 15:43 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> I've had these changes lying around for a while but never got round to
> tidying them up.

Currently dog-fooding on git.zx2c4.com.




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 15:43 ` Jason
@ 2013-03-02 15:44   ` mailings
  0 siblings, 0 replies; 29+ messages in thread
From: mailings @ 2013-03-02 15:44 UTC (permalink / raw)


my jenkins says it builds and tests ok

On 02/03/13 16:43, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
>> I've had these changes lying around for a while but never got round to
>> tidying them up.
>
> Currently dog-fooding on git.zx2c4.com.
>
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
>

-- 
Ferry Huberts




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-02 15:39       ` Jason
@ 2013-03-02 15:50         ` john
  0 siblings, 0 replies; 29+ messages in thread
From: john @ 2013-03-02 15:50 UTC (permalink / raw)


On Sat, Mar 02, 2013 at 10:39:03AM -0500, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 10:31 AM, John Keeping <john at keeping.me.uk> wrote:
> > Can you do
> > that as a fixup
> 
> Done. In the branch.

Thanks.




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-02 12:32 ` [PATCH 3/6] Update git to v1.7.7.7 john
  2013-03-02 15:19   ` Jason
@ 2013-03-04  4:53   ` Jason
  2013-03-04  9:22     ` john
  1 sibling, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-04  4:53 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> This release changes the archive interface so that we now need to pass
> argv into write_archive().

Hey John,

Take a look at this commit --

http://git.zx2c4.com/cgit/commit/?id=6e9e54e19bb06f795cc7bb02318d47c317334f9d

Something to keep in mind for future changes like this one. Looks like
PARSE_OPT_KEEP_ARGV0 mostly is not used.

Jason




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-04  4:53   ` Jason
@ 2013-03-04  9:22     ` john
  2013-03-04 14:18       ` Jason
  0 siblings, 1 reply; 29+ messages in thread
From: john @ 2013-03-04  9:22 UTC (permalink / raw)


On Sun, Mar 03, 2013 at 11:53:44PM -0500, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <john at keeping.me.uk> wrote:
> > This release changes the archive interface so that we now need to pass
> > argv into write_archive().
> 
> Hey John,
> 
> Take a look at this commit --
> 
> http://git.zx2c4.com/cgit/commit/?id=6e9e54e19bb06f795cc7bb02318d47c317334f9d
> 
> Something to keep in mind for future changes like this one. Looks like
> PARSE_OPT_KEEP_ARGV0 mostly is not used.

Interesting.  Thanks for fixing this - I guess this means we don't have
a test for ZIP archives since that should have caught this issue.  I'll
try to address that over the next few days if no-one else gets there
first...


John




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

* [PATCH 3/6] Update git to v1.7.7.7
  2013-03-04  9:22     ` john
@ 2013-03-04 14:18       ` Jason
  0 siblings, 0 replies; 29+ messages in thread
From: Jason @ 2013-03-04 14:18 UTC (permalink / raw)


On Mon, Mar 4, 2013 at 4:22 AM, John Keeping <john at keeping.me.uk> wrote:
> Interesting.  Thanks for fixing this - I guess this means we don't have
> a test for ZIP archives since that should have caught this issue.  I'll
> try to address that over the next few days if no-one else gets there
> first...

The other curious thing this broke is checksums. Git changed their
header format of tar archives, so my inbox is now filled with angry
users from package managers getting SHA1 mismatch errors on packages
that use my cgit for distribution. Of course, there's nothing that can
be done to fix this, but it is nice how sometimes angry users have
test-suite-like coverage :-).




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
                   ` (8 preceding siblings ...)
  2013-03-02 15:43 ` Jason
@ 2013-03-20 20:21 ` Jason
  2013-03-20 20:28   ` john
  9 siblings, 1 reply; 29+ messages in thread
From: Jason @ 2013-03-20 20:21 UTC (permalink / raw)


On Sat, Mar 2, 2013 at 1:32 PM, John Keeping <john at keeping.me.uk> wrote:
> The changes here are reasonably straightforward, but v1.8.0 makes things
> a lot more difficult due to Git commit ba35480 (graph.c: mark private
> file-scope symbols as static, 2012-09-15).  I'll see if Junio can be
> persuaded to revert that before trying anything too horrible here -
> without those methods we'll need to filter Git's graph output to convert
> ANSI colour escape sequences into HTML.

https://github.com/git/git/commit/c278e6f53d32ffdd475f9d4392cb6e5f5574e1ac

Looks like we're all set now. 1.8.3 should be a possibility now.




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

* [PATCH 0/6] Update to a more recent Git
  2013-03-20 20:21 ` Jason
@ 2013-03-20 20:28   ` john
  0 siblings, 0 replies; 29+ messages in thread
From: john @ 2013-03-20 20:28 UTC (permalink / raw)


On Wed, Mar 20, 2013 at 09:21:41PM +0100, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 1:32 PM, John Keeping <john at keeping.me.uk> wrote:
> > The changes here are reasonably straightforward, but v1.8.0 makes things
> > a lot more difficult due to Git commit ba35480 (graph.c: mark private
> > file-scope symbols as static, 2012-09-15).  I'll see if Junio can be
> > persuaded to revert that before trying anything too horrible here -
> > without those methods we'll need to filter Git's graph output to convert
> > ANSI colour escape sequences into HTML.
> 
> https://github.com/git/git/commit/c278e6f53d32ffdd475f9d4392cb6e5f5574e1ac
> 
> Looks like we're all set now. 1.8.3 should be a possibility now.

Yeah, I have the change here:

https://github.com/johnkeeping/cgit/tree/jk/update-git

but it's currently pointing at a random point on Git's master branch.

It looks like the relevant change is targeted at maint in Git [1] so we
should be good to go when 1.8.2.1 appears.  I'll send a proper patch
soon after that happens.

[1] https://github.com/gitster/git/blob/7b9a41987aea4f5eb4afe1ff84302b5c5fa4e77a/Documentation/RelNotes/1.8.3.txt#L82




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

end of thread, other threads:[~2013-03-20 20:28 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-02 12:32 [PATCH 0/6] Update to a more recent Git john
2013-03-02 12:32 ` [PATCH 1/6] Update git to v1.7.5.4 john
2013-03-02 15:12   ` Jason
2013-03-02 12:32 ` [PATCH 2/6] Update git to v1.7.6.5 john
2013-03-02 15:13   ` Jason
2013-03-02 12:32 ` [PATCH 3/6] Update git to v1.7.7.7 john
2013-03-02 15:19   ` Jason
2013-03-02 15:31     ` john
2013-03-02 15:39       ` Jason
2013-03-02 15:50         ` john
2013-03-04  4:53   ` Jason
2013-03-04  9:22     ` john
2013-03-04 14:18       ` Jason
2013-03-02 12:32 ` [PATCH 4/6] Update git to v1.7.8.6 john
2013-03-02 15:20   ` Jason
2013-03-02 12:32 ` [PATCH 5/6] Update git to v1.7.9.7 john
2013-03-02 15:21   ` Jason
2013-03-02 15:35     ` john
2013-03-02 15:39       ` Jason
2013-03-02 12:32 ` [PATCH 6/6] Update git to v1.7.12.4 john
2013-03-02 15:21   ` Jason
2013-03-02 15:06 ` [PATCH 0/6] Update to a more recent Git mailings
2013-03-02 15:08 ` Jason
2013-03-02 15:28   ` john
2013-03-02 15:32     ` Jason
2013-03-02 15:43 ` Jason
2013-03-02 15:44   ` mailings
2013-03-20 20:21 ` Jason
2013-03-20 20:28   ` 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).