From: Eric Wong <[email protected]>

Text-based browsers without CSS support show all the decorations
bunched together without spacing.  Rely on a whitespace instead
of CSS support.
---
v2: rebase
v1: https://lists.zx2c4.com/pipermail/cgit/2019-January/004288.html

I've been running cgit with this patch for years.  Why I wasn't using 
Eric's whole original 4-part patch series is lost to time, so I'm just 
rebasing the ones I have been using individually.

 cgit.css | 1 -
 ui-log.c | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/cgit.css b/cgit.css
index d10a24d..6963b84 100644
--- a/cgit.css
+++ b/cgit.css
@@ -728,7 +728,6 @@ div#cgit div.commit-subject a.tag-deco,
 div#cgit div.commit-subject a.tag-annotated-deco,
 div#cgit div.commit-subject a.remote-deco,
 div#cgit div.commit-subject a.deco {
-       margin-left: 1em;
        font-size: 75%;
 }
 
diff --git a/ui-log.c b/ui-log.c
index 9906bbc..12caeed 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -77,11 +77,13 @@ void show_commit_decorations(struct commit *commit)
                         * don't display anything. */
                        break;
                case DECORATION_REF_LOCAL:
+                       html(" ");
                        cgit_log_link(buf, NULL, "branch-deco", buf, NULL,
                                ctx.qry.vpath, 0, NULL, NULL,
                                ctx.qry.showmsg, 0);
                        break;
                case DECORATION_REF_TAG:
+                       html(" ");
                        if (!refs_read_ref(get_main_ref_store(the_repository), 
deco->name, &oid_tag) &&
                            !peel_object(the_repository, &oid_tag, &peeled, 
PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE))
                                is_annotated = !oideq(&oid_tag, &peeled);
@@ -90,12 +92,14 @@ void show_commit_decorations(struct commit *commit)
                case DECORATION_REF_REMOTE:
                        if (!ctx.repo->enable_remote_branches)
                                break;
+                       html(" ");
                        cgit_log_link(buf, NULL, "remote-deco", NULL,
                                oid_to_hex(&commit->object.oid),
                                ctx.qry.vpath, 0, NULL, NULL,
                                ctx.qry.showmsg, 0);
                        break;
                default:
+                       html(" ");
                        cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
                                        oid_to_hex(&commit->object.oid),
                                        ctx.qry.vpath);

base-commit: 044821677c774cd24f25f1818ea51d09cc64b006
-- 
2.53.0

Reply via email to