]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'stable'
authorLars Hjemli <hjemli@gmail.com>
Tue, 3 Aug 2010 20:52:11 +0000 (22:52 +0200)
committerLars Hjemli <hjemli@gmail.com>
Tue, 3 Aug 2010 20:52:11 +0000 (22:52 +0200)
1  2 
Makefile
ui-refs.c

diff --combined Makefile
index 8b426fe902352cabb40e88cb657c2233def25722,51620208512ec618de7ba3e17890f3844c70cae4..3e5a38d143a11a49b55d600e00a136aa6b82c679
+++ b/Makefile
@@@ -1,19 -1,16 +1,19 @@@
- CGIT_VERSION = v0.8.3.2
+ CGIT_VERSION = v0.8.3.3
  CGIT_SCRIPT_NAME = cgit.cgi
  CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
  CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
  CGIT_CONFIG = /etc/cgitrc
  CACHE_ROOT = /var/cache/cgit
  SHA1_HEADER = <openssl/sha.h>
 -GIT_VER = 1.6.4.3
 +GIT_VER = 1.7.0
  GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
  INSTALL = install
  
  # Define NO_STRCASESTR if you don't have strcasestr.
  #
 +# Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1
 +# implementation (slower).
 +#
  # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin).
  #
  
@@@ -71,7 -68,7 +71,7 @@@ endi
        $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
  
  
 -EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
 +EXTLIBS = git/libgit.a git/xdiff/lib.a -lz
  OBJECTS =
  OBJECTS += cache.o
  OBJECTS += cgit.o
@@@ -93,7 -90,6 +93,7 @@@ OBJECTS += ui-refs.
  OBJECTS += ui-repolist.o
  OBJECTS += ui-shared.o
  OBJECTS += ui-snapshot.o
 +OBJECTS += ui-ssdiff.o
  OBJECTS += ui-stats.o
  OBJECTS += ui-summary.o
  OBJECTS += ui-tag.o
@@@ -127,25 -123,17 +127,25 @@@ endi
  ifdef NO_STRCASESTR
        CFLAGS += -DNO_STRCASESTR
  endif
 +ifdef NO_OPENSSL
 +      CFLAGS += -DNO_OPENSSL
 +      GIT_OPTIONS += NO_OPENSSL=1
 +else
 +      EXTLIBS += -lcrypto
 +endif
  
  cgit: $(OBJECTS) libgit
        $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS)
  
  cgit.o: VERSION
  
 --include $(OBJECTS:.o=.d)
 +ifneq "$(MAKECMDGOALS)" "clean"
 +  -include $(OBJECTS:.o=.d)
 +endif
  
  libgit:
 -      $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 libgit.a
 -      $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 xdiff/lib.a
 +      $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a
 +      $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a
  
  test: all
        $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all
diff --combined ui-refs.c
index 94ff6be13cee2cfefde5369a0d7cbd760d454b1e,6571cc452014bc1352c279d1aeea48ed3f133197..caddfbc4fbdb3949b6c2424e21baa528e220ce7f
+++ b/ui-refs.c
@@@ -42,23 -42,25 +42,25 @@@ static int cmp_branch_age(const void *a
        return cmp_age(r1->commit->committer_date, r2->commit->committer_date);
  }
  
+ static int get_ref_age(struct refinfo *ref)
+ {
+       if (!ref->object)
+               return 0;
+       switch (ref->object->type) {
+       case OBJ_TAG:
+               return ref->tag ? ref->tag->tagger_date : 0;
+       case OBJ_COMMIT:
+               return ref->commit ? ref->commit->committer_date : 0;
+       }
+       return 0;
+ }
  static int cmp_tag_age(const void *a, const void *b)
  {
        struct refinfo *r1 = *(struct refinfo **)a;
        struct refinfo *r2 = *(struct refinfo **)b;
-       int r1date, r2date;
-       if (r1->object->type != OBJ_COMMIT)
-               r1date = r1->tag->tagger_date;
-       else
-               r1date = r1->commit->committer_date;
-       if (r2->object->type != OBJ_COMMIT)
-               r2date = r2->tag->tagger_date;
-       else
-               r2date = r2->commit->committer_date;
  
-       return cmp_age(r1date, r2date);
+       return cmp_age(get_ref_age(r1), get_ref_age(r2));
  }
  
  static int print_branch(struct refinfo *ref)
@@@ -74,7 -76,7 +76,7 @@@
        html("</td><td>");
  
        if (ref->object->type == OBJ_COMMIT) {
 -              cgit_commit_link(info->subject, NULL, NULL, name, NULL);
 +              cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL, 0);
                html("</td><td>");
                html_txt(info->author);
                html("</td><td colspan='2'>");
@@@ -187,8 -189,6 +189,8 @@@ void cgit_print_branches(int maxcount
        list.refs = NULL;
        list.alloc = list.count = 0;
        for_each_branch_ref(cgit_refs_cb, &list);
 +      if (ctx.repo->enable_remote_branches)
 +              for_each_remote_ref(cgit_refs_cb, &list);
  
        if (maxcount == 0 || maxcount > list.count)
                maxcount = list.count;