summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e9bf11)
raw | patch | inline | side by side (parent: 5e9bf11)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Thu, 4 Sep 2008 21:39:21 +0000 (23:39 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 5 Sep 2008 00:01:41 +0000 (17:01 -0700) |
log-tree.c is the ideal place for load_ref_decorations() and its
helper functions to live in, because the variable name_decoration
they're operating on is already located there, so move them thither.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
helper functions to live in, because the variable name_decoration
they're operating on is already located there, so move them thither.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-log.c | patch | blob | history | |
log-tree.c | patch | blob | history | |
log-tree.h | patch | blob | history |
diff --git a/builtin-log.c b/builtin-log.c
index 0f164620b9b7b9d0df088f101b725cee632272a4..081e660f6ff3cea2171e0ce30bdef2c347293863 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
#include "tag.h"
#include "reflog-walk.h"
#include "patch-ids.h"
-#include "refs.h"
#include "run-command.h"
#include "shortlog.h"
static const char *fmt_patch_subject_prefix = "PATCH";
static const char *fmt_pretty;
-static void add_name_decoration(const char *prefix, const char *name, struct object *obj)
-{
- int plen = strlen(prefix);
- int nlen = strlen(name);
- struct name_decoration *res = xmalloc(sizeof(struct name_decoration) + plen + nlen);
- memcpy(res->name, prefix, plen);
- memcpy(res->name + plen, name, nlen + 1);
- res->next = add_decoration(&name_decoration, obj, res);
-}
-
-static int add_ref_decoration(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
-{
- struct object *obj = parse_object(sha1);
- if (!obj)
- return 0;
- add_name_decoration("", refname, obj);
- while (obj->type == OBJ_TAG) {
- obj = ((struct tag *)obj)->tagged;
- if (!obj)
- break;
- add_name_decoration("tag: ", refname, obj);
- }
- return 0;
-}
-
-void load_ref_decorations(void)
-{
- static int loaded;
- if (!loaded) {
- loaded = 1;
- for_each_ref(add_ref_decoration, NULL);
- }
-}
-
static void cmd_log_init(int argc, const char **argv, const char *prefix,
struct rev_info *rev)
{
diff --git a/log-tree.c b/log-tree.c
index 30cd5bb22800f5e897c1170e97721a4dcdb9c9d2..2c1f3e673ae7c9441cb171244d3fb91a8dd9fb1b 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
#include "cache.h"
#include "diff.h"
#include "commit.h"
+#include "tag.h"
#include "graph.h"
#include "log-tree.h"
#include "reflog-walk.h"
+#include "refs.h"
struct decoration name_decoration = { "object names" };
+static void add_name_decoration(const char *prefix, const char *name, struct object *obj)
+{
+ int plen = strlen(prefix);
+ int nlen = strlen(name);
+ struct name_decoration *res = xmalloc(sizeof(struct name_decoration) + plen + nlen);
+ memcpy(res->name, prefix, plen);
+ memcpy(res->name + plen, name, nlen + 1);
+ res->next = add_decoration(&name_decoration, obj, res);
+}
+
+static int add_ref_decoration(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
+{
+ struct object *obj = parse_object(sha1);
+ if (!obj)
+ return 0;
+ add_name_decoration("", refname, obj);
+ while (obj->type == OBJ_TAG) {
+ obj = ((struct tag *)obj)->tagged;
+ if (!obj)
+ break;
+ add_name_decoration("tag: ", refname, obj);
+ }
+ return 0;
+}
+
+void load_ref_decorations(void)
+{
+ static int loaded;
+ if (!loaded) {
+ loaded = 1;
+ for_each_ref(add_ref_decoration, NULL);
+ }
+}
+
static void show_parents(struct commit *commit, int abbrev)
{
struct commit_list *p;
diff --git a/log-tree.h b/log-tree.h
index 59ba4c48b7966db34c6345a445ab0b10e235ac83..3c8127bb7cc8d27ff1e91ad6c159bc718fb7d9d0 100644 (file)
--- a/log-tree.h
+++ b/log-tree.h
const char **subject_p,
const char **extra_headers_p,
int *need_8bit_cte_p);
+void load_ref_decorations(void);
#endif