git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* suggestions for generating diffs through the revision list
@ 2008-06-17 21:41 Don Zickus
  2008-06-17 22:04 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Don Zickus @ 2008-06-17 21:41 UTC (permalink / raw)
  To: git

I am try to walk the revision history for a given path and analyze the
diff (as compared to its parent).  What is the proper way of doing that?

I noticed a bunch of 'library' calls such as

init_revsion(&revs);
setup_revisions(argc, argv, &revs, "HEAD");
prepare_revision_walk(&revs, NULL);
commit = get_revision(&revs);

But what I can't find is the way to generate diffs.  I see lots and lots
of code to do it, but every builtin seems to do it differently.  Not
knowing the internals that well, I was hoping for some advice.

I stumbled upon calls like

run_diff_files
run_diff_index

but I haven't seen how to use them correctly.

Any help would be appreciated.  Thanks.

Cheers,
Don

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: suggestions for generating diffs through the revision list
  2008-06-17 21:41 suggestions for generating diffs through the revision list Don Zickus
@ 2008-06-17 22:04 ` Junio C Hamano
  2008-06-19 21:20   ` Don Zickus
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2008-06-17 22:04 UTC (permalink / raw)
  To: Don Zickus; +Cc: git

Don Zickus <dzickus@redhat.com> writes:

> I am try to walk the revision history for a given path and analyze the
> diff (as compared to its parent).  What is the proper way of doing that?
>
> I noticed a bunch of 'library' calls such as
>
> init_revsion(&revs);
> setup_revisions(argc, argv, &revs, "HEAD");
> prepare_revision_walk(&revs, NULL);
> commit = get_revision(&revs);
>
> But what I can't find is the way to generate diffs.  I see lots and lots
> of code to do it, but every builtin seems to do it differently.  Not
> knowing the internals that well, I was hoping for some advice.
>
> I stumbled upon calls like
>
> run_diff_files
> run_diff_index
>
> but I haven't seen how to use them correctly.

Documentation/technical/api-*.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: suggestions for generating diffs through the revision list
  2008-06-17 22:04 ` Junio C Hamano
@ 2008-06-19 21:20   ` Don Zickus
  0 siblings, 0 replies; 3+ messages in thread
From: Don Zickus @ 2008-06-19 21:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Jun 17, 2008 at 03:04:28PM -0700, Junio C Hamano wrote:
> Don Zickus <dzickus@redhat.com> writes:
> 
> > I am try to walk the revision history for a given path and analyze the
> > diff (as compared to its parent).  What is the proper way of doing that?
> >
> > I noticed a bunch of 'library' calls such as
> >
> > init_revsion(&revs);
> > setup_revisions(argc, argv, &revs, "HEAD");
> > prepare_revision_walk(&revs, NULL);
> > commit = get_revision(&revs);
> >
> > But what I can't find is the way to generate diffs.  I see lots and lots
> > of code to do it, but every builtin seems to do it differently.  Not
> > knowing the internals that well, I was hoping for some advice.
> >
> > I stumbled upon calls like
> >
> > run_diff_files
> > run_diff_index
> >
> > but I haven't seen how to use them correctly.
> 
> Documentation/technical/api-*.txt

Hmm. Thanks.  I was trying to keep the diffs in memory and I couldn't find
anything in the api-*.txt that did anything but dump the output the stdout
or a file.

Anyway I just copied a bunch of code from builtin-blame.c and got my tool
to do what I wanted it to do, for now.

Cheers,
Don

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-19 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17 21:41 suggestions for generating diffs through the revision list Don Zickus
2008-06-17 22:04 ` Junio C Hamano
2008-06-19 21:20   ` Don Zickus

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).