Aww! And just when I _finally_ had a "step 2".
Actually, my argument is that we don't need it all that much.
For example, your "read-tree" argument is actually wrong. Anything that is
in a tree is _already_ fixed to be '\n'. So as long as we keep to things
like
git diff version1..version2
we'll actually always get the right version.
Also, the index will make sure that we don't even *try* to diff normal
checked out files.
So the only time you actually really need to test the .gitattributes file
is when you do an "open blob in working tree". And once you do that
function right, and just make sure both git-update-index and yes, the
"diff against working tree" cases use it, you really should be mostly
done.
Both git-update-index and git-diff-files want basically the same
interface:
struct file_buf {
const char *buf;
unsigned long size;
int flags;
}
int read_file(const char *path, struct file_buf *);
close_file(struct file_buf *);
and we should use that instead of the current "open + stat + mmap/read +
close" sequences.
It really shouldn't be too nasty.
Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html