From: plenz at cis.fu-berlin.de (Julius Plenz)
Subject: [PATCH 1/2] bugfix: in ssdiff, fix line number links
Date: Tue, 30 Oct 2012 13:56:01 +0100 [thread overview]
Message-ID: <1351601762-953642-2-git-send-email-plenz@cis.fu-berlin.de> (raw)
In-Reply-To: <1351601762-953642-1-git-send-email-plenz@cis.fu-berlin.de>
Previously, the id_str (i.e. the current or diffed-against commit's
SHA1 ID) was simply concatenated to the URL. Now, prepend an "id="
string so that the links actually point to the right blobs and thus
the exact lines.
Signed-off-by: Julius Plenz <plenz at cis.fu-berlin.de>
---
ui-ssdiff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui-ssdiff.c b/ui-ssdiff.c
index 0cff4b8..7108779 100644
--- a/ui-ssdiff.c
+++ b/ui-ssdiff.c
@@ -230,7 +230,7 @@ static void print_ssdiff_line(char *class,
if (old_line_no > 0) {
struct diff_filespec *old_file = cgit_get_current_old_file();
char *lineno_str = fmt("n%d", old_line_no);
- char *id_str = fmt("%s#%s", is_null_sha1(old_file->sha1)?"HEAD":sha1_to_hex(old_rev_sha1), lineno_str);
+ char *id_str = fmt("id=%s#%s", is_null_sha1(old_file->sha1)?"HEAD":sha1_to_hex(old_rev_sha1), lineno_str);
html("<td class='lineno'><a class='no' href='");
html(cgit_fileurl(ctx.repo->url, "tree", old_file->path, id_str));
htmlf("' id='%s' name='%s'>%s</a>", lineno_str, lineno_str, lineno_str + 1);
@@ -251,7 +251,7 @@ static void print_ssdiff_line(char *class,
if (new_line_no > 0) {
struct diff_filespec *new_file = cgit_get_current_new_file();
char *lineno_str = fmt("n%d", new_line_no);
- char *id_str = fmt("%s#%s", is_null_sha1(new_file->sha1)?"HEAD":sha1_to_hex(new_rev_sha1), lineno_str);
+ char *id_str = fmt("id=%s#%s", is_null_sha1(new_file->sha1)?"HEAD":sha1_to_hex(new_rev_sha1), lineno_str);
html("<td class='lineno'><a class='no' href='");
html(cgit_fileurl(ctx.repo->url, "tree", new_file->path, id_str));
htmlf("' id='%s' name='%s'>%s</a>", lineno_str, lineno_str, lineno_str + 1);
--
1.7.12.3-zedat
next prev parent reply other threads:[~2012-10-30 12:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-30 12:56 [PATCH 0/2] side-by-side-diff fixes plenz
2012-10-30 12:56 ` plenz [this message]
2012-10-30 16:37 ` [PATCH 1/2] bugfix: in ssdiff, fix line number links Jason
2012-10-30 12:56 ` [PATCH 2/2] bugfix: make ss-diff correctly handle tab expansion plenz
2012-10-30 14:56 ` plenz
2012-10-30 16:56 ` Jason
2012-10-30 17:12 ` plenz
2012-10-30 17:25 ` Jason
2012-10-30 17:52 ` plenz
2012-11-15 0:03 ` Jason
2012-11-15 16:35 ` [PATCH v2] " plenz
2013-02-01 12:51 ` Jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351601762-953642-2-git-send-email-plenz@cis.fu-berlin.de \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).