Re: [smug-devel] RSS Feeds and Diffs
Status: Alpha
Brought to you by:
amcnabb
From: Jeff A. <jef...@pr...> - 2008-10-20 20:24:47
|
Andrew McNabb wrote: > That being said, what you're talking about is slightly different than > doing a diff on two pieces of content. It sounds like you're talking > about finding all of the differences between two trees, which does seem > like a good thing for gitlib. Maybe the best thing to do would be to > add a difftrees method to Repository and a diff method to Blob. Blob's > diff could compare with another Blob, and Repository's could do a > treewalk and do a diff on each Blob. > I do see what you mean about there being a difference between diffing a single file, and diffing a tree. Would it be wrong to implement what the anonymous patch generation in gitlib? I'm not sure how the git diff command generates diffs against a working directory, but my guess is that it more or less creates blob objects, and uses the same diffing function as it does when diffing between two different git trees (commits). Maybe that's the "right" way to do things for anonymous commits? or would it be too complicated? >> Making diffs seems like a reasonable enough thing to go into gitlib-- >> just thought I'd ask before duplicating or refactoring. >> > > To sum up, I think it would be a good thing to have in Gitlib but that > it should use Python's diff module rather than a Git subcommand. > Yeah, the issue never was dropping to a git subcommand. I was more curious about the code in the anonymous commit view that calls the python unified diff library-- since that code is in the views, I didn't want to implement much of the same in a different view. I thought that a better solution might be to implement diffing in gitlib itself, rather than in a view. Jeff Anderson |