>>>>> "BL" == Bryan Larsen <[EMAIL PROTECTED]> writes:

BL> Sometimes you may wish to keep an audit trail of what changed, where,
BL> and by whom.  You do not need to know the exact details of the change,
BL> and the files are so large that keeping an extra copy of the data in
BL> the object database cache is prohibitively expensive.

I am basically OK with this patch series, except I have one
minor problem about interface detail, and more seriously, that
the patch is whitespace mangled and would not apply.  E.g.

diff --git a/cache.h b/cache.h
--- a/cache.h
+++ b/cache.h
@@ -139,7 +139,7 @@ extern int remove_cache_entry_at(int pos
  extern int remove_file_from_cache(char *path);
  extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);
  extern int ce_match_stat(struct cache_entry *ce, struct stat *st);
-extern int index_fd(unsigned char *sha1, int fd, struct stat *st);
+extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int 
info_only);

Notice the "info_only" folded, and other unchanged lines
indented by two spaces instead of one?

Please retry.  I especially like what [PATCH 4/7] does and do
not want to see this patch go to dustbin due to technicalities.

Also please make sure that core GIT part patch applies against
Linus tip (especially [PATCH 2/7]) as well. I think it does, but
please double check.

I would also suggest adding the same --info-only logic to
write-blob (perhaps give it a short and sweet name like "-n"),
in order to get the hash information out of it without actually
registering the blob.

This would make things more useful in general.  One immediate
benefit of it is that we would have a standalone checksum
program we can reuse, by just saying "write-blob -n".  Once you
have it, you _could_ even drop --info-only from git-update-cache
and use normal --cacheinfo instead.

While you are at it, you might also want to add an option to
write-blob to specify the type of the object you are hashing, so
that would make [*1*]:

    git-write-blob [-n] [-t <type>] <file>...

One way to do this would be to add "const char *type" argument
to index_fd(), which is usually "blob" in the traditional use.
Then, the change to index_fd() would become:

-       ret = write_sha1_file(buf, size, "blob", sha1);
+       if (info_only) {
+               (void) write_sha1_file_prepare(buf, size, type, sha1, hdr, 
&hdrlen);
+               ret = 0;
+       } else ret = write_sha1_file(buf, size, type, sha1);

But first let's get the whitespace mangling fixed up ;-).

[Footnote]

*1* I considered this instead:

    git-write-blob [-n | -t <type>] <file>...

which means that if you specify type then -n is implied.  But
making -t independent would let you have inverse of
git-cat-file; a silly example:

    $ git-cat-file -t $FOO
    tree
    $ git-cat-file tree $FOO >tmp1
    $ FOO1=$(git-write-blob -t tree tmp1)

If we go this route, we may also want to rename it to
write-object, but I would want to have it as a separate patch
after this series settles down.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to