List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/1] git: update to v2.2.0
@ 2014-11-27  0:30 list
  2014-11-27  9:05 ` john
  0 siblings, 1 reply; 4+ messages in thread
From: list @ 2014-11-27  0:30 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Update to git version v2.2.0, including API changes.
---
 Makefile      | 2 +-
 cgit.c        | 2 +-
 git           | 2 +-
 ui-log.c      | 4 ++--
 ui-repolist.c | 8 +++++---
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 6a8a125..975009f 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
 pdfdir = $(docdir)
 mandir = $(prefix)/share/man
 SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.0.4
+GIT_VER = 2.2.0
 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
 INSTALL = install
 COPYTREE = cp -r
diff --git a/cgit.c b/cgit.c
index 8c4517d..d70de72 100644
--- a/cgit.c
+++ b/cgit.c
@@ -453,7 +453,7 @@ static char *guess_defbranch(void)
 	const char *ref;
 	unsigned char sha1[20];
 
-	ref = resolve_ref_unsafe("HEAD", sha1, 0, NULL);
+	ref = resolve_ref_unsafe("HEAD", 0, sha1, NULL);
 	if (!ref || !starts_with(ref, "refs/heads/"))
 		return "master";
 	return xstrdup(ref + 11);
diff --git a/git b/git
index 32f5660..b260d26 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 32f56600bb6ac6fc57183e79d2c1515dfa56672f
+Subproject commit b260d265e189728b26e50506ac6ffab6a7d588da
diff --git a/ui-log.c b/ui-log.c
index bcdb666..e5faf59 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -56,11 +56,11 @@ static void inspect_files(struct diff_filepair *pair)
 
 void show_commit_decorations(struct commit *commit)
 {
-	struct name_decoration *deco;
+	const struct name_decoration *deco;
 	static char buf[1024];
 
 	buf[sizeof(buf) - 1] = 0;
-	deco = lookup_decoration(&name_decoration, &commit->object);
+	deco = get_name_decoration(&commit->object);
 	html("<span class='decoration'>");
 	while (deco) {
 		if (starts_with(deco->name, "refs/heads/")) {
diff --git a/ui-repolist.c b/ui-repolist.c
index c2bcce1..0e57c53 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -17,16 +17,18 @@ static time_t read_agefile(char *path)
 	time_t result;
 	size_t size;
 	char *buf;
-	static char buf2[64];
+	struct strbuf date_buf = STRBUF_INIT;
 
 	if (readfile(path, &buf, &size))
 		return -1;
 
-	if (parse_date(buf, buf2, sizeof(buf2)) > 0)
-		result = strtoul(buf2, NULL, 10);
+	strbuf_reset(&date_buf);
+	if (parse_date(buf, &date_buf) == 0)
+		result = strtoul(date_buf.buf, NULL, 10);
 	else
 		result = 0;
 	free(buf);
+	strbuf_release(&date_buf);
 	return result;
 }
 
-- 
2.1.3



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

* [PATCH 1/1] git: update to v2.2.0
  2014-11-27  0:30 [PATCH 1/1] git: update to v2.2.0 list
@ 2014-11-27  9:05 ` john
  2014-11-27 20:35   ` list
  0 siblings, 1 reply; 4+ messages in thread
From: john @ 2014-11-27  9:05 UTC (permalink / raw)


On Thu, Nov 27, 2014 at 01:30:56AM +0100, Christian Hesse wrote:
> Update to git version v2.2.0, including API changes.
> ---
[...]
> diff --git a/ui-repolist.c b/ui-repolist.c
> index c2bcce1..0e57c53 100644
> --- a/ui-repolist.c
> +++ b/ui-repolist.c
> @@ -17,16 +17,18 @@ static time_t read_agefile(char *path)
>  	time_t result;
>  	size_t size;
>  	char *buf;
> -	static char buf2[64];
> +	struct strbuf date_buf = STRBUF_INIT;
>  
>  	if (readfile(path, &buf, &size))
>  		return -1;
>  
> -	if (parse_date(buf, buf2, sizeof(buf2)) > 0)
> -		result = strtoul(buf2, NULL, 10);
> +	strbuf_reset(&date_buf);

Why is this necessary?  date_buf hasn't been used since it was
initialized.

> +	if (parse_date(buf, &date_buf) == 0)
> +		result = strtoul(date_buf.buf, NULL, 10);
>  	else
>  		result = 0;
>  	free(buf);
> +	strbuf_release(&date_buf);
>  	return result;
>  }
>  


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

* [PATCH 1/1] git: update to v2.2.0
  2014-11-27  9:05 ` john
@ 2014-11-27 20:35   ` list
  2014-11-27 20:41     ` list
  0 siblings, 1 reply; 4+ messages in thread
From: list @ 2014-11-27 20:35 UTC (permalink / raw)


John Keeping <john at keeping.me.uk> on Thu, 2014/11/27 09:05:
> On Thu, Nov 27, 2014 at 01:30:56AM +0100, Christian Hesse wrote:
> > Update to git version v2.2.0, including API changes.
> > ---
> [...]
> > diff --git a/ui-repolist.c b/ui-repolist.c
> > index c2bcce1..0e57c53 100644
> > --- a/ui-repolist.c
> > +++ b/ui-repolist.c
> > @@ -17,16 +17,18 @@ static time_t read_agefile(char *path)
> >  	time_t result;
> >  	size_t size;
> >  	char *buf;
> > -	static char buf2[64];
> > +	struct strbuf date_buf = STRBUF_INIT;
> >  
> >  	if (readfile(path, &buf, &size))
> >  		return -1;
> >  
> > -	if (parse_date(buf, buf2, sizeof(buf2)) > 0)
> > -		result = strtoul(buf2, NULL, 10);
> > +	strbuf_reset(&date_buf);
> 
> Why is this necessary?  date_buf hasn't been used since it was
> initialized.

Good point. Probably it is not necessary. ;)
I will reply with an updated patch.

> > +	if (parse_date(buf, &date_buf) == 0)
> > +		result = strtoul(date_buf.buf, NULL, 10);
> >  	else
> >  		result = 0;
> >  	free(buf);
> > +	strbuf_release(&date_buf);
> >  	return result;
> >  }
> >  

-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20141127/ed9571be/attachment.asc>


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

* [PATCH 1/1] git: update to v2.2.0
  2014-11-27 20:35   ` list
@ 2014-11-27 20:41     ` list
  0 siblings, 0 replies; 4+ messages in thread
From: list @ 2014-11-27 20:41 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Update to git version v2.2.0, including API changes.
---
 Makefile      | 2 +-
 cgit.c        | 2 +-
 git           | 2 +-
 ui-log.c      | 4 ++--
 ui-repolist.c | 7 ++++---
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 6a8a125..975009f 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
 pdfdir = $(docdir)
 mandir = $(prefix)/share/man
 SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.0.4
+GIT_VER = 2.2.0
 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
 INSTALL = install
 COPYTREE = cp -r
diff --git a/cgit.c b/cgit.c
index 8c4517d..d70de72 100644
--- a/cgit.c
+++ b/cgit.c
@@ -453,7 +453,7 @@ static char *guess_defbranch(void)
 	const char *ref;
 	unsigned char sha1[20];
 
-	ref = resolve_ref_unsafe("HEAD", sha1, 0, NULL);
+	ref = resolve_ref_unsafe("HEAD", 0, sha1, NULL);
 	if (!ref || !starts_with(ref, "refs/heads/"))
 		return "master";
 	return xstrdup(ref + 11);
diff --git a/git b/git
index 32f5660..b260d26 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 32f56600bb6ac6fc57183e79d2c1515dfa56672f
+Subproject commit b260d265e189728b26e50506ac6ffab6a7d588da
diff --git a/ui-log.c b/ui-log.c
index bcdb666..e5faf59 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -56,11 +56,11 @@ static void inspect_files(struct diff_filepair *pair)
 
 void show_commit_decorations(struct commit *commit)
 {
-	struct name_decoration *deco;
+	const struct name_decoration *deco;
 	static char buf[1024];
 
 	buf[sizeof(buf) - 1] = 0;
-	deco = lookup_decoration(&name_decoration, &commit->object);
+	deco = get_name_decoration(&commit->object);
 	html("<span class='decoration'>");
 	while (deco) {
 		if (starts_with(deco->name, "refs/heads/")) {
diff --git a/ui-repolist.c b/ui-repolist.c
index c2bcce1..49c991f 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -17,16 +17,17 @@ static time_t read_agefile(char *path)
 	time_t result;
 	size_t size;
 	char *buf;
-	static char buf2[64];
+	struct strbuf date_buf = STRBUF_INIT;
 
 	if (readfile(path, &buf, &size))
 		return -1;
 
-	if (parse_date(buf, buf2, sizeof(buf2)) > 0)
-		result = strtoul(buf2, NULL, 10);
+	if (parse_date(buf, &date_buf) == 0)
+		result = strtoul(date_buf.buf, NULL, 10);
 	else
 		result = 0;
 	free(buf);
+	strbuf_release(&date_buf);
 	return result;
 }
 
-- 
2.1.3



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

end of thread, other threads:[~2014-11-27 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27  0:30 [PATCH 1/1] git: update to v2.2.0 list
2014-11-27  9:05 ` john
2014-11-27 20:35   ` list
2014-11-27 20:41     ` list

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