List for cgit developers and users
 help / color / mirror / Atom feed
From: cgit at cryptocrack.de (Lukas Fleischer)
Subject: [PATCH 3/3] cmd.c: Add a "rawdiff" command
Date: Wed, 14 Aug 2013 10:50:33 +0200	[thread overview]
Message-ID: <1376470233-28581-4-git-send-email-cgit@cryptocrack.de> (raw)
In-Reply-To: <1376470233-28581-1-git-send-email-cgit@cryptocrack.de>

This can be used to generate raw diffs between arbitrary revisions using
something like

     /rawdiff/?id=v0.9&id2=v0.9.1

Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
 cmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cmd.c b/cmd.c
index 10761ce..9893710 100644
--- a/cmd.c
+++ b/cmd.c
@@ -60,6 +60,11 @@ static void diff_fn(struct cgit_context *ctx)
 	cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path, 1, 0);
 }
 
+static void rawdiff_fn(struct cgit_context *ctx)
+{
+	cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path, 1, 1);
+}
+
 static void info_fn(struct cgit_context *ctx)
 {
 	cgit_clone_info(ctx);
@@ -150,6 +155,7 @@ struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx)
 		def_cmd(objects, 1, 0, 0, 1),
 		def_cmd(patch, 1, 0, 1, 0),
 		def_cmd(plain, 1, 0, 0, 0),
+		def_cmd(rawdiff, 1, 0, 1, 0),
 		def_cmd(refs, 1, 1, 0, 0),
 		def_cmd(repolist, 0, 0, 0, 0),
 		def_cmd(snapshot, 1, 0, 0, 0),
-- 
1.8.4.rc2.477.g1da3ebd



  parent reply	other threads:[~2013-08-14  8:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14  8:50 [PATCH 0/3] Download patch between arbitrary revisions cgit
2013-08-14  8:50 ` [PATCH 1/3] Extract filepair_cb from ui-patch.c cgit
2013-08-14  8:50 ` [PATCH 2/3] Allow for creating raw diffs with cgit_print_diff() cgit
2013-08-14  8:50 ` cgit [this message]
2013-08-14 21:47 ` [PATCH 0/3] Download patch between arbitrary revisions john
2013-08-14 22:13 ` 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=1376470233-28581-4-git-send-email-cgit@cryptocrack.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).