git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Fredrik Kuivinen <freku045@student.liu.se>
Cc: git@vger.kernel.org, junkio@cox.net
Subject: Re: [PATCH] git-blame, take 2
Date: Thu, 2 Mar 2006 13:45:18 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0603021338130.22647@g5.osdl.org> (raw)
In-Reply-To: <20060302212816.GA11015@c165.ib.student.liu.se>



On Thu, 2 Mar 2006, Fredrik Kuivinen wrote:
> 
> Here is an updated version of git-blame. The main changes compared to
> the first version are:
> 
> * Use the new revision.h interface to do the revision walking
...
> +
> +	num_args = 0;
> +	args[num_args++] = NULL;
> +	args[num_args++] = "--topo-order";
> +	args[num_args++] = "--remove-empty";
> +	args[num_args++] = argv[1];
> +	args[num_args++] = "--";
> +	args[num_args++] = filename;
> +	args[num_args] = NULL;
> +	
> +	setup_revisions(num_args, args, &rev, "HEAD");

Ok, that wasn't really supposed to be necessary.

I guess the above works fine, but it should be perfectly fine to also just 
do a nicer helper function that just initializes rev_info with something 
like

	memset(revs, 0, sizeof(*revs));
	revs->max_count = -1;
	revs->min_date = -1;
	revs->max_date = -1;
	revs->dense = 1;

and then you can just fill in the things you want to directly. Just add 
the commits you want to populate things with to the "revs->commits" list, 
the paths to "revs->paths", set "revs->limited" to 1, and then do the 
"prepare_revision_walk()" and start walking.

But hey, the above "fake the arguments" thing also works. It makes me 
wince a bit, though.

		Linus

      reply	other threads:[~2006-03-02 21:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 21:28 [PATCH] git-blame, take 2 Fredrik Kuivinen
2006-03-02 21:45 ` Linus Torvalds [this message]

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=Pine.LNX.4.64.0603021338130.22647@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=freku045@student.liu.se \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).