git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Derrick Stolee <stolee@gmail.com>, Eric Wong <e@80x24.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] core.abbrev <off|false|no> disables abbreviations
Date: Tue, 1 Sep 2020 23:37:52 +0000	[thread overview]
Message-ID: <20200901233752.GC241078@camp.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqblipebto.fsf@gitster.c.googlers.com>

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

On 2020-09-01 at 15:49:55, Junio C Hamano wrote:
> I was in the vicinity of this code recently for reviewing another
> topic, but IIRC, 0 came from the UI level does get rounded up to the
> minimum accepted and never reach "default_abbrev", but if you manage
> to place 0 or -1 in default_abbrev here (e.g. with additional code,
> like the above part with the right hand side of the assignment
> updated), I think the value will propagate throughout the codepath
> and causes the downstream code to do the right thing.  0 will give
> you no-abbreviation (i.e. full length depending on the length of the
> hash) and -1 will give you the "scale as appropriate for the size of
> the object store".
> 
> I have mild preference for using 0 over hardcoded single "full
> length" here.  Even though we currently do not plan to allow
> multiple hashes in use simultaneously in a single invocation of Git,
> if that ever happens, we will regret hardcoding the_hash_algo->hexsz
> on the right hand side of the assignment here, like this patch does.

I think we have some commands that accept --abbrev=0 as a value meaning
"no abbreviation", because I've touched that code as part of the SHA-256
work.  So as far as the option value is concerned, I think it may make
sense to use 0 for that meaning and just document it.
-- 
brian m. carlson: Houston, Texas, US

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

      parent reply	other threads:[~2020-09-01 23:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  7:43 [PATCH] core.abbrev <off|false|no> disables abbreviations Eric Wong
2020-09-01 12:14 ` Derrick Stolee
2020-09-01 14:43   ` Eric Wong
2020-09-01 14:59     ` Derrick Stolee
2020-12-22 19:42     ` Junio C Hamano
2020-12-22 23:17       ` Eric Wong
2020-12-22 23:24         ` Junio C Hamano
2020-12-23  0:10           ` Junio C Hamano
2020-12-23 14:38             ` Derrick Stolee
2020-12-23 20:21             ` brian m. carlson
2020-09-01 15:49   ` Junio C Hamano
2020-09-01 19:14     ` Junio C Hamano
2020-09-01 23:37     ` brian m. carlson [this message]

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=20200901233752.GC241078@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stolee@gmail.com \
    /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).