git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Bruno Albuquerque <bga@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] object-info: support for retrieving object info
Date: Fri, 16 Apr 2021 22:01:54 +0000	[thread overview]
Message-ID: <YHoJUrqeT26Nihua@camp.crustytoothpaste.net> (raw)
In-Reply-To: <20210415212017.1407303-1-bga@google.com>

[-- Attachment #1: Type: text/plain, Size: 2782 bytes --]

On 2021-04-15 at 21:20:17, Bruno Albuquerque wrote:
> Sometimes it is useful to get information of an object without having to
> download it completely.
> 
> Add the "object-info" capability that lets the client ask for
> object-related information with their full hexadecimal object names.
> 
> Only sizes are returned for now.
> 
> Signed-off-by: Bruno Albuquerque <bga@google.com>
> ---
>  Documentation/technical/protocol-v2.txt |  31 +++++++
>  Makefile                                |   1 +
>  protocol-caps.c                         | 115 ++++++++++++++++++++++++
>  protocol-caps.h                         |  10 +++
>  serve.c                                 |   2 +
>  t/t5701-git-serve.sh                    |  26 ++++++
>  6 files changed, 185 insertions(+)
>  create mode 100644 protocol-caps.c
>  create mode 100644 protocol-caps.h
> 
> Hello.
> 
> This is my first git patch so I thought I would introduce myself. I am a
> software engineer at Google and I have been involved with opensource for
> a while (mostly with the Haiku OS project) and now I am working on some
> Git changes that hopefully will be generally usefull.
> 
> For this specific change, a clear usage scenario is implementing a VFS
> on top of Git (something like https://github.com/microsoft/VFSForGit) in
> a way that would not require someone to always fully download objects to
> get information about them. Object size is the obvious one and what is
> implemented here.

I want to point out a few notes as someone who's worked on projects
appurtenant to VFS for Git.  If your goal is to create a VFS, then
learning what Git thinks the object size is is not helpful.

Git performs all sorts of operations on files when checking them out,
such as smudge and clean filters (e.g., Git LFS), line ending
conversion, and working tree encodings (e.g., to and from UTF-16 on
Windows).  Thus, your VFS must necessarily exclude all of this
functionality to use Git's concept of an object size as a VFS parameter.

For the average project, the worst functionality to lose is actually
line ending conversion, since that means people will practically check
in a mix of line endings unless you are very strict in CI.  VFS for Git
was originally designed to address the needs of a project that was not
cross-platform and thus this was not a problem, but these limitations
are substantial and I wouldn't recommend repeating them.

So I'm not opposed to seeing this functionality come in if you have
other plans for it (which is fine and I'm certainly interested in
hearing about them if you do), but I don't think this is helpful for VFS
scenarios and shouldn't be used for that purpose.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  parent reply	other threads:[~2021-04-16 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 21:20 [PATCH] object-info: support for retrieving object info Bruno Albuquerque
2021-04-15 21:53 ` Junio C Hamano
2021-04-15 23:06   ` Bruno Albuquerque
2021-04-15 22:15 ` Junio C Hamano
2021-04-20 23:43   ` Bruno Albuquerque
2021-04-16 22:01 ` brian m. carlson [this message]
2021-04-19 21:18   ` Bruno Albuquerque

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHoJUrqeT26Nihua@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=bga@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).