List for cgit developers and users
 help / color / mirror / Atom feed
From: florent.vial at intel.com (Vial, Florent)
Subject: how to acess a commit diffstat from the summary page?
Date: Tue, 13 Sep 2011 07:23:44 -0700	[thread overview]
Message-ID: <F4D30FAEEBF59F4FA973358B5E6B9DE74C52600F@fmsmsx501.amr.corp.intel.com> (raw)

Hi all,

I have a question for a problem I am not able to resolve on my own.
My intention is following: I want to add a column for each commit in the summary tab that displays only the diffstat summary of that commit (i.e the "X files changed, Y insertions, Z deletions" part).
For that I refactored in my previous patches all the cgit_print_commit functions to be able to use them in a flexible way in some other parts of cgit, in my case ui-summary.c.
Unfortunately, the variables storing the diff information per commit are all static variables  in ui-diff.c (static int total_adds, total_rems, max_changes).
The consequence is that when I call:

cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix, show_diffstat_summary_only);

the variables are not reset properly and the diff counting keeps increasing. I tried to reset the variables before hand but that did not work either.
My feeling is that I have to somehow fake a query for each commit in the summary tab, which is ugly.
Does someone know the inner functioning of ui-diff and could help me use it properly and/or rewrite it to avoid use of static variables?

Thank you in advance,
Florent





             reply	other threads:[~2011-09-13 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AcxyH4HH4ScgzGFpRLaw4sSQ9qCcuA==>
2011-09-13 14:23 ` florent.vial [this message]
2011-09-14  6:02   ` hjemli

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=F4D30FAEEBF59F4FA973358B5E6B9DE74C52600F@fmsmsx501.amr.corp.intel.com \
    --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).