{"thread":{"id":"14006","subject":"suggestions for generating diffs through the revision list","startedAt":"2008-06-17T21:41:42Z","lastAt":"2008-06-19T21:20:49Z","messageCount":3,"participants":["Don Zickus","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"80165","messageId":"20080617214142.GM16941@redhat.com","threadId":"14006","inReplyTo":null,"subject":"suggestions for generating diffs through the revision list","fromName":"Don Zickus","fromEmail":"dzickus@redhat.com","sentAt":"2008-06-17T21:41:42Z","receivedAt":"2008-06-17T21:41:42Z","isPatch":false,"sender":{"key":"dzickus@redhat.com","avatar":null},"body":"I am try to walk the revision history for a given path and analyze the\ndiff (as compared to its parent).  What is the proper way of doing that?\n\nI noticed a bunch of 'library' calls such as\n\ninit_revsion(&revs);\nsetup_revisions(argc, argv, &revs, \"HEAD\");\nprepare_revision_walk(&revs, NULL);\ncommit = get_revision(&revs);\n\nBut what I can't find is the way to generate diffs.  I see lots and lots\nof code to do it, but every builtin seems to do it differently.  Not\nknowing the internals that well, I was hoping for some advice.\n\nI stumbled upon calls like\n\nrun_diff_files\nrun_diff_index\n\nbut I haven't seen how to use them correctly.\n\nAny help would be appreciated.  Thanks.\n\nCheers,\nDon\n"},{"id":"80170","messageId":"7v63s767mb.fsf@gitster.siamese.dyndns.org","threadId":"14006","inReplyTo":"20080617214142.GM16941@redhat.com","subject":"Re: suggestions for generating diffs through the revision list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-17T22:04:28Z","receivedAt":"2008-06-17T22:04:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Don Zickus <dzickus@redhat.com> writes:\n\n> I am try to walk the revision history for a given path and analyze the\n> diff (as compared to its parent).  What is the proper way of doing that?\n>\n> I noticed a bunch of 'library' calls such as\n>\n> init_revsion(&revs);\n> setup_revisions(argc, argv, &revs, \"HEAD\");\n> prepare_revision_walk(&revs, NULL);\n> commit = get_revision(&revs);\n>\n> But what I can't find is the way to generate diffs.  I see lots and lots\n> of code to do it, but every builtin seems to do it differently.  Not\n> knowing the internals that well, I was hoping for some advice.\n>\n> I stumbled upon calls like\n>\n> run_diff_files\n> run_diff_index\n>\n> but I haven't seen how to use them correctly.\n\nDocumentation/technical/api-*.txt\n"},{"id":"80374","messageId":"20080619212049.GO16941@redhat.com","threadId":"14006","inReplyTo":"7v63s767mb.fsf@gitster.siamese.dyndns.org","subject":"Re: suggestions for generating diffs through the revision list","fromName":"Don Zickus","fromEmail":"dzickus@redhat.com","sentAt":"2008-06-19T21:20:49Z","receivedAt":"2008-06-19T21:20:49Z","isPatch":false,"sender":{"key":"dzickus@redhat.com","avatar":null},"body":"On Tue, Jun 17, 2008 at 03:04:28PM -0700, Junio C Hamano wrote:\n> Don Zickus <dzickus@redhat.com> writes:\n> \n> > I am try to walk the revision history for a given path and analyze the\n> > diff (as compared to its parent).  What is the proper way of doing that?\n> >\n> > I noticed a bunch of 'library' calls such as\n> >\n> > init_revsion(&revs);\n> > setup_revisions(argc, argv, &revs, \"HEAD\");\n> > prepare_revision_walk(&revs, NULL);\n> > commit = get_revision(&revs);\n> >\n> > But what I can't find is the way to generate diffs.  I see lots and lots\n> > of code to do it, but every builtin seems to do it differently.  Not\n> > knowing the internals that well, I was hoping for some advice.\n> >\n> > I stumbled upon calls like\n> >\n> > run_diff_files\n> > run_diff_index\n> >\n> > but I haven't seen how to use them correctly.\n> \n> Documentation/technical/api-*.txt\n\nHmm. Thanks.  I was trying to keep the diffs in memory and I couldn't find\nanything in the api-*.txt that did anything but dump the output the stdout\nor a file.\n\nAnyway I just copied a bunch of code from builtin-blame.c and got my tool\nto do what I wanted it to do, for now.\n\nCheers,\nDon\n"}]}